123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747 |
-
- Namespace.register("U.MD.D");
- U.MD.D.IsUseStudio = (window.location.host.indexOf("www.1473.cn") > -1 ||
- window.location.host.indexOf("m.1473.cn") > -1 ||
- window.location.host == "1473.cn" ||
- window.location.host.indexOf("www.boomyun.com") > -1 ||
- window.location.host == "boomyun.com");
- U.MD.D.LocalStorage = null;
- window.onload = function () {
- U.MD.D.Load();
- }
- U.MD.D.Load = U.MD.D.FLoad = function (cb) {
-
-
-
-
- if (U.MD.D.IsUseStudio) {
-
- U.selectEl("#UD_Dtop")[0].style.display = "block";
-
- new U.UF.UI.form(false, U.selectEl("#UD_Dtop")[0], { onresize: false, style: { "cssText": "width:100%;height:100%;padding:0;border:0;border-radius:0;box-shadow:0;position:static;" }, "className": "" }, { istop: false, isdrag: false, isdrag: false, isstretching: false, isenlarge: false, isnarrow: false, isclose: false }, null, { style: { "padding": "0" } });
- }
-
- if ($("#U_MD_Home")[0]) {
-
- U.MD.D.settingGlobalVariables();
-
- U.MD.D.addEvents();
- var _browserinfo = U.UF.CI.getBrowser();
-
- if (_browserinfo["browser"] == "msie" && parseInt(_browserinfo["ver"]) < 7) {
-
- U.MD.D.A.browserCompatibleForm();
- }
- }
-
- U.MD.D.crossDomain(cb);
- }
- U.MD.D.settingGlobalVariables = function () {
-
- var _size = U.selectEl("body").getElementInfo();
- US.height = _size["CH"];
- US.width = _size["CW"];
-
- US.systemId = 1;
-
- US.pageId = Guid.newGuid();
- }
- U.MD.D.addEvents = function () {
-
- U.UF.EV.IsActivity(U.MD.D.focus, U.MD.D.blur);
-
- U.UF.F.clickTopWindow();
-
- window.onresize = U.MD.D.reSize;
-
- if (U.MD.D.IsUseStudio) {
- if (window.print) {
- document.oncontextmenu = U.UF.EV.stopDefault;
- }
- document.onselectstart = U.UF.C.shieldedSelect;
- U.UF.EV.addElementEvent("keydown", document, U.UF.C.shieldedBackspace);
- window.onerror = U.MD.D.error;
- }
-
- else {
- window.onerror = null;
- }
-
- U.UF.N.route(U.MD.N.urlGuide);
- }
- U.MD.D.reSize = function () {
-
- U.UF.UI.form.windowResize();
-
-
- var _size = U.selectEl("body").getElementInfo();
- US.height = _size["CH"];
- US.width = _size["CW"];
-
- if ($("#U_MD_D_RW")) {
- U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
- U.MD.D.T.taskbar.multitask($("#U_MD_D_RW")[0]);
-
- U.MD.D.iconPostion($("#U_MD_D_K").Child());
- }
- }
- U.MD.D.crossDomain = function (cb) {
-
- if (document.domain == "1473.cn") {
- U.UF.CD.loadAjaxCrossDomain(function () {
- U.MD.D.loadApplication(cb);
- });
- }
-
- else {
- U.UF.CD.thirdPartyLoadAjaxCrossDomain(function () {
- U.MD.D.loadApplication(cb);
- });
- }
- }
- U.MD.D.loadApplication = function (cb) {
- U.UF.CD.loadApplication(function () {
- U.MD.D.asynCrossDomain(cb);
- });
- }
- U.MD.D.asynCrossDomain = function (cb) {
-
- U.MD.N.urlGuide();
-
- U.MD.U.L.cookieLogin();
-
- if (U.MD.D.IsUseStudio) {
- U.MD.D.I.openApplication("boomYun");
- }
-
- U.MD.D.otherModularLoad();
-
- U.UF.CI.getUserLocation(U.MD.D.visitLog);
-
- if ($("#UD_Dtop")[0]) {
- U.MD.D.I.init();
- }
-
- if (U.UF.C.isFunction(cb)) {
- cb();
- }
- }
- U.MD.D.otherModularLoad = function () {
-
- U.MD.C.T.onesetInterval();
-
- U.MD.D.thirdPartyLoad();
-
-
- }
- U.MD.D.thirdPartyLoad = function () {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- U.MD.D.visitLog = function () {
- U.A.Request(US.USER, ["AddToLoginLog", US.userInfo.userid || US.EMPTYGUID, US.city.userAllLocation || ""], function () { });
- }
- window.onunload = function () {
- try {
- var _userinfo = US.userInfo;
- if (U.MD.D.LocalStorage) {
- var _count = U.MD.D.LocalStorage.get("ati") || 0;
- if (_count > 0) { _count-- };
- U.MD.D.LocalStorage.set("ati", _count);
- }
- if (_userinfo.UserId && U.A) {
- U.A.Request(US.USER, ["UserOffline", _userinfo.UserId], function () { }, []);
- }
- } catch (e) { }
- }
- U.MD.D.error = function (errorMessage, scripturi, linenumber, columnnumber, errorobj) {
- errorobj = errorobj || {};
- U.A.Request(US.USER, ["SetError", 0, (event.errorMessage || event || errorMessage), (scripturi || event.filename || event.errorUr) + "。行号:" + (linenumber || event.lineno || event.errorLine)], function () { }, []);
- U.UF.C.console(event.errorMessage || event || errorobj);
- return true;
- }
- U.MD.D.getIfraemHtml = function (src) {
- var _iframe = $$("iframe", { src: src, style: { display: "none" } });
-
- U.UF.DL.iframeLoad(_iframe, function () {
- var _html = _iframe.contentWindow.document.body.innerHTML;
- console.log(_html);
- U.selectEl(_iframe).remove();
- });
- U.selectEl(_iframe).appendTo($('body')[0]);
- };
- ;
- Namespace.register("U.MD.D.I");
- U.MD.D.I.IsDrag;
- U.MD.D.I.DeskIcon = [
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { "Name": "项目管理", "Url": "projectList", "style": { "backgroud": "url(../img/icon/project.png)" } },
- { "Name": "学生列表", "Url": "studentList", "style": { "backgroud": "url(../img/icon/student.png)" } },
- { "Name": "评价管理", "Url": "evaluation", "style": { "backgroud": "url(../img/icon/evaluation.png)" } },
- { "Name": "班级管理", "Url": "classList", "style": { "backgroud": "url(../img/icon/class.png)" } },
- { "Name": "我的资料", "Url": "profile", "style": { "backgroud": "url(../img/icon/myMessage.png)" } },
- { "Name": "通知公告", "Url": "news", "style": { "backgroud": "url(../img/icon/news.png)" } },
- { "Name": "素材库", "Url": "library", "style": { "backgroud": "url(../img/icon/library.png)" } },
- { "Name": "电子白板", "Url": "whiteBoard", "style": { "backgroud": "url(../img/icon/whiteBoard.png)" } },
- { "Name": "问卷调查", "Url": "ask", "style": { "backgroud": "url(../img/icon/ask.png)" } },
- { "Name": "便签分类", "Url": "note", "style": { "backgroud": "url(../img/icon/note.png)" } },
- { "Name": "量规评分", "Url": "score", "style": { "backgroud": "url(../img/icon/score.png)" } },
- { "Name": "思维导图", "Url": "mind", "style": { "backgroud": "url(../img/icon/mindMapping.png)" } },
- { "Name": "协同文档", "Url": "doc", "style": { "backgroud": "url(../img/icon/doc.png)" } },
- ];
- U.MD.D.I.init = function () {
- if ($("#U_MD_D_K")[0]) {
-
- U.MD.D.I.initDesktopIcons($("#U_MD_D_K")[0]);
-
- U.selectEl("#U_MD_D_RW").css("width", US.width - 165 + "px");
- }
- }
- U.MD.D.I.hiddenTaskbar = function (el) {
-
- U.selectEl(el).parentElement(3).css({ "bottom": "-63px" });
-
-
- }
- U.MD.D.I.initDesktopIcons = function (el) {
- var i,
- _content,
- _iconcontent,
- _frag = $$("frag"),
- _DesktopIconInfo = U.MD.D.I.DeskIcon;
-
- el.innerHTML = "";
-
- for (i = 0; i < _DesktopIconInfo.length; i++) {
- _content = $$("div", {
- className: "U_MD_D_KO",
- "onmousedown": U.UF.C.closure(function (obj) {
-
- U.MD.D.click(this, obj);
- }, [_DesktopIconInfo[i]]),
- "onclick": U.UF.C.closure(function (obj) {
-
- U.MD.D.click(this, obj);
- }, [_DesktopIconInfo[i]])
- }, _frag);
- _iconcontent = $$("div", { className: "U_MD_D_KOA" }, _content);
- $$("div", { className: "U_MD_D_KOS U_Img", "style": { "backgroundPosition": _DesktopIconInfo[i].Img.x + "px " + _DesktopIconInfo[i].Img.y + "px" } }, _iconcontent);
- $$("div", { className: "U_MD_D_KOX", "style": { "cssText": "text-shadow: rgb(0 0 0) 2px 1px 3px, rgb(165 165 165) 0px 1px 0px, rgb(85 85 85) -1px 0px 0px, rgb(153 153 153) 0px -1px 0px; filter: Glow(color=#777777, strength=1)\9;" }, "innerHTML": _DesktopIconInfo[i].Name }, _iconcontent);
- }
-
- U.MD.D.iconPostion($(_frag).Child());
-
- el.appendChild(_frag);
- }
- U.MD.D.I.displayTaskbar = function (el) {
-
- if (!U.UF.EV.stopBubbleMouseOutOrOver(el) && U.selectEl(el).css("bottom") != "0px") {
-
- U.selectEl(el).css({ "bottom": "0px" });
-
-
- }
- }
- U.MD.D.iconPostion = function (childs, top, left) {
- var i;
- top = top || 15;
- left = left || 20;
-
- for (i = 0; i < childs.length; i++) {
-
- if (top + 95 > US.height - 85) {
-
- if ((left + 180) > US.width) {
- top -= 115;
- left -= 90;
- }
-
- else {
- left += 90;
- top = 15;
- };
- }
-
- U.selectEl(childs[i]).css({ top: top + "px", left: left + "px" });
- if (i < childs.length - 1) {
-
- top += 115;
- }
- }
-
- return [top, left];
- }
- U.MD.D.click = function (el, obj) {
- var _buttonnumber = event.button;
- U.UF.EV.stopBubble();
-
- if (_buttonnumber < 2) {
-
- if (event.type == "click") {
-
- if (!U.MD.D.I.IsDrag) {
-
- U.MD.D.I.openApplication(obj.Url, { "userid": US.userInfo.userid, "directoryid": US.FTPFOLDERID });
- }
- }
-
- else {
-
- U.UF.F.drag(el, U.MD.D.iconMove, U.MD.D.iconUp);
- }
- U.MD.D.I.IsDrag = false;
- }
- }
- U.MD.D.iconMove = function () {
-
- U.MD.D.I.IsDrag = true;
- }
- U.MD.D.iconUp = function (el) {
- var _top = 15,
- _left = 20,
- _margin,
- _childs = U.selectEl("#U_MD_D_K").Child(),
- _positioninfo = U.UF.EL.getElementInfo(el);
- if (_positioninfo["OT"] > 15) {
-
- _margin = ((_positioninfo["OT"] - 15) % 115 > 55 && _positioninfo["OT"] + 115 < US.height) ? 1 : 0;
- _top = (Math.floor((_positioninfo["OT"] - 15) / 115) + _margin) * 115 + 15;
- }
- if (_positioninfo["OL"] > 20) {
-
- _margin = ((_positioninfo["OL"] - 20) % 90 > 45 && _positioninfo["OL"] + 90 < US.width) ? 1 : 0;
- _left = (Math.floor((_positioninfo["OL"] - 20) / 90) + _margin) * 90 + 20
- }
-
- do {
- _positioninfo = U.MD.D.iconPostion([el], _top, _left);
- _top = _positioninfo[0] + 115;
- _left = _positioninfo[1];
- } while (el = U.MD.D.isOverlap(el, _childs, _positioninfo))
- }
- U.MD.D.isOverlap = function (el, childs, postionarray) {
-
- for (var i = 0; i < childs.length; i++) {
-
- if (el != childs[i] && (childs[i].offsetTop == postionarray[0] && childs[i].offsetLeft == postionarray[1])) {
- return childs[i];
- }
- }
- }
- U.MD.D.I.openApplication = function (str, obj, info) {
- obj = obj || {};
- var _taskbar,
- _formdiv,
- _userinfo = US.userInfo,
- _userid = obj.userid || _userinfo.UserId
- ;
-
- switch (str) {
- case "friend":
- U.MD.D.I.IsDrag = true;
- U.MD.F.W.viewFriend(info);
-
- break;
- case "domain":
- var _iframe = $$('iframe', { src: '//domain.1473.cn/DomainSystem.aspx/?fileId=' + info.fileId + '&type=' + info.type + '&mode=' + info.mode, frameborder: "0", style: { cssText: "width:100%;height:100%;border:0px" } });
- _formdiv = new U.UF.UI.form("域名管理", _iframe, { id: "U_MD_DS_DomainShare", style: { "width": "370px", "height": "390px" } }).form;
- if (_formdiv) {
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj, info); } }
- }
- break;
- case "disk":
- _formdiv = U.MD.DK.initDisk(_userid, obj.directoryid);
- if (_formdiv) {
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-15px -296px", "name": "网盘", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- }
- break;
- case "word":
- var _wordinfo = U.MD.O.word(_userinfo, obj, arguments[2]);
- _formdiv = _wordinfo[0];
- if (_formdiv) {
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-462px -296px", "name": "文档", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, _wordinfo[1]); } }
- }
- if (obj.UrlType != 'join') {
- U.MD.N.urlWrite("word/" + _formdiv.id.substr(-36), "在线文档");
- }
- break;
- case "excel":
- _formdiv = U.MD.O.excel(_userinfo, obj);
- if (_formdiv) {
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-523px -296px", "name": "在线表格", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- }
- U.MD.N.urlWrite("excel/" + _formdiv.id.substr(-36), "在线表格");
- break;
- case "txt":
- _formdiv = U.MD.D.Txt.textCreate();
- if (_formdiv) {
-
- _taskbar = { "id": str + obj.directoryid, "backgroundPostion": "-267px -413px", "name": "在线文本", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- }
- U.MD.N.urlWrite("txt/" + _formdiv.id.substr(-36), "在线文本");
- break;
- case "lookupFriend":
- _formdiv = U.MD.F.S.popSearchFriendsOrGroupForm(0);
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "查找好友", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- U.MD.N.urlWrite("lookupfriend/" + obj.directoryid.substr(-36), "查找好友");
- break;
- case "ftp":
- _formdiv = U.MD.F.S.popupsSearchFtp();
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-144px -413px", "name": "FTP", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- break;
- case "group":
- _formdiv = U.MD.F.S.popupsSearchGroups(0);
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-85px -413px", "name": "群组", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- break;
- case "set":
- _formdiv = U.MD.U.P.userDataSet();
- if (_formdiv) {
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "个人设置", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- }
- break;
- case "systemSet":
- _formdiv = U.MD.D.B.init();
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-400px -296px", "name": "系统设置", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- break;
- case "boomYun":
- _formdiv = U.Boom.I.onload();
-
- _taskbar = { "id": str + _formdiv.id, "backgroundPostion": "-844px -419px", "name": "互联办公", "forms": _formdiv, "click": function () { U.MD.D.I.openApplication(str, obj); } }
- U.MD.N.urlWrite("boomyun", "互联办公");
- break;
- case "xz":
- window.open("http://xz.1473.cn");
- break;
- case "client":
- window.open("http://client.1473.cn");
- break;
- case "backEndProgramming":
- window.open("http://c.1473.cn");
- break;
- case "frontEndProgramming":
- window.open("http://d.1473.cn");
- break;
- default:
- break;
- }
-
- if (_taskbar) {
- U.MD.D.T.taskbar(_taskbar);
- }
- }
-
- ;
- Namespace.register("U.MD.D.T.taskbar");
- U.MD.D.T.taskbar = function (applyinfo, taskbarEle) {
- taskbarEle = taskbarEle || U.selectEl("#U_MD_D_RW")[0];
- var _tasks = U.selectEl('#U_MD_D_T_taskbar_' + applyinfo.id, taskbarEle)[0];
-
- if (!_tasks) {
-
- U.MD.D.T.taskbar.create(applyinfo, taskbarEle);
-
- U.MD.D.T.taskbar.multitask(taskbarEle);
- } else {
- _tasks.forms = applyinfo.forms;
- }
- }
- U.MD.D.T.taskbar.drag = 0;
- U.MD.D.T.taskbar.create = function (applyinfo, taskbarEle) {
-
- var _task = $$("div", { id: "U_MD_D_T_taskbar_" + applyinfo.id, className: "U_MD_D_BZMO", title: applyinfo.name, "forms": applyinfo.forms });
- var _taskMain = $$("div", {
- className: "U_MD_D_BZMOA",
-
- onmousedown: U.UF.C.apply(null, function () { U.MD.D.T.taskbar.dragClose(_taskMain); }),
-
- onclick: function () {
- if (!(U.MD.D.T.taskbar.drag > 1)) {
- applyinfo.click();
- }
- U.MD.D.T.taskbar.drag = 0;
- }
- }, _task);
-
- $$("div", { className: "U_MD_D_BZMOI U_Img", style: { backgroundPosition: applyinfo.backgroundPostion } }, _taskMain);
-
-
- var _taskName = $$("div", {
- className: "U_MD_D_T_taskbar_Name",
- style: { "position": "absolute", "left": "-26px", "bottom": "83px" }
-
- }, _task);
- $$("div", {
- className: "U_MD_D_BZMON U_MD_D_Text_Abbreviation",
- style: { "float": "left", "width": "100px", "margin-top": "7%", "color": "#FFFFFF", "font-family": "MicrosoftYaHei" },
- innerHTML: applyinfo.name
- }, _taskName);
- $$("div", {
- className: "U_MD_D_T_taskbar_Close",
- style: { "display": "none" },
- innerHTML: "x",
- onclick: function () {
- U.UF.EV.stopBubble();
- U.MD.D.T.taskbar.close(applyinfo)
- }
- }, _taskMain);
- $$("div", {
- className: "U_MD_D_T_taskbar_Close",
- innerHTML: "x",
- onclick: function () {
- U.UF.EV.stopBubble();
- U.MD.D.T.taskbar.close(applyinfo)
- }
- }, _taskName);
-
- if (taskbarEle) {
- U.selectEl(taskbarEle).append(_task, 0, taskbarEle.firstChild);
- }
-
- if ($(".U_MD_D_BZMOA").length >= 28) {
- U.selectEl(".U_MD_D_RW_R")[0].style.display = "block";
- } else {
- U.selectEl(".U_MD_D_RW_R")[0].style.display = "none";
- }
- }
- U.MD.D.T.taskbar.page = 1;
- U.MD.D.T.taskbar.maxPage = 1;
- U.MD.D.T.taskbar.pageNum = 1;
- U.MD.D.T.taskbar.multitask = function (taskbarEle) {
-
- U.MD.D.T.taskbar.pageNum = Math.floor($(taskbarEle).width() / 65);
-
- var _tasks = U.selectEl(taskbarEle).Child();
-
- var _tasksTotal = _tasks.length;
-
- if (_tasksTotal > U.MD.D.T.taskbar.pageNum) {
-
- U.MD.D.T.taskbar.maxPage = Math.ceil(_tasksTotal / U.MD.D.T.taskbar.pageNum);
- }
- U.MD.D.T.taskbar.page = 1;
- U.MD.D.T.taskbar.switchPage(0);
- }
- U.MD.D.T.taskbar.switchPage = function (mark, taskbarEle) {
-
- taskbarEle = taskbarEle || U.selectEl("#U_MD_D_RW")[0];
-
- U.MD.D.T.taskbar.page += mark;
-
- if (U.MD.D.T.taskbar.page < 1) { U.MD.D.T.taskbar.page = 1; }
-
- if (U.MD.D.T.taskbar.page > U.MD.D.T.taskbar.maxPage) { U.MD.D.T.taskbar.page = U.MD.D.T.taskbar.maxPage; }
-
- var _tasks = U.selectEl(taskbarEle).Child();
-
- var _startLength = (U.MD.D.T.taskbar.page - 1) * U.MD.D.T.taskbar.pageNum;
-
- var _endLength = Math.min(U.MD.D.T.taskbar.page * U.MD.D.T.taskbar.pageNum, _tasks.length);
-
- U.selectEl($(taskbarEle).Child()).css('display', 'none');
-
- var i;
- for (_startLength; _startLength < _endLength; _startLength++) {
- U.selectEl(_tasks[_startLength]).css('display', 'block');
- }
- }
- U.MD.D.T.taskbar.close = function (applyinfo) {
- var i,
- _child = U.selectEl("#U_MD_D_RW").Child(),
- _form = U.UF.C.isElement(applyinfo.forms) ? applyinfo.forms : applyinfo.forms.form;
-
- if (applyinfo.forms) {
- U.UF.F.closeWindow(_form, "remove");
- }
-
- if (applyinfo.id) {
-
- U.selectEl('#U_MD_D_T_taskbar_' + applyinfo.id).remove();
- } else {
-
- for (i = 0; i < _child.length; i++) {
- if (_child[i].forms == _form) {
- U.selectEl(_child[i]).remove();
- }
- }
- }
- }
- U.MD.D.T.taskbar.clear = function (taskEle) {
-
- taskEle = taskEle || U.selectEl("#U_MD_D_RW")[0];
-
- var _i, _tasksClose = U.selectEl('.U_MD_D_T_taskbar_Close', taskEle);
- for (_i = 0; _i < _tasksClose.length; _i++) {
- _tasksClose[_i].onclick();
- }
- }
- U.MD.D.T.taskbar.dragClose = function (taskEle) {
- U.MD.D.T.taskbar.drag = 0;
-
-
- U.MD.D.T.taskbar.stratY = U.UF.EL.getMousePosition().y;
-
- U.MD.D.T.taskbar.preStyle = U.selectEl(taskEle).css('cssText');
-
- var _taskEleCssPostion = U.selectEl(taskEle).css("postion");
- if (_taskEleCssPostion == "static" || !_taskEleCssPostion) { U.selectEl(taskEle).css("position", "absolute") };
-
- U.selectEl(taskEle).css("z-index", 9999);
-
- U.MD.D.T.taskbar.bindDragEvent(taskEle);
- }
- U.MD.D.T.taskbar.bindDragEvent = function (taskEle) {
- var _event = {
- "mousemove": function () {
-
- U.MD.D.T.taskbar.dragMove(taskEle);
-
- U.selectEl(taskEle).mouseleave(function () {
- U.MD.D.T.taskbar.dragEnd(taskEle);
- });
-
- U.MD.D.T.taskbar.drag++;
- },
- "mouseup": function () {
-
- U.MD.D.T.taskbar.dragEnd(taskEle);
-
- U.selectEl(taskEle).unbind(_event);
-
- U.selectEl(taskEle).mouseleave(null);
- }
- };
-
- U.selectEl(taskEle).bind(_event);
- }
- U.MD.D.T.taskbar.dragMove = function (taskEle) {
-
-
- U.MD.D.T.taskbar.dragY = U.MD.D.T.taskbar.stratY - U.UF.EL.getMousePosition().y;
-
-
- var _opacity = 100 - U.MD.D.T.taskbar.dragY;
-
- if (_opacity < 1) { _opacity = 1 };
-
- U.selectEl(taskEle).css({
-
- bottom: U.MD.D.T.taskbar.dragY + "px",
- filter: "alpha(opacity=" + _opacity + ")",
- "-ms-filter": "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + _opacity + ")",
- "-moz-opacity": _opacity / 100,
- "-khtml-opacity": _opacity / 100,
- "opacity": _opacity / 100
- });
- }
- U.MD.D.T.taskbar.dragEnd = function (taskEle) {
- if (U.MD.D.T.taskbar.dragY > 50) {
-
- U.selectEl('.U_MD_D_T_taskbar_Close', taskEle)[0].onclick();
- } else {
-
- U.selectEl(taskEle).css("cssText", U.MD.D.T.taskbar.preStyle);
-
- }
- }
- $(window).bind('onsize', U.MD.D.T.taskbar.multitask);;
- Namespace.register("U.MD.D.B");
- U.MD.D.B.url = "/img/background/ZMYT.jpg";
- U.MD.D.B.backUrl = "";
- U.MD.D.B.init = function () {
- if ($("#U_MD_D_A_A")[0]) {
- return U.selectEl("#U_MD_D_A_A").css("display", "block")
- }
- var _systemimg = U.selectEl("#U_MD_D_Set_BG").css("display", "block")[0]
-
- var _system = new U.UF.UI.form("<div class='U_MD_F_S_TI'>系统设置</div>",
- _systemimg, {
- "id": "U_MD_D_A_A",
- "style": {
- "width": "746px",
- "height": "500px"
- }
- }, {
- isnarrow: false,
- isenlarge: false
- }).form;
- U.MD.D.B.look();
- return _system;
- }
- U.MD.D.B.look = function () {
- var i, _img, _imgparent,
- _frag = $$("frag"),
- _url = "/img/background/",
- _pchild = U.selectEl($("#U_MD_D_Set_BG").childs()[0]).Child(),
- _imgname = ["3DBox", "cloud", "fruit", "green", "userbackgound", "Dream_train", "ZMYT"],
- _img = U.selectEl(_pchild[0]).Child()[1];
- _img.innerText = "";
- if (_imgname.hasOwnProperty) {
- for (i = 0; i < _imgname.length; i++) {
- _imgparent = $$("div", {
- "className": "U_MD_D_Set_BG_OCO",
- "title": "设为背景",
- "onclick": U.UF.C.closure(function (i) {
- U.MD.D.B.setBackgroundImage(_url + _imgname[i] + ".jpg");
- }, [i])
- }, _frag);
- _imgparent = $$("div", {}, _imgparent);
- var _addimg = U.UF.IMG.imgReady(_url + _imgname[i] + "(1).jpg", null, function () { }, function () { U.MD.C.imgError(this); });
- _imgparent.appendChild(_addimg);
- }
- }
- _img.appendChild(_frag);
- }
- U.MD.D.B.split = function (imageurl) {
- if (imageurl) {
- var _i = imageurl.lastIndexOf("/");
- return [imageurl.substr(0, _i), imageurl.substr(_i + 1)];
- }
- return ["", ""];
- }
- U.MD.D.B.asyn = function (url, str) {
- if (!U.MD.U.L.isLogin()) {
- url = url || U.MD.D.B.backUrl[0];
- str = str || U.MD.D.B.backUrl[1];
- US.userInfo.UserBackGroundImage = url;
- U.alert("修改中..");
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Users", "UpdateUserDesktopInfo", US.userInfo.userid, url + "/" + str, "", ""],
- function () { U.alert("设置成功"); });
-
- }
- }
- U.MD.D.B.disk = function (el, url, str) {
- U.MD.D.B.setBackgroundImage(url, "S");
- }
- U.MD.D.B.setBackgroundImage = function (imageurl, typename) {
- var _el = U.selectEl("#U_MD_D_BG")[0];
- typename = typename || "S";
-
- if (imageurl == null) {
- imageurl = U.MD.D.B.url;
-
- U.MD.D.B.backUrl = US.userInfo.UserBackGroundImage ? U.MD.D.B.split(US.userInfo.UserBackGroundImage) : [U.MD.D.B.url, typename];
- } else {
- U.MD.D.B.backUrl = [imageurl, typename];
- }
-
- switch (typename) {
- case "T":
-
- U.selectEl(el).addAttrArray({
- style: {
- background: "#F0F0F0 url(" + imageurl + ")"
- }
- });
- break;
- case "M":
-
- U.selectEl(el).addAttrArray({
- style: {
- background: "#F0F0F0 url(" + imageurl + ") 0 0 no-repeat"
- }
- });
- break;
- case "S":
-
- if (imageurl) {
- U.selectEl(_el).addAttrArray({
- style: {
- filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + imageurl + ",sizingMethod=scale)",
- background: "#F0F0F0 url(" + imageurl + ") 0 0 no-repeat",
- backgroundSize: "100% 100%",
- MozBackgroundSize: "100% 100%"
- }
- });
- }
- break;
- default:
- break;
- }
- }
- U.MD.D.B.upload = function (el) {
- if (U.UF.UP.isImg(el.value)) {
-
- U.UF.UP.inputUpload([el], "http://disk.1473.cn/USUpfile.ashx?typename=UploadWallpaper", U.MD.D.B.asynUp, [el]);
- }
- }
- U.MD.D.B.asynUp = function (url) {
- var i, _userchild, _imginfo,
- _userinfo = US.userInfo;
- _userid = _userinfo.BHID,
- _userchange = U.MD.DK.M.diskOperatingSwitch(_userinfo.UserId);
- r = url.value;
- if (_userid && _userchange[_userid] && (_userchild = _userchange[_userid].Child)) {
- for (i = 0; i < r.length; i++) {
- _imginfo = r[i];
-
- _imginfo = new U.MD.DK.M.entity(_imginfo.UserFilesID, _imginfo.UserFilesSize, _imginfo.UserDirectoryID, _imginfo.UserFilesName, _imginfo.UserFilesName, _imginfo.UserFilesExtendName, US.FILESYSTEMURL + _imginfo.UserFilesServerName, _imginfo.UserFilesAddTime, _imginfo.UseFilesServerThumbnailName, 9999, null, "", 1, _imginfo.UserFilesDescript, "", null)
- _userchange[_userid].Child.push(_imginfo);
- }
- }
- U.MD.D.B.setBackgroundImage(U.MD.C.getHeadImage(r[0].UserFilesServerName));
- }
- U.MD.D.B.uploadByPan = function () {
- U.MD.DK.VW.choseFile(function (obj) {
- U.MD.D.B.setBackgroundImage('http://fs.1473.cn/' + obj.UserDirectoryUrl, 'S');
- });
- };
- Namespace.register("U.MD.D.A");
- U.MD.D.A.agreement = function (_el) {
- return new U.UF.UI.form("<div class='U_MD_F_S_TI'>安全协议</div>",
- U.selectEl(_el).parentElement().css("display", "block")[0], {
- "id": "U_MD_UI_UP_O",
- "style": {
- "width": "600px",
- "height": "452px"
- }
- }, {
- isnarrow: false,
- isenlarge: false
- }).form;
- }
- U.MD.D.A.aboutUs = function () {
- var _el = U.selectEl("#U_MD_D_A_OT");
- _el.css("display", "block");
- new U.UF.UI.form("<div class='U_MD_F_S_TI'>关于我们</div>", _el[0], {
- "id": "U_MD_D_A_OT_A",
- "style": {
- "width": "920px",
- "height": "600px"
- }
- }, {
- isnarrow: false,
- isenlarge: false
- });
- }
- U.MD.D.A.browserCompatibleForm = function () {
- new U.UF.UI.form("<div class='U_MD_F_S_TI'>浏览器更新</div>",
- U.selectEl("#U_MD_D_A")[0], {
- "id": "U_MD_D_A_A",
- "style": {
- "width": "970px",
- "height": "605px"
- }
- }, {
- isnarrow: false,
- isenlarge: false
- });
- }
- Namespace.register("U.MD.DK");
- U.MD.DK.initDisk = function (userid, dirid) {
-
- if (userid) {
-
- var _formdiv = U.selectEl("#U_D_" + userid)[0],
- _diskinfo = US.disk.Disks[userid];
-
- if (_formdiv) {
- U.UF.F.windowTopCenter(_formdiv);
- U.selectEl("#U_MD_DK_LTXO", _formdiv)[0].innerHTML = "";
-
-
- if (userid == US.userInfo.userid) {
- U.MD.DK.LL.printLeftTreeDirectory(_diskinfo.directoryOrFiles.slice(0, 5), U.selectEl("#U_MD_DK_LTXO", _formdiv)[0], userid, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"])
- }
-
- else {
- U.MD.DK.LL.printLeftTreeDirectory(_diskinfo.directoryOrFiles.slice(4, 5), U.selectEl("#U_MD_DK_LTXO", _formdiv)[0], userid, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"])
- }
- U.MD.DK.openDirByDirID(userid, dirid);
- }
-
- else if (!_diskinfo) {
- var _diskel = U.selectEl("#U_MD_DK").clone(true)[0],
- _loginuserid = US.userInfo.userid || US.EMPTYGUID;
- _diskel.id = "U_MD_DK__" + userid;
- _diskel.style.display = "block";
-
-
-
- _formdiv = new U.UF.UI.form("<div class='U_MD_F_S_TI'>网盘</div>",
- _diskel, {
- "onmousedown": function () {
- U.MD.DK.M.diskOperatingSwitch(userid);
- },
- "onresize": function () {
- U.MD.DK.size(_diskel);
- },
- "id": "U_D_" + userid,
- "style": {
- "width": "80%",
- "height": "85%"
- }
- }).form;
-
- U.A.Request(US.DISK, ["InitDisk", _loginuserid, userid, dirid], U.MD.DK.asynInitDisk, [_diskel, userid, dirid, US.userInfo.userid || US.EMPTYGUID, _formdiv]);
- }
- return _formdiv;
-
- } else {
- U.MD.U.L.login();
- }
- }
- U.MD.DK.asynInitDisk = function (r) {
- var _dirinfo,
- _context = r.context,
- _diskel = _context[0],
- _userid = _context[1],
- _dirid = _context[2],
- _loginuserid = _context[3],
- _formdiv = _context[4],
- _value = r.value
- ;
-
- if (_value) {
-
- var _diskinfo = U.MD.DK.setUserGlobalVariable(_userid, _dirid, _value);
-
- U.MD.DK.VW.followState(_formdiv, _userid, _loginuserid);
-
- U.UF.N.createNav("disk" + _userid);
-
- U.MD.DK.initDiskButton(_diskinfo);
-
- U.MD.DK.size(_diskinfo.formel);
-
- U.MD.DK.initDiskUserInfo(_diskinfo);
-
- if (_diskinfo.userInfo.UserId == _diskinfo.operator) {
- U.MD.DK.LL.printLeftTreeDirectory(_diskinfo.directoryOrFiles.slice(0, 5), U.selectEl("#U_MD_DK_LTXO", _diskinfo.formel)[0], _userid, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"])
- } else {
- U.MD.DK.LL.printLeftTreeDirectory(_diskinfo.directoryOrFiles.slice(4, 5), U.selectEl("#U_MD_DK_LTXO", _diskinfo.formel)[0], _userid, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"])
- }
- U.MD.DK.openDirByDirID(_userid, _dirid);
- }
-
- else {
- U.alert("帐号不存在...");
-
- U.selectEl(_diskinfo.formel).remove();
- }
- }
- U.MD.DK.openDirByDirID = function (userid, dirid) {
- var _diskinfo = US.disk.Disks[userid];
- if (_diskinfo) {
-
-
- var _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { "UserDirectoryID": dirid })[0];
-
- if (_dirinfo) {
-
- if ($("#L" + _dirinfo["UserDirectoryID"], _diskinfo.formel)[0]) {
- U.MD.DK.LL.leftTreeClick(_dirinfo, U.selectEl("#L" + _dirinfo["UserDirectoryID"], _diskinfo.formel)[0], userid);
- }
-
- else {
- U.MD.DK.LE.openFileDirectory(_dirinfo, userid);
- }
- }
-
- else {
-
- U.MD.DK.VW.printContent([], U.selectEl("#U_MD_DK_RZ", _diskinfo.formel)[0]);
- }
- }
- }
- U.MD.DK.setUserGlobalVariable = function (userid, dirid, diskinfo) {
- var _dirinfo,
- _basicdirectory = U.MD.DK.getBasicDirectory(diskinfo),
- _groupdirectory = U.MD.DK.getGroupDirectory(diskinfo.groups, _basicdirectory, diskinfo.userInfo.UserId)
- ;
- _basicdirectory = _basicdirectory.concat(_groupdirectory);
-
-
- _dirinfo = U.Json.select(_basicdirectory, { "UserDirectoryID": dirid }, 1)[0];
- if (!_dirinfo && diskinfo.currentdirectory[0]) {
- _dirinfo = diskinfo.currentdirectory[0];
- _dirinfo = new U.MD.DK.M.entity(_dirinfo.UserDirectoryID, 0,
- _dirinfo.UserDirectoryParentID, _dirinfo.UserDirectoryName, _dirinfo.UserDirectoryName, _dirinfo.UserDirectoryExtendType,
- "", _dirinfo.UserDirectoryAddTime, _dirinfo.UserDirectoryUrl, _dirinfo.UserDirectoryDeep, _dirinfo.UserDirectoryModifyTime,
- _dirinfo.UserDirectoryEncrypt, 0, "", _dirinfo.GroupID);
- _basicdirectory.push(_dirinfo);
- }
-
- if (_dirinfo) {
- _dirinfo.Child = diskinfo.directoryOrFiles;
- U.Json.add(diskinfo.directoryOrFiles, { "Parent": _dirinfo });
- }
- diskinfo.directoryOrFiles = _basicdirectory.concat(diskinfo.directoryOrFiles);
-
- US.disk.Disks[userid] = diskinfo;
- US.disk.Disks[userid].formel = U.selectEl("#U_D_" + userid)[0];
- US.disk.Disks[userid].directoryid = dirid;
- US.disk.Disks[userid].currentDirectoryFile = [];
- US.disk.Disks[userid].operator = US.userInfo.userid;
- return US.disk.Disks[userid];
- }
- U.MD.DK.getBasicDirectory = function (diskinfo) {
- var i,
- _diskdir = US.disk.initTree.concat();
-
- for (i = 0; i < _diskdir.length; i++) {
-
- _diskdir[i] = new U.MD.DK.M.entity(_diskdir[i][0], _diskdir[i][1], _diskdir[i][2], _diskdir[i][3], _diskdir[i][4],
- _diskdir[i][5], _diskdir[i][6], _diskdir[i][7], _diskdir[i][8], _diskdir[i][9],
- _diskdir[i][10], _diskdir[i][11], _diskdir[i][12], _diskdir[i][13], _diskdir[i][14],
- _diskdir[i][15], diskinfo.userInfo.UserId, diskinfo.userInfo.UserNickName, diskinfo.userInfo.UserName, diskinfo.userInfo.UserThumbnailImageHead);
- };
-
- return _diskdir;
- }
- U.MD.DK.getGroupDirectory = function (groups, basicdirectory, userid) {
- if (groups != null) {
- var i, _diskgroupinfo;
-
- if (!basicdirectory[1].Child) {
- basicdirectory[1].Child = [];
- }
-
- if (!basicdirectory[2].Child) {
- basicdirectory[2].Child = [];
- }
-
- for (i = 0; i < groups.length; i++) {
- _diskgroupinfo = groups[i];
-
- groups[i] = new U.MD.DK.M.entity(groups[i].GroupManageID, 0, US.EMPTYGUID, groups[i].GroupManageName,
- groups[i].GroupManageName, "folder", null, U.UF.D.toTimeStamp(new Date()), U.MD.DK.C.getIcon("folder")[1],
- 1, null, null, 0, "", groups[i].GroupManageID, null, groups[i].GroupManageUserID, groups[i].GroupManageName, groups[i].GroupManageName);
-
- if (_diskgroupinfo.GroupManageCreateUserID == userid) {
- basicdirectory[1].Child.push(groups[i]);
- groups[i].Parent = basicdirectory[1];
- }
-
- else {
- basicdirectory[2].Child.push(groups[i]);
- groups[i].Parent = basicdirectory[2];
- }
- };
- }
-
- return groups || [];
- }
- U.MD.DK.initDiskButton = function (diskinfo) {
- var _navchildel = U.selectEl("#U_MD_DK_RKZ", diskinfo.formel).Child(),
- _viewchildel = U.selectEl("#U_MD_DK_RM", diskinfo.formel).Child(),
- _child = U.selectEl("#U_MD_DK_RY", diskinfo.formel).Child(),
- _headchild = U.selectEl("#U_MD_DK_RT", diskinfo.formel).Child(),
- _userid = diskinfo.userInfo.UserId,
- _el = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0];
-
- _headchild[0].onclick = function () {
- U.MD.DK.C.upload(diskinfo);
- }
-
- _headchild[1].onclick = function () {
- U.MD.DK.RE.newFolder(diskinfo);
- }
-
- _headchild[2].onclick = function () {
- U.MD.DK.RE.newText(diskinfo);
- }
-
- _headchild[3].onclick = function () {
- U.MD.DK.RE.newDocument(diskinfo);
- }
-
- _headchild[4].onclick = function () {
- U.MD.DK.RE.newopenApplication(diskinfo);
- }
-
- _headchild[5].onclick = function () {
- U.MD.DK.RE.newExcel(diskinfo);
- }
-
- _headchild[6].onclick = function () {
- var _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": diskinfo.directoryid })[0];
-
- if (_dirinfo.UserDirectoryDeep == 0) {
- window.open('http://' + diskinfo.directoryid + '.1473.cn?userid=' + diskinfo.userInfo.UserId);
- }
-
- else if (_dirinfo.UserDirectoryDeep == 1) {
- window.open('http://' + diskinfo.directoryid + '.1473.cn?userid=' + _dirinfo.UserId);
- } else {
- window.open('http://' + diskinfo.directoryid + '.1473.cn');
- }
- }
-
- _child[0].onclick = function () {
- U.UF.N.backOff("disk" + _userid);
- }
-
- _child[1].onclick = function () {
- U.UF.N.goAhead("disk" + _userid);
- }
-
- _child[2].onclick = function () {
- U.MD.DK.RE.refresh(_userid, U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": diskinfo.directoryid })[0], diskinfo);
- }
-
- _el.oncontextmenu = function () {
- U.MD.DK.RM.rightMenu(null, null, diskinfo);
- };
-
- _el.onmousedown = function () {
- U.MD.DK.C.selectElement(_el, diskinfo);
- };
-
- U.UF.EV.addElementEvent("mousedown", window, function () {
- U.selectEl("#U_MD_DK_M", diskinfo.formel)[0].style.display = "none";
- });
-
- _navchildel[0].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserDirectoryAddTime", function (timeone, timetwo) {
- return U.UF.D.sizeComparison(timeone, timetwo) == false;
- });
- }
-
- _navchildel[1].onclick = function () {
-
- _navchildel[1].className = "U_MD_DK_RKZOI U_MD_DK_Img U_MD_DK_RKZOS U_MD_DK_RKZOSI";
- _navchildel[2].className = "U_MD_DK_RKZOI U_MD_DK_Img U_MD_DK_RKZOP";
-
- U.MD.DK.VW.viewsSwitch("Normal", diskinfo);
- }
-
- _navchildel[2].onclick = function () {
-
- _navchildel[1].className = "U_MD_DK_RKZOI U_MD_DK_Img U_MD_DK_RKZOS";
- _navchildel[2].className = "U_MD_DK_RKZOI U_MD_DK_Img U_MD_DK_RKZOP U_MD_DK_RKZOPI";
-
- U.MD.DK.VW.viewsSwitch("Detailed", diskinfo);
- }
-
- _viewchildel[2].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserallDirectoryName", function (dirnameone, dirnametwo) {
- return dirnameone.localeCompare(dirnametwo, "zh") == 1;
- });
- }
-
-
-
-
-
-
-
- _viewchildel[6].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserNickName", function (nameone, nametwo) {
- return nameone.localeCompare(nametwo, "zh") == 1;
- });
- }
-
- _viewchildel[8].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserDirectoryExtendType", function (typeone, typetwo) {
- return typeone.localeCompare(typetwo, "zh") == 1;
- });
- }
-
- _viewchildel[10].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserDirectorySize", function (sizeone, sizetwo) {
- return sizeone > sizetwo;
- });
- }
-
- _viewchildel[12].onclick = function () {
- U.MD.DK.VW.SortView(diskinfo, "UserDirectoryAddTime", function (timeone, timetwo) {
- return U.UF.D.sizeComparison(timeone, timetwo) == 1;
- });
- }
- }
- U.MD.DK.initDiskUserInfo = function (diskinfo) {
- var _formel = diskinfo.formel,
- _userinfo = diskinfo.userInfo,
- _child;
-
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(_userinfo.UserThumbnailImageHead)
- }, U.selectEl("#U_MD_DK_LIL", _formel)[0]);
-
- U.selectEl("#U_MD_DK_LIRN", _formel)[0].innerText = _userinfo.UserNickName || _userinfo.UserName;
-
- U.selectEl("#U_MD_DK_LIRZ", _formel)[0].innerText = _userinfo.UserIndividualitysignature || "暂无个人简介";
-
- _child = U.selectEl("#U_MD_DK_LS", _formel).find("div");
- _child[4].innerText = U.UF.UP.minUnitToMaxUnit(_userinfo.UserDiskSpace + "M");
- _child[7].innerText = U.UF.UP.minUnitToMaxUnit(_userinfo.FileSize + "B");
- }
- U.MD.DK.size = function (formel) {
- var _contentel = U.selectEl("#U_MD_DK_RZ", formel);
- _contentel.css("height", _contentel.Parent(2).offsetHeight - 79 + "px");
- }
-
- ;
- Namespace.register("U.MD.DK.C");
- U.MD.DK.C.getAncestors = function (fileinfo, diskinfo) {
- var _dirinfo = fileinfo,
- _ancestors = []
- ;
-
- while (_dirinfo) {
- _ancestors.push(_dirinfo);
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": _dirinfo.UserDirectoryParentID }, 1)[0];
- }
- return _ancestors;
- }
- U.MD.DK.C.readWritePermission = function (dirid, diskinfo) {
- var i,
- _permi,
- _dirs = [],
- _returns = [],
- _fileinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": dirid }, 1)[0]
- ;
-
- if (_fileinfo) {
-
- _dirs = U.MD.DK.C.getAncestors(_fileinfo, diskinfo);
- _returns.push(_dirs);
-
- for (i = 0; i < _dirs.length; i++) {
- _permi = _dirs[i].UserDirectoryEncrypt;
- if (_permi == "1" || _permi == "2") {
- _returns.push(_permi);
- break;
- }
- }
- }
- return _returns;
- }
- U.MD.DK.C.getDirectoryPermissions = function (fileordirid, diskinfo) {
- diskinfo = diskinfo || US.disk.UserDisk;
- var _isftp,
- _ismyself,
- _isuserdisk,
- _isgroup,
- _isgroupmain,
- _permissions = US.permission.getDiskPermission(),
- _permissioninfo = U.MD.DK.C.readWritePermission(fileordirid, diskinfo),
- _dirinfo = _permissioninfo[0][_permissioninfo[0].length - 1],
- _currentfileordir = _permissioninfo[0][0],
- _readwrite = _permissioninfo.splice(1)
- ;
-
- if (_currentfileordir && !US.userInfo.userid || _currentfileordir.UserDirectoryID == diskinfo.directoryOrFiles[0].UserDirectoryID || _currentfileordir.UserDirectoryID == diskinfo.directoryOrFiles[1].UserDirectoryID || _currentfileordir.UserDirectoryID == diskinfo.directoryOrFiles[2].UserDirectoryID) {
- _permissions.isopen = false;
- _permissions.isupadte = false;
- _permissions.isdelete = false;
- _permissions.iscopy = false;
- _permissions.isshear = false;
- _permissions.isencryption = false;
- _permissions.isreply = false;
- _permissions.isdownload = false;
- _permissions.isnew = false;
- _permissions.ispaste = false;
- _permissions.isrefresh = false;
- _permissions.isupload = false;
- _permissions.isview = false;
- _permissions.isedit = false;
- } else {
-
- _isgroup = _dirinfo.GroupID != "";
- _isftp = _currentfileordir.GroupID == "";
-
- _isuserdisk = (diskinfo.userInfo.UserId == diskinfo.operator);
- _isgroupmain = U.Json.select(diskinfo.groups, { "UserDirectoryID": _dirinfo.GroupID, "UserId": diskinfo.operator }).length > 0;
- _ismyself = _currentfileordir.UserId == diskinfo.operator;
-
-
- if (!_isuserdisk) {
-
-
- if (!_isftp) {
- _permissions.isnew = false;
- _permissions.isopen = false;
- }
-
- if (!_ismyself) {
- _permissions.isupadte = false;
- _permissions.isdelete = false;
- _permissions.isshear = false;
- _permissions.isencryption = false;
- _permissions.ispaste = false;
- _permissions.isedit = false;
- }
- } else {
-
-
-
- if (_isgroup && !_ismyself && !_isgroupmain) {
- _permissions.isupadte = false;
- _permissions.isdelete = false;
- _permissions.isshear = false;
- _permissions.isencryption = false;
- _permissions.ispaste = false;
- _permissions.isedit = false;
- }
-
- if (_isgroup && _currentfileordir.UserDirectoryDeep == 1) {
- _permissions.isupadte = false;
- _permissions.isdelete = false;
- _permissions.isshear = false;
- _permissions.isencryption = false;
- _permissions.ispaste = false;
- _permissions.isedit = false;
- _permissions.iscopy = false;
- _permissions.isdownload = false;
- if (_currentfileordir.UserDirectoryName == "我的协同" || _currentfileordir.UserDirectoryName == "他人邀请") {
- _permissions.isnew = false;
- }
- }
- }
-
- if (!_ismyself && _readwrite.indexOf("1") > -1) {
- _permissions.isdownload = false;
- _permissions.copy = false;
- _permissions.isshear = false;
- }
-
- if (!_ismyself && _readwrite.indexOf("2") > -1) {
- _permissions.isnew = false;
- _permissions.isupload = false;
- _permissions.ispaste = false;
- }
-
- if (fileordirid && fileordirid.filetype == 1) {
- _permissions.isview = false;
- } else {
- _permissions.isreply = false;
- }
- if (!diskinfo.pasteDirOrFile) {
- _permissions.ispaste = false;
- }
- }
-
- if (diskinfo.selectElement && diskinfo.selectElement.length > 1) {
- _permissions.isopen = false;
- _permissions.isupadte = false;
- }
- diskinfo.permissions = _permissions;
- return _permissions;
- }
- U.MD.DK.C.getIcon = function (extendtype) {
- var i,
- _application = US.disk.applicationTypes
- ;
- if (extendtype) {
-
- for (i in _application) {
-
- if (_application[i].types.indexOf(extendtype.toLowerCase()) > -1) {
- return _application[i];
- }
- }
- }
- return _application["unknownfile"];
- }
- U.MD.DK.C.upload = function (diskinfo) {
-
- if (diskinfo.permissions.isupload) {
- var _groupid,
- _ancestors,
- _directoryid = diskinfo.directoryid,
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": _directoryid })[0];
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- U.MD.UI.upload(
- "http://disk.1473.cn/USUpfile.ashx?typename=UploadFlashfile&DirectoryId=" + _directoryid + "&Encrypt=" + _groupid + "&UserId=" + US.userInfo.userid + "&IsF=true",
-
- function (r, fileinfo) {
- var _data = r.data
- ;
-
- try {
- _data = eval("0," + _data);
- } catch (e) { }
-
- if (_data) {
- U.MD.DK.C.success({
- "UserFilesServerName": _data[0],
- "UseFilesServerThumbnailName": _data[1],
- "UserFilesID": _data[2],
- "size": _data[3],
- "UserDirectoryEncrypt": _data[4],
- "UserDirectoryID": _data[5],
- "UserDirectoryName": fileinfo.name
- }, _dirinfo, diskinfo);
- }
- },
-
- function (md5, fileinfo, cb) {
-
- U.A.Request(US.DISK, ["IfFileExistInsertDB", US.userInfo.userid, _directoryid, _groupid, fileinfo.size, md5, U.UF.UP.getFileNameAndExtension(fileinfo.name)[1], fileinfo.name],
-
- function (r) {
- var _userid = US.userInfo.userid;
- r = r.value;
-
- try {
- r = eval(r)[0];
- } catch (e) { }
-
- if (r) {
- U.MD.DK.C.success({
- "UserFilesServerName": r.UserFilesServerName,
- "UseFilesServerThumbnailName": r.UserDirectoryUrl,
- "UserFilesID": r.UserDirectoryID,
- "size": r.UserDirectorySize,
- "UserDirectoryEncrypt": r.UserDirectoryEncrypt,
- "UserDirectoryID": r.UserDirectoryParentID,
- "UserDirectoryName": r.UserDirectoryName
- }, _dirinfo, diskinfo);
- cb(false);
- }
-
- else {
- cb(true);
- }
- });
- });
- }
- }
- U.MD.DK.C.success = function (uploadinfo, dirinfo, diskinfo) {
- var _userinfo = US.userInfo,
- _extendtype = U.UF.UP.getFileNameAndExtension(uploadinfo.UserDirectoryName)[1],
- _img = uploadinfo.UseFilesServerThumbnailName,
- _groupid = uploadinfo.GroupID,
-
- _fileinfo = new U.MD.DK.M.entity(
- uploadinfo.UserFilesID,
- uploadinfo.size,
- uploadinfo.UserDirectoryID,
- uploadinfo.UserDirectoryName.addEllipsis(20),
- uploadinfo.UserDirectoryName,
- _extendtype,
- uploadinfo.UserFilesServerName,
- U.UF.D.toTimeStamp(new Date()),
- _img ? _img : U.MD.DK.C.getIcon(_extendtype)[1],
- 9999,
- null,
- uploadinfo.UserDirectoryEncrypt,
- 1,
- "",
- _groupid,
- "",
- _userinfo.UserId,
- _userinfo.UserNickName,
- _userinfo.UserName,
- _userinfo.UserThumbnailImageHead
- );
-
- if (_fileinfo) {
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, dirinfo);
- diskinfo && U.Alert("文件: " + _fileinfo.UserDirectoryName + " 已上传至" + dirinfo.UserallDirectoryName + "目录下");
- }
- return _fileinfo;
- }
- U.MD.DK.C.selectElement = function (el, diskinfo) {
- var i, classname, hoverclass,
- _viewtype = diskinfo.viewtype || "Normal",
- _child = U.selectEl(el).Child(),
- _fileinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": diskinfo.directoryid })[0];
- diskinfo.selectElement = [];
-
- if (_fileinfo && _fileinfo.GroupID !== true) {
-
- if (_viewtype == "Normal") {
- classname = "U_MD_DK_RZO";
- hoverclass = "U_MD_DK_RZO U_MD_DK_RZOI";
- }
-
- else {
- classname = "U_MD_DK_RZS U_MD_DK_RZXO";
- hoverclass = "U_MD_DK_RZS U_MD_DK_RZXO U_MD_DK_RZXOO";
- }
-
- if (_child[0].className != "U_MD_DK_RZF") {
-
- for (i = 0; i < _child.length; i++) {
-
- if (_child[i].className == hoverclass) {
- _child[i].className = classname;
- }
- }
-
- U.UF.F.dragSelect(el, function (arr) {
- var i,
- _isclass;
-
- for (i = 0; i < _child.length; i++) {
- _isclass = arr.indexOf(_child[i]);
-
- if (_isclass == -1 && _child[i].className == hoverclass) {
- _child[i].className = classname;
- }
-
- else if (_isclass > -1) {
- _child[i].className = hoverclass;
- }
- }
- diskinfo.selectElement = arr;
- });
- }
- }
- };
- Namespace.register("U.MD.DK.M");
- US.disk.Disks = {};
- US.disk.UserDisk = null;
- U.MD.DK.M.entity = function (directoryid, size, parentid, shortname, name, extendtype, serverurl, addtime, iconurl, deep, modifytime, encryt, filetype, descript, groupid, officevalue, userid, usernickname, username, imagehead) {
- this.UserDirectoryID = directoryid;
- this.UserDirectorySize = size;
- this.UserDirectoryParentID = parentid;
- this.UserDirectoryName = shortname;
- this.UserallDirectoryName = name;
- this.UserDirectoryExtendType = extendtype;
- this.UserFilesServerName = serverurl;
- this.UserDirectoryAddTime = addtime;
- this.UserDirectoryUrl = iconurl;
- this.UserDirectoryDeep = deep;
- this.UserDirectoryModifyTime = modifytime;
- this.UserDirectoryEncrypt = encryt;
- this.filetype = filetype;
- this.Descript = descript;
- this.GroupID = groupid;
- this.UsOffice = officevalue;
- this.UserId = userid;
- this.UserNickName = usernickname;
- this.UserName = username;
- this.UserThumbnailImageHead = imagehead;
- this.Child = null;
- this.Parent = null;
- }
- US.disk.initTree = [
- [Guid.newGuid(), 0, US.MYDISK, "最新文档", "最新文档", "folder", null, null, null, 0, null, null, 0, "", true],
- [Guid.newGuid(), 0, US.MYDISK, "我的协同", "我的协同", "folder", null, null, null, 0, null, null, 0, "", true],
- [Guid.newGuid(), 0, US.MYDISK, "他人邀请", "他人邀请", "folder", null, null, null, 0, null, null, 0, "", true],
- [US.MYFOLDERID, 0, US.MYDISK, "电脑", "我的文档(私密)", "folder", null, null, null, 0, null, null, 0, ""],
- [US.FTPFOLDERID, 0, US.MYDISK, "ftp", "共享文档", "folder", null, null, null, 0, null, null, 0, "", ""]
- ];
- US.disk.fileType = {
- "image": ["jpg", "gif", "png", "bmp", "jpeg", "JPG", "GIF", "BMP", "PNG", "JPEG"],
- "music": ["mp3"],
- "video": ["wmv", "video", "ogg", "webm", "mp4"],
- "usword": ["uw"],
- "word": ["doc", "docx"],
- "usnav": ["un"],
- "usexcel": ["ue"],
- "text": ["rtf", "mht", "txt", "htm", "html", "wsh", "wsf", "cpp", "c", "css", "txt", "php", "cs", "java", "log", "sql", "jsp"]
- }
- US.disk.applicationTypes = {
- "image": {
-
- "types": US.disk.fileType.image,
-
- "directoryid": US.IMAGEFOLDERID,
-
- "name": "图片",
-
- "classname": ["U_MD_UI_UP_COIT"]
- },
- "music": {
-
- "types": US.disk.fileType.music,
-
- "directoryid": US.MUSICEFOLDERID,
-
- "name": "音乐",
-
- "classname": ["U_MD_UI_UP_COIY", "U_MD_DK_RZOY", "U_MD_DK_LCY"]
- },
- "video": {
-
- "types": US.disk.fileType.video,
-
- "directoryid": US.VIDEOFOLDERID,
-
- "name": "视频",
-
- "classname": ["U_MD_UI_UP_COIS", "U_MD_DK_RZOP", "U_MD_DK_LCP"]
- },
- "word": {
-
- "types": US.disk.fileType.word,
-
- "directoryid": US.MYFOLDERID,
-
- "name": "Office文档",
-
- "classname": ["U_MD_UI_UP_COIW", "U_MD_DK_REODW", "U_MD_DK_LCD"]
- },
- "uw": {
-
- "types": US.disk.fileType.usword,
-
- "directoryid": US.MYFOLDERID,
-
- "name": "文档",
-
- "classname": ["U_MD_UI_UP_COIW", "U_MD_DK_RZOD", "U_MD_DK_LCD"]
- },
- "un": {
-
- "types": US.disk.fileType.usnav,
-
- "directoryid": US.MYFOLDERID,
-
- "name": "建站文档",
-
- "classname": ["U_MD_UI_UP_COIW", "U_MD_DK_REODN", "U_MD_DK_LCD"]
- },
- "ue": {
-
-
- "types": US.disk.fileType.usexcel,
-
- "directoryid": US.EMPTYGUID,
-
- "name": "文档",
-
- "classname": ["U_MD_UI_UP_COIE", "U_MD_DK_RZOE", "U_MD_DK_LCE"]
- },
- "text": {
-
- "types": US.disk.fileType.text,
-
- "directoryid": US.EMPTYGUID,
-
- "name": "文件",
-
- "classname": ["U_MD_UI_UP_COIT", "downel_content_a_r", "U_MD_DK_LCB"]
- },
- "folder": {
-
- "types": ["folder", "folderencrypt"],
-
- "directoryid": US.EMPTYGUID,
-
- "name": "文件夹",
-
- "classname": ["", "U_MD_DK_RZOW", "U_MD_DK_LCW"]
- },
- "group": {
-
- "types": ["group"],
-
- "directoryid": US.EMPTYGUID,
-
- "name": "群",
-
- "classname": ["", "U_MD_DK_RZOG", "U_MD_DK_LCW"]
- },
- "unknownfile": {
-
- "types": [],
-
- "directoryid": US.MYFOLDERID,
-
- "name": "文件",
-
- "classname": ["U_MD_UI_UP_COIT", "downel_content_a_r", "U_MD_DK_LCB"]
- }
- }
- U.MD.DK.M.entity.add = function (filesinfo, diskinfo, isgroup) {
- var i;
- for (i = 0; i < filesinfo.length; i++) {
-
- if (isgroup) {
- diskinfo.directoryOrFiles.splice(5, 0, filesinfo[i]);
- }
-
- else {
- diskinfo.directoryOrFiles.push(filesinfo[i]);
- }
- }
- }
- U.MD.DK.M.entity.addChild = function (filesinfo, dirinfo) {
-
- if (!dirinfo.Child) {
- dirinfo.Child = [];
- }
-
- for (var i = 0; i < filesinfo.length; i++) {
- dirinfo.Child.push(filesinfo[i]);
- filesinfo[i].Parent = dirinfo;
- }
- }
- U.MD.DK.M.entity.del = function (filesinfo, diskinfo) {
- var i,
- j,
- _parent,
-
-
- _diskfileanddir = diskinfo.directoryOrFiles
- ;
-
- for (i = 0; i < filesinfo.length; i++) {
-
- for (j = 0; j < _diskfileanddir.length; j++) {
-
- if (_diskfileanddir[j].UserDirectoryID == filesinfo[i].UserDirectoryID) {
- _diskfileanddir.splice(j, 1);
- break;
- }
- }
- _parent = filesinfo[i].Parent;
-
- for (j = 0; j < _parent.Child.length; j++) {
-
- if (_parent.Child[j].UserDirectoryID == filesinfo[i].UserDirectoryID) {
- _parent.Child.splice(j, 1);
- }
- }
- }
- }
- U.MD.DK.M.recursionUpdateDirectory = function (filesinfo, attribute) {
-
- for (i = 0; i < filesinfo.length; i++) {
-
- U.UF.C.AddObj(filesinfo[i], attribute);
-
- if (!filesinfo[i].fileType && filesinfo[i].Child) {
-
- U.MD.DK.M.recursionUpdateDirectory(filesinfo[i].Child, attribute);
- }
- }
- }
- U.MD.DK.M.diskOperatingSwitch = function (userid, username) {
- userid = userid || US.userInfo.userid;
- if (userid) {
- var i, _userinfo,
- _diskinfo = US.disk.Disks;
- if (_diskinfo && !_diskinfo[userid]) {
- for (i in _diskinfo) {
- if (_diskinfo[i] && _diskinfo[i][1] && _diskinfo[i][1][0] && _diskinfo[i][1][0].UserName == username) {
- userid = _diskinfo[i][1][0].UserId;
- }
- }
- }
- US.disk.UserDisk = _diskinfo[userid];
- return _diskinfo[userid];
- }
- }
- U.MD.DK.getUserDiskByName = function (username) {
- var i,
- _userdisk,
- _diskinfo = US.disk.Disks;
- for (i in _diskinfo) {
- _userdisk = _diskinfo[i][1];
- if (_userdisk && _userdisk[0].UserName == username) {
- return _userdisk[0];
- }
- }
- return {};
- }
- ;
- ;
- Namespace.register("U.MD.DK.S");
- U.MD.DK.S.search = function (inputel, diskinfo) {
- var _value = inputel.value,
- _diskinfo = diskinfo || US.disk.UserDisk,
- _searchfileordir = [];
- if (_value == "") {
- _searchfileordir = _diskinfo.currentDirectoryFile;
- } else {
- for (var i = 0; i < _diskinfo.directoryOrFiles.length; i++) {
- if (_diskinfo.directoryOrFiles[i].UserallDirectoryName.indexOf(_value) >= 0) {
- _searchfileordir.push(_diskinfo.directoryOrFiles[i]);
- }
- }
- }
-
- _content = U.selectEl("#U_MD_DK_RZ", _diskinfo.formel)[0];
- _content.innerText = "";
- U.selectEl(".U_MD_DK_RKR")[1].innerHTML = "当前文件的数量:" + (_searchfileordir.length);
- U.MD.DK.VW.printContent(_searchfileordir, _content);
- }
-
- ;
- Namespace.register("U.MD.DK.VW");
- U.MD.DK.VW.followState = function (diskel, userid) {
- var _followbutton = U.selectEl(".U_MD_DK_LIRS", diskel);
- _followbutton.attr("user", userid);
- if (userid == US.userInfo.userid) {
- _followbutton[0].innerHTML = "本人";
- } else if (US.friend.friends && U.Json.select(US.friend.friends, { UserId: userid })[0]) {
- _followbutton[0].innerHTML = "已追随";
- _followbutton.addClass("U_MD_DK_LIRSED");
- } else {
- _followbutton[0].innerHTML = "追随";
- _followbutton.removeClass("U_MD_DK_LIRSED");
- }
- }
- U.MD.DK.VW.followState.click = function (button) {
- var _userid = U.selectEl(button).attr("user");
- var _userinfo;
- if (_userid == US.userInfo.userid) {
- return;
- } else if (US.friend.friends && (_userinfo = U.Json.select(US.friend.friends, { UserId: _userid })[0])) {
- U.MD.F.M.deleteFriend(_userinfo, function () {
- button.innerHTML = "追随";
- U.selectEl(button).removeClass("U_MD_DK_LIRSED");
- });
- } else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Users", "GetUserinfoByUserId", _userid], function (r) {
- if (r.value && r.value[0]) {
- U.MD.F.M.addFriend(r.value[0], function () {
- button.innerHTML = "已追随";
- U.selectEl(button).addClass("U_MD_DK_LIRSED");
- });
- } else {
- U.Alert("用户信息有误,请稍后尝试...");
- }
- });
- }
- }
- U.MD.DK.VW.viewsSwitch = function (viewtype, diskinfo) {
- var _contentel = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0],
- _viewnav = U.selectEl(_contentel).prev()[0]
- ;
- diskinfo.viewtype = _contentel.viewtype = viewtype;
- if (diskinfo.currentDirectoryFile.length) {
- _contentel.innerHTML = "";
- U.MD.DK.VW.printContent(diskinfo.currentDirectoryFile, _contentel);
-
- if (viewtype == "Normal") {
- _contentel.style.width = "";
- _viewnav.style.display = "none";
- _contentel.style.height = U.selectEl(_contentel).Parent(2).offsetHeight - 79 + "px"
- }
-
- else {
- U.MD.DK.VW.size(diskinfo);
- }
- }
- }
- U.MD.DK.VW.SortView = function (diskinfo, type, cb) {
- var _filesinfo = diskinfo.currentDirectoryFile,
- _contentel = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0];
-
- if (_filesinfo.length) {
-
- if (_filesinfo[0].UserDirectoryAddTime > _filesinfo[1].UserDirectoryAddTime) {
-
- U.UF.Math.sequence(_filesinfo, type, cb, 1);
- } else {
-
- U.UF.Math.sequence(_filesinfo, type, cb, -1);
- }
-
- _contentel.innerHTML = "";
- U.MD.DK.VW.printContent(_filesinfo, _contentel);
- }
- }
- U.MD.DK.VW.printContent = function (filesinfo, el) {
- var _diskinfo = US.disk.UserDisk,
- _viewtype = el.viewtype || "Normal",
- _viewnav = U.selectEl(el).prev()[0]
- ;
-
- if (filesinfo.length) {
-
- if (_viewtype == "Normal") {
- U.MD.DK.VW.printNormalView(filesinfo, el);
- }
-
- else {
- U.MD.DK.VW.printDetailedView(filesinfo, el);
- }
- }
-
- else if (!$(el).Child().length) {
- U.MD.DK.VW.printNullView(el);
- }
- }
- U.MD.DK.VW.printNullView = function (el) {
- var _viewel,
- _infoel,
- _promptel,
- _viewel = $$("div", { "className": "U_MD_DK_RZF" }, el);
- _infoel = $$("div", { "className": "U_MD_DK_RZFS" }, _viewel);
- $$("div", { "className": "U_MD_DK_RZTSL U_MD_DK_RZFSL", "innerHTML": "!" }, _infoel);
- _promptel = $$("div", { "className": "U_MD_DK_RZFSR" }, _infoel);
-
- _infoel = $$("div", { "className": "U_MD_DK_RZFSRS" }, _promptel);
- $$("div", { "className": "U_MD_DK_RZFSRS", "innerHTML": "这地方暂时" }, _infoel);
- $$("div", { "className": "U_MD_DK_RZFSRS", "innerHTML": " 没有资源哦。" }, _infoel);
- $$("div", { "className": "U_MD_DK_RZTSRX U_MD_DK_RZFSRX", "innerHTML": "Nothing!!" }, _promptel);
- }
- U.MD.DK.VW.printNormalView = function (filesinfo, el) {
-
- var i,
- _isencryp,
- _date,
- _icon,
- _imgicon,
- _iconel,
- _imgeel,
- _infoel,
- _userimg,
- _frag = $$("frag"),
- _diskinfo = US.disk.UserDisk,
- _userid = _diskinfo.userInfo.UserId
- ;
-
- for (i = 0; i < filesinfo.length; i++) {
-
- _isencryp = (filesinfo[i]["UserDirectoryEncrypt"] && filesinfo[i]["UserDirectoryEncrypt"] != _userid);
- _date = U.UF.D.formatDateToArray(filesinfo[i]["UserDirectoryAddTime"], "Array");
-
- if (U.MD.DK.VW.collaborativeFileJudgment(filesinfo[i]) == true && filesinfo[i].UserDirectoryExtendType == "folder" && filesinfo[i].Parent.UserDirectoryName == "我的协同" || U.MD.DK.VW.collaborativeFileJudgment(filesinfo[i]) == true && filesinfo[i].UserDirectoryExtendType == "folder" && filesinfo[i].Parent.UserDirectoryName == "他人邀请") {
- filesinfo[i].UserDirectoryExtendType = "group";
- }
- _icon = U.MD.DK.C.getIcon(filesinfo[i].UserDirectoryExtendType);
-
- _viewel = $$("div", {
- "title": filesinfo[i]["UserallDirectoryName"],
- "className": "U_MD_DK_RZO",
- "id": "R" + (filesinfo[i].UserDirectoryID),
- "onmousedown": function () {
- var _isindex = _diskinfo.selectElement.indexOf(this);
- if (_isindex > -1) {
- U.UF.EV.stopBubble();
- }
- },
- "oncontextmenu": U.UF.C.closure(function (fileinfo) {
- U.UF.EV.stopBubble();
- U.UF.EV.stopDefault();
- U.MD.DK.RM.rightMenu(this, fileinfo, US.disk.UserDisk);
- }, [filesinfo[i]])
- }, _frag);
-
- if (filesinfo[i].filetype == "1") {
- _viewel.onclick = U.UF.C.closure(function (fileinfo) {
- U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
- }, [filesinfo[i]]);
- } else {
- _viewel.onclick = U.UF.C.closure(function (fileinfo) {
- U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
- }, [filesinfo[i]]);
- }
-
- _imgicon = "";
- _iconel = $$("div", { "className": "U_MD_DK_RZOA" }, _viewel);
-
- if (filesinfo[i].filetype != 1) {
-
- if (_isencryp) {
- _imgicon = "U_MD_DK_Img U_MD_DK_RZOM";
- }
-
- else {
- _imgicon = _icon.classname[1] ? "U_MD_DK_Img " + _icon.classname[1] : "U_MD_DK_Img U_MD_DK_RZOW";
- }
- }
-
- else if (_icon.classname[1]) {
- _imgicon = "U_MD_DK_Img " + _icon.classname[1];
- }
- _imgeel = $$("div", { "className": "U_MD_DK_RZOS " + _imgicon }, _iconel);
-
- if (_icon.name == "文件") {
- $$("div", { "className": "U_MD_DK_RZOSZ", "innerHTML": filesinfo[i].UserDirectoryExtendType || "" }, _imgeel);
- } else if (!_icon.classname[1]) {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": function () {
- U.MD.C.imgError(this, 1);
- },
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(filesinfo[i].UserDirectoryUrl)
- }, _imgeel);
- }
-
- _infoel = $$("div", { "className": "U_MD_DK_RZOZO" }, _iconel);
- $$("div", { "className": "U_MD_DK_RZOZ", "innerHTML": filesinfo[i]["UserallDirectoryName"] }, _infoel);
-
- _infoel = $$("div", { "className": "U_MD_DK_RZOFXJ U_MD_D_Text_Abbreviation" }, _infoel);
- $$("span", { "className": "U_MD_DK_RZOFXJO", "innerHTML": _date[0] + "-" + _date[1] + "-" + _date[2] }, _infoel);
- if (filesinfo[i].filetype != 0) {
- $$("span", { "className": "U_MD_DK_RZOFXJT", "innerHTML": U.UF.UP.minUnitToMaxUnit(filesinfo[i]["UserDirectorySize"]) }, _infoel);
- }
-
- _infoel = $$("div", { "className": "U_MD_DK_RZOF" }, _viewel);
- _infoel = $$("div", { "className": "U_MD_DK_RZOFD" }, _infoel);
- _userimg = $$("div", { "className": "U_MD_DK_RZOFDI" }, _infoel);
-
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(filesinfo[i].UserThumbnailImageHead),
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(filesinfo[i].UserId);
- }
- }, _userimg);
-
- $$("div", { "className": "U_MD_DK_RZOFDN U_MD_D_Text_Abbreviation", "innerHTML": filesinfo[i].UserNickName || filesinfo[i]["UserallDirectoryName"] }, _infoel);
- }
-
- U.selectEl(el).append(_frag);
- }
- U.MD.DK.VW.printDetailedView = function (filesinfo, el) {
-
- var i,
- _isencryp,
- _date,
- _icon,
- _iconandnameel,
- _ischecked = false,
- _userimg,
- _frag = $$("frag"),
- _userid = US.disk.UserDisk.userInfo.UserId
- ;
-
- for (i = 0; i < filesinfo.length; i++) {
-
- _isencryp = (filesinfo[i]["UserDirectoryEncrypt"] && filesinfo[i]["UserDirectoryEncrypt"] != _userid);
- _date = U.UF.D.formatDateToArray(filesinfo[i]["UserDirectoryAddTime"]);
- _icon = U.MD.DK.C.getIcon(filesinfo[i].UserDirectoryExtendType);
-
- _viewel = $$("div", { "title": filesinfo[i]["UserallDirectoryName"], "className": "U_MD_DK_RZS U_MD_DK_RZXO", "id": "R" + (filesinfo[i].UserDirectoryID) }, _frag);
-
- _viewel.oncontextmenu = function () {
- U.UF.EV.stopBubble();
- U.MD.DK.RM.rightMenu(_viewel, filesinfo[i], US.disk.UserDisk);
- };
- _viewel.onmousedown = function () {
- var _isindex = _diskinfo.selectElement.indexOf(this);
- if (_isindex > -1) {
- U.UF.EV.stopBubble();
- }
- }
-
- _viewel.onclick = U.UF.C.closure(function (fileinfo) {
- U.MD.DK.LE.openFileDirectory(fileinfo, _userid);
- }, [filesinfo[i]]);
- _iconandnameel = $$("div", { "className": "U_MD_DK_RZSO", "style": { "marginLeft": "0px" } }, _viewel);
-
- $$("input", {
- "className": "U_MD_DK_RZSOI",
- "checked": _ischecked,
- "type": "checkbox",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.DK.VW.checkFile(this);
- }
- }, _iconandnameel);
- _iconandnameel = $$("div", { "className": "U_MD_DK_RZSM U_MD_D_Text_Abbreviation" }, _viewel);
-
- if (_icon.classname[2]) {
- $$("span", { "className": _icon.classname[2] + " U_MD_DK_RZSMI U_MD_DK_Img U_MD_D_Text_Abbreviation", "innerHTML": " " }, _iconandnameel);
- } else {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": function () {
- U.MD.C.imgError(this, 1);
- },
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(filesinfo[i].UserDirectoryUrl || (US.FILESYSTEMURL + filesinfo[i].UseFilesServerThumbnailName))
- }, _iconandnameel);
- }
-
- $$("span", { "className": "U_MD_DK_RZSMN", "innerHTML": filesinfo[i]["UserallDirectoryName"] }, _iconandnameel);
-
- $$("div", { "className": "U_MD_DK_RZSF U_MD_DK_RZSFO U_MD_D_Text_Abbreviation", "innerHTML": 0 }, _viewel);
-
- $$("div", { "className": "U_MD_DK_RZSL U_MD_D_Text_Abbreviation", "innerHTML": filesinfo[i]["UserNickName"] }, _viewel);
-
- $$("div", { "className": "U_MD_DK_RZSX U_MD_D_Text_Abbreviation", "innerHTML": _icon.name }, _viewel);
-
- $$("div", { "className": "U_MD_DK_RZSD U_MD_D_Text_Abbreviation", "innerHTML": U.UF.UP.minUnitToMaxUnit(filesinfo[i]["UserDirectorySize"]) }, _viewel);
-
- $$("div", { "className": "U_MD_DK_RZST U_MD_D_Text_Abbreviation", "innerHTML": _date[0] + "-" + _date[1] + "-" + _date[2] + " " + _date[3] + ":" + _date[4] }, _viewel);
- }
-
- el.appendChild(_frag);
- }
- U.MD.DK.VW.collaborativeFileJudgment = function (filesinfo) {
- if (filesinfo.Parent != null) {
- return U.MD.DK.VW.collaborativeFileJudgment(filesinfo.Parent);
- }
- if (filesinfo.GroupID == true && filesinfo.UserDirectoryName == "我的协同" || filesinfo.GroupID == true && filesinfo.UserDirectoryName == "他人邀请") {
- return true;
- }
- return false;
- }
- U.MD.DK.VW.size = function (diskinfo) {
- var i, j, k,
- _childel,
- _size = [0.1, 0.2, 0.1, 0.15, 0.15, 0.15, 0.14],
- _contentel = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0],
- _contentchildel = U.selectEl(_contentel).Child(),
- _navel = U.selectEl(_contentel).prev()[0],
- _navchildel = U.selectEl(_navel).Child(),
- _width = U.selectEl(_contentel).width(),
- _height = U.selectEl(_contentel).height()
- ;
- _navel.style.display = "block";
-
- if (_contentel.viewtype === "Detailed" && diskinfo.currentDirectoryFile.length) {
- for (i = 0; i < _size.length; i++) {
-
- for (j = 0; j < _navchildel.length; j += 2) {
- _navchildel[j].style.width = _width * _size[j / 2] + "px";
- }
-
- for (j = 0; j < _contentchildel.length; j++) {
- _childel = U.selectEl(_contentchildel).Child();
- for (k = 0; k < _childel.length; k++) {
- _childel[k].style.width = _width * _size[k] + "px";
- }
- }
- }
- _navel.style.width = _width + "px";
- _contentel.style.height = _height + "px";
- }
- }
- U.MD.DK.VW.checkAllFile = function (el) {
- var i,
- _ischeck = el.checked,
- _classname = "U_MD_DK_RZS U_MD_DK_RZXO" + (_ischeck ? " U_MD_DK_RZXOO" : ""),
- _contentel = U.selectEl($(el).Parent(2)).next()[0],
- _childel = U.selectEl(_contentel).Child()
- ;
- for (i = 0; i < _childel.length; i++) {
- _childel[i].className = _classname;
- U.selectEl("input", _childel[i])[0].checked = _ischeck;
- }
- }
- U.MD.DK.VW.checkFile = function (el) {
- var _ischeck = el.checked;
-
- U.selectEl(el).Parent(2).className = "U_MD_DK_RZS U_MD_DK_RZXO" + (_ischeck ? " U_MD_DK_RZXOO" : "");
- }
- U.MD.DK.VW.chosenSaveFile = function (postfix, fileid, filename, callback, formtitle, extendtype) {
- if (!U.MD.U.L.isLogin()) {
- extendtype = extendtype || "folder";
- var _diskinfo = US.disk.Disks[US.userInfo.userid];
- var _formel = U.selectEl('#U_MD_DK_VW_ChosenSaveFile')[0];
- var _file;
- if (_formel) {
-
- U.UF.F.windowTopCenter(_formel);
-
- _file = U.selectEl('#U_MD_DK_VW_ChosenSaveFile_File')[0];
- _file.innerHTML = "";
- U.selectEl('.U_MD_DK_VW_ChosenSaveFile button', _formel)[1].onclick = function () {
- U.MD.DK.VW.chosenSaveFile.ensure(_formel, U.selectEl('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0], postfix, fileid, callback);
- }
- U.selectEl('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0].value = "";
- } else {
- var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" });
- var _newfolder = $$('button', { style: { position: "absolute", right: "0", top: "2px" }, innerHTML: "新建文件夹" }, _box);
- $$("div", { style: { "font-size": "16px", padding: "12px 10px 2px" }, innerHTML: "选择文件夹" }, _box);
- $$("hr", {}, _box);
- _file = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_DK_VW_ChosenSaveFile_File" }, _box);
- var _inputarea = $$('div', {}, _box);
- $$('span', { 'innerHTML': '文件名:' }, _inputarea);
- var _input = $$('input', { placeholder: filename || "请输入文件名...", style: { width: "89%", "text-indent": "5px", "line-height": "26px" } }, _inputarea);
- var _ensure = $$('button', { innerHTML: "确定" }, _box);
- var _cancel = $$('button', { innerHTML: "取消" }, _box);
-
- _formel = new U.UF.UI.form(
- "<span id='U_MD_DK_VW_ChosenSaveFile_Title'>" + (formtitle || "新建文件") + "</span>",
- _box, {
- "id": "U_MD_DK_VW_ChosenSaveFile",
- "style": {
- "width": "600px",
- "height": "450px"
- }
- }).form;
-
- _newfolder.onclick = function () {
- U.MD.DK.VW.chosenSaveFile.newFolder();
- }
-
- _ensure.onclick = function () {
- U.MD.DK.VW.chosenSaveFile.ensure(_formel, _input, postfix, fileid, callback);
- }
-
- _cancel.onclick = function () {
- U.UF.F.windowMinimize(_formel);
- }
- }
-
- U.MD.DK.VW.chosenSaveFile.printFolder(_diskinfo.directoryOrFiles.slice(1, 5), _file, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"], _file, extendtype);
- }
- }
- U.MD.DK.VW.chosenSaveFile.printFolder = function (data, filearea, deviant, iconclass, topfilearea, extendtype) {
- extendtype = extendtype || "folder";
- var i,
- _class;
- for (i = 0; i < data.length; i++) {
- _class = null;
- if (extendtype == "*" || extendtype.indexOf(extendtype) > -1) {
- if ((iconclass || "").length) {
- _class = iconclass[i] || iconclass;
- } else if (data[i].UserDirectoryExtendType == extendtype || extendtype == "*") {
- switch (data[i].UserDirectoryExtendType) {
- case "folder":
- _class = "U_MD_DK_LCW";
- break;
- case "UW":
- case "txt":
- case "html":
- case "uw":
- _class = "U_MD_DK_LCB";
- break;
- case "jpg":
- case "png":
- _class = "U_MD_DK_LCT";
- break;
- case "mp4":
- _class = "U_MD_DK_LCP";
- break;
- }
- }
- if (_class) {
- U.MD.DK.VW.chosenSaveFile.Print(data[i], filearea, deviant, _class, topfilearea, extendtype);
- }
- }
- }
- }
- U.MD.DK.VW.chosenSaveFile.Print = function (data, filearea, deviant, iconclass, topfilearea, extendtype) {
- var _filediv, _fileel, _folder;
- _folder = false;
- if (data.UserDirectoryExtendType == "folder") {
- _folder = true;
- };
- _filediv = $$('div', { "className": "U_MD_DK_VW_ChosenSaveFile_File_Box" }, filearea);
- _fileel = $$('div', {
- id: data["UserDirectoryID"] ? "CS" + data["UserDirectoryID"] : "",
- "className": "U_MD_DK_LTXOS",
- style: { 'padding-left': deviant + 'px' },
- onclick: U.UF.C.closure(function (directoryinfo, el) {
- var _thisdate = data;
- var _thisfolder = _folder;
- U.UF.EV.stopBubble();
- if (_thisfolder) {
-
- U.MD.DK.VW.chosenSaveFile.forderClick(directoryinfo, el, topfilearea, extendtype);
-
- if ($('.U_MD_DK_VW_ChosenSaveFileName')[0]) {
- U.selectEl('.U_MD_DK_VW_ChosenSaveFileName')[0].value = data.UserallDirectoryName;
- U.selectEl('.U_MD_DK_VW_ChosenSaveFileName')[0].data = data;
- }
- } else {
-
- if ($('.U_MD_DK_VW_ChosenSaveFileName')[0]) {
- U.selectEl('.U_MD_DK_VW_ChosenSaveFileName')[0].value = data.UserallDirectoryName;
- U.selectEl('.U_MD_DK_VW_ChosenSaveFileName')[0].data = data;
- }
- }
- }, [data, _filediv])
- }, _filediv);
- if (_folder) {
- $$('div', { className: "U_MD_DK_LTXOSI U_MD_DK_Img" }, _fileel);
- } else {
- $$('div', { className: "U_MD_DK_LTXOSI" }, _fileel);
- }
- $$('div', { className: "U_MD_DK_LCOI U_MD_DK_LTXOST U_MD_DK_Img " + iconclass }, _fileel);
- $$('span', { innerHTML: data.UserallDirectoryName }, _fileel);
- return _filediv;
- }
- U.MD.DK.VW.chosenSaveFile.forderClick = function (directoryinfo, el, topfilearea, extendtype) {
- var
- _folder = U.selectEl(el).Child()[0],
- _deviant = parseInt(_folder.style.paddingLeft || 0) + 5;
- var _icon = U.selectEl('.U_MD_DK_LTXOSI', _folder);
- U.selectEl('.U_MD_DK_LTXOSO', topfilearea).removeClass('U_MD_DK_LTXOSO');
- U.selectEl(_folder).addClass('U_MD_DK_LTXOSO');
- if (_icon.hasClass('U_MD_DK_LTXOSIO')) {
-
- _icon.removeClass('U_MD_DK_LTXOSIO');
- var _nextlevel = U.selectEl(_folder).next();
- U.selectEl(_nextlevel).remove();
- } else {
-
- _icon.addClass('U_MD_DK_LTXOSIO');
- if (directoryinfo.Child) {
-
- U.MD.DK.VW.chosenSaveFile.printFolder(directoryinfo.Child, $$('div', {}, el), _deviant, null, null, extendtype);
- } else {
-
- U.MD.DK.LE.getChildsByDirectoryId(US.userInfo.userid, directoryinfo, topfilearea, function () {
-
- U.MD.DK.VW.chosenSaveFile.printFolder(directoryinfo.Child, $$('div', {}, el), _deviant, null, null, extendtype);
- });
- }
- }
- }
- U.MD.DK.VW.chosenSaveFile.ensure = function (formel, input, postfix, fileid, callback) {
- var _name = input.value;
- if (_name.trim() == "") {
- return U.Alert('请填写文件名!');
- }
-
- if (U.UF.S.ZWFileName.test(_name)) {
- var _nowfile = U.selectEl('.U_MD_DK_LTXOSO', formel)[0];
- if (!_nowfile) {
- U.Alert('请选择文件夹新建的目录!');
- } else {
- var _parentid = _nowfile.id.replace('CS', '');
- var _userid = US.userInfo.userid;
- var _diskinfo = US.disk.Disks[_userid];
- var _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0];
- if (!U.MD.DK.C.getDirectoryPermissions(_dirinfo.UserDirectoryID, _diskinfo).isnew) {
- return U.Alert(_dirinfo.Child.length ? '分类目录无法操作,请选择群文件或文件夹!' : '分类目录无法操作,请新建群或者选择其他群文件夹');
- }
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo);
-
- if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = _diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[0].GroupID || "";
- }
- var _newfileid = fileid || Guid.newGuid();
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _newfileid, _parentid, _name, "", "", "", postfix, _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newfileid, 0, _parentid, _name, _name, postfix, "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, _dirinfo);
- U.UF.F.windowMinimize(formel);
-
- if (U.UF.C.isFunction(callback)) {
- callback(_fileinfo);
- }
- }, []);
- }
- } else {
-
- U.Alert('请填写文件名符合规范!');
- }
- }
- U.MD.DK.VW.chosenSaveFile.newFolder = function () {
- var _nowfile = U.selectEl('.U_MD_DK_VW_ChosenSaveFile_File .U_MD_DK_LTXOSO')[0];
- if (!_nowfile) {
- return U.Alert('请选择文件夹新建的目录!');
- }
- var _userid = US.userInfo.userid;
- var _parentid = _nowfile.id.replace('CS', '');
- var _diskinfo = US.disk.Disks[_userid];
- if (_diskinfo.directoryOrFiles[0].UserDirectoryID == _parentid || _diskinfo.directoryOrFiles[1].UserDirectoryID == _parentid || _diskinfo.directoryOrFiles[2].UserDirectoryID == _parentid) {
- U.Alert('该目录下无法新建文件夹,请重新选择目录!');
- } else {
-
- var _input = $$('input', { placeholder: "请输入文件夹名字...", style: { width: '180px', height: "25px", margin: "30px auto", display: "block", "text-indent": "5px" } });
-
- U.UF.UI.confirm(_input, function () {
-
- var _name = _input.value;
- if (U.UF.S.ZWFileName.test(_name)) {
- var _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0];
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = _diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
- var _newfolderid = Guid.newGuid();
-
- U.A.Request(US.DISK, ["CreateDirectory", _userid, _newfolderid, _dirinfo.UserDirectoryDeep + 1, _name, _parentid, "", _groupid, ""],
- function (r) {
-
- var _nextlevel = U.selectEl(_nowfile).next()[0] || $$('div', {}, U.selectEl(_nowfile).Parent());
- var _fileinfo = new U.MD.DK.M.entity(_newfolderid, 0, _parentid, _name, _name, "folder", "", U.UF.D.toTimeStamp(), "", _dirinfo.UserDirectoryDeep + 1,
- null, "", 0, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead);
- U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, _dirinfo);
- _filediv = U.MD.DK.VW.chosenSaveFile.Print(_fileinfo, _nextlevel, parseInt(_nowfile.style.paddingLeft || 0) + 6, "U_MD_DK_LCW");
- _nextlevel.insertBefore(_filediv, U.selectEl(_nextlevel).Child()[0]);
- });
- } else {
-
- U.Alert('请填写文件名符合规范!');
- return false;
- }
- });
- }
- }
- U.MD.DK.VW.saveSynergy = function (postfix, fileinfo, filename, type, callback) {
- if (!U.MD.U.L.isLogin()) {
- var _grouplistarr = US.disk.Disks[US.userInfo.userid];
- var _formel = U.selectEl('#U_MD_O_SaveSynergy')[0];
- var _grouplist;
- if (_formel) {
-
- U.UF.F.windowTopCenter(_formel);
-
- _grouplist = U.selectEl('#U_MD_O_SaveSynergy_GroupList')[0];
- _grouplist.innerHTML = "";
- U.selectEl('.U_MD_DK_VW_ChosenSaveFile button', _formel)[1].onclick = function () {
- U.MD.DK.VW.saveSynergy.ensure(_formel, U.selectEl('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0], postfix, fileinfo, type, callback);
- }
- U.selectEl('.U_MD_DK_VW_ChosenSaveFile input', _formel)[0].value = "";
- } else {
- var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" });
- var _creategroup = $$('button', { style: { position: "absolute", right: "0", top: "-2px" }, innerHTML: "新建群", id: "U_MD_O_SaveSynergy_CreateGroup", onclick: 'U.MD.DK.VW.saveSynergy.swith()' }, _box);
- $$("div", { style: { "font-size": "16px", padding: "6px 10px 7px" }, innerHTML: "群列表" }, _box);
- $$("hr", {}, _box);
- var _newgroup = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_O_SaveSynergy_NewGroup", style: { display: 'none', overflow: 'hidden' } }, _box);
- _grouplist = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_O_SaveSynergy_GroupList" }, _box);
- var _inputarea = $$('div', {}, _box);
- $$('span', { 'innerHTML': '文件名:' }, _inputarea);
- var _input = $$('input', {
- placeholder: "请输入文件名...",
- value: filename == "未命名文档(点击编辑)..." ? "" : filename,
-
-
- style: { width: "89%", "text-indent": "5px", "line-height": "26px" }
- }, _inputarea);
- var _ensure = $$('button', { innerHTML: "确定" }, _box);
- var _cancel = $$('button', { innerHTML: "取消" }, _box);
-
- _formel = new U.UF.UI.form(
- "<span id='U_MD_O_SaveSynergy_Title'>" + (type == 'move' ? "将文档移动到" : "选择保存到") + "指定群</span>",
- _box, {
- "id": "U_MD_O_SaveSynergy",
- "style": {
- "width": "600px",
- "height": "450px"
- }
- }).form;
-
- _ensure.onclick = function () {
- U.MD.DK.VW.saveSynergy.ensure(_formel, _input, postfix, fileinfo, type, callback);
- }
-
- _cancel.onclick = function () {
- U.UF.F.windowMinimize(_formel);
- }
- }
-
- U.MD.DK.VW.chosenSaveFile.printFolder(_grouplistarr.directoryOrFiles.slice(1, 3), _grouplist, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS"]);
-
- U.MD.DK.VW.saveSynergy.swith(true);
- }
- };
- U.MD.DK.VW.saveSynergy.ensure = function (formel, input, postfix, fileinfo, type, callback) {
- var _name = input.value;
- if (_name.trim() == "") {
- return U.Alert('请填写文件名!');
- }
-
- if (U.UF.S.ZWFileName.test(_name)) {
- var _dirinfo;
- var _userid = US.userInfo.userid;
- var _diskinfo = US.disk.Disks[_userid];
- if ($('#U_MD_O_SaveSynergy_GroupList').css('display') == 'none') {
- var _groupName = '协同文档群--' + new Date().getHours() + ":" + new Date().getMinutes(),
- _groupDesc = "由" + US.userInfo.username + "发起的互联办公群组。";
- U.MD.F.J.determineCreateGroupAndAddGroupUser(false, null, null, false, _groupName, _groupDesc, function (groupid) {
- _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: groupid })[0];
- U.MD.DK.VW.saveSynergy.ensure.operate(formel, _dirinfo, fileinfo, groupid, groupid, type, postfix, _name, callback);
- });
- } else {
- var _groupid, _parentid;
- var _nowfile = U.selectEl('.U_MD_DK_LTXOSO', formel)[0];
- _parentid = _nowfile.id.replace('CS', '');
- _dirinfo = U.Json.select(_diskinfo.directoryOrFiles, { UserDirectoryID: _parentid })[0];
- if (!U.MD.DK.C.getDirectoryPermissions(_dirinfo.UserDirectoryID, _diskinfo).isnew) {
- return U.Alert(_dirinfo.Child.length ? '分类目录无法操作,请选择群文件或文件夹!' : '分类目录无法操作,请新建群或者选择其他群文件夹');
- }
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, _diskinfo);
-
- if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = _diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[0].GroupID || "";
- }
- U.MD.DK.VW.saveSynergy.ensure.operate(formel, _dirinfo, fileinfo, _parentid, _groupid, type, postfix, _name, callback);
- }
- } else {
- U.Alert('请填写文件名符合规范!');
- }
- }
- U.MD.DK.VW.saveSynergy.ensure.operate = function (formel, dirinfo, fileinfo, parentid, groupid, type, postfix, name, callback) {
- var _fileid = fileinfo.UserDirectoryID;
- var _userid = US.userInfo.userid;
- var _diskinfo = US.disk.Disks[_userid];
- if (type == "move") {
- var _pastecontent = US.disk.Disks[_userid].pasteDirOrFile = {
- "type": "shear",
- "UserDirectoryID": groupid,
- "dirorfile": fileinfo,
- "userid": _userid
- }
- U.A.Request(US.DISK, ["CutAndPasteFiles", fileinfo.UserId, groupid, fileinfo.UserDirectoryID, groupid, groupid],
- top.U.MD.DK.RE.asynPaste, ["", dirinfo, groupid, _pastecontent, _diskinfo]);
- U.A.Request(US.DISK, ["UpdateFileInfo", _fileid, name], function () {
- fileinfo.UserallDirectoryName = name;
- fileinfo.UserDirectoryName = name.addEllipsis(20);
- fileinfo.GroupId = fileinfo.UserDirectoryEncrypt = groupid;
-
- if (U.UF.C.isFunction(callback)) {
- callback(fileinfo);
- }
- U.UF.F.windowMinimize(formel);
- });
- } else {
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _fileid, parentid, name, "", "", "", postfix, groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_fileid, 0, parentid, name, name, postfix, "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], _diskinfo, dirinfo);
- U.UF.F.windowMinimize(formel);
-
- if (U.UF.C.isFunction(callback)) {
- callback(_fileinfo);
- }
- U.UF.F.windowMinimize(formel);
- }, []);
- }
- }
- U.MD.DK.VW.saveSynergy.swith = function (init) {
- var _newgroup = U.selectEl('#U_MD_O_SaveSynergy_NewGroup');
- var _grouplist = U.selectEl('#U_MD_O_SaveSynergy_GroupList');
- var _creategroup = U.selectEl('#U_MD_O_SaveSynergy_CreateGroup');
- if (_newgroup.css('display') == 'none' && !init) {
- _newgroup.css('display', 'block');
- _grouplist.css('display', 'none');
- _creategroup[0].innerHTML = "返回群列表";
- _creategroup[0].nextElementSibling.innerHTML = "选择联系人";
- if (_newgroup.Child().length == 0) {
- U.MD.DK.VW.saveSynergy.createGroupInit();
- }
- U.MD.DK.VW.saveSynergy.Friends();
- } else {
- _newgroup.css('display', 'none');
- _grouplist.css('display', 'block');
- _creategroup[0].innerHTML = "新建群";
- _creategroup[0].nextElementSibling.innerHTML = "群列表";
- }
- }
- U.MD.DK.VW.saveSynergy.createGroupInit = function () {
- var _newgroup = U.selectEl('#U_MD_O_SaveSynergy_NewGroup')[0];
- var _left = $$('div', { style: { borderRight: "1px solid #ccc", position: "relative" } }, _newgroup);
- var _right = $$('div', { style: { overflow: "hidden" } }, _newgroup);
- var _count = $$('div', { style: { lineHeight: '30px' }, innerHTML: '已选择联系人:<span>1</span>' }, _right);
- var _select = $$('div', { id: "U_MD_O_SaveSynergy_NewGroup_Select", style: { height: '265px', overflow: 'auto' } }, _right);
- var _box = $$('div', { "className": 'U_MD_O_SaveSynergy_NewGroup_Friend', style: { paddingLeft: '5px' } }, _select);
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(US.userInfo.UserThumbnailImageHead) }, _box);
- $$('span', { innerHTML: US.userInfo.UserNickName || US.userInfo.username }, _box);
- }
- U.MD.DK.VW.saveSynergy.Friends = function () {
- var i, _box,
- _friends = US.friend.friends;
- var _child = U.selectEl('#U_MD_O_SaveSynergy_NewGroup').Child();
- var _friendel = _child[0];
- var _countel = U.selectEl('span', U.selectEl(_child[1]).Child()[0])[0];
- var _selectel = U.selectEl("#U_MD_O_SaveSynergy_NewGroup_Select");
- _friendel.innerHTML = "";
- _countel.innerHTML = "1";
- U.MD.F.J.selectUserInfo.NeedUser = [];
- var _oldfriend = _selectel.Child();
-
- for (i = 1; i < _oldfriend.length; i++) {
- U.selectEl(_oldfriend[i]).remove();
- }
-
- if (_friends.length > 0) {
-
- for (i = 0; i < _friends.length; i++) {
-
- var _box = $$('div', {
- "className": 'U_MD_O_SaveSynergy_NewGroup_Friend',
- onclick: U.UF.C.closure(function (friendinfo) {
- U.MD.DK.VW.saveSynergy.Friends.Select(friendinfo, _selectel[0], _countel);
- }, [_friends[i]]),
- friendid: _friends[i].FriendsID
- }, _friendel);
-
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(_friends[i].UserThumbnailImageHead) }, _box);
-
- $$('span', { innerHTML: _friends[i].UserNickName || _friends[i].UserName }, _box);
- }
- }
-
- else {
-
- $$('p', {
- style: { cssText: "font-weight: bold; font-size: 14px;padding-left:60px;padding-top:60px;" },
- innerHTML: '您暂无添加好友,</br> 快去<span style="cursor:pointer;color:rgb(41, 103, 167);" onclick="U.MD.F.S.popSearchFriendsOrGroupForm(0);">添加你的好友</span>吧。 </br>'
- }, _friendel);
-
- $$('span', {
- innerHTML: "已添加完好友点击刷新好友列表",
- onclick: function () {
- U.UF.DL.loading(_friendel);
- setTimeout(function () {
- U.MD.DK.VW.saveSynergy.Friends();
- U.UF.DL.uploading(_friendel);
- }, 300);
- },
- style: { color: "red", cursor: "pointer", position: "absolute", bottom: "0px", fontSize: "12px" }
- }, _friendel);
- }
- }
- U.MD.DK.VW.saveSynergy.Friends.Select = function (friendinfo, selectel, countel) {
- var i,
- _isselect = U.Json.select(U.MD.F.J.selectUserInfo.NeedUser, { UserId: friendinfo.UserId })[0];
- if (!_isselect) {
- countel.innerHTML = parseInt(countel.innerHTML) + 1;
- U.MD.F.J.selectUserInfo.NeedUser.push(friendinfo);
-
- var _box = $$('div', {
- "className": 'U_MD_O_SaveSynergy_NewGroup_Friend',
- style: { paddingLeft: '5px' },
- onclick: function () {
- U.selectEl(this).remove();
- U.Json.del(U.MD.F.J.selectUserInfo.NeedUser, { "UserId": friendinfo.UserId });
- countel.innerHTML = parseInt(countel.innerHTML) - 1;
- }
- }, selectel);
-
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.C.getHeadImage(friendinfo.UserThumbnailImageHead) }, _box);
-
- $$('span', { innerHTML: friendinfo.UserNickName || friendinfo.UserName }, _box);
- }
- }
- U.MD.DK.VW.choseFile = function (cb, type) {
- var _diskinfo = US.disk.Disks[US.userInfo.userid];
- var _formel = U.selectEl('#U_MD_DK_VW_ChosenSaveFile')[0];
- var _file;
- type = type ? type : "*";
- if (_formel) {
-
- U.UF.F.windowTopCenter(_formel);
-
- _file = U.selectEl('#U_MD_DK_VW_ChosenSaveFile_File')[0];
- _file.innerHTML = "";
- } else {
- var _box = $$('div', { style: { position: "relative", overflow: "hidden" }, "className": "U_MD_DK_VW_ChosenSaveFile" });
- var _newfolder = $$('button', { style: { position: "absolute", right: "0", top: "2px" }, innerHTML: "新建文件夹" }, _box);
- $$("div", { style: { "font-size": "16px", padding: "12px 10px 2px" }, innerHTML: "文件名称" }, _box);
- $$("hr", {}, _box);
- _file = $$("div", { "className": "U_MD_DK_VW_ChosenSaveFile_File", id: "U_MD_DK_VW_ChosenSaveFile_File" }, _box);
- var _inputarea = $$('div', {}, _box);
- $$('span', { 'innerHTML': '文件名:' }, _inputarea);
- var _input = $$('input', { "className": "U_MD_DK_VW_ChosenSaveFileName", placeholder: "请输入文件名...", style: { width: "89%", "text-indent": "5px", "line-height": "26px" } }, _inputarea);
- var _ensure = $$('button', { innerHTML: "确定" }, _box);
- var _cancel = $$('button', { innerHTML: "取消" }, _box);
-
- _formel = new U.UF.UI.form(
- "<span id='U_MD_DK_VW_ChosenSaveFile_Title'>选择文件</span>",
- _box, {
- "id": "U_MD_DK_VW_ChosenSaveFile",
- "style": {
- "width": "600px",
- "height": "450px"
- }
- }).form;
-
- _newfolder.onclick = function () {
- U.MD.DK.VW.chosenSaveFile.newFolder();
- }
-
- _ensure.onclick = function () {
- cb($('.U_MD_DK_VW_ChosenSaveFileName')[0].data);
- U.UF.F.windowMinimize(_formel);
- _input.value = "";
- _input.data = null;
- }
-
- _cancel.onclick = function () {
- U.UF.F.windowMinimize(_formel);
- }
- }
-
- U.MD.DK.VW.chosenSaveFile.printFolder(_diskinfo.directoryOrFiles.slice(1, 5), _file, 0, ["U_MD_DK_LCD", "U_MD_DK_LCS", "U_MD_DK_LCD", "U_MD_DK_LCB", "U_MD_DK_LCF", "U_MD_DK_LCT", "U_MD_DK_LCP", "U_MD_DK_LCY"], _file, type);
- }
- Namespace.register("U.MD.DK.LE");
- U.MD.DK.LE.openFileDirectory = function (fileinfo, userid) {
- var i,
- _content,
- _div,
- _apptype,
- _applicationame,
- _types = US.disk.applicationTypes,
- _navarray,
- _extension,
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(userid);
- U.UF.EV.stopBubble();
-
-
- if (fileinfo.filetype) {
- _extension = fileinfo["UserDirectoryExtendType"].toLocaleLowerCase();
-
- _types = US.disk.applicationTypes;
- _applicationame;
-
- for (i in _types) {
- if (_types[i].types.indexOf(_extension) > -1) {
- _applicationame = i;
- break;
- }
- }
-
- switch (_applicationame) {
- case "music":
- U.MD.DK.LE.music(fileinfo);
- break;
- case "image":
- U.MD.DK.LE.img(fileinfo);
- break;
- case "video":
- U.MD.DK.LE.video(fileinfo);
- break;
- case "text":
- U.MD.D.Txt.textCreate(fileinfo);
- break;
- case "usoffice":
-
- case "ue":
- U.MD.D.I.openApplication("excel", fileinfo);
- break;
- case "uw":
- case "un":
- U.MD.D.I.openApplication("word", fileinfo);
- break;
- case "word":
- U.MD.D.I.openApplication("word", fileinfo);
- break;
- case "txt":
- U.MD.D.I.openApplication("txt", fileinfo);
- break;
-
- default:
- U.MD.DK.RE.downloadFile(fileinfo.UserDirectoryID, false);
- break;
- }
- }
-
- else {
-
- U.UF.N.addEvent(function () {
- U.MD.DK.LE.openDirectory(fileinfo, userid);
- }, "disk" + userid);
- }
-
- if (fileinfo.UserDirectoryDeep > 1) {
-
- if (fileinfo.filetype == 0) {
- U.A.Request(US.DISK, ["UpdateDirectoryInfo", fileinfo.UserDirectoryID, ""], function () { });
- }
-
- else {
- U.A.Request(US.DISK, ["UpdateFileInfo", fileinfo.UserDirectoryID, ""], function () { });
- }
-
- fileinfo["UserDirectoryModifyTime"] = U.UF.D.toTimeStamp();
- }
- }
- U.MD.DK.LE.openDirectory = function (fileinfo, userid) {
- var _groupinfo,
- _groupdirectory,
- _leftel,
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(userid),
- _content = U.selectEl("#U_MD_DK_RZ", _diskinfo.formel)[0];
- _diskinfo.selectElement = [];
- _content.innerText = "";
- _diskinfo.directoryid = fileinfo["UserDirectoryID"];
-
- U.MD.N.urlWrite("disk/" + _diskinfo.userInfo.UserId + "/" + _diskinfo.directoryid, _diskinfo.userInfo.UserNickName + "的网盘");
-
- if (fileinfo.Child) {
- U.MD.DK.LE.loadDirectory(fileinfo, _diskinfo, userid);
- }
-
- else {
-
- if (_diskinfo.directoryOrFiles[0].UserDirectoryID == fileinfo.UserDirectoryID) {
- U.MD.DK.LE.getNewDocument(userid, fileinfo, _content);
- }
-
- else if (_diskinfo.directoryOrFiles[1].UserDirectoryID == fileinfo.UserDirectoryID || _diskinfo.directoryOrFiles[2].UserDirectoryID == fileinfo.UserDirectoryID) {
- if (US.friend.group) {
- _groupinfo = US.friend.group.concat();
- _diskinfo.groups = _groupdirectory = U.MD.DK.getGroupDirectory(_groupinfo, _diskinfo.directoryOrFiles, userid);
- _diskinfo.directoryOrFiles = _diskinfo.directoryOrFiles.concat(_groupdirectory);
- }
- U.MD.DK.LE.loadDirectory(fileinfo, _diskinfo, userid);
- }
-
- else {
- U.MD.DK.LE.getChildsByDirectoryId(userid, fileinfo, _content);
- }
- }
- }
- U.MD.DK.LE.loadDirectory = function (fileinfo, diskinfo, userid) {
-
- var _childs = fileinfo.Child || [],
- _leftel = U.selectEl("#L" + fileinfo["UserDirectoryID"], diskinfo.formel)[0],
- _content = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0];
-
- if (_leftel) {
- U.MD.DK.LL.printLeftTreeDirectory(U.Json.select(_childs, { "filetype": 0 }), _leftel, userid);
- }
- U.selectEl("#U_MD_DK_RKR", diskinfo.formel)[0].innerHTML = "当前文件的数量:" + _childs.length;
- diskinfo.currentDirectoryFile = _childs;
-
- var _navarray = U.MD.DK.C.getAncestors(fileinfo, diskinfo);
- U.MD.DK.LL.printNavigation(_navarray, U.selectEl("#U_MD_DK_RYB", diskinfo.formel)[0], userid);
-
- U.MD.DK.VW.printContent(_childs, _content);
-
- var _permissions = U.MD.DK.C.getDirectoryPermissions(fileinfo.UserDirectoryID, diskinfo);
- var _permissioninfo = U.MD.DK.C.readWritePermission(fileinfo.UserDirectoryID, diskinfo)
- U.MD.DK.LE.myCollJudgment(_permissions, _permissioninfo[0][0]);
- }
- U.MD.DK.LE.myCollJudgment = function (permissions, permissioninfo) {
- var _div = U.selectEl(".U_MD_DK_RT")[1].children;
- if (permissions.isupadte == false && permissions.isdownload == false && permissions.isnew == false) {
- _div[0].style.display = "none";
- _div[1].style.display = "none";
- _div[2].style.display = "none";
- _div[3].style.display = "none";
- _div[4].style.display = "none";
- _div[5].style.display = "none";
- _div[6].style.display = "none";
- _div[7].style.display = "none";
- if (permissioninfo.UserDirectoryName == "我的协同") {
- _div[7].style.display = "block";
- _div[7].onclick = function () {
- U.MD.F.J.groupInfoForm();
- }
- }
- } else {
- _div[0].style.display = "block";
- _div[1].style.display = "block";
- _div[2].style.display = "block";
- _div[3].style.display = "block";
- _div[4].style.display = "block";
- _div[5].style.display = "block";
- _div[6].style.display = "block";
- _div[7].style.display = "none";
- }
- }
- U.MD.DK.LE.getChildsByDirectoryId = function (userid, fileinfo, loading, cb) {
-
- U.A.Request(US.DISK, ["GetChildsByDirectoryId", userid, fileinfo.UserDirectoryID, fileinfo.GroupID], U.MD.DK.LE.asynGetChildsByDirectoryId, [loading, userid, fileinfo, cb]);
- }
- U.MD.DK.LE.getNewDocument = function (userid, fileinfo, loading, cb) {
-
- if (US.userInfo.userid) {
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Office", "GetCollaborativeDocument", US.userInfo.userid, "00000000-0000-0000-0000-000000000000", "", 0, 0, 100], function (r) {
- var i;
- for (i = 0; i < r.value.length; i++) {
- r.value[i] = new U.MD.DK.M.entity(r.value[i].UserFilesID, r.value[i].UserFilesSize, r.value[i].UserDirectoryID, r.value[i].UserFilesName, r.value[i].UserFilesName, r.value[i].UserFilesExtendName, r.value[i].UserFilesServerName, r.value[i].UserFilesAddTime, "", "9999", r.value[i].UserFilesModifyTime, r.value[i].UserDirectoryEncrypt, 1, r.value[i].UserFilesDescript, r.value[i].UserDirectoryEncrypt, "", r.value[i].UserID, r.value[i].UserName, r.value[i].UserName, r.value[i].UserThumbnailImageHead);
- }
- U.MD.DK.LE.asynGetChildsByDirectoryId(r);
- }, [loading, userid, fileinfo, cb]);
- }
-
- else {
- U.MD.DK.LE.asynGetChildsByDirectoryId({ "context": [loading, userid, fileinfo, cb], "value": [] });
- }
- }
- U.MD.DK.LE.asynGetChildsByDirectoryId = function (r) {
- var _context = r.context,
- _userid = _context[1],
- _fileinfo = _context[2],
- _cb = _context[3],
- _dirid = _fileinfo.UserDirectoryID,
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(_userid);
- r = r.value;
-
- U.Json.del(_diskinfo.directoryOrFiles, { "UserDirectoryParentID": _dirid });
- _fileinfo.Child = r;
- U.Json.add(r, { "Parent": _fileinfo });
-
- U.MD.DK.M.entity.add(r, _diskinfo);
-
- if (U.UF.C.isFunction(_cb)) {
- _cb();
- }
-
- else if (_fileinfo.UserDirectoryID == _diskinfo.directoryid) {
-
- U.MD.DK.LE.openDirectory(_fileinfo, _userid);
- }
- }
- U.MD.DK.LE.music = function (fileinfo) {
- var _mp3arr, i,
- _num = 0,
- _diskinfo = US.disk.UserDisk,
- _arr = [];
-
- if (fileinfo.UserDirectoryParentID) {
- _mp3arr = U.Json.select(_diskinfo.currentDirectoryFile, { "UserDirectoryExtendType": "mp3", "UserDirectoryParentID": fileinfo.UserDirectoryParentID });
-
- for (i = 0; i < _mp3arr.length; i++) {
- _arr[i] = {
- "title": _mp3arr[i].UserallDirectoryName,
- "author": "",
- "src": "http://fs.1473.cn/" + _mp3arr[i].UserFilesServerName,
- "cover": _mp3arr[i].UserThumbnailImageHead,
- "lrc": ""
- }
- if (_mp3arr[i].UserDirectoryID == fileinfo.UserDirectoryID) {
- _num = i;
- }
- }
- } else {
- _arr[0] = {
- "title": fileinfo.UserallDirectoryName,
- "author": "",
- "src": "http://fs.1473.cn/" + fileinfo.UserFilesServerName,
- "cover": fileinfo.UserThumbnailImageHead,
- "lrc": ""
- }
- }
- U.MD.UI.music(_arr, _num, true);
- U.MD.D.T.taskbar({ "id": "music", "backgroundPostion": "-144px -296px", "name": "音乐播放器", "forms": U.MD.UI.music.player, "click": function () { U.UF.F.topWindow(U.MD.UI.music.player.form); } });
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- U.MD.DK.LE.img = function (fileinfo) {
- var _diskinfo = US.disk.UserDisk;
- U.UF.DL.asynLoadCss({ "href": "/css/Controls/Basic/Picture.css", type: "text/css", rel: "stylesheet" });
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/Basic/Picture.js" }, function () {
- var i,
- j = 0,
- _arr = [],
- _num = 0;
-
- if (_diskinfo && fileinfo.UserDirectoryParentID && _diskinfo.userInfo.UserId == fileinfo.UserId) {
- for (i = 0; i < _diskinfo.currentDirectoryFile.length; i++) {
- if (fileinfo.UserDirectoryParentID == _diskinfo.currentDirectoryFile[i].UserDirectoryParentID && U.UF.UP.isImg(_diskinfo.currentDirectoryFile[i].UserDirectoryExtendType)) {
- _arr[j] = "http://fs.1473.cn/" + _diskinfo.currentDirectoryFile[i].UserFilesServerName;
- if (_diskinfo.currentDirectoryFile[i].UserDirectoryID == fileinfo.UserDirectoryID) {
- _num = j;
- }
- j++;
- }
- }
- }
- if (_arr.length == 0) {
- _arr.push("http://fs.1473.cn/" + fileinfo.UserFilesServerName);
- }
- U.MD.UI.picture(_arr, _num)
- U.UF.F.topWindow($('#U_MD_UI_PictureForm')[0], true);
- });
- }
- U.MD.DK.LE.video = function (fileinfo) {
- var _form = new U.UF.UI.form(fileinfo.UserallDirectoryName, "", { "style": { "width": "780px", "height": "330px", "margin": "0" } }, { istop: true, isstretching: false, isenlarge: false, isnarrow: false });
- U.UF.DL.asynLoadCss({ rel: "stylesheet", type: "text/css", href: "/css/Controls/Basic/Video.css" });
- U.UF.DL.asynLoadJs({ src: "/js/Controls/Basic/Video.js", "charset": "utf-8", "type": "text/javascript" }, function () {
- var _video = U.MD.UI.video(("http://fs.1473.cn/" + fileinfo.UserFilesServerName), 780, 300, false, _form.middle);
-
- _form.closecallback = function () {
- _video.video.pause();
- }
-
-
-
- });
- }
-
- ;
- Namespace.register("U.MD.DK.LL");
- U.MD.DK.LL.printLeftTreeDirectory = function (directorys, el, userid, classes) {
- var _dtorydiv,
- _namediv,
- _frag = $$("div"),
- _padding = 3
- ;
-
- if ($(el).Child()[0]) {
- _padding = parseInt($(el).Child()[0].style.paddingLeft || 0) + 5;
-
- if ($($(el).Child()[0]).Child()[0].className.indexOf("U_MD_DK_LTXOSIO") == -1) {
- return;
- }
- }
-
- if ($(el).Child()[1]) {
- el.removeChild($(el).Child()[1]);
- }
-
- for (i = 0; i < directorys.length; i++) {
- if (directorys[i].filetype == 0) {
-
- if ((classes || "").length) {
- _Img = classes[i] || classes;
- } else {
- if ((directorys[i]["UserDirectoryEncrypt"] && directorys[i]["UserDirectoryEncrypt"] != userid)) {
- _Img = "U_MD_DK_LCJ";
- } else {
- _Img = "U_MD_DK_LCW";
- }
- }
-
- _dtorydiv = $$("div", { "id": directorys[i]["UserDirectoryID"] ? "L" + directorys[i]["UserDirectoryID"] : "", "className": "U_MD_DK_LTXOA" }, _frag);
- _namediv = $$("div", {
- "className": "U_MD_DK_LTXOS",
- "style": {
- "paddingLeft": _padding + "px"
- },
-
- "onclick": U.UF.C.closure(function (directoryinfo, el) {
- U.UF.EV.stopBubble();
- U.MD.DK.LL.leftTreeClick(directoryinfo, el, userid)
- }, [directorys[i], _dtorydiv]),
-
- "oncontextmenu": U.UF.C.closure(function (directoryinfo) {
- U.UF.EV.stopBubble();
- U.UF.EV.stopDefault();
- U.MD.DK.RM.rightMenu(this, directoryinfo, US.disk.UserDisk);
- }, [directorys[i]])
- }, _dtorydiv);
- $$("div", {
- "className": "U_MD_DK_LTXOSI U_MD_DK_Img"
- }, _namediv);
- $$("div", { "className": "U_MD_DK_LCOI U_MD_DK_LTXOST U_MD_DK_Img " + _Img }, _namediv);
-
- $$("div", {
- "className": "U_MD_DK_LTXOSN U_MD_D_Text_Abbreviation",
- "innerHTML": directorys[i].UserallDirectoryName,
- "ondblclick": U.UF.C.closure(function (directoryinfo) {
- U.UF.EV.stopBubble();
- U.MD.DK.RE.rename(this, directoryinfo);
- }, [directorys[i]])
- }, _namediv);
- }
- }
- el.appendChild(_frag);
- }
- U.MD.DK.LL.leftTreeClick = function (fileinfo, el, userid) {
- var _childel = U.selectEl(el).Child()[0];
-
-
- if ($(_childel).Child()[0].className.indexOf("U_MD_DK_LTXOSIO") > -1) {
- U.selectEl(_childel).Child()[0].className = "U_MD_DK_LTXOSI U_MD_DK_Img";
-
- var _contentel = U.selectEl(_childel).next();
-
- if (_contentel[0]) {
- el.removeChild(_contentel[0]);
- }
- } else {
-
- U.selectEl(_childel).Child()[0].className = "U_MD_DK_LTXOSI U_MD_DK_Img U_MD_DK_LTXOSIO";
- }
- U.selectEl(".U_MD_DK_LTXOSO").removeClass('U_MD_DK_LTXOSO');
- U.selectEl(_childel).addClass('U_MD_DK_LTXOSO');
-
- U.MD.DK.LE.openFileDirectory(fileinfo, userid);
- }
- U.MD.DK.LL.leftTreeHighlight = function (el) {
- var i,
- _childel,
- _parentel = el;
-
- do {
- _parentel = el.parentNode;
- _childel = U.selectEl(_parentel).Child();
-
- for (i = 0; i < _childel.length; i++) {
- U.selectEl(_childel[i]).Child()[0].className = el == _childel[i] ? "U_MD_DK_LTXOS U_MD_DK_LTXOSO" : "U_MD_DK_LTXOS";
- }
- } while ((el = _parentel.parentNode) && el.id != "U_MD_DK_LTXO")
- }
- U.MD.DK.LL.printNavigation = function (navarray, el, userid) {
- var i,
- _frag = $$("frag"),
- _click
- ;
- el.innerText = "";
-
- for (i = navarray.length - 1; i > -1; i--) {
-
- $$("div", {
- "className": "U_MD_DK_RYBO",
- "innerHTML": navarray[i]["UserallDirectoryName"],
- "onclick": U.UF.C.closure(function (nav) {
- U.MD.DK.LE.openFileDirectory(nav, userid);
- }, [navarray[i]])
- }, _frag);
- }
- el.appendChild(_frag);
-
- var _navchild = U.selectEl(el).Child();
- while (el.scrollHeight > 30) {
- _navchild[i].style.display = "none";
- }
- }
-
- ;
- Namespace.register("U.MD.DK.RE");
- U.MD.DK.RE.attribute = function (fileordir, userid) {
- var _diskinfo = U.MD.DK.M.diskOperatingSwitch(userid),
- _attributeel = U.MD.DK.RE.attributeStyle(fileordir, true, _diskinfo);
- U.UF.UI.alertClick(_attributeel);
- }
- U.MD.DK.RE.attributeStyle = function (fileordir, issetpermissions, diskinfo) {
- var _selected = 2;
- var _icon = U.MD.DK.C.getIcon(fileordir.UserDirectoryExtendType.toLowerCase())
- var _box = $$("div", { className: "U_MD_DK_fileInfo" });
- var _head = $$("div", { className: "U_MD_DK_fileInfo_head" }, _box);
- $$("div", { className: "U_MD_DK_fileInfo_line" }, _box);
- var _info = $$("div", { className: "U_MD_DK_fileInfo_info" }, _box);
-
- if (U.UF.UP.isImg(fileordir.UserDirectoryExtendType)) {
- var _img = $$("div", { className: "U_MD_DK_fileInfo_img" }, _head);
- $$("img", { "onerror": U.MD.C.imgError, "src": U.MD.C.getHeadImage(fileordir.UserDirectoryUrl) }, _img);
- } else {
- $$("div", { className: "U_MD_DK_fileInfo_icon U_MD_DK_Img " + _icon.classname[1] }, _head);
- }
- $$("div", { style: { "cssText": "overflow:hidden;white-space: nowrap;text-overflow: ellipsis;line-height: 42px;padding-left:10px;" }, innerHTML: fileordir.UserallDirectoryName, "title": fileordir.UserallDirectoryName }, _head);
-
- if (fileordir.filetype) {
- $$("div", { "innerHTML": "<span>类型:</span>文件" }, _info);
- $$("div", {
- "spellcheck": "false",
- "onselectstart": U.UF.EV.stopBubble,
- "innerHTML": "<span>路径:</span>" + "http://fs.1473.cn/" + fileordir["UserDirectoryID"] + ""
- }, _info);
- } else if (issetpermissions) {
- $$("div", { "innerHTML": "<span>类型:</span>" + "文件夹" }, _info);
- var _permission = $$("div", { "className": "", "innerHTML": "<span>权限选择:</span>" }, _info);
- var _select = $$("select", { "onchange": function () { U.MD.DK.RE.setpermissions(this, fileordir, diskinfo); } }, _permission);
- $$('option', { value: "1", innerHTML: "只允许上传" }, _select);
- $$('option', { value: "2", innerHTML: "只允许下载" }, _select);
- $$('option', { value: "", innerHTML: "无限制" }, _select);
- if (fileordir.UserDirectoryEncrypt == "1") {
- _selected = 0;
- } else if (fileordir.UserDirectoryEncrypt == "2") {
- _selected = 1;
- }
- U.selectEl('option', _select)[_selected].selected = true;
- }
- $$("div", { "innerHTML": "<span>大小:</span>" + U.UF.UP.minUnitToMaxUnit(fileordir.UserDirectorySize) }, _info);
- $$("div", { "innerHTML": "<span>创建时间:</span>" + U.UF.D.getYearMonthDay(fileordir.UserDirectoryAddTime) }, _info);
- return _box;
- }
- U.MD.DK.RE.setpermissions = function (selectel, dirinfo, diskinfo) {
- var _value = selectel.options[selectel.selectedIndex].value;
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "SetFtpPriviledge", dirinfo.UserDirectoryID, _value], U.MD.DK.RE.asynSetPermissions, ["", dirinfo, _value, diskinfo]);
- U.alert("权限设置中...");
- }
- U.MD.DK.RE.asynSetPermissions = function (r) {
- var _leftel,
- _rightel,
- _imgicon,
- _context = r.context,
- _dirinfo = _context[1],
- _value = _context[2],
- _diskinfo = _context[3];
- r = r.value;
-
- if (r) {
- _dirinfo.UserDirectoryEncrypt = _value;
- _leftel = U.selectEl("#L" + _dirinfo.UserDirectoryID, _diskinfo.formel)[0];
- _rightel = U.selectEl("#R" + _dirinfo.UserDirectoryID, _diskinfo.formel)[0];
-
- if (_leftel) {
-
- if (_value != "") {
- _imgicon = "U_MD_DK_LCOI U_MD_DK_LTXOST U_MD_DK_Img U_MD_DK_LCJ";
- }
-
- else {
- _imgicon = "U_MD_DK_LCOI U_MD_DK_LTXOST U_MD_DK_Img U_MD_DK_LCW";
- }
- U.selectEl("div", _leftel)[2].className = _imgicon;
- }
-
- if (_rightel) {
-
- if (_value != "") {
- _imgicon = "U_MD_DK_RZOS U_MD_DK_Img U_MD_DK_RZOM";
- }
-
- else {
- _imgicon = "U_MD_DK_RZOS U_MD_DK_Img U_MD_DK_RZOW";
- }
- U.selectEl("div", _rightel)[1].className = _imgicon;
- }
- }
-
- else {
- U.alert("设置失败");
- }
- }
- U.MD.DK.RE.addFileOrFolder = function (fileordirinfo, diskinfo, dirinfo) {
- var _nowdiskinfo = US.disk.UserDisk,
- _leftel = U.selectEl("#L" + dirinfo["UserDirectoryID"], diskinfo.formel)[0],
- _el = U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0];
-
- U.MD.DK.M.entity.add(fileordirinfo, diskinfo);
- U.MD.DK.M.entity.addChild(fileordirinfo, dirinfo);
-
- if (fileordirinfo[0].UserDirectoryParentID == _nowdiskinfo.directoryid && diskinfo == _nowdiskinfo && _nowdiskinfo.directoryid == diskinfo.directoryid) {
-
- if ($(_el).Child()[0].className == "U_MD_DK_RZF") {
- _el.innerText = "";
- }
- U.MD.DK.VW.printContent(fileordirinfo, _el);
-
- if (_leftel) {
- U.MD.DK.LL.printLeftTreeDirectory(fileordirinfo, _leftel, diskinfo.userInfo.UserId);
- }
- }
- _el.scrollTop = _el.offsetHeight;
- U.selectEl(_el.lastChild).addClass("U_MD_DK_RZOI");
- }
- U.MD.DK.RE.newFolder = function (diskinfo) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- U.MD.DK.RE.newFolder.confirm(diskinfo, _directoryid);
- } else { U.alert("无权限访问此文件夹"); };
- }
- }
- U.MD.DK.RE.newFolder.confirm = function (diskinfo, directoryid) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入文件夹名字", "style": { "width": "180px", "height": "25px" } })
-
- U.MD.DK.RE.newconfirm(
- _input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.DISK, ["CreateDirectory", _userid, _newguid, _dirinfo.UserDirectoryDeep + 1, _input.value, directoryid, "", _groupid, ""],
- function (r) {
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "folder", "", U.UF.D.toTimeStamp(), "", _dirinfo.UserDirectoryDeep + 1,
- null, "", 0, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
- }, []);
- } else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { },
- "新建文件夹"
- );
- }
- U.MD.DK.RE.newText = function (diskinfo, fun) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- top.U.MD.DK.VW.chosenSaveFile('txt', null, '新建文件', fun);
- } else { U.alert("无权限访问此文件"); };
- }
- }
- U.MD.DK.RE.newText.confirm = function (diskinfo, directoryid, fun) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入新文本文档的命名", "style": { "width": "180px", "height": "25px", "padding-left": "7px" } });
-
- U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "txt", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "txt", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
-
- if (fun) {
- fun(_fileinfo);
- }
- }, []);
- } else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { }, "新建文本文件");
- }
- U.MD.DK.RE.newDocument = function (diskinfo, fun, fileid) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- return U.MD.DK.RE.newDocument.confirm(diskinfo, _directoryid, fun, fileid);
- } else { U.alert("无权限访问此文档"); };
- }
- }
- U.MD.DK.RE.newDocument.confirm = function (diskinfo, directoryid, fun, fileid) {
- var _ancestors,
- _groupid,
- _newguid = fileid || Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入文档名字", "style": { "width": "180px", "height": "25px" } });
- return U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[0].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "uw", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "uw", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
-
- if (fun) {
- fun(_fileinfo);
- }
- }, []);
- } else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { }, "新建文档");
- }
- U.MD.DK.RE.newopenApplication = function (diskinfo, fun, fileid) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- return U.MD.DK.RE.newopenApplication.confirm(diskinfo, _directoryid, fun, fileid);
- } else { U.alert("无权限访问此文档"); };
- }
- }
- U.MD.DK.RE.newopenApplication.confirm = function (diskinfo, _directoryid, fun, fileid) {
- var _ancestors,
- _groupid,
- _taskbar,
- _formdiv,
- _newguid = fileid || Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": _directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入文档名字", "style": { "width": "180px", "height": "25px" } });
- U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[0].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[0].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _newguid, _directoryid, _input.value, "", "", "", "un", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, _directoryid, _name, _name, "un", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- _fileinfo.UserDirectoryExtendType = 'un';
- _fileinfo.UsOffice = U.A.Request(US.CD, ([US.DB, "UseStudio_Disk",
- "GetFileContent", "6a8a235a-41c4-c3d2-8dd5-b6ee851e1967"
- ])).value[0].UsOffice.unEscapeQuotes();
- _fileinfo.newfile = true;
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
-
-
- if (fun) {
- fun(_fileinfo);
- }
- }, []);
- } else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { }, "新建导航文档");
- }
- U.MD.DK.RE.newExcel = function (diskinfo) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- U.MD.DK.RE.newExcel.confirm(diskinfo, _directoryid);
- } else { U.alert("无权限访问此工作表"); };
- }
- }
- U.MD.DK.RE.newExcel.confirm = function (diskinfo, directoryid) {
- var _ancestors,
- _groupid,
- _newguid = Guid.newGuid(),
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": directoryid })[0],
- _userid = US.userInfo.userid,
- _input = $$("input", { "placeholder": "请输入表格名字", "style": { "width": "180px", "height": "25px" } });
- U.MD.DK.RE.newconfirm(_input,
- function () {
- var _name = _input.value;
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
-
- if (U.UF.S.ZWFileName.test(_input.value)) {
-
- U.A.Request(US.DISK, ["CreateFile", _userid, _newguid, directoryid, _input.value, "", "", "", "ue", _groupid], function (r) {
-
- var _fileinfo = new U.MD.DK.M.entity(_newguid, 0, directoryid, _name, _name, "ue", "", U.UF.D.toTimeStamp(), "", "9999", null, "", 1, "", _groupid, "", _userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- U.MD.DK.RE.addFileOrFolder([_fileinfo], diskinfo, _dirinfo);
- }, []);
- } else {
- U.alert("文件名过长或者为空");
- return false;
- }
- },
- function () { }, "新建工作表");
- }
- U.MD.DK.RE.newconfirm = function (content, determineFun, cancelFun, str) {
-
- var _confirm = $$("div", { "style": { "cssText": "width: 100%; background: rgb(255,255,255); overflow:hidden; " }, id: "123133456" });
- var _string = str || "提示框";
-
- var _content = $$("div", { "style": { "cssText": "text-align: center; margin: 30px 20px 30px 20px; " } }, _confirm);
-
- if (U.UF.C.isElement(content)) {
-
- U.selectEl(_content).append(content);
- } else {
-
- _content.innerHTML = content || '内容';
- }
-
- var _footer = $$("div", { "style": { "cssText": " height:45px;" } }, _confirm);
-
- var _form = new U.UF.UI.form(
- _string,
- _confirm, {
- 'className': 'U_MD_DK_RE_confirmForm',
- "style": {
- "cssText": "font-size: 16px; background: rgb(255,255,255); width: 300px; position: fixed; box-shadow: 0 0 10px 3px rgb(0,0,0); border-radius: 5px;"
- }
- }, {
- "istop": true,
- "isenlarge": false,
- "isstretching": false,
- "isnarrow": false
- }, {
- "style": {
- "cssText": " background: rgb(59,88,120); padding: 10px;padding-left: 20px; color: rgb(255,255,255); "
- }
- });
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 30%; padding: 5px; background: rgb(48,126,208); border-radius: 5px;float: right; margin-right:35px;"
- },
- innerHTML: "确定",
- onclick: function () {
- var _bool = true;
- if (U.UF.C.isFunction(determineFun)) {
- _bool = determineFun();
- }
- if (_bool !== false) {
- U.UF.F.closeWindow(_form.form);
- }
- }
- }, _footer);
- content.onkeydown = function (e) {
- var ev = document.all ? window.event : e;
- if (ev.keyCode == 13) {
- if ($('.U_MD_DK_RE_confirmForm').length > 0) {
- for (var i = 0; i < U.selectEl('.U_MD_DK_RE_confirmForm').length; i++) {
- if ($('.U_MD_DK_RE_confirmForm')[i].style.display == "block") {
- var _bool = true;
- if (U.UF.C.isFunction(determineFun)) {
- _bool = determineFun();
- }
- if (_bool !== false) {
- U.UF.F.closeWindow(_form.form);
- }
- }
- }
- }
- }
- }
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 30%; padding: 5px; background: rgb(48,126,208); border-radius: 5px;background: rgb(170,170,170); float: left; margin-left:35px;"
- },
- "innerHTML": "取消",
- "onclick": function () {
- U.UF.C.isFunction(cancelFun) && cancelFun();
- U.UF.F.closeWindow(_form.form);
- }
- }, _footer);
- content.focus();
- return _form;
- }
- U.MD.DK.RE.newDocConfirm = function (diskinfo /*determineFun cancelFun*/) {
- if (!U.MD.U.L.isLogin()) {
- var _directoryid = diskinfo.directoryid;
- if (U.MD.DK.C.getDirectoryPermissions(_directoryid, diskinfo).isnew) {
- var _confirm = $$('div'),
- _pickarea = $$("div", { "style": { "cssText": "display:table; width: 100%; height: auto; " } }, _confirm),
- _picklocal = $$("div", { "id": "U_MD_DK_RE_localDoc", "style": { "cssText": "display:table-cell; width:235px; height:170px; background-color:#f5f5f5;text-align:center; vertical-align: middle;cursor: pointer;" } }, _pickarea),
- _pickline = $$("div", { "style": { "cssText": "display:table-cell; width:1px; height: 100%; background-color:#cecece;" } }, _pickarea),
- _pickoa = $$("div", { "style": { "cssText": "display:table-cell; width:234px; height:100%; background-color:#f5f5f5;text-align:center; vertical-align: middle;cursor: pointer;" } }, _pickarea);
- $$("img", { "onerror": U.MD.C.imgError, src: "/img/officefileicon.png", style: { "vertical-align": "middle" } }, _picklocal);
- $$("img", { "onerror": U.MD.C.imgError, src: "/img/oaofficeicon.png", style: { "vertical-align": "middle" } }, _pickoa);
- $$('span', { innerText: '互联文档', style: { "margin-left": "10px" } }, _pickoa);
- $$('span', { innerText: '本地文档', style: { "margin-left": "10px" } }, _picklocal);
-
- var _enter = $$("div", { "style": { "cssText": "width: 100%; background: rgb(255,255,255); overflow:hidden; display:none" }, id: "123133456" }, _confirm);
- var _string = "新建文档";
-
- var _content = $$("div", { "style": { "cssText": "text-align: center; margin: 30px 20px 30px 20px;" } }, _enter)
-
- var _footer = $$("div", { "style": { "cssText": " height:45px;" } }, _enter);
-
- var _form = new U.UF.UI.form(
- _string,
- _confirm, {
- "style": {
- "cssText": "font-size: 16px; background: rgb(255,255,255); width: 470px; position: fixed; box-shadow: rgb(0, 0, 0) 2px 1px 5px; "
- }
- }, {
- "istop": true,
- "isenlarge": false,
- "isstretching": false,
- "isnarrow": false
- }, {
- "style": {
- "cssText": " background: #3c475b;padding:4px 0 ; color: rgb(255,255,255); "
- }
- });
- U.selectEl(_picklocal).bind({
- "mouseover": function () { _picklocal.style.backgroundColor = "#dcdcdc"; },
- "mouseout": function () { _picklocal.style.backgroundColor = "#f5f5f5"; },
- "click": function () {
- U.MD.DK.RE.newDocument(diskinfo);
- U.UF.F.closeWindow(_form.form, "remove");
- }
- })
- U.selectEl(_pickoa).bind({
- "mouseover": function () { _pickoa.style.backgroundColor = "#dcdcdc"; },
- "mouseout": function () { _pickoa.style.backgroundColor = "#f5f5f5"; },
- "click": function () {
-
- var _docId = Guid.newGuid();
- U.MD.O.word(US.userInfo, { 'UserDirectoryID': _docId }, function () {
- var _iframe = U.selectEl('#UD_Word' + _docId).find('iframe')[0].contentWindow;
- _iframe.document.getElementById('U_MD_O_H_body_left_invite_user').children[0].click();
- U.UF.F.closeWindow(_form.form, "remove");
- });
- }
- })
- return _form;
- } else { U.alert("无权限访问此工作表"); };
- }
- }
- U.MD.DK.RE.deleteFileOrDir = function (fileordirs, userid, diskinfo) {
- var _contentel, _fileordir;
-
- if (fileordirs.length > 1) {
- _contentel = $$("div", { "style": { "cssText": "text-align:center;width:100%;height:30px;padding:5% 0 0% 0;" } });
- $$("span", { "style": { "cssText": "font-weight:bold;" }, "innerHTML": "你确定要删除这" + fileordirs.length + "项吗?" }, _contentel);
- U.UF.UI.confirm(_contentel, function () {
- _fileordir = true;
- for (var i = 0; i < fileordirs.length; i++) {
- if (fileordirs[i].UserDirectoryExtendType == "folder") {
- U.alert("删除失败,多选无法删除文件夹");
- _fileordir = false;
- }
- }
- if (_fileordir == true) {
- U.MD.DK.RE.deleteDirectoryOrFile(fileordirs, userid);
- }
- })
- }
-
- else {
- U.A.Request(US.DISK, ["GetChildsByDirectoryId", userid, fileordirs.UserDirectoryID, ""], function (r) {
- if (r.value.length == 0) {
- _contentel = U.MD.DK.RE.attributeStyle(fileordirs, null, diskinfo);
- fileordirs = [fileordirs];
-
- U.UF.UI.confirm(_contentel, function () {
- U.MD.DK.RE.deleteDirectoryOrFile(fileordirs, userid);
- });
- } else {
- U.alert("删除失败,请先清除文件夹中的文件");
- }
- });
- }
- }
- U.MD.DK.RE.deleteDirectoryOrFile = function (fileordirs, userid) {
- var _allfileordirid = U.Json.toKeyArray(fileordirs, "UserDirectoryID").join(",");
- U.A.Request(US.DISK, ["DeleteDirectoryOrFile", _allfileordirid, fileordirs[0].GroupID || ""], U.MD.DK.RE.asynDeleteDirectoryOrFile, ["", fileordirs, userid]);
- }
- U.MD.DK.RE.asynDeleteDirectoryOrFile = function (r) {
- var i,
- _dirid,
- _context = r.context,
- _fileordirs = _context[1],
- _userid = _context[2],
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(_userid)
- ;
- r = r.value;
-
- if (r) {
- U.MD.DK.M.entity.del(_fileordirs, _diskinfo);
- U.MD.DK.RE.delPageFileOrDir(_fileordirs, _diskinfo);
- } else {
- U.alert("操作失败!");
- }
- }
- U.MD.DK.RE.delPageFileOrDir = function (fileordirs, diskinfo) {
- var i,
- _parentdirinfo,
- _contentel = U.selectEl("#U_MD_DK_RZ", diskinfo.formel);
-
- for (i = 0; i < fileordirs.length; i++) {
- U.selectEl("#L" + fileordirs[i].UserDirectoryID, diskinfo.formel).remove();
- U.selectEl("#R" + fileordirs[i].UserDirectoryID, diskinfo.formel).remove();
-
- if (fileordirs[i].UserDirectoryID == diskinfo.directoryid) {
- _parentdirinfo = fileordirs[i].Parent;
- }
- }
-
- if (_parentdirinfo) {
-
- U.MD.DK.LE.openFileDirectory(_parentdirinfo, diskinfo.userInfo.UserId);
- }
-
- else if (_contentel.Child() == 0) {
- U.MD.DK.VW.printNullView(_contentel[0]);
- }
- U.selectEl('#U_MD_DK_RKR', diskinfo.formel)[0].innerHTML = '当前文件的数量:' + U.selectEl('.U_MD_DK_RZO').length
- }
- U.MD.DK.RE.rename = function (el, fileordir, diskinfo) {
- var _input, _el;
- if (el.firstChild.children[1]) {
- _el = el.firstChild.children[1].children[0];
- _el.innerText = ""
- } else {
- _el = el.lastElementChild;
- _el.innerText = ""
- }
- _input = $$("input", {
- "ondblclick": U.UF.EV.stopBubble,
- "onblur": function () {
- U.MD.DK.RE.detemineReName(this, fileordir, diskinfo);
- },
-
- "onkeyup": function () {
- if (event.keyCode == 13 || event.keyCode == 10) {
- this.onblur();
- }
- },
- "onclick": U.UF.EV.stopBubble,
- "className": "U_MD_U_P_C_P_N_I",
- "value": fileordir.UserallDirectoryName.replace("." + fileordir.UserDirectoryExtendType, "")
- }, _el);
- _input.focus();
- }
- U.MD.DK.RE.detemineReName = function (inputel, fileordir, diskinfo) {
- var _leftel,
- _rightel,
- _extendtype = fileordir.UserDirectoryExtendType,
- _name = inputel.value.replaceHtmlSign() + (fileordir.filetype ? "." + _extendtype : "");
-
- if (_name != fileordir.UserallDirectoryName) {
-
- if (U.UF.S.FileName.test(_name)) {
-
- if (_extendtype == "folder") {
- U.A.Request(US.DISK, ["UpdateDirectoryInfo", fileordir.UserDirectoryID, _name], U.MD.DK.RE.asynDetemineReName, ["", fileordir, _name, diskinfo]);
- }
-
- else {
- U.A.Request(US.DISK, ["UpdateFileInfo", fileordir.UserDirectoryID, _name], U.MD.DK.RE.asynDetemineReName, ["", fileordir, _name, diskinfo]);
- }
- _leftel = U.selectEl("#L" + fileordir.UserDirectoryID, diskinfo.formel)[0];
- _rightel = U.selectEl("#R" + fileordir.UserDirectoryID, diskinfo.formel)[0];
-
- if (_leftel) {
- U.selectEl("div", _leftel)[3].innerText = _name;
- }
-
- if (_rightel) {
- U.selectEl("div", _rightel)[3].innerText = _name;
- }
- }
- }
- }
- U.MD.DK.RE.asynDetemineReName = function (r) {
- var _context = r.context,
- _fileordir = _context[1],
- _name = _context[2]
- ;
- r = r.value;
-
- if (r) {
- _fileordir.UserallDirectoryName = _name;
- _fileordir.UserDirectoryName = _name.addEllipsis(20);
- }
- }
- U.MD.DK.RE.copyorshear = function (dirorfile, type, diskinfo) {
- var _userid = US.disk.UserDisk.userInfo.UserId,
- _dirid = dirorfile.UserDirectoryParentID
- ;
-
- if (!Array.isArray(dirorfile)) {
- dirorfile = [dirorfile];
- }
-
- US.disk.Disks[_userid].pasteDirOrFile = {
- "type": type,
- "UserDirectoryID": _dirid,
- "dirorfile": dirorfile,
- "userid": _userid
- };
- }
- U.MD.DK.RE.paste = function (diskinfo) {
- var _ancestors,
- _groupid,
- _fileordirids,
- _dirid = diskinfo.directoryid,
- _dirinfo = U.Json.select(diskinfo.directoryOrFiles, { "UserDirectoryID": _dirid }, 1)[0],
- _userid = US.disk.UserDisk.userInfo.UserId,
- _pastecontent = US.disk.Disks[_userid].pasteDirOrFile,
- _type = _pastecontent.type,
- _pastedirid = _pastecontent.UserDirectoryID,
- _dirorfile = _pastecontent.dirorfile,
- _pasteuserid = _pastecontent.userid
- ;
-
- if (_pastecontent && (_type == "copy" || _dirid != _pastedirid || _pasteuserid != _userid)) {
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, diskinfo);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = diskinfo.userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
- _fileordirids = U.Json.toKeyArray(_dirorfile, "UserDirectoryID").join(",");
-
-
- if (_type == "shear") {
-
- U.A.Request(US.DISK, ["CutAndPasteFiles", US.userInfo.userid, _dirid, _fileordirids, _groupid, _dirorfile[0].GroupID], U.MD.DK.RE.asynPaste, ["", _dirinfo, _groupid, _pastecontent, diskinfo, _pastecontent.type]);
- _pastecontent.type = "copy";
- }
-
- else {
-
- U.A.Request(US.DISK, ["CopyAndPasteFiles", US.userInfo.userid, _dirid, _fileordirids, _groupid], U.MD.DK.RE.asynPaste, ["", _dirinfo, _groupid, _pastecontent, diskinfo, _pastecontent.type]);
- }
- }
- }
- U.MD.DK.RE.asynPaste = function (r) {
- var i,
- _context = r.context,
- _dirinfo = _context[1],
- _groupid = _context[2],
- _pastecontent = _context[3],
- _diskinfo = _context[4],
- _type = _context[5],
- _copyorshearinfo = US.disk.Disks[_pastecontent.userid],
- _pasteinfo = r.value
- ;
-
- if (_type == "shear") {
- U.MD.DK.M.entity.del(_pastecontent.dirorfile, _copyorshearinfo);
- U.MD.DK.RE.delPageFileOrDir(_pastecontent.dirorfile, _copyorshearinfo);
- }
-
- for (i = 0; i < _pasteinfo.length; i++) {
- _pasteinfo[i] = new U.MD.DK.M.entity(_pasteinfo[i].UserDirectoryID, _pasteinfo[i].UserDirectorySize, _pasteinfo[i].UserDirectoryParentID, _pasteinfo[i].UserDirectoryName, _pasteinfo[i].UserDirectoryName, _pasteinfo[i].UserDirectoryExtendType, _pasteinfo[i].UserDirectoryUrl, _pasteinfo[i].UserDirectoryAddTime, _pasteinfo[i].UserDirectoryUrl, _pasteinfo[i].UserDirectoryDeep, null, _pasteinfo[i].UserDirectoryEncrypt, _pasteinfo[i].UserDirectoryExtendType == "folder" ? 0 : 1, "", _pasteinfo[i].UserDirectoryEncrypt, "", US.userInfo.userid, US.userInfo.UserNickName, US.userInfo.username, US.userInfo.UserThumbnailImageHead)
- }
-
- U.MD.DK.RE.addFileOrFolder(_pasteinfo, _diskinfo, _dirinfo);
- }
- U.MD.DK.RE.downloadFile = function (dirorfileid, isdir) {
- window.open("/Pages/Download.htm?id=" + dirorfileid + "&type=" + (isdir || ""));
- }
- U.MD.DK.RE.replay = function (fileinfo) {
-
-
- }
- U.MD.DK.RE.refresh = function (userid, fileinfo, diskinfo) {
-
- if (fileinfo.GroupID !== true) {
- U.MD.DK.LE.getChildsByDirectoryId(userid, fileinfo, U.selectEl("#U_MD_DK_RZ", diskinfo.formel)[0]);
- }
- }
-
- ;
- Namespace.register("U.MD.DK.RM");
- U.MD.DK.RM.rightMenu = function (el, fileordir, diskinfo) {
- var _ids,
- _diskinfo = diskinfo || US.disk.UserDisk,
- _selectElement = diskinfo.selectElement,
- _userid = _diskinfo.userInfo.UserId,
- _fileordir = fileordir || U.Json.select(_diskinfo.directoryOrFiles, { "UserDirectoryID": _diskinfo.directoryid })[0],
- _permissions = U.MD.DK.C.getDirectoryPermissions(_fileordir.UserDirectoryID, _diskinfo),
- _rightel = U.selectEl("#U_MD_DK_M", _diskinfo.formel)[0],
- _childel = U.selectEl(_rightel).Child()
- ;
- if (_selectElement.length > 1) {
- _ids = U.Json.toKeyArray(_selectElement, "id").join(",");
- fileordir = U.Json.like(diskinfo.currentDirectoryFile, { "UserDirectoryID": _ids });
- }
-
- if (_permissions.isopen && fileordir) {
- _childel[0].style.display = "block";
- _childel[0].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.LE.openFileDirectory(fileordir, _userid);
- };
- } else {
- _childel[0].style.display = "none";
- }
-
- if (_permissions.isupadte && fileordir) {
- _childel[1].style.display = "block";
- _childel[1].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.rename(el, fileordir, _diskinfo);
- };
- } else {
- _childel[1].style.display = "none";
- }
-
- if (_permissions.isdelete && fileordir) {
- _childel[2].style.display = "block";
- _childel[2].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.deleteFileOrDir(fileordir, _userid, _diskinfo);
- }
- } else {
- _childel[2].style.display = "none";
- }
-
- if (_permissions.iscopy && fileordir) {
- _childel[3].style.display = "block";
- _childel[3].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.copyorshear(fileordir, "copy", _diskinfo);
- }
- } else {
- _childel[3].style.display = "none";
- }
-
- if (_permissions.isshear && fileordir) {
- _childel[4].style.display = "block";
- _childel[4].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.copyorshear(fileordir, "shear", _diskinfo);
- }
- } else {
- _childel[4].style.display = "none";
- }
-
- if (_permissions.isencryption && fileordir) {
- _childel[5].style.display = "block";
- _childel[5].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.asynSetPermissions(fileordir);
- }
- } else {
- _childel[5].style.display = "none";
- }
-
- if (_permissions.isdownload && fileordir) {
- _childel[6].style.display = "block";
- _childel[6].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.downloadFile(fileordir.UserDirectoryID || U.Json.toKeyArray(fileordir, "UserDirectoryID").join(","), fileordir.filetype == 0);
- }
- } else {
- _childel[6].style.display = "none";
- }
-
- if (_permissions.isnew && !fileordir) {
- _childel[7].style.display = "block";
- _childel[8].style.display = "block";
- _childel[9].style.display = "block";
- _childel[10].style.display = "block";
- _childel[7].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newFolder(_diskinfo);
- }
- _childel[8].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newText(_diskinfo);
- }
- _childel[9].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newDocument(_diskinfo);
- }
- _childel[10].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.newExcel(_diskinfo);
- }
- } else {
- _childel[7].style.display = "none";
- _childel[8].style.display = "none";
- _childel[9].style.display = "none";
- _childel[10].style.display = "none";
- }
-
- if (_permissions.isreply && !fileordir) {
- _childel[11].style.display = "block";
- _childel[11].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.replay(fileordir);
- }
- } else {
- _childel[11].style.display = "none";
- }
-
- if (_permissions.ispaste && !fileordir) {
- _childel[12].style.display = "block";
- _childel[12].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.paste(_diskinfo);
- }
- } else {
- _childel[12].style.display = "none";
- }
-
- if (_permissions.isrefresh && !fileordir) {
- _childel[13].style.display = "block";
- _childel[13].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.refresh(_userid, _fileordir, _diskinfo);
- }
- } else {
- _childel[13].style.display = "none";
- }
-
- if (_permissions.isupload && !fileordir) {
- _childel[14].style.display = "block";
- _childel[14].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.C.upload(_diskinfo);
- }
- } else {
- _childel[14].style.display = "none";
- }
-
- if (_permissions.isview && !fileordir) {
- _childel[15].style.display = "block";
- _childel[16].style.display = "block";
- _childel[15].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.VW.viewsSwitch("Normal", _diskinfo);
- }
- _childel[16].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.VW.viewsSwitch("Detailed", _diskinfo);
- }
- } else {
- _childel[15].style.display = "none";
- _childel[16].style.display = "none";
- }
-
- if (fileordir && _permissions.isopen) {
- _childel[17].style.display = "block";
- _childel[17].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.DK.RE.attribute(fileordir);
- }
- } else {
- _childel[17].style.display = "none";
- }
-
- if (_permissions.isedit && US.disk.fileType.text.indexOf(_fileordir.UserDirectoryExtendType) > -1) {
- _childel[18].style.display = "block";
- _childel[18].onclick = function () {
- U.MD.DK.RM.hiddenRightMenu(_diskinfo);
- U.MD.D.I.openApplication("txt", _fileordir);
- }
- } else {
- _childel[18].style.display = "none";
- }
-
- _rightel.style.display = "block";
- if (_rightel.offsetHeight < 10) {
- _rightel.style.display = "none"
- } else {
-
- U.UF.C.rightClickMenuLocation(_rightel);
- }
- }
- U.MD.DK.RM.hiddenRightMenu = function (diskinfo) {
- U.selectEl("#U_MD_DK_M", diskinfo.formel)[0].style.display = "none";
- }
- U.MD.DK.RM.getSelectionFilesOrDir = function (el) {
-
-
-
-
-
- }
-
- ;
- Namespace.register("U.MD.DK.SP");
- U.MD.DK.SP.getUser = function (userid) {
- var _userid = userid;
- if (userid) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Users", "GetUserinfoByUserId", _userid], function (r) {
- console.log(r.value);
- U.selectEl('.U_MD_DK_SP_Head_Logo_name')[0].innerHTML = r.value[0].UserNickName + '的云盘';
- if (r.value[0].UserImageHead) {
- U.selectEl('.U_MD_DK_SP_Head_UImg')[0].src = "http://fs.1473.cn/" + r.value[0].UserImageHead;
- }
- U.selectEl('.U_MD_DK_SP_Head_UImg')[0].title = r.value[0].UserNickName;
- });
- }
- }
- U.MD.DK.SP.getDirectioryInfo = function (directoryid, userid) {
- U.UF.CD.loadPageCrossDomain(function () {
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "GetDirectroyById", directoryid], U.MD.DK.SP.getDirectioryInfo.asyn, [null, userid, directoryid]);
- });
- }
- U.MD.DK.SP.getDirectioryInfo.asyn = function (r) {
- var _directioryinfo = r.value[0],
- _userid = r.context[1],
- _dirid = r.context[2];
- U.MD.DK.SP.getUser(_userid);
- U.MD.DK.SP.getAllFileInfo(_dirid, _userid, _directioryinfo ? _directioryinfo.GroupID : "");
- }
- U.MD.DK.SP.getAllFileInfo = function (directoryid, userid, groupid) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "GetChildsByDirectoryId", userid, directoryid, groupid || directoryid], U.MD.DK.SP.getAllFileInfo.asyn);
- }
- U.MD.DK.SP.getAllFileInfo.asyn = function (r) {
- console.log(r.value);
- var _contentBox = U.selectEl('.U_MD_DK_SP_ContentList')[0];
- U.MD.DK.SP.getParentFile(r.value[0].UserDirectoryParentID);
- for (var i = 0; i < r.value.length; i++) {
- var _fileli = $$('div', { 'className': 'U_MD_DK_SP_Li', 'id': 'U_MD_DK_SP_Li' + i }, _contentBox);
- $$('div', { 'className': 'U_MD_DK_SP_CTopNum', 'innerHTML': i > 8 ? (i + 1) : '0' + (i + 1) }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- var _icon = U.MD.DK.SP.getIcon(r.value[i].UserDirectoryExtendType);
- if (!_icon.classname[2]) {
- _icon.classname[2] = 'U_MD_DK_SP_unfile';
- }
- var _filename = $$('div', { 'className': 'U_MD_DK_SP_CTopFileName', 'title': r.value[i].UserallDirectoryName }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- $$('span', { 'className': _icon.classname[2] + ' U_MD_DK_SP_Img U_MD_DK_SP_RZSMI ', 'innerHTML': ' ' }, _filename);
- _filename.innerHTML += r.value[i].UserallDirectoryName;
- $$('div', { 'className': 'U_MD_DK_SP_CTopFileType', 'innerHTML': r.value[i].UserDirectoryExtendType }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- $$('div', { 'className': 'U_MD_DK_SP_CTopFileSize', 'innerHTML': U.UF.UP.minUnitToMaxUnit(r.value[i].UserDirectorySize) }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- $$('div', { 'className': 'U_MD_DK_SP_CTopFileAuthor', 'innerHTML': r.value[i].UserNickName }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- var _date = U.UF.D.formatDateToArray(r.value[i].UserDirectoryAddTime);
- $$('div', { 'className': 'U_MD_DK_SP_CTopFileUpdateTime', 'innerHTML': _date[0] + "-" + _date[1] + "-" + _date[2] + " " + _date[3] + ":" + _date[4] }, U.selectEl('#U_MD_DK_SP_Li' + i)[0]);
- _fileli.onclick = U.UF.C.closure(function (fileinfo) {
- console.log(fileinfo);
- if (fileinfo.UserDirectoryExtendType == 'folder') {
- window.location.href = window.location.origin + window.location.pathname + window.location.search + "/" + fileinfo.UserallDirectoryName;
- } else {
-
- var i,
- _applicationame,
- _types = US.disk.applicationTypes,
- _extension = fileinfo["UserDirectoryExtendType"].toLocaleLowerCase();
- for (i in _types) {
- if (_types[i].types.indexOf(_extension) > -1) {
- _applicationame = i;
- break;
- }
- }
- console.log(_applicationame);
- switch (_applicationame) {
- case "music":
- U.MD.DK.LE.music(fileinfo);
- break;
- case "image":
- U.MD.DK.LE.img(fileinfo);
- break;
- case "video":
- U.MD.DK.LE.video(fileinfo);
- break;
- case "text":
- U.MD.D.Txt.textCreate(fileinfo);
- break;
- case "usoffice":
-
- case "ue":
- U.MD.D.I.openApplication("excel", fileinfo);
- break;
- case "uw":
- case "un":
- U.MD.D.I.openApplication("word", fileinfo);
- break;
- case "word":
- U.A.Request(US.DISK, ["GetFileContent", fileinfo.UserDirectoryID], function (r) {
-
- if (r.value && r.value.UsOffice !== undefined && r.value.UsOffice != null) {
- fileinfo.UsOffice = r.value.UsOffice.unEscapeQuotes();
- U.MD.D.I.openApplication("word", fileinfo);
- }
-
- else {
- U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", fileinfo.UserDirectoryExtendType, fileinfo.UserFilesServerName], function (r) {
- if (r.value.value != undefined) {
- r = r.value;
- fileinfo.UsOffice = r.value.getBodyHtml().replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/ig, function (str1, str2) {
- return "src=\"http://office.1473.cn/usoffice/" + str2 + "\"";
- });
- U.MD.D.I.openApplication("word", fileinfo);
- } else {
- U.Alert('文档已丢失。。。');
- }
- });
- }
- });
- break;
- case "txt":
- U.MD.D.I.openApplication("txt", fileinfo);
- break;
-
- default:
- U.MD.DK.RE.downloadFile(fileinfo.UserDirectoryID, false);
- break;
- }
- }
- }, [r.value[i]]);
- }
- }
- U.MD.DK.SP.getIcon = function (extendtype) {
- var i,
- _application = US.disk.applicationTypes
- ;
- if (extendtype) {
-
- for (i in _application) {
-
- if (_application[i].types.indexOf(extendtype.toLowerCase()) > -1) {
- return _application[i];
- }
- }
- }
- return _application["unknownfile"];
- }
- U.MD.DK.SP.getParentFile = function (parentid) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "GetDirectroyById", parentid], function (r) {
- if (r.value[0]) {
- U.selectEl('.U_MD_DK_SP_Head_Logo_name')[0].innerHTML += '-' + r.value[0].UserDirectoryName + '文档详细列表';
- }
- }, []);
- }
- ;;
- Namespace.register("U.MD.F.J");
- U.MD.F.J.selectUserInfo = {
- NeedUser: [],
- SelectUser: [],
- CallBack: null
- };
- U.MD.F.J.groupInfoForm = function (groupinfo, chatel) {
- var _formel,
- _groupuserinfo,
- _determinebottom,
- _closebottom,
- _isgroupmain,
- _isdeletegroup,
- _groupinfoel = U.selectEl("#U_MD_F_Add"),
- _addgroupuserel = U.selectEl("#U_MD_F_RC_C")[0],
- _groupinfochildsel = _groupinfoel.Child(),
- _inputel = U.selectEl("input,textarea", _groupinfochildsel[0]);
-
- U.MD.F.J.selectUserInfo.NeedUser.splice(0, U.MD.F.J.selectUserInfo.NeedUser.length);
-
- _groupinfochildsel[1].innerHTML = "";
-
- if (groupinfo) {
-
- if ($('.U_MD_F_Add_TNM_ADD2')[0]) {
- U.selectEl('.U_MD_F_Add_TNM_ADD2')[0].style.display = "none";
- }
- if ($('.U_MD_F_Add_TNMO')[0]) {
- U.selectEl('.U_MD_F_Add_TNMO')[0].style.display = "block";
- }
- if ($('.U_MD_F_Add_C_D')[0]) {
- U.selectEl('.U_MD_F_Add_C_D')[0].style.display = "block";
- }
- if (groupinfo) {
- _isgroupmain = groupinfo.GroupManageCreateUserID == US.userInfo.userid;
- } else {
- _isgroupmain = !groupinfo;
- }
-
- if (_isgroupmain) {
- _isdeletegroup = "解散该群";
- } else {
- _isdeletegroup = "退出该群";
- }
-
- U.selectEl(_groupinfoel[0]).Child()[2].style.display = "block";
-
- _inputel[0].value = groupinfo.GroupManageName;
- _inputel[1].value = groupinfo.GroupManageDescript;
-
- _groupuserinfo = U.Json.select(US.friend.groupusers, { "GroupManageID": groupinfo.GroupManageID });
-
- U.selectEl('.U_MD_F_Add_TNM_Number')[0].innerHTML = _groupuserinfo.length + "人";
-
- U.MD.F.J.selectUserInfo.SelectUser = _groupuserinfo;
-
- U.MD.F.J.printGroupUserInfo(_groupinfochildsel[1], _groupuserinfo, groupinfo);
-
- U.selectEl(_groupinfochildsel[2]).addAttrArray({
- "onclick": function () {
- U.MD.F.J.groupExit(groupinfo, U.Json.selectOne(_groupuserinfo, { "UserId": US.userInfo.userid }), _groupinfoel);
- },
- "innerHTML": _isdeletegroup
- });
- }
-
- else {
-
- _inputel[0].value = "";
- _inputel[1].value = "";
- U.selectEl(_groupinfoel[0]).Child()[2].style.display = "none";
- U.selectEl('.U_MD_F_Add_TNMO')[0].style.display = "none";
- U.selectEl('.U_MD_F_Add_C_D')[0].style.display = "none";
- U.selectEl('.U_MD_F_Add_TNM_ADD2')[0].style.display = "block";
- }
- _groupinfoel[0].style.display = "block";
-
- _formel = new U.UF.UI.form("群聊信息", _groupinfoel[0], { "id": "U_MD_F_Add_O", "style": { "width": "480px" } }, { isnarrow: false, isenlarge: false }).form;
- if (!groupinfo) {
- U.selectEl($(_formel).Child()[2]).Child()[0].style.MaxHeight = "650px";
- U.selectEl(_formel)[0].style.Maxheight = "650px";
- }
-
- _determinebottom = U.selectEl(_groupinfochildsel[3]).Child()[0];
- _determinebottom.onclick = function () {
- if ($('#U_MD_F_addFriendorGroup')[0]) {
- U.selectEl('#U_MD_F_addFriendorGroup')[0].style.display = "none";
- }
- U.MD.F.J.determineCreateGroupAndAddGroupUser(groupinfo ? groupinfo.GroupManageID : null, _groupinfochildsel[0], chatel);
- };
-
- _invitationbottom = U.selectEl($(_groupinfochildsel[0]).Child()[1]).Child()[1];
- _invitationbottom.onclick = function () {
- U.MD.F.J.selectFriendForm(function () {
- U.MD.F.J.determineCreateGroupAndAddGroupUser(groupinfo ? groupinfo.GroupManageID : null, _groupinfochildsel[0], chatel, true);
- }, 'friend', "", 1);
- }
- U.selectEl('#U_MD_F_Add_TNM_ADD2_add')[0].onclick = function () {
- U.MD.F.J.selectFriendForm(function () {
- U.MD.F.J.determineCreateGroupAndAddGroupUser(groupinfo ? groupinfo.GroupManageID : null, _groupinfochildsel[0], chatel, true);
- }, 'friend', "", 0);
- }
-
- _closebottom = U.selectEl(_groupinfochildsel[3]).Child()[1];
- _closebottom.onclick = function () {
- U.UF.F.windowMinimize(_formel);
- }
- return _formel;
- }
- U.MD.F.J.printGroupUserInfo = function (el, groupuserinfo, groupinfo) {
- var i,
-
- _tempel,
- _temponeel,
- _temptwoel,
- _tempname,
- _frag = $$("frag"),
- _childsel = U.selectEl(el).Child(),
- _isgroupmain;
-
- if (groupinfo) {
- _isgroupmain = groupinfo.GroupManageCreateUserID == US.userInfo.userid;
- } else {
- _isgroupmain = !groupuserinfo;
- }
-
- if (_isgroupmain) {
- _tempname = "U_MD_F_Add_R" + " U_MD_F_Add_RS"
- } else {
- _tempname = "U_MD_F_Add_R" + ""
- }
-
- for (i = 0; i < groupuserinfo.length; i++) {
- _tempel = $$("div", { "className": "U_MD_F_Add_CO" }, _frag);
- _tempell = $$("div", { "style": { "width": "32%", "height": "30px", "float": "left" } }, _tempel);
- $$("img", { "onerror": U.MD.C.imgError, "onerror": U.MD.C.imgError, "title": "点击查看", "src": U.MD.C.getHeadImage(groupuserinfo[i].UserThumbnailImageHead) }, _tempell);
- $$("div", { "className": "U_MD_F_Add_COM U_MD_D_Text_Abbreviation", "innerHTML": groupuserinfo[i].UserName }, _tempell);
- _temponeel = $$("div", { "className": "U_MD_F_Add_COM U_MD_D_Text_Abbreviation UD_UserName", "style": { "width": "32%", "margin-left": "2%" }, "innerHTML": groupuserinfo[i].GroupUsersDescript || groupuserinfo[i].UserNickName || groupuserinfo[i].UserName }, _tempel);
- _temptwoel = $$("div", { "className": _tempname }, _tempel);
-
- if (groupinfo) {
-
- if (_isgroupmain || groupuserinfo[i].UserId == US.userInfo.userid) {
- $$("img", {
- "src": "/img/Edit1.png",
- "title": "修改群名片",
- "onclick": (function (i) {
- return U.UF.C.closure(U.MD.F.J.upateGroupUserDescriptForm, [groupuserinfo[i], _temponeel]);
- })(i)
- }, _temptwoel);
- }
- $$("img", {
- "src": "/img/personalCard1.png",
- "title": "查看用户资料",
- "onclick": (function (i) {
- return U.UF.C.closure(U.MD.U.V.ViewOtherUserInfo, [groupuserinfo[i].UserId]);
- })(i)
- }, _temptwoel);
- $$("img", {
- "src": "/img/Add1.png",
- "title": "添加好友",
- "onclick": (function (i) {
- return U.UF.C.closure(U.MD.F.M.addFriend, [groupuserinfo[i], null, _tempel]);
- })(i)
- }, _temptwoel);
- }
-
- if (_isgroupmain) {
- $$("img", {
- "src": "/img/exit1.png",
- "title": "移除",
- "onclick": (function (i) {
- return U.UF.C.closure(U.MD.F.J.groupExit, [groupinfo, groupuserinfo[i], _tempel]);
- })(i)
- }, _temptwoel);
- }
- }
-
- if (_childsel.length) {
- el.insertBefore(_frag, _childsel[_childsel.length - 1]);
- } else {
- el.appendChild(_frag);
- }
- }
- U.MD.F.J.upateGroupUserDescriptForm = function (groupuserinfo, el) {
- var _tempel,
- _temponeel,
- _temptwoel,
- _groupname = groupuserinfo.GroupUsersDescript || groupuserinfo.UserName;
- if (groupuserinfo) {
-
- _tempel = $$("div", { "className": "U_MD_U_L_Box_I U_MD_F_Add_TNL U_MD_F_G" });
- _temponeel = $$("div", {}, _tempel)
- _temptwoel = $$("input", {
- "value": _groupname,
- "onfocus": function () {
- U.UF.MR.inputPlaceholder(this, _groupname, "");
- },
- "onblur": function () {
- U.UF.MR.inputPlaceholder(this, "", _groupname);
- }
- }, _temponeel);
-
- U.UF.UI.confirm(_tempel, function () {
- U.MD.F.J.determineUpateGroupUserDescript(groupuserinfo, _temptwoel, el);
- });
- } else {
- U.alert("暂无群信息");
- }
- }
- U.MD.F.J.determineUpateGroupUserDescript = function (groupuserinfo, inputel, el) {
-
- if (inputel.value && U.UF.S.NickName.test(inputel.value)) {
- U.A.Request(US.FRIEND, ["UpdateGroupMemberInfo", US.userInfo.userid, groupuserinfo.GroupManageID, groupuserinfo.UserId, inputel.value],
- U.MD.F.J.asynDetermineUpateGroupUserDescript, [null, groupuserinfo, inputel.value, el]);
- } else {
- U.alert("备注名格式不对");
- return true;
- }
- }
- U.MD.F.J.asynDetermineUpateGroupUserDescript = function (r) {
- var _context = r.context,
- _groupuserinfo = _context[1],
- _descriptname = _context[2],
- _el = _context[3];
-
- _el.innerText = _groupuserinfo.GroupUsersDescript = _descriptname;
- U.alert("修改备注成功!");
- }
- U.MD.F.J.groupExit = function (groupinfo, userinfo, el) {
- var _userid = US.userInfo.userid,
- _isgroupmain = groupinfo.GroupManageCreateUserID == _userid
- ;
-
- if (_isgroupmain) {
-
- if (userInfo.userid == _userid) {
- U.UF.UI.confirm("是否解散该群", function () {
- U.MD.F.J.enterGroupExit(groupinfo, userinfo, true, el);
- });
- }
-
- else {
-
- U.UF.UI.confirm("是否移除该群用户", function () {
- U.MD.F.J.enterGroupExit(groupinfo, userinfo, false, el);
- });
- }
- }
-
- else {
- U.UF.UI.confirm("是否确定退出该群", function () { U.MD.F.J.enterGroupExit(groupinfo, userinfo, false, el); });
- }
- }
- U.MD.F.J.enterGroupExit = function (groupinfo, userinfo, isdelete, el) {
- if (isdelete === true) {
- U.A.Request(US.FRIEND, ["DeleteGroup", US.userInfo.userid, groupinfo.GroupManageID], U.MD.F.J.asynGroupExit, ["", groupinfo, userinfo, isdelete, el]);
- } else {
- U.A.Request(US.FRIEND, ["ExitGroup", US.userInfo.userid, groupinfo.GroupManageID, userInfo.userid], U.MD.F.J.asynGroupExit, ["", groupinfo, userinfo, isdelete, el]);
- }
- }
- U.MD.F.J.asynGroupExit = function (r) {
- var _context = r.context,
- _chatfrom,
- _groupinfo = _context[1],
- _friendinfo = _context[2],
- _isdelete = _context[3],
- _el = _context[4],
- _chatformel = U.selectEl("#U_MD_F")[0];
-
- if (_isdelete) {
-
- U.Json.del(US.friend.group, { "GroupManageID": _groupinfo.GroupManageID });
- U.Json.del(US.friend.groupusers, { "GroupManageID": _friendinfo.GroupManageID });
-
- U.selectEl("#U_MD_F_H_ZLZ").find("[tid='" + _groupinfo.GroupManageID + "']").remove();
-
- if (U.MD.F.W.isCreateForm(_groupinfo.GroupManageID)) {
- U.MD.F.W.delteFriendChat(_groupinfo.GroupManageID, _chatformel);
- }
-
- if (_el) {
- _el = U.selectEl(_el).Parent({ usform: "true" });
- _el.close();
- }
- U.alert('解散群成功');
- }
-
- else if (_groupinfo.GroupManageUserID == US.userInfo.userid && _isdelete == false) {
- U.selectEl(_el).remove();
- U.Json.del(US.friend.groupusers, { "GroupManageID": _friendinfo.GroupManageID, "UserId": _friendinfo.UserId });
- U.Json.del(U.MD.F.J.selectUserInfo.SelectUser, { "UserId": _friendinfo.UserId });
- U.alert('已将成员移除群聊');
- }
-
- else {
-
- U.MD.F.W.delteFriendChat(_friendinfo.GroupManageID, _chatformel);
- U.selectEl("#U_MD_F_H_ZLZ").find("[tid='" + _groupinfo.GroupManageID + "']").remove();
- U.Json.del(US.friend.group, { "GroupManageID": _friendinfo.GroupManageID });
- U.Json.del(US.friend.recentcontacts, { "GroupManageID": _friendinfo.GroupManageID });
-
- if (_el) {
- _el = U.selectEl(_el).Parent({ usform: "true" });
- _el.close();
- }
- U.alert('已退出群聊');
- }
- }
- U.MD.F.J.selectFriendForm = function (cb, type, fileinfo, group) {
-
- if (!U.MD.U.L.isLogin() && US.friend.friends) {
- var i,
- _formel,
- _gel = U.selectEl("#U_MD_F_RC_G_C")[0],
- _fel = U.selectEl("#U_MD_F_RC_F_C")[0],
- _elparent = U.selectEl("#U_MD_F_RC")[0],
- _clone = _elparent.cloneNode(true),
- _allfriendinfo = U.Json.select(US.friend.friends.concat([])),
- _addfriendinfo = U.MD.F.J.selectUserInfo,
- _selectfriend = _addfriendinfo.SelectUser,
- _clickEl = U.selectEl('#U_MD_F_RC_Friend')[0],
- _groupEl = U.selectEl('#U_MD_F_RC_Group')[0],
- _joinEl = U.selectEl('#U_MD_F_RC_Join')[0]
- if (group == 1) {
-
- for (i = 0; i < _selectfriend.length; i++) {
- U.Json.del(_allfriendinfo, { "UserId": _selectfriend[i].UserId });
- }
- }
-
- var _form = new U.UF.UI.form("选择联系人",
- _elparent, {
- "id": "U_MD_F_RC_O",
- "style": {
- "width": "480px",
- "height": "530px",
- "min-width": "480px"
- }
- }, {
- isnarrow: false,
- isenlarge: false
- });
-
- _addfriendinfo.CallBack = cb;
- if (US.friend.friends.length) {
-
- if (!type || type == 'friend') {
- U.MD.F.J.printSelectFriend(_fel, _allfriendinfo, _elparent);
- _clickEl.onclick = function () {
- _clickEl = U.MD.F.J.alterNately($(_elparent).find('#U_MD_F_RC_F_C')[0], U.selectEl(_elparent).find('#U_MD_F_RC_G_C')[0], _elparent, _clickEl, this)
- }
- }
-
- if (!type || type == 'group') {
- U.MD.F.J.printSelectGroupUser(_gel, US.friend.group, _elparent);
- _groupEl.onclick = function () {
- _clickEl = U.MD.F.J.alterNately($(_elparent).find('#U_MD_F_RC_G_C')[0], U.selectEl(_elparent).find('#U_MD_F_RC_F_C')[0], _elparent, _clickEl, this)
- }
- }
- if (type == 'friend' || type == 'group') {
- _clickEl.style.display = 'none';
- _groupEl.style.display = 'none';
- } else {
- _clickEl.style.display = 'block';
- _groupEl.style.display = 'block';
- }
- } else {
- _clickEl.style.display = 'none';
- _groupEl.style.display = 'none';
- _joinEl.style.display = 'block';
- U.selectEl('.U_MD_F_RC_Join_btn')[0].onclick = function () {
- var _input = $$('input', {}, _joinEl),
- _fileType = fileinfo.UserDirectoryExtendType == 'uw' ? 'word' : 'execl';
- _input.value = "/" + _fileType + '/join/' + fileinfo.UserDirectoryID;
- _input.select();
- document.execCommand("Copy");
- U.selectEl(_input).remove();
- U.Alert('复制成功,赶快分享给小伙伴吧!');
- }
- }
- _addfriendinfo.NeedUser = [];
- _elparent.parentNode.style.backgroundColor = "#f3f3f3"
- U.selectEl(_elparent)[0].style.display = "block";
- U.selectEl("#U_MD_Home")[0].appendChild(_clone);
- return _formel;
- }
- }
- U.MD.F.J.printSelectFriend = function (el, friendinfo, boxele) {
- var i,
- _tempel,
- _temponeel,
- _frag = $$("frag");
-
- for (i = 0; i < friendinfo.length; i++) {
- _tempel = $$("div", {
- "className": "U_MD_F_RC_CO",
- "FID": friendinfo[i].UserId,
- "onclick": U.UF.C.closure(function (firendinfo) {
- U.MD.F.J.clickSelectFriend(this, firendinfo);
- U.MD.F.J.showChoose(firendinfo, U.selectEl(this).find('.U_MD_F_RC_COC ')[0], boxele, 'friend')
- }, [friendinfo[i]])
- },
- _frag);
- $$("div", { "className": "U_MD_F_RC_COI U_Img" }, _tempel);
- _temponeel = $$("div", { "className": "U_MD_F_RC_COC U_MD_D_Text_Abbreviation" }, _tempel);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "onclick": function (n) {
- return function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(friendinfo[n].UserId);
- }
- }(i),
- "src": U.MD.C.getHeadImage(friendinfo[i].UserThumbnailImageHead),
- "alt": friendinfo[i].FriendsDescript
- },
- _temponeel);
- $$("div", { "className": "U_MD_F_RC_COCN", "innerHTML": friendinfo[i].UserNickName }, _temponeel);
- }
-
- el.innerHTML = "";
- el.appendChild(_frag);
- }
- U.MD.F.J.printSelectGroupUser = function (el, groupinfo, boxele) {
- var i,
- _tempel,
- _temponeel,
- _frag = $$("frag");
-
- for (i = 0; i < groupinfo.length; i++) {
- _tempel = $$("div", {
- "className": "U_MD_F_RC_CO",
- "FID": groupinfo[i].GroupManageID,
- "onclick": function (n) {
- return function () {
- U.MD.F.J.showChoose(firendinfo, U.selectEl(this).find('.U_MD_F_RC_COC ')[0], boxele, 'group', this)
- U.MD.F.J.clickSelectGroup(this, groupinfo[n]);
- }
- }(i)
- }, _frag);
- $$("div", { "className": "U_MD_F_RC_COI U_Img" }, _tempel);
- _temponeel = $$("div", { "className": "U_MD_F_RC_COC U_MD_D_Text_Abbreviation" }, _tempel);
- $$("img", {
- "title": "点击查看",
- "onclick": function (n) {
- return function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.GroupInfo(groupinfo[n]);
- }
- }(i),
- "src": "/img/chatgroup.png"
- }, _temponeel);
- $$("div", { "className": "U_MD_F_RC_COCN", "innerHTML": groupinfo[i].GroupManageName }, _temponeel);
- }
- el.appendChild(_frag);
- }
- U.MD.F.J.searchSelectFriend = function (groupinfo) {
- var _searchel = U.selectEl("#U_MD_F_RC_C")[0],
- _UDTD = U.selectEl("div@FID=" + groupinfo.UserId)[0];
- if (_UDTD) {
- _UDTD.onclick();
- U.UF.EV.scrollToPosition(_UDTD);
- } else { U.alert("好友已经添加到群组里~"); }
- }
- U.MD.F.J.clickSelectFriend = function (el, friendinfo) {
- var _selectel = U.selectEl("div", el)[0];
-
- if (_selectel.className == "U_MD_F_RC_COI U_Img") {
- _selectel.className += " U_MD_F_RC_COIO";
- U.MD.F.J.selectUserInfo.NeedUser.push(friendinfo);
- }
-
- else {
- _selectel.className = "U_MD_F_RC_COI U_Img";
- U.Json.del(U.MD.F.J.selectUserInfo.NeedUser, { "UserId": friendinfo.UserId });
- }
- }
- U.MD.F.J.clickSelectGroup = function (el, groupinfo) {
- var i,
- _selectel = U.selectEl("div", el)[0],
- _needuser = U.MD.F.J.selectUserInfo.NeedUser,
- _groupuser = U.Json.select(US.friend.groupusers, { "GroupManageID": groupinfo.GroupManageID });
-
- if (_selectel.className == "U_MD_F_RC_COI U_Img") {
- _selectel.className += " U_MD_F_RC_COIO";
- _needuser = _needuser.concat(_groupuser);
- }
-
- else {
- _selectel.className = "U_MD_F_RC_COI U_Img";
-
- for (i = 0; i < _groupuser.length; i++) {
- U.Json.del(_needuser, { "UserId": _groupuser[i].UserId });
- }
- }
- }
- U.MD.F.J.closeSelectFriendForm = function (el) {
- U.UF.F.closeWindow($(el).Parent({ usform: "true" }), "remove");
- }
- U.MD.F.J.determineSelectFriend = function (el) {
- var _selectuserinfo = U.MD.F.J.selectUserInfo,
- _groupid = U.selectEl(el).find('.U_MD_F_RC_COIO')[0] && U.selectEl(el).find('.U_MD_F_RC_COIO')[0].parentNode.getAttribute('fid');
- _groupid = U.Json.select(US.friend.group, { "GroupManageID": _groupid })[0] ? _groupid : false;
-
- if (_selectuserinfo.CallBack) {
- _selectuserinfo.CallBack(_groupid);
- _selectuserinfo.CallBack = null;
- }
- U.UF.F.closeWindow(el, "remove");
- }
- U.MD.F.J.inputDocName = function () {
- var _confirmEl = U.selectEl('#U_UF_UI_confirm')
- U.UF.F.topWindow(_confirmEl[0])
- U.selectEl(_confirmEl).find('#U_MD_DK_RE_localDoc')[0].click()
- }
- U.MD.F.J.determineCreateGroupAndAddGroupUser = function (groupid, el, chatel, update, groupname, groupdescript, cb) {
- var i,
- _groupinfo,
- _inputs = U.selectEl("input,textarea", el),
- _adduserinfo = U.MD.F.J.selectUserInfo.NeedUser,
- _userid = US.userInfo.userid,
- _groupname = groupname == undefined ? _inputs[0].value : groupname,
- _groupdescript = groupdescript == undefined ? _inputs[1].value : groupdescript,
- _groupuserids = U.Json.toKeyArray(_adduserinfo, "UserId").join(",")
- ;
-
- if (!groupid) {
- if (_groupname == "") {
- for (var i = 0; i < _adduserinfo.length; i++) {
- _groupname = _groupname + "、" + _adduserinfo[i].UserNickName;
- }
- _groupname = _groupname + "、" + US.userInfo.UserNickName;
- _groupname = _groupname.substr(1, _groupname.length);
- }
- groupid = Guid.newGuid();
- _groupinfo = new U.MD.F.T.groupEntity(groupid, _groupname, new Date(), _userid, _groupdescript, null);
-
- _adduserinfo.push(US.userInfo);
- if (_groupuserids) {
- _groupuserids = _userid + "," + _groupuserids;
- } else {
- _groupuserids = _userid;
- }
-
- U.UF.F.closeWindow($(el).Parent({ usform: "true" }), "remove");
- }
-
- else {
- _groupinfo = U.Json.select(US.friend.group, { "GroupManageID": groupid })[0];
- }
-
-
- U.A.Request(US.FRIEND, ["CreateGroupAndAddUser", _userid, groupid, _groupname, _groupdescript, _groupuserids],
- U.MD.F.J.asynDetermineCreateGroupAndAddGroupUser, ["", _groupinfo, _adduserinfo, groupid, _groupname, _groupdescript, el, chatel, _groupuserids, update, cb]);
- }
- U.MD.F.J.asynDetermineCreateGroupAndAddGroupUser = function (r) {
- var i,
- _context = r.context,
- _directory,
- _diskinfo,
- _groupuser,
- _userinfo = US.userInfo,
- _groupinfo = _context[1],
- _groupuserinfo = _context[2],
- _groupid = _context[3],
- _groupname = _context[4],
- _groupdescript = _context[5]
- ;
- r = r.value;
-
- if (r !== false) {
-
- if (!U.Json.select(US.friend.group, { "GroupManageID": _groupid })[0]) {
- US.friend.group.unshift(_groupinfo);
-
- _directory = new U.MD.DK.M.entity(_groupinfo.GroupManageID, 0, US.userInfo.userid, _groupinfo.GroupManageName, _groupinfo.GroupManageName,
- "folder", null, new Date(), U.MD.DK.C.getIcon("folder")[1], 1, null, null, 0, "", _groupinfo.GroupManageID);
-
- _diskinfo = U.MD.DK.M.diskOperatingSwitch(_userinfo.UserId);
- U.MD.DK.M.entity.add([_directory], _diskinfo);
- }
-
- else {
- _groupinfo.GroupManageName = _groupname;
- _groupinfo.GroupManageDescript = _groupdescript;
- }
-
- for (i = 0; i < _groupuserinfo.length; i++) {
- _groupuser = new U.MD.F.T.groupUserEntity(_groupuserinfo[i].UserId, _groupuserinfo[i].UserImageHead,
- _groupuserinfo[i].UserNickName, _groupuserinfo[i].UserName, _groupuserinfo[i].UserThumbnailImageHead,
- _groupuserinfo[i].UserNickName, _groupid, 1);
- US.friend.groupusers.push(_groupuser);
- }
-
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[2]).Child()[0].onclick();
-
- if (_groupinfo && _groupuserinfo.length > 0) {
- if (_groupinfo) {
- var _alert = _groupname + "邀请成功";
- } else {
- var _alert = "邀请好友请入群成功~";
- }
-
- U.MD.F.J.selectUserInfo.NeedUser.splice(0, U.MD.F.J.selectUserInfo.NeedUser.length);
- U.Alert(_alert);
-
- } else {
- U.selectEl('#U_MD_F_Add_O')[0].style.display = "none";
- }
- }
-
- else {
- U.Alert("服务器繁忙,请从新创建!!");
- }
- }
- U.MD.F.J.isCreateGroup = function (groupid, groupname, groupds, fileid, cb) {
- _isgroup = U.Json.select(US.friend.group, { "GroupManageID": groupid })[0];
-
- if (!_isgroup) {
- var _elparent = $$("div", {});
- var _elcontent = $$("div", {
- "className": "U_MD_F_A_T",
- "innerHTML": "您的文档将移至新建群里(" + groupds + "),是否新建群组?"
- },
- _elparent);
- var _elall = $$("div", {
- "className": "U_MD_F_A_T_All"
- },
- _elparent);
- var _elbutton = $$("div", {
- "className": "U_MD_F_A_T_OFF",
- "innerHTML": "取消"
- },
- _elall);
- $$("div", {
- "className": "U_MD_F_A_T_OUT",
- "innerHTML": "确认",
- "onclick": function () {
- U.MD.F.J.changeInfo(groupid, groupname, groupds, fileid, cb);
- }
- },
- _elall);
- _elbutton.onclick = function () {
- U.selectEl("#U_MD_D_emp_CK")[0].close()
- }
- new U.UF.UI.form("提示",
- _elparent, {
- "id": "U_MD_D_emp_CK",
- "style": {
- "width": "250px",
- "height": "170px"
- }
- }, {
- istop: true,
- isdrag: false,
- isnarrow: false,
- isenlarge: false
- }).form;
- } else {
- U.MD.F.J.changeInfo(groupid, groupname, groupds, fileid, cb)
- }
- }
- U.MD.F.J.changeInfo = function (groupid, groupname, groupds, fileid, cb) {
- var i, _isgroup,
-
- _groupsign = 1,
- _userid = US.userInfo.userid,
- _groupinfo = [groupname, groupds],
- _groupfriend = U.MD.F.J.selectUserInfo.NeedUser,
- _grouparr = new Array();
-
- for (var i = 0; i < _groupfriend.length; i++) {
- var pd = 0;
-
- for (var u = 0; u < _grouparr.length; u++) {
- if (_grouparr[u].UserId == _groupfriend[i].UserId || _groupfriend[i].UserId == US.userInfo.userid) {
- pd++
- }
- }
- if (pd == 0) {
- _grouparr.push(_groupfriend[i]);
- }
- }
- _frienduser = U.Json.toKeyArray(_grouparr, "UserId").join(","),
- _useridarr = U.Json.toKeyArray(_grouparr, "UserId").join(",");
- _isgroup = U.Json.select(US.friend.group, { "GroupManageID": groupid })[0];
- if (!_isgroup) {
- _groupsign = 0;
- groupid = groupid || Guid.newGuid();
-
- _isgroup = new U.MD.F.T.groupEntity((groupid = groupid || Guid.newGuid()), _groupinfo[0], new Date(), _userid, _groupinfo[1], null);
-
- if (_useridarr) {
- _useridarr = _userid + "," + _useridarr
- } else {
- _useridarr = _userid + "" + _useridarr
- }
- }
-
-
- U.A.Request(US.FRIEND, ["CreateGroupAndAddUser", _userid, groupid, _groupinfo[0], _groupinfo[1], _useridarr], U.MD.F.J.asynChangeInfo, ["", _isgroup, _grouparr.splice(0, _grouparr.length), groupid, _groupinfo[0], _groupinfo[1], cb, _frienduser, groupid, _groupinfo[0]]);
-
-
-
- U.selectEl("#U_MD_D_emp_CK").hide()
- }
- U.MD.F.J.asynChangeInfo = function (r) {
- U.MD.F.J.asynDetermineCreateGroupAndAddGroupUser(r);
- var _context = r.context;
- _context[6](_context[1], _context[7], _context[8], _context[9]);
- }
- U.MD.F.J.addUsersToGroup = function (groupinfo, cb) {
- if (!U.MD.U.L.isLogin()) {
- var _userinfo = US.userInfo,
- _userid = _userinfo.UserId,
- _groups = US.friend.group,
- _group = U.Json.select(_groups, { "GroupManageID": groupinfo.GroupManageID })[0];
-
- if (!_group) {
- U.alert("正在加入,请稍等..");
-
- U.A.Request(US.FRIEND, ["AddUsersToGroup", US.userInfo.userid, groupinfo.GroupManageID, _userid], U.MD.F.J.asynAddUsersToGroup, ["", { MessageContent: groupinfo.GroupManageID, MessageDescript: groupinfo.GroupManageName, UserId: groupinfo.UserId },]);
- }
-
- else {
- if (cb) {
- cb();
- } else { U.MD.F.W.viewFriend(_group); }
- }
- }
- }
- U.MD.F.J.asynAddUsersToGroup = function (r) {
- var _context = r.context,
- _cb = _context[2],
- _userid = US.userInfo.userid,
- _diskinfo = US.disk.Disks[_userid],
- _groupinfo = U.MD.F.N.asynPulledIntoGroups(r);
-
- if (_cb) {
- U.UF.C.apply(this, _cb)();
- }
-
- else {
- U.MD.F.W.viewFriend(_groupinfo);
- }
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[2]).Child()[0].onclick();
- U.alert("成功加入该群");
- }
- U.MD.F.J.addPopup = function () {
- var _el;
- _el = $$("div", { "className": "U_MD_F_A" });
- $$("div", { "className": "U_MD_F_RA", "onclick": U.MD.F.M.createFriendGroupPopup, "innerHTML": "添加分组" }, _el);
- $$("div", { "className": "U_MD_F_RA_E", "onclick": "U.MD.F.S.popSearchFriendsOrGroupForm(0);", "innerHTML": "添加/<br>查找好友" }, _el);
- $$("div", { "className": "U_MD_F_RA", "onclick": "U.MD.F.S.popSearchFriendsOrGroupForm(1)", "innerHTML": "加入群组" }, _el);
- $$("div", { "className": "U_MD_F_RA", "onclick": "U.MD.F.J.groupInfoForm();", "innerHTML": "创建群组" }, _el);
- new U.UF.UI.form("添加好友/群聊", _el, { 'id': 'U_MD_F_addFriendorGroup', "style": { "width": "390px", "height": "220px" } }, { isenlarge: false, isnarrow: false });
- };
- U.MD.F.J.alterNately = function (el, nel, elparent, clickel, thisel) {
- if (thisel != clickel) {
- nel.style.display = 'none';
- nel.previousElementSibling.children[0].src = "/img/arrowR.png";
- var con = U.selectEl(nel).find('.U_MD_F_RC_COIO');
- for (var i = 0; i < con.length; i++) {
- con[i].className = "U_MD_F_RC_COI U_Img"
- }
- U.MD.F.J.selectUserInfo.NeedUser = [];
- U.selectEl(elparent).find('.U_MD_F_RC_C_C')[0].innerHTML = "";
- U.selectEl(elparent).find('.U_MD_F_RC_C_T')[0].innerText = 0;
- }
- if (el.style.display == 'none') {
- el.style.display = 'block';
- el.previousElementSibling.children[0].src = "/img/arrowB.png";
- } else {
- el.style.display = 'none';
- el.previousElementSibling.children[0].src = "/img/arrowR.png";
- }
- return thisel
- }
- U.MD.F.J.showChoose = function (firendinfo, el, boxele, type, cthis) {
- var _fel = U.selectEl($(boxele).find('.U_MD_F_RC_C_C')[0]).find("div[fid='" + U.selectEl(el.parentNode).attr('fid') + "']")[0],
- _leftShowEl = U.selectEl(boxele).find('.U_MD_F_RC_C_C')[0],
- _cNam = cthis && U.selectEl(cthis.parentNode).find('.U_MD_F_RC_COIO') || []
- if (_cNam.length && _cNam[0].parentNode.getAttribute('fid') != U.selectEl(cthis).attr('fid')) {
- var _delElFid = U.selectEl($(_cNam)[0].parentNode).attr('fid')
- _cNam[0].className = _cNam[0].className.replace(' U_MD_F_RC_COIO', '');
- U.selectEl($(boxele).find("div[fid='" + _delElFid + "']")[1]).remove()
- U.MD.F.J.selectUserInfo.NeedUser = []
- }
- if (!_fel) {
- var addel = $$('div', { className: "U_MD_F_RC_C_C_A", fid: U.selectEl(el.parentNode).attr('fid') });
- $$('img', { "onerror": U.MD.C.imgError, src: el.firstElementChild.src }, addel);
- $$('span', { innerText: el.lastElementChild.innerText }, addel)
- addel.onclick = function () {
- U.MD.F.J.clearDefaultStyle();
- addel.className += " U_MD_F_A_AddNewGrouper";
- $$("div", {
- "id": "U_MD_F_A_XX",
- "style": {
- "width": "19px",
- "height": "19px",
- "background-image": "url('/img/YS2017.png')",
- "display": "inline-block",
- "background-repeat": "no-repeat",
- "background-position": "-984px -407px",
- "float": "right",
- "margin": "12px",
- "cursor": "pointer"
- },
- "onclick": function () {
- U.MD.F.J.deleteClick(this, firendinfo, boxele);
- }
- }, addel);
- }
- if (type == "friend") {
- U.selectEl(boxele).find('.U_MD_F_RC_C_C')[0].appendChild(addel);
- } else if (type == "group") {
- _leftShowEl.innerHTML = "";
- if (!cthis.firstChild.className.match('U_MD_F_RC_COIO')) {
- var _groupFid = U.selectEl(el.parentNode).attr('fid'),
- _groupFriends = U.Json.select(US.friend.groupusers, { "GroupManageID": _groupFid })
- _newEl = $$('div');
- for (var i = 0; i < _groupFriends.length; i++) {
- var _cloneEl = addel.cloneNode(true);
- _cloneEl.setAttribute('fid', _groupFriends[i].UserId)
- _cloneEl.fid = _groupFriends[i].UserId;
- _cloneEl.firstChild.src = U.MD.C.getHeadImage(_groupFriends[i].UserImageHead) || "/img/UserHead/UseHead.jpg";
- _cloneEl.lastChild.innerText = _groupFriends[i].UserName;
- _newEl.appendChild(_cloneEl);
- }
- _leftShowEl.appendChild(_newEl);
- U.MD.F.J.selectUserInfo.NeedUser = _groupFriends;
- }
- U.selectEl(boxele).find('.U_MD_F_RC_C_T')[0].innerText = _leftShowEl.children[0] ? _leftShowEl.children[0].children.length : 0;
- return;
- }
- } else {
- U.selectEl(_fel).remove()
- }
- U.MD.F.J.clearDefaultStyle();
- var _lastChild = U.selectEl(".U_MD_F_RC_C_C.U_MD_F_RC_C")[1].lastChild;
- _lastChild.className += " U_MD_F_A_AddNewGrouper";
- $$("div", {
- "id": "U_MD_F_A_XX",
- "style": {
- "width": "19px",
- "height": "19px",
- "background-image": "url('/img/YS2017.png')",
- "display": "inline-block",
- "background-repeat": "no-repeat",
- "background-position": "-984px -407px",
- "float": "right",
- "margin": "12px"
- },
- "onclick": function () {
- U.MD.F.J.deleteClick(this, firendinfo, boxele);
- }
- }, _lastChild);
- U.selectEl(boxele).find('.U_MD_F_RC_C_T')[0].innerText = _leftShowEl.children.length;
- }
- U.MD.F.J.clearDefaultStyle = function () {
- var targerList = U.selectEl(".U_MD_F_RC_C_C.U_MD_F_RC_C")[1].children
- for (var i = 0; i < targerList.length; i++) {
- targerList[i].className = "U_MD_F_RC_C_C_A";
- U.selectEl("#U_MD_F_A_XX")[0] ? U.selectEl("#U_MD_F_A_XX")[0].remove() : "";
- };
- }
- U.MD.F.J.deleteClick = function (div, firendinfo, boxele) {
- window.event ? window.event.cancelBubble = true : e.stopPropagation();
- var _fid = div.parentNode.fid;
- U.Json.del(U.MD.F.J.selectUserInfo.NeedUser, { "UserId": firendinfo.UserId });
- div.parentNode.remove();
- U.selectEl(boxele).find('.U_MD_F_RC_C_T')[0].innerText = U.selectEl(boxele).find('.U_MD_F_RC_C_C')[0].children.length;
- var _list = U.selectEl(".U_MD_F_RC_CO");
- for (var x = 0; x < _list.length; x++) {
- if (_list[x].FID == _fid) {
- _list[x].children[0].className = "U_MD_F_RC_COI U_Img";
- }
- }
- }
- U.MD.F.J.oneKeyCreateGroup = function (groupid, el, chatel, update, cb) {
- var i,
- _groupinfo,
-
- _adduserinfo = U.MD.F.J.selectUserInfo.NeedUser,
- _userid = US.userInfo.userid,
- _groupname = "协同文档群-" + (new Date().getHours().toString()[1] ? new Date().getHours() : "0" + new Date().getHours()) + ":" + (new Date().getMinutes().toString()[1] ? new Date().getMinutes() : "0" + new Date().getMinutes()),
- _groupdescript = "",
- _groupuserids = U.Json.toKeyArray(_adduserinfo, "UserId").join(",")
- ;
-
- if (!groupid) {
- if (_groupname == "") {
- for (var i = 0; i < _adduserinfo.length; i++) {
- _groupname = _groupname + "、" + _adduserinfo[i].UserNickName;
- }
- _groupname = _groupname + "、" + US.userInfo.UserNickName;
- _groupname = _groupname.substr(1, _groupname.length);
- }
- groupid = Guid.newGuid();
- _groupinfo = new U.MD.F.T.groupEntity(groupid, _groupname, new Date(), _userid, _groupdescript, null);
-
- _adduserinfo.push(US.userInfo);
- if (_groupuserids) {
- _groupuserids = _userid + "," + _groupuserids;
- } else {
- _groupuserids = _userid;
- }
-
-
- }
-
-
- U.A.Request(US.FRIEND, ["CreateGroupAndAddUser", _userid, groupid, _groupname, _groupdescript, _groupuserids],
- U.MD.F.J.asynDetermineCreateGroupAndAddGroupUser, ["", _groupinfo, _adduserinfo, groupid, _groupname, _groupdescript, el, chatel, _groupuserids, update, cb]);
- };
- Namespace.register("U.MD.F");
- U.MD.F.initFriend = U.MD.F.CSHFG = function () {
-
- if ($("#U_MD_F_H_Z")[0]) {
- var i,
- _friendinfo,
- _selectbottomel,
- _childsel,
- _chatform = U.selectEl("#U_MD_F_H_Z")[0],
- _userinfoel = U.selectEl("#U_MD_F_H_ZLTI", _chatform)[0];
-
- U.MD.F.W.friendDisplayAndNone([{
- "display": "none",
- "left": "auto"
- },
- {
- "display": "block",
- "top": (US.height - 530) / 2,
- "right": "0px"
- }
- ], true);
-
- U.selectEl($("img", _userinfoel)[0] || $$("img")).addAttrArray({
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(US.userInfo.UserThumbnailImageHead),
- "onclick": U.MD.U.P.userDataSet
- }).appendTo(_userinfoel);
- if (US.friend.recentcontacts.length) {
- _friendinfo = US.friend.recentcontacts;
- } else {
- _friendinfo = US.friend.friends;
- }
- U.MD.F.printRightFormFriend(_friendinfo, U.selectEl("#U_MD_F_H_RC")[0]);
- U.MD.F.newFriendTips();
-
- _selectbottomel = U.selectEl("#U_MD_F_H_ZLTA").Child()[0];
- U.selectEl(_selectbottomel).Child()[0].onclick();
- }
- }
- U.MD.F.printRightFormFriend = function (friendinfo, el) {
- var i,
- _tempel,
- _temponeel,
- _frag = $$("frag"),
- _childs = U.selectEl(el).Child();
-
- for (i = 1; i < _childs.length; i++) {
- el.removeChild(_childs[i]);
- }
-
- if (friendinfo.length) {
-
- for (i = 0;
- (i < friendinfo.length && i < 11); i++) {
-
- if (friendinfo[i].tf == 1) {
- friendinfo[i] = U.Json.select(US.friend.group, { "GroupManageID": friendinfo[i].UserId })[0];
- _friendoneel = $$("div", {
- "className": "U_MD_F_H_ZLZOCOI",
- "style": { "margin": "9px 0 0 10px" },
- "title": friendinfo[i].GroupManageName,
- "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
- U.MD.F.W.popupFriendsForm(friendinfo);
- }, [friendinfo[i]])
- }, _frag);
- U.MD.F.printGroupHeadImage(friendinfo[i], _friendoneel, 4, [35, 35]);
- }
-
- else {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "title": friendinfo[i]["FriendsDescript"],
- "className": "U_MD_F_H_RCI",
- "src": U.MD.C.getHeadImage(friendinfo[i].UserThumbnailImageHead),
- "alt": friendinfo[i].FriendsDescript || friendinfo[i].UserNickName,
- "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
- U.MD.F.W.popupFriendsForm(friendinfo);
- U.MD.F.N.canelMarkMessage(friendinfo);
- }, [friendinfo[i]])
- }, _frag);
- }
- }
- }
-
- else {
- _tempel = $$("div", { "className": "U_MD_F_H_RCT" }, _frag);
- _temponeel = $$("div", { "className": "U_MD_F_H_RCTS" }, _tempel);
- $$("img", { "onerror": U.MD.C.imgError, "src": "/img/YSUN.png" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_RCTZ U_Img" }, _tempel);
- $$("div", { "className": "U_MD_F_H_RCTX", "innerHTML": "暂时无追随" }, _tempel);
- }
- el.appendChild(_frag);
- }
- U.MD.F.newFriendTips = function () {
- if (!$('.U_MD_D_NewsTipsIcon')[0]) {
- var _tipsicon = $$("div", { className: "U_MD_D_NewsTipsIcon" }, U.selectEl("#U_MD_F_H_R")[0]);
- _tipsicon.onmousedown = function () { U.UF.F.drag(_tipsicon); };
- }
- }
- U.MD.F.printFriendGroupOrFriend = function (el) {
- var i,
- _tempel,
- _temponeel,
- _classinfo,
- _friendinfo = US.friend.allclass,
- _frag = $$("frag");
- el.innerText = "";
-
- if (US.friend.friends.length) {
-
- for (i = 0; i < _friendinfo.length; i++) {
- _classinfo = U.Json.select(US.friend.friends, { "FriendsGroupID": _friendinfo[i].FriendsGroupID });
-
- _tempel = $$("div", { id: "g" + _friendinfo[i].FriendsGroupID, "tid": _friendinfo[i].FriendsGroupID, "className": "U_MD_F_H_ZLZO" }, _frag);
- U_MD_F_H_ZLZOT_Img = '<div class="U_MD_F_H_ZLZOT_img"></div>';
- $$("div", {
- "className": "U_MD_F_H_ZLZOT",
- "innerHTML": U_MD_F_H_ZLZOT_Img + _friendinfo[i].FriendsGroupName + "(" + _classinfo.length + ")",
- "onclick": U.UF.C.closure(function (i) {
- U.MD.F.openOrCloseFriendClass(this);
- }, [i]),
- "oncontextmenu": U.UF.C.closure(function (i) {
- U.MD.F.R.friendClassRightClickMenu(US.friend.allclass[i], this);
- }, [i])
- }, _tempel);
- _temponeel = $$("div", { "className": "U_MD_F_H_ZLZOC" }, _tempel);
-
- U.MD.F.printFriendOrGroup(_temponeel, _classinfo);
- }
- }
-
- else {
- U.MD.F.printHasNoFriend(_frag);
- }
- el.appendChild(_frag);
- }
- U.MD.F.printFriendOrGroup = function (el, friendorgroupinfo, isinsert) {
- var i,
- _isfront,
- _friendel,
- _friendoneel,
- _friendtwoel,
- _onlinefrag = $$("frag"),
- _offlinefrag = $$("frag");
-
- if (friendorgroupinfo.length == 0) {
- $$("div", { "class": "U_MD_F_H_ZLZOCO_under", "style": { "margin": "9px 0 0 10px" }, "innerHTML": "该分组暂无好友" }, el);
- } else {
- for (i = 0; i < friendorgroupinfo.length; i++) {
- if (friendorgroupinfo[i].tf == 1) {
- friendorgroupinfo[i] = U.Json.select(US.friend.group, { "GroupManageID": friendorgroupinfo[i].UserId })[0]
- }
- _friendel = $$("div", {
- "className": "U_MD_F_H_ZLZOCO",
- "onclick": U.UF.C.closure(function (friendorgroupinfo) {
- U.MD.F.N.canelMarkMessage(friendorgroupinfo);
- U.MD.F.N.cancelNewsMessage(friendorgroupinfo);
- U.MD.F.W.popupFriendsForm(friendorgroupinfo, this);
- }, [friendorgroupinfo[i]]),
- "tid": friendorgroupinfo[i].GroupManageID || friendorgroupinfo[i].UserId,
- "oncontextmenu": U.UF.C.closure(function (friendorgroupinfo) {
- if (friendorgroupinfo.UserId) {
- U.MD.F.R.friendsRightClickMenu(this, friendorgroupinfo);
- U_MD_F_G_Group.style.display = "none";
- } else if (friendorgroupinfo.GroupManageID) {
- U.MD.F.R.GroupRightClickMenu(this, friendorgroupinfo);
- U_MD_F_G_Div.style.display = "none";
- }
- }, [friendorgroupinfo[i]])
- });
- _friendoneel = $$("div", { "className": "U_MD_F_H_ZLZOCOI" }, _friendel);
-
- if (friendorgroupinfo[i].GroupManageID) {
- U.MD.F.printGroupHeadImage(U.Json.select(US.friend.group, { "GroupManageID": friendorgroupinfo[i].GroupManageID || friendorgroupinfo[i].UserId })[0], _friendoneel, 4, [35, 35]);
- }
-
- else {
- $$("img", { "onerror": U.MD.C.imgError, "title": "点击查看", "src": U.MD.C.getHeadImage(friendorgroupinfo[i].UserThumbnailImageHead) }, _friendoneel);
- }
- _friendtwoel = $$("div", { "className": "U_MD_F_H_ZLZOCOR U_MD_D_Text_Abbreviation" }, _friendel);
- $$("div", { "className": "U_MD_F_H_ZLZOCORN U_MD_D_Text_Abbreviation", "innerHTML": friendorgroupinfo[i].FriendsDescript || friendorgroupinfo[i].UserNickName || friendorgroupinfo[i].GroupManageName }, _friendtwoel);
- $$("div", { "className": "U_MD_F_H_ZLZOCORT U_MD_D_Text_Abbreviation", "innerHTML": friendorgroupinfo[i].UserIndividualitysignature || (friendorgroupinfo[i].GroupManageDescript == friendorgroupinfo[i].GroupManageName ? "" : friendorgroupinfo[i].GroupManageDescript) || "" }, _friendtwoel);
-
- if (friendorgroupinfo[i].IsLogin == 1) {
- _onlinefrag.appendChild(_friendel);
- }
-
- else {
- _offlinefrag.appendChild(_friendel);
- }
- }
- el.insertBefore(_onlinefrag, el.firstChild);
-
- if (isinsert) {
- el.insertBefore(_offlinefrag, el.firstChild);
- } else {
- el.appendChild(_offlinefrag);
- }
- }
- }
- U.MD.F.openOrCloseFriendClass = function (el) {
- var _firendel = U.selectEl($(el).Parent()).Child()[1];
-
- if (_firendel.style.display == "none") {
- U.selectEl($($(el).Parent()).Child()[0]).Child()[0].style.cssText += "height:6px;width:10px;background:url(/BoomYun/img/pc/U_MD_F_H_ZLZOT_Open.png)";
- _firendel.style.display = "block";
- }
-
- else {
- U.selectEl($($(el).Parent()).Child()[0]).Child()[0].style.cssText += "height:10px;width:6px;background:url(/BoomYun/img/pc/U_MD_F_H_ZLZOT_Retract.png)";
- _firendel.style.display = "none";
- }
- }
- U.MD.F.printHasNoFriend = function (el) {
- var _tempel,
- _temponeel;
- _tempel = $$("div", { "className": "U_MD_F_H_ZLZT" }, el);
- _temponeel = $$("div", { "className": "U_MD_F_H_ZLZTS" }, _tempel);
- $$("img", { "onerror": U.MD.C.imgError, "src": "/img/YSUN.png" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_ZLZTZ U_Img" }, _tempel);
- $$("div", { "className": "U_MD_F_H_ZLZTX", "innerHTML": "暂时没有添加追随!!" }, _tempel);
- }
- U.MD.F.switchFriendOrGroup = function (typename, el, classname) {
- var i,
- _chatform = U.selectEl("#U_MD_F_H_ZLZ")[0],
- _childsel = U.selectEl(el).parentElement(2).Child(),
- _classarray = ["U_MD_F_H_ZLTT", "U_MD_F_H_ZLTO", "U_MD_F_H_ZLTS", "U_MD_F_H_ZLTF"];
-
- for (i = 0; i < _childsel.length; i++) {
- U.selectEl(_childsel[i]).Child()[0].className = _classarray[i] + " U_Img U_MD_F_H_ZLTOK";
- }
-
- el.className = classname + " U_Img U_MD_F_H_ZLTOK";
-
- if (typename == "A") {
- U.MD.F.M.createFriendGroupPopup();
- } else {
-
- if (typename == "H") {
- var _grouparr = US.friend.group;
- _chatform.innerText = "";
- U.MD.F.printFriendOrGroup(_chatform, _grouparr);
- }
-
- else if (typename == "G") {
- var _recentcontacts = US.friend.recentcontacts;
- _chatform.innerText = "";
- U.MD.F.printFriendOrGroup(_chatform, _recentcontacts);
- }
-
- else {
- U.MD.F.printFriendGroupOrFriend(_chatform);
- }
- }
- }
- U.MD.F.printGroupHeadImage = function (groupinfo, el, num, size) {
- var i, j,
- _groupnameel,
- _horizontal,
- _vertical,
- _imageel,
- _groupuserinfo = U.Json.select(US.friend.groupusers, { "GroupManageID": groupinfo.GroupManageID }, (num || 9));
- if (_groupuserinfo.length < 3) {
- _horizontal = _groupuserinfo.length;
- } else {
- if (_groupuserinfo.length > 6) {
- _horizontal = 3;
- } else {
- _horizontal = 2;
- }
- }
-
- if (_groupuserinfo.length > 4) {
- _vertical = 3
- } else {
- if (_groupuserinfo.length > 1) {
- _vertical = 2
- } else {
- _vertical = 1
- }
- }
- size = size || [el.offsetHeight || 40, el.offsetWidth || 40];
- _groupnameel = $$("div", { "className": "U_MD_HomeSSZFZAIO", "title": groupinfo.GroupManageName });
-
- for (i = 0; i < _horizontal; i++) {
- _imageel = $$("div", { "style": { "width": "100%", "height": Math.floor(size[0] / _horizontal) + "px" } }, _groupnameel);
-
- for (j = i * _vertical; j < i * _vertical + _vertical && j < _groupuserinfo.length; j++) {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(_groupuserinfo[j].UserThumbnailImageHead),
- "style": {
- "width": Math.floor(size[1] / _vertical) + "px",
- "height": Math.floor(size[0] / _vertical) + "px"
- }
- }, _imageel);
- }
- };
-
- el.appendChild(_groupnameel);
- }
-
- ;
- Namespace.register("U.MD.F.T");
- U.MD.F.T.friendEntity = function (signature, userid, userimagehead, thumbnailheadimage, nickname, name, friendid, descript, groupid, islogin) {
- this.UserIndividualitysignature = signature;
- this.UserId = userid;
- this.UserImageHead = userimagehead;
- this.UserThumbnailImageHead = thumbnailheadimage;
- this.UserNickName = nickname;
- this.UserName = name;
- this.FriendsID = friendid;
- this.FriendsDescript = descript;
- this.FriendsGroupID = groupid;
- this.IsLogin = islogin;
- }
- U.MD.F.T.recentContactsEntity = function (userid, username, userimagehead, usernickname, userthumbnailimagehead, sendtime, descript, signature, islogin) {
- this.UserId = userid;
- this.UserName = username;
- this.UserImageHead = userimagehead;
- this.UserNickName = usernickname;
- this.UserThumbnailImageHead = userthumbnailimagehead;
- this.maxMessageSendTime = sendtime;
- this.FriendsDescript = descript;
- this.UserIndividualitysignature = signature;
- this.IsLogin = islogin;
- }
- U.MD.F.T.friendGroupEntity = function (groupid, groupname, descript) {
- this.FriendsGroupID = groupid;
- this.FriendsGroupName = groupname;
- this.FriendsGroupDescript = descript;
- }
- U.MD.F.T.groupEntity = function (groupid, name, date, userid, descript, remark) {
- this.GroupManageID = groupid;
- this.GroupManageName = name;
- this.GroupManageCreateDate = date;
- this.GroupManageCreateUserID = userid;
- this.GroupManageUserID = userid;
- this.GroupManageDescript = descript;
- this.GroupManageRemark = remark;
- }
- U.MD.F.T.groupUserEntity = function (userid, userimagehead, nickname, name, thumbnailimagehead, descript, groupid, islogin) {
- this.UserId = userid;
- this.UserImageHead = userimagehead;
- this.UserNickName = nickname;
- this.UserName = name;
- this.UserThumbnailImageHead = thumbnailimagehead;
- this.GroupUsersDescript = descript;
- this.GroupManageID = groupid;
- this.IsLogin = islogin;
- }
- U.MD.F.T.initFriendInfo = function () {
- var i,
- j,
- _arr = ["friends", "groupusers", "recentcontacts"],
- _userinfo;
-
- for (i = 0; i < _arr.length; i++) {
-
-
- for (j = 0; j < US.friend[_arr[i]].length; j++) {
- _userinfo = US.friend[_arr[i]][j];
-
- if (US.friend.onlinefirendinfo.indexOf(_userinfo.UserId) > -1) {
- _userinfo.IsLogin = 1;
- }
-
- if (i != 1) {
- U.Json.Change(_userinfo, {
- "UserIndividualitysignature": _userinfo["UserIndividualitysignature"] || "",
- "UserNickName": _userinfo.UserName,
- "FriendsDescript": _userinfo["FriendsDescript"] || _userinfo.UserName
- });
- }
-
- else {
- U.Json.Change(_userinfo, {
- "UserNickName": _userinfo.UserName,
- "GroupUsersDescript": _UFE[j]["GroupUsersDescript"] || _userinfo.UserName
- });
- }
- }
-
- if (i != "recentcontacts") {
- U.Json.Reset(US.friend[_arr[i]], "IsLogin", 1);
- }
- }
-
- };
- Namespace.register("U.MD.F.S");
- U.MD.F.S.SearchPostion;
- U.MD.F.S.searchFriendsOrGroupForm = function (inputs, el, cb, typename) {
- var _searchfriendinfo = [],
- _searchvalue = inputs.value,
- _isserch = U.MD.F.S.searchFriendsKeyboardHandle(el, inputs)
- ;
-
- if (_isserch) {
-
- if (!typename || typename == "F") {
- _searchfriendinfo = _searchfriendinfo.concat(U.Json.like(US.friend.friends, { "FriendsDescript": _searchvalue, "UserNickName": _searchvalue, "UserName": _searchvalue }));
- }
-
- if (!typename || typename == "G") {
- _searchfriendinfo = _searchfriendinfo.concat(U.Json.like(US.friend.group, { "GroupManageName": _searchvalue }));
- }
-
- el.style.display = "block";
- el.innerText = "";
-
- U.MD.F.S.printSearchFriends(_searchfriendinfo, el, cb);
- };
- }
- U.MD.F.S.searchFriendsKeyboardHandle = function (el, inputs) {
- var _keycode;
-
- if (event) {
- _keycode = event.keyCode
- } else {
- _keycode = 0
- }
- _childs = U.selectEl(el).Child(),
- _searchvalue = inputs.value,
- _position = U.MD.F.S.SearchPostion,
- _searchel = _childs[_position]
- ;
-
- if (_searchvalue == "" || _searchvalue == inputs.defaultValue) {
- el.style.display = "none";
- }
-
- else if (_position > -1 && _keycode == 13 || _keycode == 10 && _childs[_position].onmousedown) {
- _childs[_position].onclick();
- }
-
- else if (_keycode != 38 && _keycode != 40) {
- U.MD.F.S.SearchPostion = -1;
- return true;
- }
- return false;
- }
- U.MD.F.S.printSearchFriends = function (friendinfo, el, cb) {
- var i,
- _name,
- _tempel,
- _temponeel,
- _temptwoel,
- _frag = $$("frag"),
- _childs = U.selectEl(el).Child();
-
- if (!friendinfo[0]) {
- $$("div", { "className": "U_MD_F_S_Local_NoData", "innerText": "很抱歉,没有找到您搜索的好友" }, el);
- } else {
-
- for (i = 0; i < friendinfo.length; i++) {
- (function (i) {
-
- _name = friendinfo[i].GroupManageName || friendinfo[i].FriendsDescript || friendinfo[i].UserNickName || friendinfo[i].UserName;
-
- _tempel = $$("div", {
- "title": "点击查看",
- "className": "U_MD_F_S_Local_Result",
-
-
-
- "onclick": function () {
- U.MD.F.W.popupFriendsForm(friendinfo[i]);
- U.MD.F.S.hideSearchFriendsOrGroupForm(el);
- }
- }, _frag);
- _temptwoel = $$("div", { "className": "U_MD_F_H_ZLZOCOI", "title": _name }, _tempel);
- if (friendinfo[i].GroupManageID) {
- U.MD.F.printGroupHeadImage(friendinfo[i], _temptwoel, 4, [35, 35]);
- } else {
- $$("img", { "onerror": U.MD.C.imgError, "className": "U_MD_HomeSSZJDAO", "src": U.MD.C.getHeadImage(friendinfo[i].UserThumbnailImageHead) }, _temptwoel);
- }
- $$("span", { "className": "U_MD_F_S_Local_UserName", "innerHTML": _name }, _tempel);
- })(i);
- }
- el.appendChild(_frag);
- }
- U.MD.F.S.SearchPostion = -1;
- return _childs;
- }
- U.MD.F.S.switchSearchFriendsOrGroup = function (el, switchposition) {
- var _switchel,
- _top,
- _scrolltop,
- _isswitch = null,
- _keycode = event.keyCode,
- _childs = U.selectEl(el).Child(),
- _postion = U.MD.F.S.SearchPostion,
- _index = switchposition || U.MD.F.S.SearchPostion,
- _nowswitchel = _index > -1 ? _childs[switchposition || U.MD.F.S.SearchPostion] : null
- ;
- if (_keycode == 38) {
- _isswitch = -1
- } else if (_keycode == 40) {
- _isswitch = 1
- }
-
- if (_isswitch || (switchposition != null && switchposition != _postion)) {
-
- if (switchposition != null) {
- U.MD.F.S.SearchPostion = switchposition;
- }
-
- else {
- U.MD.F.S.SearchPostion += _isswitch;
- }
-
- if (U.MD.F.S.SearchPostion > _childs.length - 1) {
- U.MD.F.S.SearchPostion = 0;
- } else if (U.MD.F.S.SearchPostion < 0) {
- U.MD.F.S.SearchPostion = _childs.length - 1;
- }
- switchposition = U.MD.F.S.SearchPostion;
- _switchel = _childs[switchposition];
-
- if (_switchel) {
- U.selectEl('.U_MD_F_S_Local_Result_Hover').removeClass('U_MD_F_S_Local_Result_Hover')
- _switchel.className = "U_MD_F_S_Local_Result U_MD_F_S_Local_Result_Hover";
-
- _top = _switchel.offsetTop;
- _scrolltop = el.scrollTop;
- if (_top > el.offsetHeight + _scrolltop - 40) {
- el.scrollTop = _top - el.offsetHeight;
- }
- if (_top < el.scrollTop) {
- el.scrollTop = _top;
- }
- }
- }
- }
- U.MD.F.S.hideSearchFriendsOrGroupForm = function (el) {
- el.style.display = "none";
- U.selectEl(el).prev().Child()[0].value = "联系人、好友讨论组";
- }
- U.MD.F.S.popupsSearchGroups = function () {
-
- var _form = new U.UF.UI.form('<div class="U_MD_F_S_TO U_MD_F_S_TR">群文档搜索查看区域</div><div class="U_MD_F_S_TD" onmousedown="U.UF.EV.stopBubble();"><div class="U_MD_F_S_TDL"><input id="U_MD_F_S_GF_Search" value="群文档搜索" onblur="U.UF.MR.inputPlaceholder(this,\'\',\'群文档搜索\');" onfocus="U.UF.MR.inputPlaceholder(this,\'群文档搜索\',\'\');" placeholder="群文档搜索" onkeyup="if (event.keyCode == 13 || event.keyCode == 10) {$(this).parentElement(2).Child()[1].onclick();}" /></div><div id="U_MD_F_S_TDR_GF" class="U_MD_F_S_TDR">搜索</div></div>',
- "<div class='U_MD_F_S_CX'></div><div class='U_MD_F_S_CD'></div>", { "onresize": U.MD.F.S.searchGroupsFormSize, "id": "U_MD_F_S", "style": { "width": "71.5%", "height": "70%" } }, null, { "style": { "padding": "10px 0" } });
- var _formel = _form.form;
- U.selectEl(_formel).find("input")[0].focus();
- U.selectEl('#U_MD_F_S_TDR_GF')[0].onclick = function () {
- U.MD.F.S.searchAjax(1, 1, _formel.children[2].children[0], U.selectEl('#U_MD_F_S_GF_Search')[0])
- }
- U.MD.F.S.searchGroupsFormSize(_formel);
- U.MD.F.S.searchAjax($(_form.middle).Child()[1], 1, _formel.children[2].children[0], U.selectEl('#U_MD_F_S_GF_Search')[0]);
- return _formel;
- }
- U.MD.F.S.popupsSearchFtp = function () {
- var _form = new U.UF.UI.form('<div class="U_MD_F_S_TO U_MD_F_S_TR">FTP共享区域查看</div><div class="U_MD_F_S_TD" onmousedown="U.UF.EV.stopBubble();"><div class="U_MD_F_S_TDL"><input id="U_MD_F_S_FTP_Search" value="FTP搜索" onblur="U.UF.MR.inputPlaceholder(this,\'\',\'FTP搜索\');" onfocus="U.UF.MR.inputPlaceholder(this,\'FTP搜索\',\'\');" placeholder="FTP搜索" onkeyup="if (event.keyCode == 13 || event.keyCode == 10) {$(this).parentElement(2).Child()[1].onclick();}" /></div><div id="U_MD_F_S_TDR" class="U_MD_F_S_TDR">搜索</div></div>',
- "<div class='U_MD_F_S_CX'></div><div class='U_MD_F_S_CD'></div>", { "onresize": U.MD.F.S.searchGroupsFormSize, "id": "U_MD_F_F", "style": { "width": "70%", "height": "70%" } }, null, { "style": { "padding": "10px 0" } });
- var _formel = _form.form;
- U.selectEl('#U_MD_F_S_TDR')[0].onclick = function () {
- U.MD.F.S.searchAjax(1, 0, U.selectEl("#U_MD_F_F")[0].children[2].children[0], U.selectEl("#U_MD_F_S_FTP_Search")[0])
- }
- U.selectEl(_formel).find("input")[0].focus();
- U.MD.F.S.searchGroupsFormSize(_formel);
- U.MD.F.S.searchAjax($(_form.middle).Child()[1], 0, _formel.children[2].children[0], U.selectEl('#U_MD_F_S_FTP_Search')[0]);
- return _formel;
- }
- U.MD.F.S.searchGroupsFormSize = function (contentel) {
- var _parentel = U.selectEl(contentel).Parent(3);
- contentel.style.width = Math.floor(_parentel.offsetWidth / 225) * 225 + "px";
- U.selectEl(contentel).Parent().style.height = _parentel.offsetHeight - 125 + "px";
- }
- U.MD.F.S.searchAjax = function (page, isgroupserch, contentel, inputel) {
- var _searchvalue = inputel.value == inputel.defaultValue ? "" : inputel.value;
-
- if (_searchvalue != "") {
- U.MD.F.S.searchGroupOrFriend(page, isgroupserch, contentel, inputel);
- }
-
- else {
- U.MD.F.S.getHotFriendOrGroup(1, isgroupserch, contentel);
- }
- }
- U.MD.F.S.searchGroupOrFriend = function (page, isgroupserch, contentel, inputel) {
- var _searchvalue = inputel.value == inputel.defaultValue ? "" : inputel.value,
- _end = page * 80,
- _start = _end - 79,
- _loadingel = page > 1 ? U.selectEl(contentel).parentElement(2).Child()[2] : U.selectEl(contentel).parentElement()[0];
-
- if (isgroupserch) {
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SearchGroupInfo", _searchvalue, _start, _end],
- U.MD.F.S.ajaxSearchAjax, [_loadingel, page, _searchvalue, contentel, isgroupserch]);
- }
-
- else {
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SearchFriendInfo", US.userInfo.userid || US.EMPTYGUID, _searchvalue, _start, _end],
- U.MD.F.S.ajaxSearchAjax, [_loadingel, page, _searchvalue, contentel, isgroupserch]);
- }
-
- U.UF.EV.scrollLoad($(contentel).Parent(), function () {
- U.MD.F.S.searchAjax(page + 1, isgroupserch, contentel, inputel);
- });
- }
- U.MD.F.S.getHotFriendOrGroup = function (page, isgroup, el) {
- var i,
- _loadingel = page > 1 ? U.selectEl(el).parentElement(2).Child()[2] : U.selectEl(el).parentElement()[0],
- _end = page * 80,
- _start = _end - 79;
-
- if (page == 1) {
-
- U.UF.EV.scrollLoad($(el).Parent(), function () {
- U.MD.F.S.getHotFriendOrGroup(page + 1, isgroup, el);
- });
- }
-
- if (isgroup) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "RecommendGroups", _start, _end],
- U.MD.F.S.asynGetHotFriendOrGroup, [_loadingel, el, isgroup]);
- }
-
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetFtpHotUser", _start, _end],
- U.MD.F.S.asynGetHotFriendOrGroup, [_loadingel, el, isgroup]);
- }
- }
- U.MD.F.S.asynGetHotFriendOrGroup = function (r) {
- var _context = r.context,
- _el = _context[1],
- _isgroup = _context[2];
- r = r.value;
-
- U.MD.F.S.printSearchContent(r, _el, _isgroup);
-
- if (r.length < 80) {
- U.selectEl(_el).Parent().onscroll = null;
- }
- }
- U.MD.F.S.ajaxSearchAjax = function (r) {
-
- var _context = r.context,
- _page = _context[1],
- _searchvalue = _context[2],
- _el = _context[3],
- _isgroup = _context[4];
- r = r.value;
-
- if (_page == 1) {
- _el.innerHTML = "";
-
- if (!r || !r.length) {
- U.MD.F.S.printNullSearch(_el);
- }
- }
-
- if (r && r.length) {
- U.MD.F.S.printSearchContent(r, _el, _isgroup);
- }
- }
- U.MD.F.S.printSearchContent = function (friendsinfo, el, isgroup) {
- var i, _el, _tempel, _tempela, _tempelb, _tempelc, _arr,
- _userid = US.userInfo.userid || "",
- _frag = $$("frag");
- if (isgroup) {
- _arr = ["GroupManageName", "+加群"];
- } else {
- _arr = ["UserNickName", "+好友"];
- }
-
- for (i = 0; i < friendsinfo.length; i++) {
- _el = $$("div", {
- "className": "U_MD_F_S_Pop_Content_G U_MD_D_Radius_5",
- "onclick": U.UF.C.closure(function (friendinfo) {
- if (isgroup) { } else {
- U.MD.D.I.openApplication("disk", { "userid": friendinfo.UserId, "directoryid": US.FTPFOLDERID });
- }
- }, [friendsinfo[i]])
- }, _frag);
- _tempel = $$("div", { "className": "U_MD_F_S_Pop_Content_G_T" }, _el);
- _tempela = $$("div", { "className": "U_MD_F_S_Pop_Content_G_T_L" }, _tempel);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "src": isgroup ? "" : U.MD.C.getHeadImage(friendsinfo[i]["UserThumbnailImageHead"]),
- "title": friendsinfo[i][_arr[0]],
- "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
-
- if (isgroup) { }
-
- else {
- U.MD.U.V.ViewOtherUserInfo(friendinfo.UserId);
- }
- }, [friendsinfo[i]])
- }, _tempela);
- _tempelb = $$("div", { "className": "U_MD_F_S_Pop_Content_G_T_R" }, _tempel);
- $$("div", { "className": "U_MD_F_S_Pop_Content_G_T_R_T U_MD_D_Text_Abbreviation", "innerHTML": friendsinfo[i][_arr[0]] }, _tempelb);
- $$("div", { "className": "U_MD_F_S_Pop_Content_G_T_R_C U_MD_D_Text_Abbreviation", "innerHTML": (isgroup ? "目前人数:" : "目前好友:") + (friendsinfo[i].FCount || 0) }, _tempelb);
- $$("div", { "className": "U_MD_F_S_Pop_Content_G_T_R_B U_MD_D_Text_Abbreviation", "innerHTML": "ftp文件:" + (friendsinfo[i].DCount || 0) }, _tempelb);
- _tempelc = $$("div", { "className": "U_MD_F_S_Pop_Content_G_B" }, _el);
- $$("div", {
- "className": "U_MD_F_S_Pop_Content_G_B_A U_MD_D_Radius_5",
- "innerHTML": _arr[1],
- "onclick": U.UF.C.closure(function (friendinfo) {
- U.UF.EV.stopBubble();
-
- if (isgroup) { U.MD.F.J.addUsersToGroup(friendinfo); }
-
- else { U.MD.F.M.addFriend(friendinfo); }
- }, [friendsinfo[i]])
- }, _tempelc);
- }
- el.appendChild(_frag);
- }
- U.MD.F.S.printNullSearch = function (el) {
- $$("div", { "className": "U_MD_F_S_CXT", "innerHTML": "暂无搜索消息, 请稍候搜索。" }, el);
- }
- U.MD.F.S.popSearchFriendsOrGroupForm = function (defaultindex) {
- var _searchel = U.selectEl("#U_MD_F_S_Pop")[0],
- _contentel = U.selectEl($(_searchel).Child()[1]).Child()[0],
- _inputel = U.selectEl("input", _searchel)[0];
- _searchel.style.display = "block";
-
- var _form = new U.UF.UI.form("查找好友/群",
- _searchel, {
- "onresize": function () { U.MD.F.S.searchGroupsFormSize(_contentel); },
- "id": "U_MD_F_S",
- "style": {
- "width": "70%",
- "height": "70%"
- }
- }, null);
- var _formel = _form.form;
- _inputel.focus();
- U.MD.F.S.searchGroupsFormSize(_contentel);
- U.MD.F.S.searchFriendsOrGroupFormClick($("span", _searchel)[defaultindex]);
- return _formel;
- }
- U.MD.F.S.clickSearch = function (el) {
- var i,
- _changeel,
- _topel = U.selectEl(el).Parent(2),
- _childel = U.selectEl($(_topel).Child()[0]).Child();;
- for (i = 0; i < _childel.length; i++) {
- _changeel = U.selectEl(_childel[i]).Child()[0];
- if (_changeel.className == "U_MD_F_S_Pop_Head_Nav_fonto") {
- U.MD.F.S.searchFriendsOrGroupFormClick(_changeel);
- return;
- }
- }
- }
- U.MD.F.S.searchFriendsOrGroupFormClick = function (el) {
- var i, j,
- _changeel,
- _parentel = U.selectEl(el).Parent(2),
- _childel = U.selectEl(_parentel).Child(),
- _topel = U.selectEl(_parentel).Parent(2),
- _contentel = U.selectEl($(_topel).Child()[1]).Child()[0],
- _inputel = U.selectEl("input", _topel)[0];
-
- for (i = 0; i < _childel.length; i++) {
- _changeel = U.selectEl(_childel[i]).Child()[0];
-
- if (_changeel == el) {
- el.className = "U_MD_F_S_Pop_Head_Nav_fonto";
- j = i;
- }
-
- else {
- _changeel.className = "";
- }
- }
- _contentel.innerText = "";
- U.MD.F.S.searchAjax(1, j == 1, _contentel, _inputel);
- }
- Namespace.register("U.MD.F.W");
- U.MD.F.W.viewFriend = U.MD.F.W.SLHCK = function (friendinfo) {
-
- if (!(U.MD.U.L.isLogin())) {
- var _childs,
- _friendel;
-
- if (friendinfo) {
-
- if (friendinfo.UserId == US.userInfo.userid) {
- U.alert("无法与本人聊天!");
- } else {
-
- _friendel = U.selectEl("#U_MD_F_H_RCO").find("[tid='" + friendinfo.UserId + "']")[0];
-
- if (_friendel) {
- _friendel.onclick();
- }
-
- else {
- U.MD.F.W.popupFriendsForm(friendinfo);
- }
- }
- }
-
- else {
- _childs = U.selectEl("#U_MD_F_H_RCO").Child();
- friendinfo = (US.friend.recentcontacts[0] || US.friend.friends[0]);
-
- if (_childs.length) {
- _childs[0].onclick();
- }
-
- else {
-
- if (friendinfo && friendinfo.tf) {
- friendinfo = U.Json.select(US.friend.group, { "GroupManageID": friendinfo.UserId })[0];
- }
- U.selectEl("#U_MD_F_H_ZRO").remove();
-
- U.MD.F.W.popupFriendsForm(friendinfo);
-
- if (!friendinfo || (!friendinfo.UserId && !friendinfo.GroupManageID)) {
- U.MD.F.W.recommendFriend($("#U_MD_F_H_ZR")[0], 0);
- }
- }
- }
- }
- }
- U.MD.F.W.printRecommendFriend = function (friendinfo, el, page) {
-
- var _tempel,
- _temponeel,
- _temptwoel,
- _tempthreeel,
- _tempfourel,
- _tempfiveel
- ;
-
- el.innerText = "";
-
- _tempel = $$("div", { "className": "U_MD_F_H_ZRO", "id": "U_MD_F_H_ZRO", "onmousedown": U.UF.EV.stopBubble });
- _temponeel = $$("div", { "className": "U_MD_F_H_ZROS" }, _tempel);
- $$("div", { "className": "U_MD_F_H_ZROSS", "innerHTML": "这里暂时没有任何内容哦" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_ZROSZ", "innerHTML": "Nothing!!" }, _temponeel);
- _temptwoel = $$("div", { "className": "U_MD_F_H_ZROSX" }, _temponeel);
- $$("div", { "className": "U_MD_F_H_ZROSXL", "innerHTML": "可尝试点击左边的头像,或追随一下的用户!" }, _temptwoel);
- $$("div", { "className": "U_MD_F_H_ZROSXR U_Img" }, _temptwoel);
- _temponeel = $$("div", { "className": "U_MD_F_H_ZROX" }, _tempel);
- _temptwoel = $$("div", { "className": "U_MD_F_H_ZROXT" }, _temponeel);
- $$("div", { "className": "U_MD_HomeSXLTTO U_MD_HomeSXROHTO", "innerHTML": "推荐追随" }, _temptwoel);
- $$("div", {
- "className": "U_MD_HomeSXLTTI U_Img",
- "onclick": function () {
- U.MD.F.W.recommendFriend(el, page);
- }
- }, _temptwoel);
- _temptwoel = $$("div", { "className": "U_MD_F_H_ZROXX" }, _temponeel);
-
- for (i = 0; i < friendinfo.length; i++) {
- _tempthreeel = $$("div", { "className": "U_MD_F_H_ZROXXO", "style": { "marginLeft": "65px" } }, _temptwoel);
- _tempfourel = $$("div", { "className": "U_MD_F_H_ZROXXOS" }, _tempthreeel);
- _tempfiveel = $$("div", { "className": "U_MD_F_H_ZROXXOSL" }, _tempfourel);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.ViewOtherUserInfo(friendinfo[i].UserId);
- },
- "src": U.MD.C.getHeadImage(friendinfo[i].UserThumbnailImageHead),
- "alt": friendinfo[i].UserName
- },
- _tempfiveel);
- $$("div", { "className": "U_MD_F_H_ZROXXOSN U_MD_D_Text_Abbreviation", "innerHTML": friendinfo[i].UserName }, _tempfourel);
- $$("div", {
- "className": "U_MD_F_H_ZROXXOSR",
- "title": "点击追随该用户",
- "innerHTML": "追随",
- "onclick": function () {
- U.MD.F.M.addFriend(friendinfo[i]);
- }
- },
- _tempfourel);
- _tempfourel = $$("div", { "className": "U_MD_F_H_ZROXXOX U_MD_HomeSXZLLZOOX" }, _tempthreeel);
- $$("div", { "className": "U_MD_F_W_S", "innerHTML": "▲" }, _tempfourel);
- $$("div", {
- "className": "U_MD_F_W_X",
- "innerHTML": friendinfo[i].UserIndividualitysignature ? friendinfo[i].UserIndividualitysignature.substring(0, 15).trim() : ("添加我为好友吧,分享我们的信息,让我们距离更近一步").trim()
- }, _tempfourel);
- }
-
- el.appendChild(_tempel);
- }
- U.MD.F.W.recommendFriend = function (el, page) {
- var _userinfo = US.userInfo,
- _start = page * 30,
- _end = (page + 1) * 30,
- _recommendfriend = US.friend.commonfriend.slice(_start, _end)
- ;
-
- if (_recommendfriend.length) {
- U.MD.F.W.printRecommendFriend(_recommendfriend, el, page + 1);
- }
-
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "RecommendFriends", _userinfo.UserId || US.EMPTYGUID, _userinfo.length, _userinfo.length + 4], U.MD.F.W.asynRecommendFriend, [el, el, page]);
- }
- }
- U.MD.F.W.asynRecommendFriend = function (r) {
- var _userinfo = US.userInfo,
- _context = r.context,
- _el = _context[1],
- _page = _context[2]
- ;
- r = r.value;
- _userinfo = US.friend.commonfriend.concat(r);
- U.MD.F.W.printRecommendFriend(r, _el, _page + 1);
- }
- U.MD.F.W.popupFriendsForm = function (friendinfo, el) {
-
- var _close;
- if (!U.MD.U.L.isLogin()) {
- var _friendform = U.selectEl("#U_MD_F_H_ZA")[0];
-
- if (!_friendform) {
- U.selectEl("#U_MD_F_H_Z")[0].style.display = "block";
-
- var _window = new U.UF.UI.form("<div class='U_MD_F_S_TI'>聊天对话</div>", U.selectEl("#U_MD_F_H_Z")[0], {
- "onresize": U.MD.F.W.reSize,
- "id": "U_MD_F_H_ZA",
- "style": {
- "display": "block",
- "height": "80%",
- "min-width": '882px'
- }
- }, {
- isstretching: false,
- isnarrow: false,
- closecallback: function () {
- U.MD.F.W.friendDisplayAndNone([{ "display": "none" }, { "display": "block" }], { "left": "auto", "right": "0px" });
- }
- });
- }
-
- else {
- U.UF.F.topWindow($("#U_MD_F_H_ZA")[0]);
- }
- if (friendinfo) {
- U.MD.F.W.openFriendChat(friendinfo);
- U.MD.F.N.canelMarkMessage(friendinfo);
- U.MD.F.W.addChecked(friendinfo);
- U.MD.F.W.reSize();
- }
- }
- }
- U.MD.F.W.switchFileOrGroup = function (friendinfo) {
- var infotid = (friendinfo.UserId == null) ? friendinfo.GroupManageID : friendinfo.UserId;
- if (infotid == friendinfo.UserId) {
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[1]).Child()[0].onclick();
- } else if (infotid == friendinfo.GroupManageID) {
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[2]).Child()[0].onclick();
- }
- }
- U.MD.F.W.openFriendChat = function (friendinfo) {
- var _friendfromel = U.selectEl("#U_MD_F_H_ZR")[0],
- _friendchatfrom = U.selectEl("#U_MD_F")[0],
- _userid = friendinfo.GroupManageID || friendinfo.UserId,
- _chatform = U.MD.F.W.isCreateForm(_userid),
- _isgroup = friendinfo.GroupManageID != null;
- _friendchatfrom.style.display = "block";
- _friendfromel.appendChild(_friendchatfrom);
-
- if (!_chatform) {
- _chatform = U.MD.F.W.createFriendChat(friendinfo);
- }
-
- U.MD.F.W.switchFriendsChat(_chatform, friendinfo);
-
- U.MD.F.H.getFriendOrGroupNews(_userid, function (r) {
- U.MD.F.N.asynReceiveMessages(_isgroup, _chatform[1], r.value);
- }, _isgroup);
- }
- U.MD.F.W.reSize = function () {
- U.MD.F.W.leftSize();
- if ($("#U_MD_F_H_ZA")[0]) {
- U.MD.F.W.chatBoxSize($("#U_MD_F_H_ZA")[0], U.MD.F.W.switchFriendsChat.Ele || U.selectEl("#U_MD_F")[0].childs[0].element[1]);
- }
- }
- U.MD.F.W.leftSize = function () {
-
- var _content = U.selectEl("#U_MD_F_H_ZA")[0];
- if (_content) {
-
- var _height = _content.offsetHeight,
- _childs = U.selectEl(".U_MD_F_H_ZL").Child();
-
- U.selectEl("#U_MD_F_H_ZLZ")[0].style.height = _height - _childs[0].offsetHeight - _childs[1].offsetHeight - 30 + "px";
- }
- }
- U.MD.F.W.chatBoxSize = function (el, chatel) {
- var i,
- _childs,
- _rightchilds = U.selectEl(chatel).Child(),
- _chatchilds = U.selectEl(chatel.parentNode).Child(),
- _height = el.offsetHeight,
- _width = chatel.offsetWidth;
-
- for (i = 0; i < _chatchilds.length; i++) {
-
- _childs = U.selectEl(_chatchilds[i]).Child();
- _childs[0].style.width = _width - _childs[1].offsetWidth - 1 + "px";
- _childs[1].style.height = _height - 90 + "px";
-
- U.selectEl(".U_MD_F_CA", _chatchilds[i]).css("height", _height - 380 + "px");
- }
- }
- U.MD.F.W.friendDisplayAndNone = function (style) {
- var _friendform = U.selectEl("#U_MD_F_H_ZA"),
- _friendright = U.selectEl("#U_MD_F_H_R");
- _friendform.addAttrArray({ "style": style[0] });
- _friendright.addAttrArray({ "style": style[1] });
- }
- U.MD.F.W.isCreateForm = function (friendid) {
- var i,
- _friendchatform = U.selectEl("#U_MD_F")[0];
- if (_friendchatform.childs) {
- for (i = 0; i < _friendchatform.childs.length; i++) {
- if (_friendchatform.childs[i].formid == friendid) {
- return _friendchatform.childs[i].element;
- }
- }
- }
- }
- U.MD.F.W.createFriendChat = function (friendandgroupinfo) {
-
- var _headel,
- _headimageel,
- _chatel,
- _chatleftel,
- _chatheadel,
- _chatheadimageel,
- _chatheadcontentel,
- _chatheadpromptel,
- _chatcontentel,
- _chatcontentnewsel,
- _chatnewsel,
- _chatnewsoneel,
- _chatnewstwoel,
- _chateditel,
- _chatbuttonel,
- _chatbuttonsendel,
- _chatrecordel,
- _buttondiv,
- _userid,
- _name,
- descript,
- _chatformel,
- _chatformchilds,
- _navichilds;
-
- _userid = friendandgroupinfo.GroupManageID ||
- friendandgroupinfo.UserId;
-
- _name = friendandgroupinfo.GroupManageName ||
- friendandgroupinfo.FriendsDescript ||
- friendandgroupinfo.UserNickName;
-
- descript = friendandgroupinfo.GroupManageDescript ||
- friendandgroupinfo.UserIndividualitysignature ||
- "暂时没有填写介绍..";
-
- _chatformel = U.selectEl("#U_MD_F")[0];
-
- _chatformchilds = U.selectEl(_chatformel).Child();
-
- _navichilds = U.selectEl(_chatformchilds[0]).Child();
-
- _headel = $$("div", {
- "className": "U_MD_F_TO",
- "onmousedown": U.UF.EV.stopBubble
- }, _navichilds[0], _navichilds[0].firstChild);
- _headimageel = $$("div", { "className": "U_MD_F_TOI" }, _headel);
- U.selectEl(_headel).attr("user", _userid);
-
- if (friendandgroupinfo.UserId) {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(friendandgroupinfo.UserThumbnailImageHead),
- "alt": friendandgroupinfo.UserNickName
- }, _headimageel);
- }
-
- else {
- U.MD.F.printGroupHeadImage(friendandgroupinfo, _headimageel, 4, [25, 25]);
- }
- $$("div", { "className": "U_MD_F_TON U_MD_D_Text_Abbreviation", "innerHTML": _name }, _headel);
- $$("div", {
- "className": "U_MD_F_TOC U_Img",
- "onclick": function () {
- U.MD.F.W.delteFriendChat(_userid, _chatformel, friendandgroupinfo);
- }
- }, _headel);
-
- _chatel = $$("div", { "className": "U_MD_F_NA" });
- _chatformchilds[1].insertBefore(_chatel, _chatformchilds[1].firstChild);
-
- _chatleftel = $$("div", { "className": "U_MD_F_N" }, _chatel);
-
- _chatheadel = $$("div", { "className": "U_MD_F_H" }, _chatleftel);
- _chatheadimageel = $$("div", { "className": "U_MD_F_HH" }, _chatheadel);
- if (friendandgroupinfo.GroupManageID) {
- U.MD.F.printGroupHeadImage(friendandgroupinfo, _chatheadimageel);
- U.selectEl(_chatheadimageel).addAttrArray({ onclick: function () { U.MD.F.J.groupInfoForm(friendandgroupinfo, _chatleftel); }, title: friendandgroupinfo["GroupManageName"] });
- } else {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "onclick": function () {
- U.UF.EV.stopBubble();
- if (U.MD.D.IsUseStudio) {
- U.MD.U.V.ViewOtherUserInfo(_userid);
- }
- },
- "src": U.MD.C.getHeadImage(friendandgroupinfo.UserThumbnailImageHead),
- "alt": friendandgroupinfo.UserNickName
- }, _chatheadimageel);
- }
- _chatheadcontentel = $$("div", { "className": "U_MD_F_HT U_MD_D_Text_Abbreviation" }, _chatheadel);
- $$("div", { "className": "U_MD_F_HTN", "innerHTML": _name }, _chatheadcontentel);
- $$("div", { "className": "U_MD_F_HTC", "innerHTML": (friendandgroupinfo.GroupManageDescript || friendandgroupinfo.UserIndividualitysignature || "暂时没有填写介绍..") }, _chatheadcontentel);
- _chatheadpromptel = $$("div", { "className": "U_MD_F_HG" }, _chatleftel);
- $$("div", { "className": "U_MD_F_GI U_Img" }, _chatheadpromptel);
- $$("div", { "className": "U_MD_F_GC", "innerHTML": "交谈中请勿轻信汇款、中奖信息、陌生电话..." }, _chatheadpromptel);
- $$("div", {
- "style": {
- "width": "10px",
- "height": "10px",
- "background-image": "url('/img/YS2017.png')",
- "display": "inline-block",
- "background-repeat": "no-repeat",
- "background-position": "-817px -482px",
- "float": "right",
- "margin": "8px"
- },
- "onclick": function () { _chatheadpromptel.style.visibility = "hidden"; }
- }, _chatheadpromptel);
-
- _chatcontentel = $$("div", { "className": "U_MD_F_CA" }, _chatleftel);
- _chatcontentnewsel = $$("div", { "className": "U_MD_F_C" }, _chatcontentel);
-
- _chatnewsel = $$("div", { "className": "U_MD_F_D", "style": { "position": "relative" } }, _chatleftel);
- _chatnewsoneel = $$("div", { "className": "U_MD_F_DA" }, _chatnewsel);
- _chatnewstwoel = $$("div", { "className": "U_MD_F_DT" }, _chatnewsoneel);
- _chateditel = $$("div", { "className": "U_MD_F_DC", "contentEditable": "true" }, _chatnewsoneel);
- $$("div", { "className": "U_MD_F_DJ U_Img" }, _chatnewsoneel);
-
- _chatface = $$("div", { "style": { "margin-top": "-194px", "margin-left": "14px" } }, _chatformel);
- _chatbuttonel = $$("div", { "className": "U_MD_F_X" }, _chatleftel);
- _chatbuttonsendel = $$("div", {
- "className": "U_MD_F_XE",
- "innerHTML": "发送(Ctrl+Enter)",
- "style": {
- "marginRight": "15px"
- },
- "onclick": function () {
- U.MD.F.H.sendFriendOrGroupChatMessage(friendandgroupinfo, _chateditel, _chatcontentnewsel, (friendandgroupinfo.UserId == null));
- }
- }, _chatbuttonel);
- $$("div", {
- "className": "U_MD_F_XC",
- "innerHTML": "关闭(n)",
- "onclick": function () {
- U.MD.F.W.friendDisplayAndNone([{ "display": "none" }, { "display": "block" }], { "left": "auto", "right": "0px" });
- }
- }, _chatbuttonel);
-
- _chatrecordel = $$("div", { "className": "U_MD_F_L" }, _chatel);
- $$("div", { "className": "U_MD_F_LA" }, _chatrecordel);
- $$("div", { "className": "U_MD_F_LB" }, _chatrecordel);
-
- _buttondiv = $$("div", {
- "className": "U_MD_F_DTF U_MD_F_W_Face",
- "title": "发送表情",
- "style": {
- "margin": "0",
- "position": "relative",
- "background": "url(/img/face.png) no-repeat 0",
- "background-size": "20px"
- }
- }, _chatnewstwoel);
- $$("button", {
- "style": {
- "opacity": "0",
- "width": "28px",
- "height": "28px"
- },
- "onmousedown": function () {
- U.MD.UI.face(_chatface, _chateditel);
- },
- "onclick": U.UF.EV.stopBubble
- }, _buttondiv);
- _chatheadimageel = $$("div", {
- "className": "U_MD_F_UploadPng U_Img",
- "title": "添加文件",
- "style": { "cssText": "margin-left:5px" },
- "onclick": function (e) {
- if ($(".U_MD_F_UploadInput")[0]) {
-
- U.selectEl(".U_MD_F_UploadInput")[0].remove();
- return;
- }
- var _firendinfo = friendandgroupinfo;
- var _div = $$("div", { "className": "U_MD_F_UploadInput", style: { "cssText": "width:154px;float:none;position:absolute;background-color:#fff;z-Index:999;border:1px solid #ccc;height:80px;text-align:center;top:26px;left:56px" } }, _chatheadimageel);
- var _local = $$("div", {
- "className": "U_MD_F_LoaclChose",
- innerHTML: "选择本地上传文件",
- style: { "cssText": "position:relative;float:none;width:100%;height:32px;margin:8px 0 0 0;line-height:32px" },
- onclick: function () {
- var _groupid,
- _ancestors,
- _directoryid = US.disk.Disks[US.userInfo.userid].directoryid,
- _dirinfo = U.Json.select(US.disk.Disks[US.userInfo.userid].directoryOrFiles, { "UserDirectoryID": _directoryid })[0];
-
- _ancestors = U.MD.DK.C.getAncestors(_dirinfo, US.disk.Disks[US.userInfo.userid]);
-
- if (_ancestors[_ancestors.length - 1].UserDirectoryID == US.FTPFOLDERID) {
- _groupid = US.disk.Disks[US.userInfo.userid].userInfo.UserId;
- }
-
- else {
- _groupid = _ancestors[_ancestors.length - 1].GroupID || "";
- }
- U.MD.UI.upload(
- "http://disk.1473.cn/USUpfile.ashx?typename=UploadFlashfile&DirectoryId=" + _directoryid + "&Encrypt=" + _groupid + "&UserId=" + US.userInfo.userid + "&IsF=true",
-
- function (r, fileinfo) {
- var _data = r.data
- ;
-
- try {
- _data = eval("0," + _data);
- } catch (e) { }
- var _fileInfo = {
- "UserFilesServerName": _data[0],
- "UserallDirectoryName": fileinfo.name,
- "UserDirectoryExtendType": U.UF.UP.getFileNameAndExtension(fileinfo.name)[1],
- "UserDirectorySize": _data[3],
- "UserDirectoryID": _data[2],
- "UserDirectoryUrl": _data[1]
- }
- U.MD.F.W.printMessageContent(_fileInfo.UserDirectoryExtendType, _fileInfo, _chatcontentnewsel, true, _firendinfo);
- },
-
- function (md5, fileinfo, cb) {
-
- U.A.Request(US.DISK, ["IfFileExistInsertDB", US.userInfo.userid, _directoryid, _groupid, fileinfo.size, md5, U.UF.UP.getFileNameAndExtension(fileinfo.name)[1], fileinfo.name],
-
- function (r) {
- var _userid = US.userInfo.userid;
- r = r.value;
-
- try {
- r = eval(r)[0];
- } catch (e) { }
-
- if (r) {
- var _fileInfo = {
- "UserFilesServerName": r.UserFilesServerName,
- "UserallDirectoryName": r.UserDirectoryName.addEllipsis(20),
- "UserDirectoryExtendType": U.UF.UP.getFileNameAndExtension(r.UserDirectoryName)[1],
- "UserDirectorySize": r.UserDirectorySize,
- "UserDirectoryID": r.UserDirectoryID,
- "UserDirectoryUrl": r.UserDirectoryUrl
- }
- U.MD.F.W.printMessageContent(_fileInfo.UserDirectoryExtendType, _fileInfo, _chatcontentnewsel, true, _firendinfo);
- cb(false);
- }
-
- else {
- cb(true);
- }
- });
- });
-
- U.UF.EV.stopBubble()
-
- U.selectEl(".U_MD_F_UploadInput").remove();
- }
- }, _div);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var _disk = $$("div", {
- "className": "U_MD_F_DiskChose",
- innerHTML: "选择网盘上传文件",
- style: { "cssText": "float:none;width:100%;height:32px;margin:0 0 0 0;line-height:32px" },
- onclick: function () {
-
- U.UF.EV.stopBubble()
- U.MD.DK.VW.choseFile(function (data) {
-
- U.MD.F.W.printMessageContent(data.UserDirectoryExtendType, data, _chatcontentnewsel, true, friendandgroupinfo);
-
- U.selectEl(".U_MD_F_UploadInput").remove();
- })
- }
- }, _div);
- U.UF.EV.stopBubble();
- }
- }, _chatnewstwoel);
- if (friendandgroupinfo.GroupManageID) {
- $$("div", {
- "className": "U_MD_F_DTS U_Img",
- "title": "网盘提交",
- "onclick": function () {
- U.MD.D.I.openApplication("disk", {
- "userid": US.userInfo.userid,
- "directoryid": friendandgroupinfo.GroupManageID
- });
- }
- }, _chatnewstwoel);
- }
- $$("div", {
- "className": "U_MD_F_DTJ U_Img",
- "title": "聊天记录",
- "onclick": function () {
- U.MD.F.H.viewFriendsChatRecords(_chatrecordel, friendandgroupinfo, 1, (friendandgroupinfo.UserId == null));
- }
- }, _chatnewstwoel);
- U.selectEl(_chateditel).bind("keydown", function () {
- if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10)) {
- _chatbuttonsendel.onclick();
- U.UF.EV.stopDefault();
- }
- });
- U.UF.E.initEditor(_chateditel);
- _headel.onclick = function () {
- U.MD.F.W.switchFriendsChat([_headel, _chatel], friendandgroupinfo);
- };
-
-
-
- if (_chatformel.childs == null) {
- _chatformel.childs = [];
- }
- _chatformel.childs.unshift({ "formid": _userid, "element": [_headel, _chatel], "info": friendandgroupinfo });
- return _chatformel.childs[0].element;
- }
- U.MD.F.W.switchFriendsChat = function (elements, friendorgroupinfo) {
- var i,
- _friendchatel,
- _topleftbottom,
- _chatel = U.selectEl(elements[1]).Parent(2),
- _topbottom = U.selectEl($(_chatel).Child()[0]).Child()[2],
- _chatchilds = U.selectEl(_chatel)[0].childs;
-
- if (_topbottom.children[0]) {
- _topbottom.children[0].remove();
- }
-
- for (i = 0; i < _chatchilds.length; i++) {
- _friendchatel = _chatchilds[i].element;
- if (_friendchatel[0] == elements[0] && _friendchatel[1] == elements[1]) {
- U.MD.F.W.switchFriendsChat.Ele = elements[1];
- U.selectEl(elements[0]).addClass("U_MD_F_TOT");
- U.selectEl(elements[1]).css("display", "block");
-
- U.selectEl(".U_MD_F_DC", elements[1])[0].focus();
- } else {
- U.selectEl(_friendchatel[0]).removeClass("U_MD_F_TOT");
- U.selectEl(_friendchatel[1]).css("display", "none");
- }
- }
-
- _topbottom.onclick = function () { U.MD.F.R.popupRightCornerMenu(friendorgroupinfo, _topbottom); };
- if (friendorgroupinfo.UserId) {
- _topleftbottom = "个人信息";
- } else {
- _topleftbottom = "创建群";
- }
- _topbottom.title = _topleftbottom;
-
- U.MD.F.W.chatBoxSize($(elements[1]).Parent(7), elements[1]);
- }
- U.MD.F.W.delteFriendChat = function (friendid, el) {
- var i, j,
- _chatinfo,
- _elements,
- _childs = U.selectEl(el)[0].childs;
- U.UF.EV.stopBubble();
-
- if (_childs.length == 1 && _childs[0].formid == friendid) {
- U.MD.F.W.friendDisplayAndNone([{ "display": "none" }, { "display": "block" }], { "left": "auto", "right": "0px" });
- } else {
-
- for (i = 0; i < _childs.length; i++) {
-
- if (_childs[i].formid == friendid) {
- _elements = _childs[i]["element"];
- for (j = 0; j < _elements.length; j++) {
- U.selectEl(_elements[j]).remove();
- }
- _childs.splice(i, 1);
-
- if (_elements[0].className.indexOf("U_MD_F_TOT") > -1) {
-
- _chatinfo = _childs[i] || _childs[i - 1];
-
- U.MD.F.W.switchFriendsChat(_chatinfo["element"], _chatinfo["info"]);
- }
- break;
- }
- }
- }
- }
- U.MD.F.W.delteAllFriendChat = function () {
- }
- U.MD.F.W.printFriendChatMessage = function (el, newsinfo, issend) {
- var i,
- _mydate,
- _month,
- _date,
- _contentel,
- _content,
- _chatcontentel,
- _contentoneel,
- _contentimgel,
- _chatcontentoneel,
- _chatcontentwordsel,
- _chatel = el.parentNode,
- _frag = $$("frag");
-
-
- if (issend) {
- _stylearray = ["U_MD_F_CT", " U_MD_F_CTLC U_MD_F_GCTLC", " U_MD_F_COLCOO", " U_MD_F_CTTO", " "];
- }
-
- else {
- _stylearray = ["U_MD_F_CO", "U_MD_F_CTLC_Receive U_MD_F_GCTLC", " U_MD_F_COLCOT", " U_MD_F_CTT"];
- }
-
- var _el;
- for (i = 0; i < newsinfo.length; i++) {
- _mydate = new Date();
- _month = _mydate.getMonth() + 1;
- _date = newsinfo[i]["Time"] || U.MD.F.N.getHoursMinutesSeconds(newsinfo[i]["GroupMessageSendTime"] || newsinfo[i]["MessageSendTime"], "Array");
- _contentBox = $$("div", { "style": { "margin": " 0 10px" } }, _frag);
-
- if (el.innerText == "") {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_date) }, _contentBox);
- }
-
- else {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "display": "none", "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_mydate.getFullYear() + "/" + _month + "/" + _mydate.getDate() + " " + _date) }, _contentBox);
- var _pastTime = _chatel.firstChild.lastChild.firstChild.innerText;
- if (_mydate.getTime() / 1000 - new Date(_pastTime).getTime() / 1000 >= 120) {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_date) }, _contentBox);
- }
- }
- _contentel = $$("div", { "className": _stylearray[0], "title": newsinfo[i].GroupMessageSendUsername || newsinfo[i].MessageDescript || newsinfo[i].Name }, _contentBox);
- _content = $$("div", {}, _contentel);
- _contentoneel = $$("div", { "className": "U_MD_F_COLC" + " " + _stylearray[1] }, _content);
- _contentimgel = $$("img", {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- 'i': i,
- "onclick": function () {
- U.MD.U.V.ViewOtherUserInfo(newsinfo[this.i].GroupMessageSendUser || newsinfo[this.i].UserId || newsinfo[this.i].MessageSendUserID);
- },
- "src": U.MD.C.getHeadImage((newsinfo[i].IMG || newsinfo[i].UserThumbnailImageHead || '/img/UserHead/UseHead.jpg' || U.selectEl('.U_MD_F_HH')[0].children[0].src)),
- "className": "U_MD_F_COLCI"
- }, _contentel);
-
- if (newsinfo[i].MessageIsVerify == 6) {
- var _filedata = JSON.parse(newsinfo[i].MessageContent),
-
- _filebox = $$('div', { style: { cssText: 'position:relative; padding: 10px; background-color: #fff; border:1px solid silver; overflow:hidden; cursor: pointer;' } }, _contentoneel)
- U.MD.F.W.printFileContent(_filedata, _filebox)
- } else {
- _el = newsinfo[i]["MessageContent"] || newsinfo[i]["GroupMessageContent"] || newsinfo[i]["Content"]
- if (U.UF.C.isElement(_el)) {
- _contentwordsel = $$("div", { "className": "U_MD_F_COLCO " + _stylearray[2] }, _contentoneel);
- U.selectEl(_el).appendTo(_contentwordsel);
- } else {
- _contentwordsel = $$("div", { "className": "U_MD_F_COLCO " + _stylearray[2], "innerHTML": _el }, _contentoneel);
- }
- }
- if (issend) {
- _contentoneimgel = $$("div", { "style": { "width": "6px", "height": "10px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-984px -344px", "margin": "10px 4px 10px 0px" } }, _content);
- _content.style.float = "right";
- _contentel.insertBefore(_contentimgel, _content);
- _contentimgel.style.float = "right";
- _content.style.marginRight = "8px";
- } else {
- _contentoneimgel = $$("div", { "style": { "width": "6px", "height": "10px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-1004px -344px", "margin": "10px 0px 10px 4px" } }, _content);
- _content.style.float = "left";
- _contentel.insertBefore(_contentimgel, _content);
- }
- }
- el.appendChild(_frag);
-
- _chatel.scrollTop = _chatel.scrollHeight - _chatel.offsetHeight;
- }
- U.MD.F.W.printGroupChatMessage = function (el, newsinfo, issend) {
- var i,
- _date,
- _contentel,
- _contentoneel,
- _contentwordsel,
- _contentimgel,
- _contentnameel,
- _stylearray,
- _chatcontentel = el.parentNode,
- _frag = $$("frag");
-
- if (issend) {
- _stylearray = ["U_MD_F_CT", " U_MD_F_CTLC U_MD_F_GCTLC", " U_MD_F_COLCOO", " U_MD_F_CTTO", " "];
- } else {
- _stylearray = ["U_MD_F_CO", "U_MD_F_CTLC_Receive U_MD_F_GCTLC", " U_MD_F_COLCOT", " U_MD_F_CTT"];
- }
-
- for (i = 0; i < newsinfo.length; i++) {
- var _i = i;
- var _isFile = true;
- var _mydate = new Date(),
- _month = _mydate.getMonth() + 1;
- _mydate.getHours();
- _mydate.getMinutes();
- _mydate.getSeconds();
- _date = newsinfo[i]["Time"] || U.MD.F.N.getHoursMinutesSeconds(newsinfo[i]["GroupMessageSendTime"]), "Array";
- _contentBox = $$("div", { "style": { "margin": " 0 10px" } }, _frag);
- if (el.innerText == "") {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_date) }, _contentBox);
- } else {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "display": "none", "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_mydate.getFullYear() + "/" + _month + "/" + _mydate.getDate() + " " + _date) }, _contentBox);
- var _pastTime = _chatcontentel.firstChild.lastChild.firstChild.innerText;
- if (_mydate.getTime() / 1000 - new Date(_pastTime).getTime() / 1000 >= 120) {
- _time = $$("div", { "className": "U_MD_F_COTO U_MD_F_CTO", "style": { "margin": " 0 10px", "text-align": "center", "color": "#aaaaaa", "font-size": "13px" }, "innerHTML": (_date) }, _contentBox);
- }
- }
- _contentel = $$("div", { "className": _stylearray[0], "title": newsinfo[i].GroupMessageSendUsername || newsinfo[i].MessageDescript || newsinfo[i].Name }, _contentBox);
- _content = $$("div", {}, _contentel);
- _contentoneel = $$("div", { "className": "U_MD_F_COLC" + " " + _stylearray[1] }, _content);
- _contentimgel = $$("img", {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "onclick": function () {
- U.MD.U.V.ViewOtherUserInfo(newsinfo[_i].GroupMessageSendUser || newsinfo[_i].UserId);
- },
- "src": U.MD.C.getHeadImage((newsinfo[i].IMG || newsinfo[i].UserThumbnailImageHead)),
- "className": "U_MD_F_COLCI"
- }, _contentel);
- if (_isFile) {
- _contentwordsel = $$("div", { "className": "U_MD_F_COLCO " + _stylearray[2], "innerHTML": newsinfo[i]["Content"] || newsinfo[i]["GroupMessageContent"] }, _contentoneel);
- } else {
- var _filedata = newsinfo[i].Content,
- _filebox = $$('div', {
- style: { cssText: 'position:relative; padding: 10px; background-color: #fff; border:1px solid silver; overflow:hidden; cursor: pointer;' },
- onclick: U.UF.C.closure(function (i, filedata) {
- var _type = '';
- switch (filedata.fileType) {
- case "uw":
- _type = 'word';
- break;
- case "ue":
- _type = 'excel';
- break;
- }
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", filedata.fileID]), function (r) {
- U.MD.D.I.openApplication(_type, r.value[0])
- });
- }, [i, _filedata])
- }, _contentoneel)
- $$('span', { className: 'U_MD_DK_RZOS U_MD_DK_Img U_MD_DK_RZOD' }, _filebox);
- $$('span', { style: { cssText: 'vertical-align: top; padding-left: 20px; padding-right: 40px;' }, innerText: _filedata.fileName + '.' + _filedata.fileType }, _filebox);
- $$('div', { style: { cssText: 'position: absolute; right: 10px; bottom: 10px;' }, innerText: '查看' }, _filebox)
- }
- if (issend) {
- _contentoneimgel = $$("div", { "style": { "width": "6px", "height": "10px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-984px -344px", "margin": "10px 4px 10px 0px" } }, _content);
- _content.style.float = "right";
- _contentel.insertBefore(_contentimgel, _content);
- _contentimgel.style.float = "right";
- _content.style.marginRight = "8px";
- } else {
- _contentoneimgel = $$("div", { "style": { "width": "6px", "height": "10px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-1004px -344px", "margin": "10px 0px 10px 4px" } }, _content);
- _content.style.float = "left";
- _contentel.insertBefore(_contentimgel, _content);
- }
- }
-
- el.appendChild(_frag);
-
- _chatcontentel.scrollTop = _chatcontentel.scrollHeight - _chatcontentel.clientHeight;
- }
- U.MD.F.W.addFile = function (friendinfo, el, thumbnail, fileurl, fileinfo) {
-
- var _tempel,
- _temponeel,
- _temptwoel,
- _tempthreeel,
- _isgroup = friendinfo.UserId == null;
-
- if (U.UF.UP.isImg(fileinfo.UserDirectoryExtendType)) {
-
- _tempel = $$("div", {});
-
- $$("img", { "onerror": U.MD.C.imgError, "className": "U_MD_F_CI", "src": U.MD.C.getHeadImage(thumbnail), "title": U.MD.C.getHeadImage(fileurl) },
- _messageel).onclick = "U.UF.EV.stopBubble();U.MD.I.Img(US.userInfo, { 'Thm': '" + fileurl + "', 'Img': '" + fileurl + "'})";
-
- U.MD.F.H.sendFriendOrGroupChatMessage(friendinfo, _messageel, el, _isgroup, true);
- }
-
- else {
- _tempthreeel = $$("div");
-
- _tempel = $$("div", { "className": "U_MD_F_F" }, _tempthreeel);
- _temponeel = $$("div", { "className": "U_MD_F_FS" }, _tempel);
- _temptwoel = $$("div", { "className": "U_MD_F_FSS" }, _temponeel);
- $$("div", { "innerHTML": fileinfo["UserDirectoryExtendType"] }, _temptwoel);
- _temptwoel = $$("div", { "className": "U_MD_F_FSX" }, _temponeel);
- $$("div", { "className": "U_MD_F_FSXN", "innerHTML": fileinfo["UserallDirectoryName"] }, _temptwoel);
- $$("div", { "className": "U_MD_F_FSXS", "innerHTML": "已成功发送" }, _temptwoel);
- _temponeel = $$("div", { "className": "U_MD_F_FX" }, _tempel);
-
- if (U.MD.D.IsUseStudio) {
- _tempel.onclick = "U.UF.EV.stopBubble();YDHJH('disk', ['" + fileinfo.UserId + "', '" + fileinfo.UserDirectoryID + "'])"
- _temptwoel = $$("div", { "innerHTML": "打开我的云盘", "title": "打开我的云盘" }, _temponeel);
- _temptwoel.onclick = "U.UF.EV.stopBubble();YDHJH('disk', ['" + fileinfo.UserId + "','" + fileinfo.UserDirectoryParentID + "'])";
- _temptwoel = $$("div", { "innerHTML": "打开", "title": "打开" }, _temponeel);
- _temptwoel.onclick = "U.UF.EV.stopBubble();YDHJH('disk', ['" + fileinfo.UserId + "','" + fileinfo.UserDirectoryID + "'])";
- }
-
- else {
- _temptwoel = $$("div", { "innerHTML": "下载", "title": "下载" }, _temponeel);
- _temptwoel.onclick = "U.UF.EV.stopBubble();U.UF.UP.download('" + fileinfo.UserallDirectoryName + "','" + fileinfo.UserFilesServerName + "')";
- }
-
- U.MD.F.H.sendFriendOrGroupChatMessage(friendinfo, _tempthreeel, el, _isgroup, true);
- }
- }
- U.MD.F.W.rightFormlocation = function () {
- U.selectEl("#U_MD_F_H_R").addAttrArray({
- "style": {
- "top": (US.height - 530) / 2,
- "right": "0px"
- }
- });
- }
- U.MD.F.W.printMessageContent = function (type, data, parent, send, friend) {
- var _content = $$('div', {}),
- _folder = $$("div", { style: { "cssText": "padding:8px;background:#fff;border-radius:2px;position:relative" } }, _content);
-
- var _message = {
- UserFilesServerName: data.UserFilesServerName,
- fileName: data.UserallDirectoryName,
- fileType: data.UserDirectoryExtendType,
- fileSize: data.UserDirectorySize,
- fileID: data.UserDirectoryID,
- fileUrl: data.UserDirectoryUrl,
- filetype: fileType = "folder" ? 1 : 0,
- UserDirectoryExtendType: data.UserDirectoryExtendType,
- UserDirectoryID: data.UserDirectoryID,
- UserallDirectoryName: data.UserallDirectoryName
- };
- U.MD.F.W.printFileContent(_message, _folder);
-
- var _newsinfo = [{
- "UserId": US.userInfo.userid,
- "Time": new Date().getHours() + ":" + new Date().getMinutes() + ":" + new Date().getSeconds(),
- "Content": _content,
- "IMG": US.userInfo.UserThumbnailImageHead,
- "Name": US.userInfo.UserNickName
- }];
-
- if (send) {
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SentMessageToFriend", US.userInfo.userid, friend.UserId, US.userInfo.UserNickName, JSON.stringify(_message), 6, false], function () { });
- }
-
- U.MD.F.W.printFriendChatMessage(parent, _newsinfo, true);
- }
- U.MD.F.W.printFileContent = function (data, parent) {
- var _content, _titile, _icon,
- _type = data.fileType.toLowerCase();
- switch (data.fileType) {
- case "folder":
- _content = $$("div", { style: { "cssText": "width:100%" } }, parent);
- $$("div", { "className": "U_MD_DK_RZOS U_MD_DK_Img U_MD_DK_RZOW", style: { "cssText": "float:none;display:inline-block;" } }, _content);
- _titile = $$("div", { "className": "", style: { "cssText": "display:inline-block;margin:0px 5px;width:155px;vertical-align:top;" } }, _content);
- $$("div", { innerHTML: data.fileName, style: { "cssText": "color:#000" } }, _titile);
- $$("div", { innerHTML: "(" + U.UF.UP.minUnitToMaxUnit(data.fileSize) + ")", style: { "cssText": "color:#aaaaaa;font-size:10px;line-height:10px" } }, _titile);
- $$("div", { onclick: function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid) }, innerHTML: "打开", style: { "cssText": "color:#429bfe;margin-top:-20px;text-align: right;cursor: pointer;" } }, parent);
- break;
- case "txt":
- case "html":
- case "uw":
- case "ue":
- _content = $$("div", { style: { "cssText": "width:100%" } }, parent);
- $$("div", { "className": "U_MD_DK_RZOD U_MD_DK_RZOS", style: { "cssText": "float:none;display:inline-block;" } }, _content);
- _titile = $$("div", { "className": "", style: { "cssText": "display:inline-block;margin:0px 5px;width:155px;vertical-align:top;" } }, _content);
- $$("div", { innerHTML: data.fileName, style: { "cssText": "color:#000" } }, _titile);
- $$("div", { onclick: function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid) }, innerHTML: "查看", style: { "cssText": "color:#429bfe;margin-top:-20px;text-align: right;cursor: pointer;" } }, parent);
- break;
- case "jpg":
- case "png":
- $$("img", { "onclick": function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid) }, "onerror": U.MD.C.imgError, "src": "http://fs.1473.cn/" + data.fileUrl, "style": { "cssText": "width:100%;max-width:300px;min-width:30px;min-height:30px" } }, parent);
- break;
- case "mp4":
- if (parent.parentElement.className == "U_MD_F_LO") {
- _content = $$("div", { style: { "cssText": "width:100%" } }, parent);
- $$("div", { "className": "U_MD_DK_RZOS U_MD_DK_VIDEO", style: { "cssText": "float:none;display:inline-block;width:40px;height:40px;background-image:url('/img/YS2017.png');background-repeat:no-repeat;background-position:-1081px -527px;" } }, _content);
- _titile = $$("div", { "className": "", style: { "cssText": "display:inline-block;margin:0px 5px;width:155px;vertical-align:top;" } }, _content);
- $$("div", { innerHTML: data.fileName, style: { "cssText": "color:#000" } }, _titile);
- $$("div", { onclick: function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid) }, innerHTML: "查看", style: { "cssText": "color:#429bfe;margin-top:-20px;float:right" } }, parent);
- } else {
- $$("img", { "onerror": U.MD.C.imgError, "src": "http://fs.1473.cn/" + data.fileUrl, "style": { "cssText": "width:100%;max-width:300px;" } }, parent);
- _content = $$("div", {}, parent);
- $$("div", { onclick: function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid) }, "style": { "width": "97px", "height": "96px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-1015px -362px", "position": "absolute", "top": "25%", "left": "28%" } }, _content);
- $$("div", { "innerHTML": data.fileName, "style": { "cssText": "color:white;font-size:16px;position: absolute;top: 137px;margin-left: 10px;" } }, _content);
- $$("span", { "innerHTML": U.UF.UP.minUnitToMaxUnit(data.fileSize), "style": { "cssText": "color:#d4d3d1;font-size:14px;position: absolute;top: 155px;margin-left: 10px;" } }, _content);
- $$("span", { "innerHTML": "已发送", "style": { "cssText": "color:#d4d3d1;font-size:14px;position: absolute;top: 155px;right:20px" } }, _content);
- }
- break;
- default:
- _content = $$("div", { style: { "cssText": "width:100%" } }, parent);
- _icon = $$("div", { "className": "U_MD_DK_RZOS U_MD_DK_Img downel_content_a_r", style: { "cssText": "float:none;display:inline-block;" } }, _content);
- $$("div", { "className": "U_MD_DK_RZOSZ", 'innerHTML': data.fileType }, _icon);
- _titile = $$("div", { "className": "", style: { "cssText": "display:inline-block;margin:0px 5px;width:155px;vertical-align:top;" } }, _content);
- $$("div", { innerHTML: data.fileName, style: { "cssText": "color:#000" } }, _titile);
- $$("div", { innerHTML: "(" + U.UF.UP.minUnitToMaxUnit(data.fileSize) + ")", style: { "cssText": "color:#aaaaaa;font-size:10px;line-height:10px" } }, _titile);
- $$("div", { "onclick": function () { U.MD.DK.LE.openFileDirectory(data, US.userInfo.userid); }, innerHTML: "打开", style: { "cssText": "color:#429bfe;margin-top:-20px;text-align: right;cursor: pointer;" } }, parent);
- break;
- };
- }
- U.MD.F.W.addChecked = function (friendinfo) {
- var _infotid = friendinfo.UserId || friendinfo.GroupManageID;
- if ($('.U_MD_F_H_ZLZOCOChecked')[0]) {
- U.UF.EL.removeClass($('.U_MD_F_H_ZLZOCOChecked')[0], "U_MD_F_H_ZLZOCOChecked");
- }
- if ($("[tid='" + _infotid + "']")[0]) {
- U.UF.EL.addClass($("[tid='" + _infotid + "']")[0], "U_MD_F_H_ZLZOCOChecked");
- }
- };
- Namespace.register("U.MD.F.H");
- U.MD.F.H.viewFriendsChatRecords = function (el, friendandgroupinfo, page, isgroup) {
-
- if (el.style.display == "block") {
- el.style.display = "none";
- U.MD.F.W.chatBoxSize($(el).Parent(3), U.selectEl(el).Parent());
- }
-
- else {
- U.selectEl(el).Child()[1].innerHTML = "";
- U.MD.F.H.chatRecord(el, friendandgroupinfo, page, isgroup);
- el.style.display = "block";
- }
- U.MD.F.W.chatBoxSize($(el).Parent(8), U.selectEl(el).Parent());
- }
- U.MD.F.H.chatRecord = function (el, friendandgroupinfo, page, isgroup) {
- var _end = page * 20,
- _start = _end - 20;
-
- if (isgroup) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetGroupChatHistory", friendandgroupinfo.GroupManageID, _start, _end], U.MD.F.H.asynChatRecord, ["", el, friendandgroupinfo, page, isgroup]);
- }
-
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetFriendChatHistory", US.userInfo.userid, friendandgroupinfo.UserId, _start, _end], U.MD.F.H.asynChatRecord, ["", el, friendandgroupinfo, page, isgroup]);
- }
- }
- U.MD.F.H.asynChatRecord = function (r) {
- var _context = r.context,
- _recentcontactsel = _context[1],
- _friendandgroupinfo = _context[2],
- _page = _context[3],
- _isgroup = _context[4],
- _childs = U.selectEl(_recentcontactsel).Child();
- r = r.value;
- _childs[0].innerText = "";
- if (r.length) {
-
- U.MD.F.H.printChatRecord(_childs[0], r, _friendandgroupinfo);
-
- _childs[0].scrollTop = _childs[0].scrollHeight;
-
-
-
-
-
-
-
- if (!$("div", _childs[1]).length) {
- var _calendarinput,
- _date = new Date(),
- _allpage = Math.ceil(r[0].AllC / 20),
- _month = _date.getMonth() + 1;
- $$("div", {
- "style": { "width": "16px", "height": "17px", "background-image": "url('/img/YS2017.png')", "display": "inline-block", "background-repeat": "no-repeat", "background-position": "-855px -481px", "margin": "5px 0 5px 61px" },
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.selectEl(document).bind("click", function (e) {
- U.selectEl(".U_MD_UI_calendar_bigboard")[0].style.cssText = "display:none";
- })
- U.MD.UI.calendar(_calendarinput, _calendarPlace, false);
- }
- }, _childs[1]);
- $$("div", {
- "className": "U_MD_F_H_checkAllCalendar",
- "style": { "width": "49px", "height": "19px", "position": "absolute", "bottom": "-1px", "right": "222px", "line-height": "19px", "display": "inline-block", "margin": "5px 0 7px 0px", "text-align": "center", "border-radius": "3px", "border": "1px solid #ccc", "cursor": "pointer" },
- "innerHTML": "全部",
- onclick: function () {
- _calendarinput.value = '';
- _childs[0].innerText = "";
-
- U.MD.F.H.printChatRecord(_childs[0], r, _friendandgroupinfo);
-
- _childs[0].scrollTop = _childs[0].scrollHeight;
- }
- }, _childs[1]);
- _calendarinput = $$("input", { "value": _date.getFullYear() + "-" + _month + "-" + _date.getDate(), "readOnly": "true", "style": { "width": "68px", "height": "17px", "display": "block", "margin": "5px 0 5px 5px", "position": "absolute", 'bottom': '2px', 'left': "76px", 'border': '0px' } }, _childs[1]);
- $$("div", {
- "style": { "width": "13px", "height": "18px", "background-image": "url('/img/YS2017.png')", "background-position": "-891px -481px", "display": "inline-block", "margin": "5px 20px 4px 76px" },
- onclick: function () {
-
- _page = Math.ceil(r[0].AllC / 20);
- U.MD.F.H.chatRecord(_recentcontactsel, _friendandgroupinfo, _page, _isgroup);
- }
- }, _childs[1]);
- $$("div", {
- "style": { "width": "11px", "height": "18px", "background-image": "url('/img/YS2017.png')", "background-position": "-924px -481px", "display": "inline-block", "margin": "5px 20px 4px 0px" },
- onclick: function () {
- if (_page <= _allpage - 1) {
- _page++;
- U.MD.F.H.chatRecord(_recentcontactsel, _friendandgroupinfo, _page, _isgroup);
- }
- }
- }, _childs[1]);
- $$("div", {
- "style": { "width": "10px", "height": "17px", "background-image": "url('/img/YS2017.png')", "background-position": "-957px -481px", "display": "inline-block", "margin": "5px 20px 4px 0px" },
- onclick: function () {
- if (_page > 1) {
- _page--;
- U.MD.F.H.chatRecord(_recentcontactsel, _friendandgroupinfo, _page, _isgroup);
- }
- }
- }, _childs[1]);
- $$("div", {
- "style": { "width": "13px", "height": "18px", "background-image": "url('/img/YS2017.png')", "background-position": "-987px -481px", "display": "inline-block", "margin": "5px 13px 4px 0px" },
- onclick: function () {
-
- _page = 1;
- U.MD.F.H.chatRecord(_recentcontactsel, _friendandgroupinfo, _page, _isgroup);
- }
- }, _childs[1]);
- _calendarPlace = $$('div', { "style": { cssText: "position:absolute; bottom: 400px; right:317px" } }, _childs[1]);
- U.MD.UI.calendar.SetCallBack("CheckedDay", function () { U.MD.F.H.asynGetRecordByCalendar(_calendarinput.value, _friendandgroupinfo, _childs[0]); });
- }
- } else {
- U.alert("暂无消息记录");
- }
- }
- U.MD.F.H.asynGetRecordByCalendar = function (calenderday, friendandgroupinfo, contactsel) {
- var _previousdate = calenderday,
- _nextdate = U.MD.F.H.asynGetNextDay(_previousdate),
- _userid = friendandgroupinfo.UserId ? friendandgroupinfo.UserId : friendandgroupinfo.GroupManageID;
- if (friendandgroupinfo.UserId) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetFriendChatHistoryByDate",
- US.userInfo.userid, _userid, _previousdate, _nextdate
- ], function (r) {
- contactsel.innerText = "";
- U.MD.F.H.printChatRecord(contactsel, r.value, friendandgroupinfo);
- }, [contactsel, friendandgroupinfo]);
- } else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetGroupChatHistoryByDate",
- _userid, _previousdate, _nextdate
- ], function (r) {
- contactsel.innerText = "";
- U.MD.F.H.printChatRecord(contactsel, r.value, friendandgroupinfo);
- }, [contactsel, friendandgroupinfo]);
- }
- }
- U.MD.F.H.asynGetNextDay = function (date) {
- var _currdate = new Date(date),
- _nextdate = new Date(_currdate.getTime() + 24 * 60 * 60 * 1000),
- _nextdateyear = (_nextdate.getFullYear().toString())[1] ? _nextdate.getFullYear() : '0' + _nextdate.getFullYear(),
- _nextdatemonth = (_nextdate.getMonth().toString())[1] ? (_nextdate.getMonth() + 1) : '0' + (_nextdate.getMonth() + 1),
- _nextdateday = (_nextdate.getDate().toString())[1] ? _nextdate.getDate() : '0' + _nextdate.getDate(),
- _nextday = _nextdateyear + '-' + _nextdatemonth + '-' + _nextdateday;
- return _nextday;
- }
- U.MD.F.H.printChatRecord = function (el, recordinfo, friendandgroupinfo) {
- var _tempel,
- _temponeel,
- _temptwoel,
- i = recordinfo.length,
- _frag = $$("frag");
-
- while (i--) {
-
- if (recordinfo[i].MessageContent ? recordinfo[i].MessageContent.indexOf("fileName") != -1 : recordinfo[i].GroupMessageContent.indexOf("fileName") != -1) {
- _tempel = $$("div", { "className": "U_MD_F_LO" }, _frag);
- _temponeel = $$("div", { "className": "U_MD_F_LOT" }, _tempel);
- $$("div", { "className": "U_MD_F_LOTN", "innerHTML": recordinfo[i].MessageDescript || recordinfo[i].GroupMessageSendUsername || friendandgroupinfo.FriendsDescript || friendandgroupinfo.GroupManageName }, _temponeel);
- $$("div", { "className": "U_MD_F_LOTT", "innerHTML": U.UF.D.getDateInterval(recordinfo[i].MessageSendTime || recordinfo[i].GroupMessageSendTime) }, _temponeel);
- var _data = JSON.parse(recordinfo[i].MessageContent);
- if (_data.fileType == "jpg" || _data.fileType == "png" || _data.fileType == "mp4") {
- var _content = $$("div", { "style": { "cssText": "padding:8px 8px 8px 8px;background:#fff;border-radius:2px;margin-top:12px;position:relative" } }, _tempel);
- } else {
- var _content = $$("div", { "style": { "cssText": "padding:8px 8px 8px 8px;background:#fff;border-radius:2px;margin-top:12px;border:1px #d3d3d3 solid;background:#f9f9f9;" } }, _tempel);
- }
- U.MD.F.W.printFileContent(_data, _content);
- } else {
- _tempel = $$("div", { "className": "U_MD_F_LO" }, _frag);
- _temponeel = $$("div", { "className": "U_MD_F_LOT" }, _tempel);
- $$("div", { "className": "U_MD_F_LOTN", "innerHTML": recordinfo[i].MessageDescript || recordinfo[i].GroupMessageSendUsername || friendandgroupinfo.FriendsDescript || friendandgroupinfo.GroupManageName }, _temponeel);
- $$("div", { "className": "U_MD_F_LOTT", "innerHTML": U.UF.D.getDateInterval(recordinfo[i].MessageSendTime || recordinfo[i].GroupMessageSendTime) }, _temponeel);
- $$("div", { "className": "U_MD_F_LOD", "innerHTML": recordinfo[i].MessageContent || recordinfo[i].GroupMessageContent }, _tempel);
- }
- }
- el.appendChild(_frag);
- }
- U.MD.F.H.sendFriendOrGroupChatMessage = function (friendandgroupinfo, chateditel, chatcontentnewsel, isgroup, isupload) {
- var _newsinfo,
- _chatcontent = chateditel.innerHTML,
- _hours = new Date().getHours().toString()[1] ? new Date().getHours() : '0' + new Date().getHours(),
- _minutes = new Date().getMinutes().toString()[1] ? new Date().getMinutes() : '0' + new Date().getMinutes(),
- _seconds = new Date().getSeconds().toString()[1] ? new Date().getSeconds() : '0' + new Date().getSeconds(),
- _friendid = friendandgroupinfo.UserId || friendandgroupinfo.GroupManageID;
-
- if (_chatcontent.isHtmlNull()) {
- U.MD.F.H.sendChatMessageToDb(_friendid, _chatcontent, null, isgroup);
-
- _newsinfo = [{
- "UserId": US.userInfo.userid,
- "Time": _hours + ":" + _minutes + ":" + _seconds,
- "Content": _chatcontent,
- "IMG": US.userInfo.UserThumbnailImageHead,
- "Name": US.userInfo.UserNickName
- }]
-
- if (isgroup) {
- U.MD.F.W.printGroupChatMessage(chatcontentnewsel, _newsinfo, true);
- } else {
- U.MD.F.W.printFriendChatMessage(chatcontentnewsel, _newsinfo, true);
- }
-
- if (!isupload) {
- chateditel.innerText = ""
- }
- }
- }
- U.MD.F.H.sendChatMessageToDb = function (friendid, message, cb, isgroup) {
- var _friendorgroupinfo,
- _userinfo = US.userInfo;
-
- if (isgroup) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SendMessageToGroup", friendid, Guid.newGuid(), _userinfo.UserId, message, _userinfo.UserNickName], function () { }, [""]);
- }
-
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "SentMessageToFriend", _userinfo.UserId, friendid, _userinfo.UserNickName, message, 0, false], function () { }, [""]);
- }
-
-
- if (isgroup) {
- _friendorgroupinfo = U.Json.select(US.friend.group, { "GroupManageID": friendid })[0];
- }
-
- else {
-
- _friendorgroupinfo = U.Json.select(US.friend.recentcontacts, { "UserId": friendid })[0];
-
- if (_friendorgroupinfo) {
-
- _friendorgroupinfo = U.Json.select(US.friend.friends, { "UserId": friendid })[0];
- }
- }
-
- if (_friendorgroupinfo) {
- U.MD.F.H.recentContacts(_friendorgroupinfo);
- }
- }
- U.MD.F.H.getFriendOrGroupNews = function (friendid, cb, isgroup) {
- var _userinfo = US.userInfo;
-
- if (isgroup) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetGroupUnreadMessage", _userinfo.UserId, friendid], cb, ["", friendid, isgroup]);
- }
-
- else {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "GetFriendUnreadMessage", _userinfo.UserId, friendid], cb, ["", friendid, isgroup]);
- }
- }
- U.MD.F.H.recentContacts = function (userinfo) {
- var _recentcontactsel,
- _num,
- _recentcontactsinfo,
- _contentel = U.selectEl("#U_MD_F_H_ZLZ")[0];
- if (US.friend.recentcontacts) {
-
- _num = US.friend.recentcontacts.objIndexOf({ "UserId": userInfo.userid }) || US.friend.recentcontacts.objIndexOf({ "GroupManageID": userinfo.GroupManageID });
-
- if (_num > -1) {
- _recentcontactsinfo = US.friend.recentcontacts.splice(_num, 1)[0];
- }
-
- else {
-
- _recentcontactsinfo = new U.MD.F.T.recentContactsEntity(userinfo.GroupManageID || userInfo.userid,
- userinfo.GroupManageName || userinfo.UserName, userinfo.UserImageHead || "", userinfo.UserNickName || "",
- userinfo.UserThumbnailImageHead || "", userinfo.maxMessageSendTime || new Date(),
- userinfo.GroupManageDescript || userinfo.FriendsDescript, userinfo.GroupManageRemark || userinfo.UserIndividualitysignature || "",
- userinfo.IsLogin || 3, userinfo.GroupManageID ? 1 : 0);
- }
-
- US.friend.recentcontacts.unshift(_recentcontactsinfo);
-
- _recentcontactsel = U.selectEl("#U_MD_F_H_ZLTA").childs()[0];
- _recentcontactsel = U.selectEl(_recentcontactsel).Child()[0];
-
- if (_recentcontactsel.className.indexOf("U_MD_F_H_ZLTSO") > -1) {
- _recentcontactsel = U.selectEl("[tid='" + (userinfo.GroupManageID || userInfo.userid + "']"), U.selectEl("#U_MD_F_H_ZLZ")[0])[0];
-
- if (_recentcontactsel) {
- ($(_recentcontactsel).appendTo(_contentel, 0, _contentel.firstChild));
- }
-
- else {
- U.MD.F.printFriendOrGroup(_contentel, US.friend.recentcontacts[0], true);
- }
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ;
- Namespace.register("U.MD.F.M");
- U.MD.F.M.createFriendGroupPopup = function () {
- var _tempel,
- _temponeel,
- _temptwoel;
-
- _tempel = $$("div", { "className": "U_MD_U_L_Box_I U_MD_F_Add_TNLFZ U_MD_F_G" });
- _temponeel = $$("div", {}, _tempel)
- _temptwoel = $$("input", {
- "placeholder": "请输入你要创建的分组",
- "onfocus": function () {
- U.UF.MR.inputPlaceholder(this, '请输入你要创建的分组名', "")
- },
- "onblur": function () {
- U.UF.MR.inputPlaceholder(this, "", '请输入你要创建的分组名');
- }
- }, _temponeel);
-
- U.UF.UI.confirm(_tempel, function () {
- U.MD.F.M.createFriendGroup(_temptwoel);
- });
- }
- U.MD.F.M.createFriendGroup = function (inputel) {
- var _value = inputel.value,
- _groupid = Guid.newGuid();
-
- if (_value.length > 20) {
- U.alert("分组名不可超过20个字符");
- }
-
- else if (!_value.isStrNull() && _value != inputel.defaultValue) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "CreateFriendClass", _groupid, US.userInfo.userid, _value, ""], U.MD.F.M.asynCreateFriendGroup, ["", _value, _groupid]);
- }
-
- else {
- U.alert("请输入正确的群名");
- }
- }
- U.MD.F.M.asynCreateFriendGroup = function (r) {
- var _groupinfo,
- _context = r.context;
- r = r.value;
- _groupinfo = new U.MD.F.T.friendGroupEntity(_context[2], _context[1], "");
-
- US.friend.allclass.push(_groupinfo);
-
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[1]).Child()[0].onclick();
-
- U.alert("创建" + _context[1] + "分组成功");
- }
- U.MD.F.M.deleteFriend = function (friendinfo, callback) {
-
- U.A.Request(US.FRIEND, ["DeleteFriend", US.userInfo.userid, friendinfo.FriendsID, friendinfo.UserId], U.MD.F.M.asynDeleteFriend, ["", friendinfo, callback]);
- }
- U.MD.F.M.asynDeleteFriend = function (r) {
- var _context = r.context,
- _message = "好友已删除",
- _friendinfo = _context[1];
- U.Json.del(US.friend.friends, { "FriendsID": _friendinfo.FriendsID });
- U.Json.del(US.friend.recentcontacts, { "UserId": _friendinfo.UserId });
-
- if ($('#U_MD_F_H_ZLTA .U_MD_F_H_ZLTOO')[0]) {
- var _friendclassinfo = U.Json.select(US.friend.allclass, { "FriendsGroupID": _friendinfo.FriendsGroupID })[0],
- _friendclassuserinfo = U.Json.select(US.friend.friends, { "FriendsGroupID": _friendinfo.FriendsGroupID }),
- _el = U.selectEl(".U_MD_F_H_ZLZOCO"),
- _friendel = U.selectEl('#g' + _friendclassinfo.FriendsGroupID).Child(),
- _switchbootom = U.selectEl("#U_MD_F_H_ZLTA").Child();
-
- for (var i = 0; i < _el.length; i++) {
- if (_el[i].tid == _friendinfo.UserId) {
- U.selectEl(_el[i]).remove();
- U.MD.F.W.delteFriendChat(_el[i].tid, U.selectEl("#U_MD_F")[0]);
- _friendel[0].innerHTML = _friendclassinfo.FriendsGroupName + "(" + (_friendclassuserinfo.length) + ")";
- break;
- }
- }
-
-
- if (US.friend.allclass.length == 1 && !_friendclassuserinfo.length) {
- U.MD.F.printHasNoFriend(_friendel[1]);
- }
- _message = '好友' + (_friendinfo.UserNickName || _friendinfo.UserName) + '已从好友列表中删除';
- }
-
- if ($('#U_MD_F_H_ZLTA .U_MD_F_H_ZLTTO')[0]) {
- var _el = U.selectEl(".U_MD_F_H_ZLZOCO");
-
- for (var i = 0; i < _el.length; i++) {
- if (_el[i].tid == _friendinfo.UserId) {
- U.selectEl(_el[i]).remove();
- U.MD.F.W.delteFriendChat(_el[i].tid, U.selectEl("#U_MD_F")[0]);
- break;
- }
- }
- }
- var _win = U.selectEl('.U_MD_F_TO[user="9dff9339-2d37-4072-b62e-3b0a027ae997"]');
- _win[0] && U.selectEl('.U_MD_F_TOC', _win)[0].onclick();
- U.UF.C.isFunction(_context[2]) && _context[2]();
- U.alert(_message);
- };
- U.MD.F.M.addFriend = function (userinfo, cb, typename) {
- if (!U.MD.U.L.isLogin()) {
- typename = typename || "1";
-
- if (userInfo.userid != US.userInfo.userid) {
-
- var _friendinfo = U.Json.select(US.friend.friends, { "UserId": userInfo.userid })[0];
-
- if (!_friendinfo) {
- U.MD.F.M.addFriendForm(userinfo, cb, typename);
- }
-
- else {
- U.MD.F.W.popupFriendsForm(_friendinfo);
- }
- } else { U.Alert("不可以添加自己为好友哟!"); }
- } else { U.Alert("快速登录关注他(她)吧"); }
- }
- U.MD.F.M.addFriendForm = function (userinfo, cb, typename) {
- var i,
- _formel,
- _tempel,
- _temponeel,
- _temptwoel,
- _tempthreeel,
- _tempfourel,
- _friendgroupinfo = US.friend.allclass;
- var _date = new Date();
-
- _tempel = $$("div", { "className": "U_MD_U_UV_IAC" });
- _temponeel = $$("div", { "className": "U_MD_U_UV_IACA" }, _tempel);
- _temptwoel = $$("div", { "className": "U_MD_U_UV_IACL" },
- _temponeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACLT" }, _temptwoel);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "title": "点击查看",
- "src": U.MD.C.getHeadImage(userinfo.UserThumbnailImageHead)
- },
- _tempthreeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACLB" }, _temptwoel);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": userinfo.UserNickName || userinfo.UserName }, _tempthreeel);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": "性别:" + (userinfo.UserSex ? "男" : "女") }, _tempthreeel);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": "年龄:" + (U.UF.D.getYearMonthDay(_date.toLocaleDateString())[3] - U.UF.D.getYearMonthDay(userinfo.Birthday)[3]) }, _tempthreeel);
- _temptwoel = $$("div", { "className": "U_MD_U_UV_IACR" }, _temponeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACRT" }, _temptwoel);
- $$("div", { "className": "U_MD_U_UV_IACRTL", "innerHTML": "备注姓名:" }, _tempthreeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACRTR" }, _tempthreeel);
- _memoName = $$("input", { "value": userinfo.UserNickName || userinfo.UserName }, _tempthreeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACRB" }, _temptwoel);
- $$("div", { "className": "U_MD_U_UV_IACRBL", "innerHTML": "分       组:" }, _tempthreeel);
- _tempthreeel = $$("div", { "className": "U_MD_U_UV_IACRBR" },
- _tempthreeel);
- _tempfourel = $$("select", {}, _tempthreeel);
-
- _tempfourel.options.length = _friendgroupinfo.length;
- for (i = 0; i < _friendgroupinfo.length; i++) {
- _tempfourel.options[i].text = _friendgroupinfo[i].FriendsGroupName;
- }
-
- _formel = U.UF.UI.confirm(_tempel, function () {
- U.MD.F.M.addFriendToDb(userinfo, cb, _tempfourel, _temponeel, typename, _memoName.value);
- });
- _formel.form.style.width = "400px";
- }
- U.MD.F.M.addFriendToDb = function (userinfo, cb, selectel, loadingel, typename, _memoName) {
- var _friendgroupinfo = US.friend.allclass[selectel.selectedIndex],
- _groupid = _friendgroupinfo.FriendsGroupID,
- _friendid = Guid.newGuid(),
- _messageid = Guid.newGuid();
- _descript = U.selectEl(".U_MD_U_UV_IACRTR")[0].childNodes[0].value;
-
-
- if (typename == "0") {
- U.A.Request(US.FRIEND, ["AgreeAddFriend", US.userInfo.userid, userInfo.userid, _friendid, _groupid, (userinfo.UserNickName || userinfo.UserName), userinfo.MessageContent.toUpperCase()],
- U.MD.F.M.asynAddFriendToDb, [loadingel, _groupid, userinfo, _friendgroupinfo, cb, _friendid]);
- }
-
- else {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Friends", "AddFriend", US.userInfo.userid, _friendid, userInfo.userid, _groupid, _messageid, (userinfo.UserNickName || userinfo.UserName), ("" || _descript)]), U.MD.F.M.asynAddFriendToDb, [loadingel, _groupid, userinfo, _friendgroupinfo, cb, _friendid]);
- }
-
-
- return false;
- }
- U.MD.F.M.asynAddFriendToDb = function (r) {
- var _context = r.context,
- _loadingel = _context[0],
- _groupid = _context[1],
- _userinfo = _context[2],
- _friendgroupinfo = _context[3],
- _cb = _context[4],
- _friendid = _context[5];
- r = r.value;
-
- if (r) {
-
- U.MD.F.M.displayAddFriend(_userinfo, _friendid, _groupid, _friendgroupinfo, r);
-
- if (_cb) {
- _cb();
- }
- U.alert('添加好友成功,快和他发起聊天吧');
- }
-
- else {
- U.alert("您的请求已经发送,请等待对方的同意。");
- }
-
- U.selectEl(_loadingel).Parent({ usform: "true" }).remove();
- }
- U.MD.F.M.displayAddFriend = function (userinfo, friendid, classid, friendgroupinfo, r) {
- var _childs,
- _groupel,
-
- _friendinfo = new U.MD.F.T.friendEntity(userinfo.UserIndividualitysignature, userInfo.userid, userinfo.UserImageHead,
- userinfo.UserThumbnailImageHead, userinfo.UserNickName || userinfo.UserName,
- userinfo.UserName, friendid, userinfo.UserNickName || userinfo.UserName, classid, 0);
- _friendinfo["IsLogin"] = r[1] == "True" ? 1 : 0;
- US.friend.friends.unshift(_friendinfo);
-
- _groupel = U.selectEl("#g" + classid);
- if (_groupel[0]) {
- _childs = U.selectEl(_groupel).Child();
-
- if (US.friend.friends.length == 1) {
- U.selectEl("#U_MD_F_H_ZR")[0].innerText = "";
- };
-
- U.MD.F.printFriendOrGroup(_childs[1], [_friendinfo], true);
-
- _childs[0].innerText = friendgroupinfo["FriendsGroupName"] + "(" + (U.Json.select(US.friend.friends, { "FriendsGroupID": classid }).length) + ")";
- };
-
- U.MD.F.W.popupFriendsForm(_friendinfo);
-
- if (!US.friend.recentcontacts.length) {
- U.MD.F.printRightFormFriend(US.friend.friends, U.selectEl("#U_MD_F_H_RC")[0]);
- }
- }
-
- ;
- Namespace.register("U.MD.F.N");
- U.MD.F.N.news = [];
- U.MD.F.N.messageService = function (userid) {
- if (US.friend.allclass && userid && userid.length == 36) {
-
- U.A.Request(US.USER, ["GetAllUnreadMessage", userid], U.MD.F.N.asynMessageService);
- }
- }
- U.MD.F.N.asynMessageService = function (r) {
- r = r.value;
- if (r) {
- var i,
- _userinfo = US.userInfo,
- _statenew = r[1];
-
- if (typeof _statenew == "string") {
- U.MD.F.N.inlineNotice(_statenew);
- }
-
- else {
- U.MD.F.N.friendOnlineAndOffline(_statenew);
- U.MD.F.N.messageHandle(r);
- }
- }
- }
- U.MD.F.N.friendOnlineAndOffline = function (statenew) {
- var i,
- j,
- k,
- _num,
- _el,
- _idarr,
- _friendform = U.selectEl("#U_MD_F_H_ZLZ")[0],
- _userid = US.userInfo.userid,
- _friendinfo = US.friend;
-
- for (i = 0; i < statenew.length; i++) {
-
- if (statenew[i].length) {
-
- _idarr = statenew[i].join(",");
-
- for (j = 0; j < 3; j++) {
- _num = j = 0 ? 1 : j + 2;
- for (k = 0; k < _friendinfo[_num].length; k++) {
-
- if (_idarr.indexOf(_friendinfo[_num][k].UserId) > -1) {
- _friendinfo[_num][k].IsLogin = i;
- }
- }
- U.Json.sort(US.friend[_num], "IsLogin", 1);
- }
-
- for (j = 0; j < statenew[i].length; j++) {
- _el = U.selectEl("[tid='" + statenew[i][j] + "']", _friendform);
- if (_el[0]) {
- U.selectEl(_el[0].Parent()).append(_el, null, i ? _el[0].Parent().firstChild : null);
- }
- }
- }
- }
- }
- U.MD.F.N.inlineNotice = function (userstate) {
-
- if (userstate == "upline") {
- return;
-
- U.UF.UI.confirm($$("div", {
- "style": {
- "textAlign": "center",
- "marginTop": "25px",
- "padding": "10px 0",
- "fontSize": "14px",
- "color": "red"
- },
- "innerHTML": "您好, 您的账号在别处有登录!"
- }));
- U.MD.U.LO.logout();
- }
-
- else {
- U.A.Request(US.FRIEND, ["UserStateLogin", US.userInfo.username, US.userInfo.UserPassword], function () { });
- }
- }
- U.MD.F.N.messageHandle = function (arr) {
-
- if (arr[0]) {
- U.MD.F.N.friendMessageHandle(arr[0]);
- }
- if (arr[1]) {
- U.MD.F.N.otherNews(arr[1]);
- }
- }
- U.MD.F.N.friendMessageHandle = function (newsarr) {
- var i, j, k,
- _issound,
- _isnews,
- _obj,
- _form,
- _news,
- _isgroup,
- _verify,
- _allnews = U.MD.F.N.news
- ;
-
- for (j = 0; j < newsarr.length; j++) {
- _news = newsarr[j];
-
- if (_news) {
-
- for (i = 0; i < _news.length; i++) {
- _obj = null;
- _isgroup = _news[i].UserId == null;
- _verify = _news[i].MessageIsVerify || 0;
- _allnews[_verify] = _allnews[_verify] || [];
-
- switch (_verify) {
-
- case 0:
- case 6:
- _news[i].MessageSendTime = U.UF.D.getYearMonthDay(_news[i].MessageSendTime) || U.UF.D.getYearMonthDay(_news[i].GroupMessageSendTime);
- _form = U.MD.F.W.isCreateForm(_news[i].UserId || _news[i].GroupManageID);
-
- if (_form && _form[1] && U.selectEl('#U_MD_F_H_ZA')[0].style.display == 'block' && _form[1].style.display != "none") {
-
- U.MD.F.N.canelMarkMessage(_news[i]);
-
- U.MD.F.H.getFriendOrGroupNews(_news[i].UserId || _news[i].GroupManageID, function (r) {
- U.MD.F.N.asynReceiveMessages(_isgroup, _form[1], r.value);
- }, _isgroup);
- _issound = true;
- continue;
- }
- U.MD.F.H.recentContacts(_news[i]);
- break;
-
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
-
- break;
- }
-
- for (k = 0; k < _allnews[_verify].length; k++) {
-
- if ((_allnews[_verify][k].GroupManageID != null && _allnews[_verify][k].GroupManageID == _news[i].GroupManageID) ||
- (_allnews[_verify][k].UserId != null && _allnews[_verify][k].UserId == _news[i].UserId)) {
- _obj = _allnews[_verify][k];
- break;
- }
- }
-
- if ((_verify == 0 || _verify == 6) && _obj) {
-
- if (_news[i].GroupManageID) {
- if (_news[i].count > _obj.count) {
- _issound = true;
- }
- _obj.count = _news[i].count;
- }
-
- else {
- _issound = true;
- _obj.count += _news[i].count;
- }
- }
-
- else {
- _issound = true;
- _allnews[_verify].push(_news[i]);
- }
- _isnews = true;
- }
- }
- }
-
- if (_issound) {
- U.MD.F.N.addNewsSound($('.U_MD_D_NewsTipsIcon')[0], _allnews);
- }
-
- if (_isnews) {
-
- U.MD.F.N.tipsForm();
-
- U.MD.F.N.markUnreadMessage(newsarr);
-
- for (i = 0; i <= 6; i++) {
- if (_allnews[i] && _allnews[i].length) {
- U.MD.F.N.displayFriendMessage(_allnews[i], i);
- }
- }
- }
- }
- U.MD.F.N.tipsForm = function () {
- var _friendel = U.selectEl("#U_MD_D_MG_AFT")[0];
- _friendel.innerText = "";
- if (!$('.U_MD_F_N_IconAnimation')[0]) {
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].className += ' U_MD_F_N_IconAnimation';
- }
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].onmouseover = function () {
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].className = 'U_MD_D_NewsTipsIcon';
- if (!$("#U_MD_F_N_Message")[0]) {
-
- new U.UF.UI.form(US.userInfo.UserNickName, _friendel, {
- "id": "U_MD_F_N_Message",
- "style": { 'position': 'absolute', "width": "233px", "height": "343px", "left": "-100px", "bottom": "52px", "background": "#ffffff", "padding": "0", "border": "0", "maxWidth": "300px" }
- }, {
- "istop": true,
- "isdrag": false,
- "isstretching": false,
- "isenlarge": false,
- "isnarrow": false,
- "isclose": false,
- "closecallback": function () {
- U.MD.F.N.clearAllNews();
- }
- }, { 'id': 'U_MD_F_N_MessageHead', 'style': { 'text-indent': '10px', 'height': '30px', 'line-height': '30px', 'background-color': '#fff', 'color': '#000', 'font-size': '14px', 'overflow': 'hidden', 'padding-top': '5px', 'margin-bottom': '5px' } },
- '', '', U.selectEl('.U_MD_D_NewsTipsIcon')[0]);
- if (!$('.U_MD_F_N_MessageTop')[0]) {
- $$('div', {
- 'innerHTML': '全部忽略',
- 'className': 'U_MD_F_N_MessageTop',
- 'onclick': function () {
- U.UF.EV.stopBubble();
- U.MD.F.N.clearAllNews();
- U.MD.F.N.delAllNewsTips();
- U.MD.F.N.canelAllMarkMessage();
- }
- }, U.selectEl('#U_MD_F_N_MessageHead')[0]);
- }
- } else {
- U.selectEl("#U_MD_F_N_Message")[0].style.display = "block";
- U.MD.F.N.noNewsTips();
- }
- }
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].onmouseout = function () {
- if ($("#U_MD_D_MG_AFT").Child().length != 0) {
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].className += ' U_MD_F_N_IconAnimation';
- };
- U.selectEl("#U_MD_F_N_Message")[0].style.display = "none";
- }
- }
- U.MD.F.N.messagesendTime = function (time) {
- var _reg = RegExp(/Date/);
- if (time.match(_reg)) {
- time = time.replace(/[^0-9]/ig, "");
- var _date = new Date(parseInt(time));
- var _year = _date.getFullYear();
- var _month = _date.getMonth() + 1;
- var _day = _date.getDate();
- return _year + '-' + _month + '-' + _day;
- }
- return time;
- }
- U.MD.F.N.getHoursMinutesSeconds = function (time) {
- var _reg = RegExp(/Date/);
- if (time && time.match(_reg)) {
- time = time.replace(/[^0-9]/ig, "");
- var _date = new Date(parseInt(time)),
- _hours = _date.getHours().toString()[1] ? _date.getHours() : '0' + _date.getHours(),
- _minutes = _date.getMinutes().toString()[1] ? _date.getMinutes() : '0' + _date.getMinutes(),
- _seconds = _date.getSeconds().toString()[1] ? _date.getSeconds() : '0' + _date.getSeconds();
- return _hours + ':' + _minutes + ':' + _seconds;
- }
- return time;
- }
- U.MD.F.N.displayFriendMessage = function (news, verify) {
- var i,
- _username,
- _descript,
- _newel,
- _newael,
- _cb,
- _newcontent,
- _frag = $$("frag");
-
- for (i = 0; i < news.length; i++) {
-
- _newel = $$("div", { "className": "U_MD_D_MG_OO", "title": "消息", "tid": "O" + news[i].MessageID }, _frag);
- _username = news[i].FriendsDescript || news[i].GroupManageName || news[i].UserNickName;
- _newsenttime = U.MD.F.N.messagesendTime(news[i].MessageSendTime);
-
- switch (verify) {
-
- case 0:
- _descript = news[i].count;
- _newcontent = news[i].MessageContent || news[i].GroupMessageContent;
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.chatMessage(newsinfo, news, _newel);
- U.UF.EV.stopBubble();
- }, [news, news[i], _newel]);
- break;
-
- case 1:
- _username = news[i].UserNickName;
- _newcontent = "添加您为好友";
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.addFriendNewsHandle(newsinfo, news, _newel);
- U.UF.EV.stopBubble();
- }, [news, news[i], _newel]);
- break;
-
- case 2:
- _username = news[i].UserNickName;
- _newcontent = "请求加入该群";
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.entryGroup(newsinfo, news, _newel);
- }, [news, news[i], _newel]);
- break;
-
- case 3:
- _username = news[i].UserNickName;
- _newcontent = "邀请您加入讨论组";
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.pulledIntoGroups(newsinfo, news, _newel);
- U.UF.EV.stopBubble();
- }, [news, news[i], _newel])
- break;
-
- case 4:
- _username = news[i].UserNickName;
- _newcontent = "同意添加你为好友";
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.confirmAddFriend(newsinfo, news, _newel);
- }, [news, news[i], _newel]);
- break;
-
- case 5:
- _username = news[i].UserNickName;
- _newcontent = "加入讨论组";
-
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.pulledIntoGroups(newsinfo, news, _newel);
- }, [news, news[i], _newel]);
- break;
- case 6:
- _newcontent = "你的文件到了!!!";
- _cb = U.UF.P.apply(function (news, newsinfo, _newel) {
- U.MD.F.N.chatMessage(newsinfo, news, _newel);
- U.UF.EV.stopBubble();
- }, [news, news[i], _newel]);
- break;
- }
-
- _newel.onclick = _cb;
- _newael = $$("div", { "className": "U_MD_D_MG_OOI" }, _newel);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "alt": news[i].FriendsDescript || news[i].UserNickName || news[i].GroupManageName,
- "src": U.MD.C.getHeadImage(news[i].UserThumbnailImageHead || "/img/UserHead/UseHead.jpg")
- }, _newael);
- $$("div", { "className": "U_MD_D_MG_OON U_MD_D_Text_Abbreviation", "innerHTML": _username }, _newel);
- $$('div', { 'style': { 'float': 'none', 'text-align': 'end', 'color': '#737373', 'height': '15px', 'margin-right': '5px' }, 'innerHTML': _newsenttime }, _newel);
- $$('div', { className: 'U_MD_D_MG_OONC', 'innerHTML': _newcontent, 'style': { 'margin-left': '10px', 'font-size': '14px', 'margin-top': '8px' } }, _newel);
- if (verify != 0) {
- _newel.children[3].style.color = '#2683f5';
- }
- if (verify == 0) {
- $$("div", { "style": { "float": "right", 'margin-top': '9px', 'margin-right': '5px' }, "className": " U_MD_D_MG_Count", "innerHTML": _descript }, _newel);
- }
- }
- U.selectEl("#U_MD_D_MG_AFT")[0].appendChild(_frag);
- }
- U.MD.F.N.chatMessage = function (newsinfo, news, el) {
- var _chatinfo;
-
- if (newsinfo.GroupManageID) {
- _chatinfo = U.Json.select(US.friend.group, { "GroupManageID": newsinfo.GroupManageID })[0];
- }
-
- else {
- _chatinfo = U.Json.select(US.friend.friends, { "UserId": newsinfo.UserId })[0]
- }
- U.MD.F.W.viewFriend(_chatinfo);
- U.MD.F.N.clearNews(newsinfo, news, el);
- U.MD.F.N.delNewsTips();
- }
- U.MD.F.N.asynReceiveMessages = function (isgroup, chatform, r) {
-
- if (isgroup) {
- U.MD.F.W.printGroupChatMessage($("div.U_MD_F_C", chatform)[0], r);
- }
-
- else {
- U.MD.F.W.printFriendChatMessage($("div.U_MD_F_C", chatform)[0], r);
- }
- }
- U.MD.F.N.addFriendNewsHandle = function (newsinfo, news, el) {
- var _friendinfo = U.Json.select(US.friend.friends, { "UserId": newsinfo.UserId }, null, 1)[0];
-
- if (!_friendinfo) {
- U.MD.F.M.addFriend(newsinfo, null, "0");
- }
-
- else {
- U.MD.F.W.popupFriendsForm(_friendinfo);
- }
- U.MD.F.N.clearNews(newsinfo, news, el);
- }
- U.MD.F.N.entryGroup = function (newsinfo, news, el) {
- var _groupuserid = Guid.newGuid(),
- _friendinfo = U.Json.select(US.friend.groupusers, { "GroupManageID": news.MessageContent, "UserId": news.UserId }, null, 1)[0];
-
- if (_friendinfo) {
- U.alert("添加成功");
- }
-
- else {
- U.A.Request(US.FRIEND, ["AddUsrsToGroup", US.userInfo.userid, news.MessageID, news.UserId, news.MessageContent.toUpperCase(), _groupuserid, news.MessageDescript], U.MD.F.N.asynEntryGroup, ["", news, _groupuserid]);
- }
- U.MD.F.N.clearNews(newsinfo, news, el);
- }
- U.MD.F.N.asynEntryGroup = function (r) {
- var _groupuserinfo,
- _context = r.context,
- _news = _context[1],
- _groupuserid = _context[2];
-
- _groupuserinfo = U.MD.F.T.groupUserEntity(_news.UserId, _news.UserImageHead, _news.UserNickName, _news.UserNickName, _news.UserThumbnailImageHead, _news.MessageContent.toUpperCase(), _news.MessageID, 1)
-
- US.friend.groupusers.push(_groupuserinfo);
- }
- U.MD.F.N.pulledIntoGroups = function (newsinfo, news, el) {
- var _groupinfo = U.Json.select(US.friend.group, { "GroupManageID": newsinfo.MessageContent.toLowerCase() })[0];
-
- if (!_groupinfo) {
- U.A.Request(US.FRIEND, ["GetJoinGroupNews", US.userInfo.userid, newsinfo.MessageID, newsinfo.MessageContent], U.MD.F.N.asynPulledIntoGroups, ["", newsinfo]);
- } else {
- U.MD.F.W.viewFriend(_groupinfo);
-
- if (newsinfo.MessageContent.length == 36) {
- }
- }
- U.MD.F.N.clearNews(newsinfo, news, el);
- U.MD.F.W.addChecked(newsinfo);
- U.MD.F.N.delNewsTips();
- }
- U.MD.F.N.asynPulledIntoGroups = function (r) {
-
- if (r.value) {
- var _groupfriend,
- _groupfriends,
- _groupdiskarr,
- _context = r.context,
- _newinfo = _context[1],
- _userid = US.userInfo.userid,
- _diskinfo = US.disk.Disks[_userid],
- _groupinfo = new U.MD.F.T.groupEntity(_newinfo.MessageContent.toLocaleLowerCase(), _newinfo.MessageDescript, U.UF.D.toTimeStamp(new Date()), _newinfo.UserId, "", null)
- ;
- r = r.value;
- _groupfriends = r[0];
- US.friend.group.unshift(_groupinfo);
-
- for (i = 0; i < _groupfriends.length; i++) {
-
- if (!U.Json.select(US.friend.groupusers, { "GroupManageID": _groupfriends[i].GroupManageID, "UserId": _groupfriends[i].UserId })[0]) {
-
- _groupfriend = new U.MD.F.T.groupUserEntity(_groupfriends[i].UserId, U.MD.C.getHeadImage(_groupfriends[i].UserImageHead), _groupfriends[i].UserNickName || _groupfriends[i].UserName, _groupfriends[i].UserName, U.MD.C.getHeadImage(_groupfriends[i].UserThumbnailImageHead), _groupfriends[i].GroupUsersDescript || _groupfriends[i].UserNickName, _groupfriends[i].GroupManageID, 1);
-
- US.friend.groupusers.push(_groupfriend);
- }
- }
- _groupdiskarr = [new U.MD.DK.M.entity(_groupinfo.GroupManageID, 0, US.EMPTYGUID, _groupinfo.GroupManageName,
- _groupinfo.GroupManageName, "folder", null, U.UF.D.toTimeStamp(new Date()), U.MD.DK.C.getIcon("folder")[1],
- 1, null, null, 0, "", _groupinfo.GroupManageID)];
- _diskinfo && U.MD.DK.RE.addFileOrFolder(_groupdiskarr, _diskinfo, _diskinfo.directoryOrFiles[2])
-
-
- U.MD.F.W.viewFriend(_groupinfo);
- U.selectEl($("#U_MD_F_H_ZLTA").Child()[2]).Child()[0].onclick();
-
- return US.friend.group[0];
- }
- }
- U.MD.F.N.confirmAddFriend = function (newsinfo, news, el) {
- var _friendid = Guid.newGuid(),
- _friendinfo = U.Json.select(US.friend.friends, { "UserId": news.UserId })[0]
- ;
-
- if (!_friendinfo) {
- U.A.Request(US.FRIEND, ["AddFriend", US.userInfo.userid, news.UserId, _friendid, news.MessageContent, news.MessageDescript], U.MD.F.N.asynAddFriend, [null, news, news.MessageContent, _friendid]);
- }
-
- else {
- U.MD.F.W.popupFriendsForm(_friendinfo);
- }
- U.MD.F.N.clearNews(newsinfo, news, el);
- }
- U.MD.F.N.asynAddFriend = function (r) {
- var _context = r.context,
- _new = _context[1],
- _groupid = _context[2],
- _friendid = _context[3];
- r = r.value;
- U.MD.F.M.displayAddFriend(r[0][0], _friendid, _groupid, r);
- }
- U.MD.F.N.clearAllNews = function () {
- var i, j,
- _allids = "",
- _allnews = U.MD.F.N.news;
-
- for (i = 0; i < _allnews.length; i++) {
- if (_allnews[i]) {
- for (j = 0; j < _allnews[i].length; j++) {
- _allids += (_allnews[i][j].GroupManageID || _allnews[i][j].MessageID) + ",";
- }
- _allnews[i].splice(0);
- }
- }
- _allids = _allids.substring(0, _allids.length - 1);
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "DeleteMessageById", _allids, US.userInfo.userid], function () { }, []);
- U.selectEl("#U_MD_D_MG_AFT")[0].innerText = "";
- }
- U.MD.F.N.clearNews = function (newsinfo, news, el) {
- var _pel = U.selectEl(el).Parent(),
- _messageid = (newsinfo.MessageID || newsinfo.GroupMessageID);
-
- U.Json.del(news, { "MessageID": newsinfo.MessageID });
-
- U.MD.F.N.canelMarkMessage(newsinfo);
- U.selectEl(el).remove();
-
- if ($(_pel).Child().length == 0 && U.selectEl("#U_MD_F_N_Message")[0]) {
- U.selectEl("#U_MD_F_N_Message")[0].close();
- }
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "DeleteMessageById", _messageid, US.userInfo.userid], function () { }, []);
- }
- U.MD.F.N.otherNews = function (news) {
- }
- U.MD.F.N.markUnreadMessage = function (newsarr) {
- var i, j, _id, _el, _parentel;
- for (i = 0; i < newsarr.length; i++) {
- for (j = 0; j < newsarr[i].length; j++) {
- _id = newsarr[i][j].UserId || newsarr[i][j].GroupManageID;
- if (_id) {
- _el = U.selectEl("[tid='M" + _id + "']")[0];
- _parentel = U.selectEl("[tid='" + _id + "']")[0];
-
- if (_parentel) {
- if (_el) {
- _el.innerHTML = newsarr[i][j].count;
- } else {
- $$("div", { className: "U_Mark", innerHTML: newsarr[i][j].count, tid: "M" + _id, "style": { "cssText": "margin:0;position:absolute;left:48px" } }, _parentel);
- }
- }
- }
- }
- }
- }
- U.MD.F.N.canelMarkMessage = function (friendInfo) {
- if (friendInfo) {
- if (friendInfo.GroupManageID) {
- U.selectEl("[tid='M" + friendInfo.GroupManageID + "']").remove();
- } else if (friendInfo.UserId) {
- U.selectEl("[tid='M" + friendInfo.UserId + "']").remove();
- } else if (friendInfo.MessageSendUserID) {
- U.selectEl("[tid='M" + friendInfo.MessageSendUserID + "']").remove();
- }
- }
- }
- U.MD.F.N.canelAllMarkMessage = function () {
- U.selectEl(".U_Mark").remove();
- }
- U.MD.F.N.delNewsTips = function () {
-
- if ($("#U_MD_D_MG_AFT").Child().length == 0) {
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].className = 'U_MD_D_NewsTipsIcon';
- }
- }
- U.MD.F.N.delAllNewsTips = function () {
-
- U.selectEl('.U_MD_D_NewsTipsIcon')[0].className = 'U_MD_D_NewsTipsIcon';
- }
- U.MD.F.N.noNewsTips = function () {
-
- if ($("#U_MD_D_MG_AFT").Child().length == 0) {
- if (!$('.U_MD_F_N_NoNewsTips')[0]) {
- $$('div', { 'className': 'U_MD_F_N_NoNewsTips', 'style': {}, 'innerHTML': '暂无消息' }, U.selectEl("#U_MD_F_N_Message")[0]);
- } else {
- U.selectEl('.U_MD_F_N_NoNewsTips')[0].style.display = "block";
- }
- U.MD.F.N.delAllNewsTips();
- } else {
- if ($('.U_MD_F_N_NoNewsTips')[0]) {
- U.selectEl('.U_MD_F_N_NoNewsTips')[0].style.display = "none";
- }
- }
- }
- U.MD.F.N.addNewsSound = function (parentele, allnews) {
-
- if (!$('#U_MD_F_N_NewsAudio')[0]) {
- $$('audio', { "id": "U_MD_F_N_NewsAudio", "src": "http://gddx.sc.chinaz.com/Files/DownLoad/sound1/201703/8407.wav", "autoplay": 'autoplay' }, parentele);
- }
-
- else {
- U.selectEl('#U_MD_F_N_NewsAudio')[0].play();
- }
- }
- U.MD.F.N.cancelNewsMessage = function (friendInfo) {
- var i,
- _news,
- _id = friendInfo.GroupManageID ? "GroupManageID" : "UserId",
- _obj = {},
- _child = U.selectEl("#U_MD_D_MG_AFT").Child();
- _obj[_id] = friendInfo[_id];
- _news = U.Json.select(U.MD.F.N.news[0], _obj)[0];
- if (_news) {
-
- for (i = 0; i < _child.length; i++) {
- if (_child[i].tid == "O" + _news.MessageID) {
- U.MD.F.N.chatMessage(_news, U.MD.F.N.news[0], _child[i]);
- return;
- }
- }
- }
- };
- Namespace.register("U.MD.F.R");
- U.MD.F.R.friendsRightClickMenu = function (el, friendinfo) {
- var _friendmenuel = U.selectEl('#U_MD_F_G_Div')[0],
- _child = U.selectEl(_friendmenuel).Child();
-
- U.selectEl(_friendmenuel).css({ "display": "block", "zIndex": "999" });
- U.UF.C.rightClickMenuLocation(_friendmenuel);
-
- _child[0].onclick = function () { U.MD.F.W.popupFriendsForm(friendinfo); };
- _child[1].onclick = function () { U.MD.U.V.ViewOtherUserInfo(friendinfo.UserId); };
- _child[2].onmouseover = function () { U.MD.F.R.moveFriendForm(friendinfo, el, _child[2]); };
- _child[3].onclick = function () { U.MD.F.R.deleteFriendForm(friendinfo); };
-
- U.selectEl(document).bind("click", function () {
- U.selectEl(_friendmenuel)[0].style.display = "none";
- })
- }
- U.MD.F.R.moveFriendForm = function (friendinfo, el, menubootom) {
- var i,
- _friendclassel = U.selectEl(menubootom).parentElement().Child()[4],
- _friendclassinfo = US.friend.allclass;
- _friendclassel.innerText = "";
- if (!friendinfo.FriendsGroupID) {
- friendinfo.FriendsGroupID = U.Json.select(US.friend.friends, { "UserId": friendinfo.UserId })[0].FriendsGroupID;
- }
-
- if (_friendclassinfo.length > 1) {
-
- for (i = 0; i < _friendclassinfo.length; i++) {
-
- if (_friendclassinfo[i].FriendsGroupID != friendinfo.FriendsGroupID) {
-
- $$("div", {
- "class": "U_MD_F_G_Div_Children_A",
- "innerText": _friendclassinfo[i]["FriendsGroupName"],
- "onclick": U.UF.C.closure(function (i) {
- U.MD.F.R.assignMoveFriend(friendinfo, _friendclassinfo[i], el);
- }, [i])
- }, _friendclassel);
- }
- }
- _friendclassel.style.display = "block";
- }
- }
- U.MD.F.R.assignMoveFriend = function (friendinfo, groupinfo, el) {
- var _friendsid;
-
- if (friendinfo) {
- U.selectEl('#U_MD_F_G_Div')[0].style.display = "none";
- U.selectEl(".U_MD_F_G_Div_Children")[0].style.display = "none";
- if (friendinfo.FriendsID) {
- _friendsid = friendinfo.FriendsID;
- } else {
- friendinfo.FriendsID = U.Json.select(US.friend.friends, { "UserId": friendinfo.UserId })[0].FriendsID;
- friendinfo.FriendsGroupID = U.Json.select(US.friend.friends, { "UserId": friendinfo.UserId })[0].FriendsGroupID;
- }
-
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "MoveFriendToOtherClass", friendinfo.FriendsID, groupinfo["FriendsGroupID"]],
- U.MD.F.R.asynAssignMoveFriend, ["", friendinfo, groupinfo, el]);
- U.alert('修改成功');
- }
- }
- U.MD.F.R.asynAssignMoveFriend = function (r) {
- var _child,
- _context = r.context,
- _friendinfo = _context[1],
- _groupinfo = _context[2],
- _el = _context[3],
- _friendgroupel = U.selectEl("#g" + _groupinfo.FriendsGroupID)[0],
- _previousgroupinfo = U.Json.select(US.friend.allclass, { "FriendsGroupID": _friendinfo.FriendsGroupID })[0],
- _friendnum = U.Json.select(US.friend.friends, { "FriendsGroupID": _friendinfo.FriendsGroupID }).length - 1
- ;
-
-
- if ($('.U_MD_F_H_ZLTOO')[0]) {
- U.selectEl(_el).parentElement(2).Child()[0].innerHTML = _previousgroupinfo.FriendsGroupName + "(" + _friendnum + ")";
- U.MD.F.R.assignNoFriendTips(_previousgroupinfo, _friendnum, U.selectEl(_el).parentElement(2).Child()[1], U.selectEl(_friendgroupel).Child()[1]);
- }
-
- _friendinfo.FriendsGroupID = _groupinfo.FriendsGroupID;
- U.Json.select(US.friend.friends, { "UserId": _friendinfo.UserId })[0].FriendsGroupID = _groupinfo.FriendsGroupID;
-
- if (_friendgroupel) {
- _child = U.selectEl(_friendgroupel).Child();
- _friendnum = U.Json.select(US.friend.friends, { "FriendsGroupID": _friendinfo.FriendsGroupID }).length;
- _child[0].innerHTML = _groupinfo["FriendsGroupName"] + "(" + _friendnum + ")";
- _child[1].appendChild(_el);
- }
- }
- U.MD.F.R.assignNoFriendTips = function (previousgroupinfo, nowfriendnum, previousel, nowel) {
- var _previousfriendnum = U.Json.select(US.friend.friends, { "FriendsGroupID": previousgroupinfo.FriendsGroupID }).length;
- if (_previousfriendnum == 0 && previousel.parentNode) {
- $$("div", { "class": "U_MD_F_H_ZLZOCO_under", "style": { "margin": "9px 0 0 10px" }, "innerHTML": "该分组暂无好友" }, previousel);
- }
- if (nowel.parentNode && nowel.getElementsByClassName("U_MD_F_H_ZLZOCO_under")[0]) {
- nowel.removeChild($('.U_MD_F_H_ZLZOCO_under')[0]);
- }
- }
- U.MD.F.R.moveFriendOver = function (isdisplay, friendgroupmenu, el) {
-
- if (!U.UF.EV.stopBubbleMouseOutOrOver(el)) {
-
- friendgroupmenu.style.display = isdisplay ? "none" : "block";
- }
- }
- U.MD.F.R.topMoveFriendForm = function (el, friendinfo) {
- var _chooseGroupInfon = null;
-
-
- var i,
- _tempel,
- _friendclassel = $$("div", { "className": "U_MD_F_G_Y_D" }),
- _friendclassinfo = US.friend.allclass,
- _friendclassform = U.UF.UI.confirm(_friendclassel, function () { U.MD.F.R.assignMoveFriend(friendinfo, _chooseGroupInfon, el) });
- $$("div", { "innerText": "选择好友移动至", "className": "U_MD_F_G_Y_DT" }, _friendclassel);
- _tempel = $$("div", { "className": "U_MD_F_G_Y_DS" }, _friendclassel);
-
- for (i = 0; i < _friendclassinfo.length; i++) {
- $$("div", {
- "innerHTML": _friendclassinfo[i].FriendsGroupName,
- "className": "U_MD_F_G_Div_Q" + (friendinfo.FriendsGroupID == _friendclassinfo[i].FriendsGroupID ? " U_MD_F_G_Div_QO" : ""),
- "onclick": U.UF.C.closure(function (i) {
- _chooseGroupInfon = _friendclassinfo[i];
- U.MD.F.R.topMoveFriendFormSwitch(this, friendinfo, _friendclassinfo[i], _friendclassform, el);
- }, [i])
- }, _tempel);
- }
-
- U.selectEl($(_friendclassform.content)[0]).Parent().style.height = "100%";
- U.selectEl($($($($($(".U_MD_F_G_Y_D")[0]).Parent()).Parent()).Parent()).Parent()).Parent().style.zIndex = 100;
-
-
-
-
-
-
-
-
- }
- U.MD.F.R.topMoveFriendFormSwitch = function (groupel, friendinfo, friendclassinfo, friendclassform, el) {
- var i,
- _child = U.selectEl(el).parentElement().Child();
-
- _group = groupel.parentNode.children;
- for (i = 0; i < _group.length; i++) {
- _group[i].className = U.selectEl(".U_MD_F_G_Y_DS").Child()[i].className == "U_MD_F_G_Div_Q U_MD_F_G_Div_QO" ? "U_MD_F_G_Div_Q" : "U_MD_F_G_Div_Q";
- groupel.className = "U_MD_F_G_Div_Q U_MD_F_G_Div_QO";
- }
-
- for (i = 0; i < _child.length; i++) {
- _child[i].className = "U_MD_F_H_ZLZOCO" + (el == _child[i] ? " U_MD_F_G_Div_QQ" : "");
- }
-
-
- }
- U.MD.F.R.friendClassRightClickMenu = function (friendgroupinfo, el) {
- var _el = U.selectEl('#U_MD_F_G_Qun')[0],
- _child = U.selectEl(_el).Child();
- U.selectEl(_el).css({ "display": "block", "zIndex": "999" });
- U.UF.C.rightClickMenuLocation(_el);
-
- _child[0].onclick = function () { U.MD.F.R.popupUpdateFriendsClassForm(friendgroupinfo, el); };
- _child[1].onclick = function () { U.MD.F.R.popupDeleteFriendsClassForm(friendgroupinfo, el); };
- U.selectEl(document).bind("click", function () {
- U.selectEl('#U_MD_F_G_Qun')[0].style.display = "none";
- })
- }
- U.MD.F.R.popupUpdateFriendsClassForm = function (friendgroupinfo, el) {
- var _tempel,
- _temponeel,
- _temptwoel;
- var _el = U.selectEl('#U_MD_F_G_Qun')[0];
- U.selectEl(_el).css({ "display": "none" });
- if (friendgroupinfo) {
-
- _tempel = $$("div", { "className": "U_MD_U_L_Box_I U_MD_F_Add_TNL U_MD_F_G" });
- _temponeel = $$("div", {}, _tempel)
- _temptwoel = $$("input", {
- "value": friendgroupinfo.FriendsGroupName,
- "onfocus": function () { U.UF.MR.inputPlaceholder(this, friendgroupinfo.FriendsGroupName, ""); },
- "onblur": function () { U.UF.MR.inputPlaceholder(this, "", friendgroupinfo.FriendsGroupName); }
- }, _temponeel);
-
- U.UF.UI.confirm(_tempel, function () { U.MD.F.R.assignUpdateFriendsClass(friendgroupinfo, _temptwoel, el); });
- } else {
- U.alert("暂无群信息");
- }
- }
- U.MD.F.R.assignUpdateFriendsClass = function (friendgroupinfo, formel, el) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "UpdateClassNameAndDescription", friendgroupinfo["FriendsGroupID"], formel.value, ""],
- function () {
- U.selectEl(el)[0].innerText = formel.value;
- U.alert("修改成功");
- }, []);
- U.alert("正在修改中");
- }
- U.MD.F.R.popupDeleteFriendsClassForm = function (friendgroupinfo, el) {
- var _content;
- var _el = U.selectEl('#U_MD_F_G_Qun')[0];
- U.selectEl(_el).css({ "display": "none" });
- if (friendgroupinfo) {
- _content = "是否确定删除(" + friendgroupinfo.FriendsGroupName + ")该分组";
- U.UF.UI.confirm(_content, function () { U.MD.F.R.assignDeleteFriendsClass(friendgroupinfo, el); });
- }
- }
- U.MD.F.R.assignDeleteFriendsClass = function (friendgroupinfo, el) {
- var _friendGroupLength = U.Json.select(US.friend.friends, { "FriendsGroupID": friendgroupinfo.FriendsGroupID }).length;
- if (friendgroupinfo.FriendsGroupDescript != "自动创建") {
- if (_friendGroupLength == 0) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "DeleteFriendClass", friendgroupinfo.FriendsGroupID],
- function () {
- U.selectEl(el).Parent().remove()
- U.alert("删除成功");
-
- for (i = 0; i < US.friend.allclass.length; i++) {
- if (US.friend.allclass[i].FriendsGroupID == friendgroupinfo.FriendsGroupID) {
- US.friend.allclass.splice(i, 1);
- }
- }
- }, []);
- U.alert("正在删除中");
- } else {
- U.alert(friendgroupinfo.FriendsGroupName + "该分组下有好友,无法删除");
- }
- } else {
- U.alert("自动创建的分组不可删除");
- }
- }
- U.MD.F.R.deleteFriendForm = function (friendinfo, callback) {
- var _el;
- U.MD.F.R.addFriendsId(friendinfo);
-
- _el = $$("div", { "class": "U_MD_F_G_D" });
- $$("div", { "class": "U_MD_F_G_DelSpan", "innerText": "删除后对方将从好友列表中消失,无法进行发送以及接收消息。" }, _el);
-
- U.UF.UI.confirm(_el, function () {
- U.MD.F.M.deleteFriend(friendinfo);
- U.UF.C.isFunction(callback) && callback();
- });
- }
- U.MD.F.R.popupRightCornerMenu = function (friendinfo, el) {
- var _tempel,
- _friendclassinfo,
- _isaddfriend,
- _menuel = U.selectEl(el).Child()[0];
-
- if (_menuel) {
- U.selectEl(_menuel).remove();
- } else {
-
- if (friendinfo.UserId) {
- _isaddfriend = U.Json.selectOne(US.friend.friends, { "UserId": friendinfo.UserId });
-
- _tempel = $$("div", { "class": "U_MD_F_T_B", style: {} }, el);
- if (_isaddfriend) {
-
- _friendclassinfo = U.selectEl($("#g" + _isaddfriend.FriendsGroupID + " div")[1]).find('[tid="' + _isaddfriend["UserId"] + '"]')[0];
-
-
- $$("div", {
- "innerText": "修改备注姓名",
- "onclick": function () {
- U.MD.F.R.updateFriendDescriptForm(_isaddfriend);
- }
- },
- _tempel);
- $$("div", {
- "innerText": "修改好友分组",
- "onclick": function () {
- U.MD.F.R.topMoveFriendForm(_friendclassinfo, _isaddfriend);
- }
- },
- _tempel);
- $$("div", {
- "innerText": "删除好友",
- "onclick": function () {
- U.MD.F.R.deleteFriendForm(_isaddfriend);
- }
- },
- _tempel);
- U.UF.EV.stopBubble();
- U.selectEl(document).bind("click", function (e) {
- U.selectEl(".U_MD_F_T_B").remove();
- })
- }
-
- else {
- $$("div", {
- "innerText": "添加该好友",
- 'onclick': function () {
- U.MD.F.M.addFriend(friendinfo);
- }
- }, _tempel);
- }
- }
-
- else {
- U.MD.F.J.groupInfoForm(friendinfo);
- }
- }
- }
- U.MD.F.R.updateFriendDescriptForm = function (_friendinfo) {
- var _tempel,
- _temponeel,
- _temptwoel,
- _descript;
- _descript = _friendinfo.FriendsDescript || _friendinfo.UserNickName;
-
- _tempel = $$("div", { "className": "U_MD_U_L_Box_I U_MD_F_Add_TNL U_MD_F_G" });
- _temponeel = $$("div", {}, _tempel)
- _temptwoel = $$("input", {
- "value": _descript,
- "onfocus": function () {
- U.UF.MR.inputPlaceholder(this, _descript, "");
- },
- "onblur": function () {
- U.UF.MR.inputPlaceholder(this, "", _descript);
- }
- }, _temponeel);
-
- U.UF.UI.confirm(_tempel, function () {
- U.MD.F.R.updateFriendDescript(_friendinfo, _temptwoel);
- });
- }
- U.MD.F.R.updateFriendDescript = function (friendinfo, el) {
- U.A.Request(US.CD, [US.DB, "UseStudio_Friends", "UpdateFriendDescription", friendinfo['FriendsID'], el.value],
- U.MD.F.R.asynUpdateFriendDescript, [null, friendinfo, el.value]);
- }
- U.MD.F.R.asynUpdateFriendDescript = function (r) {
- var _context = r.context,
- _friendinfo = _context[1],
- _descript = _context[2],
- _el = U.selectEl($("#g" + _friendinfo.FriendsGroupID + " div")[1]).find('[tid="' + _friendinfo["UserId"] + '"]')[0];
- _friendinfo.FriendsDescript = _descript;
-
- if (_el) {
- U.selectEl("div", _el)[2].innerText = _context[2];
- }
-
- U.selectEl("div", U.selectEl('.U_MD_F_TO.U_MD_F_TOT')[0])[1].innerText = _context[2];
- var _obj = U.selectEl('.U_MD_F_TO.U_MD_F_TOT')[0],
- _tags = U.selectEl(".U_MD_F_TA")[0].children;
- for (var i = 0, len = _tags.length; i < len; i++) {
-
- if (_tags[i] == _obj) {
- U.selectEl("div", U.selectEl('.U_MD_F_H')[i])[2].innerText = _context[2];
- }
- }
- }
- U.MD.F.R.GroupRightClickMenu = function (el, friendgroupinfo) {
- var _el = U.selectEl('#U_MD_F_G_Group')[0],
- _groupuserinfo = U.Json.select(US.friend.groupusers, { "GroupManageID": friendgroupinfo.GroupManageID }),
- _child = U.selectEl(_el).Child();
- U.selectEl(_el).css({ "display": "block", "zIndex": "999" });
- U.UF.C.rightClickMenuLocation(_el);
-
- _child[0].onclick = function () { U.MD.F.J.groupInfoForm(friendgroupinfo, el) };
- _child[1].onclick = function () { U.MD.F.J.groupExit(friendgroupinfo, U.Json.selectOne(_groupuserinfo, { "UserId": US.userInfo.userid })); };
- U.selectEl(document).bind("click", function () {
- U.selectEl('#U_MD_F_G_Group')[0].style.display = "none";
- })
- }
- U.MD.F.R.addFriendsId = function (friendinfo) {
- var _userfriends = US.friend.friends;
- if (!friendinfo.FriendsID) {
- for (var i = 0; i < _userfriends.length; i++) {
- if (friendinfo.UserId == _userfriends[i].UserId) {
- friendinfo.FriendsID = _userfriends[i].FriendsID;
- }
- }
- } else {
- for (var i = 0; i < _userfriends.length; i++) {
- if (friendinfo.UserId == _userfriends[i].UserId && friendinfo.FriendsID != _userfriends[i].FriendsID) {
- friendinfo.FriendsID = _userfriends[i].FriendsID;
- }
- }
- }
- };;
- Namespace.register("U.MD.U.C");
- U.MD.U.C.J = { "citylist": [{ "co": "中国", "cp": [{ "p": "北京市", "c": [{ "n": "东城" }, { "n": "西城" }, { "n": "崇文" }, { "n": "宣武" }, { "n": "朝阳" }, { "n": "丰台" }, { "n": "石景山" }, { "n": "海淀" }, { "n": "门头沟" }, { "n": "房山" }, { "n": "通州" }, { "n": "顺义" }, { "n": "昌平" }, { "n": "大兴" }, { "n": "怀柔" }, { "n": "平谷" }, { "n": "密云" }, { "n": "延庆" }] }, { "p": "天津市", "c": [{ "n": "和平" }, { "n": "河东" }, { "n": "河西" }, { "n": "南开" }, { "n": "河北" }, { "n": "红挢" }, { "n": "塘沽" }, { "n": "汉沽" }, { "n": "大港" }, { "n": "东丽" }, { "n": "西青" }, { "n": "津南" }, { "n": "北辰" }, { "n": "武清" }, { "n": "宝坻" }, { "n": "宁河" }, { "n": "静海" }, { "n": "蓟县" }] }, { "p": "河北省", "c": [{ "n": "石家庄" }, { "n": "唐山" }, { "n": "秦皇岛" }, { "n": "邯郸" }, { "n": "邢台" }, { "n": "保定" }, { "n": "张家口" }, { "n": "承德" }, { "n": "沧州" }, { "n": "廊坊" }, { "n": "衡水" }] }, { "p": "山西省", "c": [{ "n": "太原" }, { "n": "大同" }, { "n": "阳泉" }, { "n": "长治" }, { "n": "晋城" }, { "n": "朔州" }, { "n": "晋中" }, { "n": "运城" }, { "n": "忻州" }, { "n": "临汾" }, { "n": "吕梁" }] }, { "p": "内蒙古", "c": [{ "n": "呼和浩特" }, { "n": "包头" }, { "n": "乌海" }, { "n": "赤峰" }, { "n": "通辽" }, { "n": "鄂尔多斯" }, { "n": "呼伦贝尔" }, { "n": "巴彦淖尔" }, { "n": "乌兰察布" }, { "n": "兴安" }, { "n": "锡林郭勒" }, { "n": "阿拉善" }] }, { "p": "辽宁省", "c": [{ "n": "沈阳" }, { "n": "大连" }, { "n": "鞍山" }, { "n": "抚顺" }, { "n": "本溪" }, { "n": "丹东" }, { "n": "锦州" }, { "n": "营口" }, { "n": "阜新" }, { "n": "辽阳" }, { "n": "盘锦" }, { "n": "铁岭" }, { "n": "朝阳" }, { "n": "葫芦岛" }] }, { "p": "吉林省", "c": [{ "n": "长春" }, { "n": "吉林" }, { "n": "四平" }, { "n": "辽源" }, { "n": "通化" }, { "n": "白山" }, { "n": "松原" }, { "n": "白城" }, { "n": "延边" }] }, { "p": "黑龙江", "c": [{ "n": "哈尔滨" }, { "n": "齐齐哈尔" }, { "n": "鸡西" }, { "n": "鹤岗" }, { "n": "双鸭山" }, { "n": "大庆" }, { "n": "伊春" }, { "n": "佳木斯" }, { "n": "七台河" }, { "n": "牡丹江" }, { "n": "黑河" }, { "n": "绥化" }, { "n": "大兴安岭" }] }, { "p": "上海市", "c": [{ "n": "黄浦" }, { "n": "卢湾" }, { "n": "徐汇" }, { "n": "长宁" }, { "n": "静安" }, { "n": "普陀" }, { "n": "闸北" }, { "n": "虹口" }, { "n": "杨浦" }, { "n": "闵行" }, { "n": "宝山" }, { "n": "嘉定" }, { "n": "浦东新" }, { "n": "金山" }, { "n": "松江" }, { "n": "南汇" }, { "n": "奉贤" }, { "n": "青浦" }, { "n": "崇明" }] }, { "p": "江苏省", "c": [{ "n": "南京" }, { "n": "无锡" }, { "n": "徐州" }, { "n": "常州" }, { "n": "苏州" }, { "n": "南通" }, { "n": "连云港" }, { "n": "淮安" }, { "n": "盐城" }, { "n": "扬州" }, { "n": "镇江" }, { "n": "泰州" }, { "n": "宿迁" }] }, { "p": "浙江省", "c": [{ "n": "杭州" }, { "n": "宁波" }, { "n": "温州" }, { "n": "嘉兴" }, { "n": "湖州" }, { "n": "绍兴" }, { "n": "金华" }, { "n": "衢州" }, { "n": "舟山" }, { "n": "台州" }, { "n": "丽水" }] }, { "p": "安徽省", "c": [{ "n": "合肥" }, { "n": "芜湖" }, { "n": "蚌埠" }, { "n": "淮南" }, { "n": "马鞍山" }, { "n": "淮北" }, { "n": "铜陵" }, { "n": "安庆" }, { "n": "黄山" }, { "n": "滁州" }, { "n": "阜阳" }, { "n": "宿州" }, { "n": "巢湖" }, { "n": "六安" }, { "n": "亳州" }, { "n": "池州" }, { "n": "宣城" }] }, { "p": "福建省", "c": [{ "n": "福州" }, { "n": "厦门" }, { "n": "莆田" }, { "n": "三明" }, { "n": "泉州" }, { "n": "漳州" }, { "n": "南平" }, { "n": "龙岩" }, { "n": "宁德" }] }, { "p": "江西省", "c": [{ "n": "南昌" }, { "n": "景德镇" }, { "n": "萍乡" }, { "n": "九江" }, { "n": "新余" }, { "n": "鹰潭" }, { "n": "赣州" }, { "n": "宜春" }, { "n": "吉安" }, { "n": "抚州" }, { "n": "上饶" }] }, { "p": "山东省", "c": [{ "n": "济南" }, { "n": "青岛" }, { "n": "淄博" }, { "n": "枣庄" }, { "n": "东营" }, { "n": "烟台" }, { "n": "潍坊" }, { "n": "济宁" }, { "n": "泰安" }, { "n": "威海" }, { "n": "日照" }, { "n": "莱芜" }, { "n": "临沂" }, { "n": "德州" }, { "n": "聊城" }, { "n": "滨州" }, { "n": "菏泽" }] }, { "p": "河南省", "c": [{ "n": "郑州" }, { "n": "开封" }, { "n": "洛阳" }, { "n": "平顶山" }, { "n": "安阳" }, { "n": "鹤壁" }, { "n": "新乡" }, { "n": "焦作" }, { "n": "濮阳" }, { "n": "许昌" }, { "n": "漯河" }, { "n": "三门峡" }, { "n": "南阳" }, { "n": "商丘" }, { "n": "信阳" }, { "n": "周口" }, { "n": "驻马店" }, { "n": "济源" }] }, { "p": "湖北省", "c": [{ "n": "武汉" }, { "n": "黄石" }, { "n": "十堰" }, { "n": "宜昌" }, { "n": "襄樊" }, { "n": "鄂州" }, { "n": "荆门" }, { "n": "孝感" }, { "n": "荆州" }, { "n": "黄冈" }, { "n": "咸宁" }, { "n": "随州" }, { "n": "恩施" }, { "n": "仙桃" }, { "n": "潜江" }, { "n": "天门" }, { "n": "神农架" }] }, { "p": "湖南省", "c": [{ "n": "长沙" }, { "n": "株洲" }, { "n": "湘潭" }, { "n": "衡阳" }, { "n": "邵阳" }, { "n": "岳阳" }, { "n": "常德" }, { "n": "张家界" }, { "n": "益阳" }, { "n": "郴州" }, { "n": "永州" }, { "n": "怀化" }, { "n": "娄底" }, { "n": "湘西" }] }, { "p": "广东省", "c": [{ "n": "广州" }, { "n": "韶关" }, { "n": "深圳" }, { "n": "珠海" }, { "n": "汕头" }, { "n": "佛山" }, { "n": "江门" }, { "n": "湛江" }, { "n": "茂名" }, { "n": "肇庆" }, { "n": "惠州" }, { "n": "梅州" }, { "n": "汕尾" }, { "n": "河源" }, { "n": "阳江" }, { "n": "清远" }, { "n": "东莞" }, { "n": "中山" }, { "n": "潮州" }, { "n": "揭阳" }, { "n": "云浮" }] }, { "p": "广西省", "c": [{ "n": "南宁" }, { "n": "柳州" }, { "n": "桂林" }, { "n": "梧州" }, { "n": "北海" }, { "n": "防城港" }, { "n": "钦州" }, { "n": "贵港" }, { "n": "玉林" }, { "n": "百色" }, { "n": "贺州" }, { "n": "河池" }, { "n": "来宾" }, { "n": "崇左" }] }, { "p": "海南省", "c": [{ "n": "海口" }, { "n": "三亚" }, { "n": "五指山" }, { "n": "琼海" }, { "n": "儋州" }, { "n": "文昌" }, { "n": "万宁" }, { "n": "东方" }, { "n": "定安" }, { "n": "屯昌" }, { "n": "澄迈" }, { "n": "临高" }, { "n": "白沙" }, { "n": "昌江" }, { "n": "乐东" }, { "n": "陵水" }, { "n": "保亭" }, { "n": "琼中" }, { "n": "西沙" }, { "n": "南沙" }, { "n": "中沙" }] }, { "p": "重庆市", "c": [{ "n": "渝中" }, { "n": "大渡口" }, { "n": "江北" }, { "n": "沙坪坝" }, { "n": "九龙坡" }, { "n": "南岸" }, { "n": "北碚" }, { "n": "万盛" }, { "n": "双挢" }, { "n": "渝北" }, { "n": "巴南" }, { "n": "万州" }, { "n": "涪陵" }, { "n": "黔江" }, { "n": "长寿" }, { "n": "江津" }, { "n": "合川" }, { "n": "永川" }, { "n": "南川" }, { "n": "綦江" }, { "n": "潼南" }, { "n": "铜梁" }, { "n": "大足" }, { "n": "荣昌" }, { "n": "壁山" }, { "n": "垫江" }, { "n": "武隆" }, { "n": "丰都" }, { "n": "城口" }, { "n": "梁平" }, { "n": "开县" }, { "n": "巫溪" }, { "n": "巫山" }, { "n": "奉节" }, { "n": "云阳" }, { "n": "忠县" }, { "n": "石柱" }, { "n": "彭水" }, { "n": "酉阳" }, { "n": "秀山" }] }, { "p": "四川省", "c": [{ "n": "成都" }, { "n": "自贡" }, { "n": "攀枝花" }, { "n": "泸州" }, { "n": "德阳" }, { "n": "绵阳" }, { "n": "广元" }, { "n": "遂宁" }, { "n": "内江" }, { "n": "乐山" }, { "n": "南充" }, { "n": "眉山" }, { "n": "宜宾" }, { "n": "广安" }, { "n": "达川" }, { "n": "雅安" }, { "n": "巴中" }, { "n": "资阳" }, { "n": "阿坝" }, { "n": "甘孜" }, { "n": "凉山" }] }, { "p": "贵州省", "c": [{ "n": "贵阳" }, { "n": "六盘水" }, { "n": "遵义" }, { "n": "安顺" }, { "n": "铜仁" }, { "n": "黔西南" }, { "n": "毕节" }, { "n": "黔东南" }, { "n": "黔南" }] }, { "p": "云南省", "c": [{ "n": "昆明" }, { "n": "曲靖" }, { "n": "玉溪" }, { "n": "保山" }, { "n": "昭通" }, { "n": "丽江" }, { "n": "普洱" }, { "n": "临沧" }, { "n": "楚雄" }, { "n": "红河" }, { "n": "文山" }, { "n": "西双版纳" }, { "n": "大理" }, { "n": "德宏" }, { "n": "怒江" }, { "n": "迪庆" }] }, { "p": "西藏", "c": [{ "n": "拉萨" }, { "n": "昌都" }, { "n": "山南" }, { "n": "日喀则" }, { "n": "那曲" }, { "n": "阿里" }, { "n": "林芝" }] }, { "p": "陕西省", "c": [{ "n": "西安" }, { "n": "铜川" }, { "n": "宝鸡" }, { "n": "咸阳" }, { "n": "渭南" }, { "n": "延安" }, { "n": "汉中" }, { "n": "榆林" }, { "n": "安康" }, { "n": "商洛" }] }, { "p": "甘肃省", "c": [{ "n": "兰州" }, { "n": "嘉峪关" }, { "n": "金昌" }, { "n": "白银" }, { "n": "天水" }, { "n": "武威" }, { "n": "张掖" }, { "n": "平凉" }, { "n": "酒泉" }, { "n": "庆阳" }, { "n": "定西" }, { "n": "陇南" }, { "n": "临夏" }, { "n": "甘南" }] }, { "p": "青海省", "c": [{ "n": "西宁" }, { "n": "海东" }, { "n": "海北" }, { "n": "黄南" }, { "n": "海南" }, { "n": "果洛" }, { "n": "玉树" }, { "n": "梅西" }] }, { "p": "宁夏省", "c": [{ "n": "银川" }, { "n": "石嘴山" }, { "n": "吴忠" }, { "n": "固原" }, { "n": "中卫" }] }, { "p": "新疆", "c": [{ "n": "乌鲁木齐" }, { "n": "克拉玛依" }, { "n": "吐鲁番" }, { "n": "哈密" }, { "n": "昌吉" }, { "n": "博尔塔拉" }, { "n": "巴音郭楞" }, { "n": "阿克苏" }, { "n": "克孜勒苏" }, { "n": "喀什" }, { "n": "和田" }, { "n": "伊犁" }, { "n": "塔城" }, { "n": "阿勒泰" }, { "n": "石河子" }, { "n": "阿拉尔" }, { "n": "图木舒克" }, { "n": "五家渠" }] }, { "p": "台湾省", "c": [{ "n": "台北市" }, { "n": "高雄市" }, { "n": "基隆市" }, { "n": "台中市" }, { "n": "台南市" }, { "n": "新竹市" }, { "n": "嘉义市" }, { "n": "台北县" }, { "n": "宜兰县" }, { "n": "桃园县" }, { "n": "新竹县" }, { "n": "苗栗县" }, { "n": "台中县" }, { "n": "彰化县" }, { "n": "南投县" }, { "n": "云林县" }, { "n": "嘉义县" }, { "n": "台南县" }, { "n": "高雄县" }, { "n": "屏东县" }, { "n": "台东县" }, { "n": "花莲县" }, { "n": "澎湖县" }] }, { "p": "香港", "c": [{ "n": "香港" }] }, { "p": "澳门", "c": [{ "n": "澳门" }] }] }, { "co": "其它", "cp": [{ "p": "其它", "c": [{ "n": "其它" }] }] }] };;
- Namespace.register("U.MD.U.F");
- U.MD.U.F.findPassword = function () {
- var _parent = U.selectEl("#U_MD_U_L_login");
-
- var _child = _parent.Child();
- _child[1].style.display = "none";
- _child[2].style.display = "none";
- U.selectEl("div", _child[0])[2].innerHTML = "找回密码";
-
- var _head = U.selectEl(_child[0]).childs()[1];
- U.selectEl(_head).addAttrArray({
- "innerHTML": "",
- "onclick": null,
- "className": "",
- "title": ""
- });
-
- U.MD.U.F.findPasswordProcessing($(_child[3]).Child()[1], 0);
-
- U.MD.U.F.switchEmailOrSecurityFind($("span", _child[3])[0], 'security');
- _child[3].style.display = "block";
- }
- U.MD.U.F.findPasswordProcessing = function (el, displaynum) {
- var _inputs,
- _len,
- _bottom,
- _child = U.selectEl(el).Child(),
- _parentel = U.selectEl(el).Parent();
-
- for (i = 0; i < _child.length; i++) {
-
- if (i == displaynum) {
- _child[i].style.display = "block";
- _inputs = U.selectEl("input", _child[i]);
- _len = _inputs.length;
- } else {
- _child[i].style.display = "none";
- }
- }
-
- while (_len--) {
- _inputs[_len].value = "";
- _inputs[_len].innerText = "6-20位字符或数字";
- _inputs[_len].focus();
- _inputs[_len].blur();
- }
- }
- U.MD.U.F.switchEmailOrSecurityFind = function (el, typename) {
- var _input,
- _tempel,
- _parentel = U.selectEl(el).Parent(2),
- _childs = U.selectEl(_parentel).Child(),
- _inputs = U.selectEl("input", _parentel),
- _span = U.selectEl("span", _parentel),
- _is = U.selectEl("i", _parentel),
- _bottom = U.selectEl(_parentel).Child()[2],
- _code = U.selectEl("#U_MD_U_L_Overflow_Code")[0];
-
- if (typename == "email") {
- _input = _inputs[1];
- _tempel = $$("input", {
- "type": "text",
- "onblur": function () {
- U.MD.U.F.checkEmail(this);
- U.selectEl(this).parentElement(2).removeClass('U_MD_U_L_Box_Border');
- },
- "onfocus": _input.onfocus,
- "onkeyup": _input.onkeyup
- });
- _input.parentNode.replaceChild(_tempel, _input);
- _is[1].innerText = "请输入邮箱";
- _span[1].className = "U_MD_U_F_T_Hover";
- _span[0].className = "";
- _code.style.display = "none";
- _bottom.onclick = function () {
- U.MD.U.F.findPasswordByEmail(_childs[1]);
- }
- }
-
- else if (typename == 'security') {
- _input = _inputs[1];
- _tempel = $$("input", {
- "type": "text",
- "onblur": function () {
- U.MD.U.F.checkPhone(this);
- U.selectEl(this).parentElement(2).removeClass('U_MD_U_L_Box_Border');
- },
- "onfocus": _input.onfocus,
- "onkeyup": _input.onkeyup
- });
- _input.parentNode.replaceChild(_tempel, _input);
- _is[1].innerText = "请输入手机号";
- _span[0].className = "U_MD_U_F_T_Hover";
- _span[1].className = "";
- _code.style.display = "block";
- _inputs[3].value = "发送";
- _inputs[3].onclick = function () {
- U.MD.U.F.userName(U.MD.U.F.phoneSend);
- }
- _bottom.onclick = function () {
- U.MD.U.F.phoneConfirm(_childs[1]);
- }
- }
- }
- U.MD.U.F.checkSecurityCode = function (el) {
- var _inputs = U.selectEl("input", el),
- _username = _inputs[0],
- _phone = _inputs[1];
- if (U.MD.U.F.checkUserName(_username) && U.MD.U.F.checkPhone(_phone)) {
- U.MD.U.F.phoneCheckSecurityCode(["", el, _username, _phone])
- }
- }
- U.MD.U.F.phoneSend = function () {
- var _username = U.selectEl("#U_MD_U_L_Box_height")[0].children[0].children[0].value;
- U.A.Request(US.CD, [US.DB, "UseStudio_Users", "GetUserinfoByUserName", _username], function (r) {
- if (r.value[0] == undefined) {
- U.MD.U.R.setInputStyle($("#userphone")[0].children[0], {
- "color": "red",
- "textAlign": "right",
- "display": "block"
- }, "输入的手机号与账号不匹配");
- return false;
- }
- if (r.value[0].UserTelephoneNumber != U.selectEl("#userphone")[0].children[0].children[0].value) {
- U.MD.U.R.setInputStyle($("#userphone")[0].children[0], {
- "color": "red",
- "textAlign": "right",
- "display": "block"
- }, "输入的手机号与账号不匹配");
- return false;
- } else {
-
-
-
- var _xhttp = new XMLHttpRequest();
- _xhttp.onreadystatechange = function () {
- if (this.readyState == 4) {
- if (this.status == 201) {
- U.Alert('发送成功');
- U.MD.U.F.setTime($("#U_MD_U_L_Overflow_Code")[0].children[1].children[0]);
- } else {
- U.Alert(JSON.parse(this.response).err || '验证码发送失败,请重新发送...');
- }
- }
- };
- _xhttp.open("POST", "http://api.cloudsql.1473.cn/postnumber", true);
- _xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- _xhttp.withCredentials = true;
- _xhttp.send("number=" + U.selectEl("#userphone")[0].children[0].children[0].value);
-
-
-
-
- }
- })
- }
- U.MD.U.F.phoneConfirm = function (el) {
- var _xhttp = new XMLHttpRequest();
- _xhttp.onreadystatechange = function () {
- if (this.readyState == 4) {
- if (this.status == 201) {
- U.MD.U.F.checkSecurityCode(el);
- U.Alert("验证成功");
- } else {
- U.Alert(JSON.parse(this.response).err || "验证码有误");
- }
- }
- };
- _xhttp.open("POST", "http://api.cloudsql.1473.cn/verifi", true);
- _xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- _xhttp.withCredentials = true;
- _xhttp.send("code=" + U.selectEl("#U_MD_U_L_Overflow_Code")[0].children[0].children[0].value);
- }
- U.MD.U.F.setTime = function (obj, countdown) {
- var countdown = 60;
- var _settime = setInterval(function () {
- if (countdown == 0) {
- obj.removeAttribute("disabled");
- obj.value = "重新获取验证码";
- clearInterval(_settime);
- return;
- } else {
- obj.setAttribute("disabled", true);
- obj.value = "重新发送(" + countdown + ")";
- countdown--;
- }
- }, 1000);
- }
- U.MD.U.F.userName = function (cb) {
- U.A.Request(US.USER, ["CheckUserName", U_MD_U_L_Box_height.children[0].children[0].value],
- function (r) {
- var _str = U.UF.C.jsonToStr(r.value);
- if (_str == "false") {
- U.MD.U.R.setInputStyle(U_MD_U_L_Box_height, {
- "color": "red",
- "textAlign": "right",
- "display": "block"
- }, "用户名不存在");
- }
- cb();
- })
- }
- U.MD.U.F.phoneCheckSecurityCode = function (r) {
- var _bottom,
- _childs,
- _username = r[2],
- _enterpassword = r[3],
- _el = U.selectEl(_username).Parent(4);
-
- if (r) {
-
- U.MD.U.F.findPasswordProcessing(_el, 1);
- _bottom = U.selectEl(_el.parentNode).Child()[2];
- _childs = U.selectEl("input", _el);
-
- _bottom.onclick = function () {
- U.MD.U.F.setNewUserPassword(r, _childs[1]);
- };
- } else {
-
- U.MD.U.R.setInputStyle(_enterpassword, {
- "color": "red",
- "textAlign": "right",
- "display": "block"
- }, "账号或者密保错误");
- }
- }
- U.MD.U.F.setNewUserPassword = function (userinfo, phone) {
-
- var _newpassword = userinfo[1].children[1].children[0].children[0].children[0].value;
- var _newpasswordt = userinfo[1].children[1].children[1].children[0].children[0].value;
- if (U.MD.U.F.checkConfirmPassword(_newpassword, _newpasswordt)) {
- U.A.Request(US.USER, ["UpdateUserPasswordByOldPhoneNumber", phone.value, _newpassword],
- U.MD.U.F.asynSetNewUserPassword);
- }
- }
- U.MD.U.F.asynSetNewUserPassword = function (r) {
- if (r.value) {
- U.alert("修改密码成功,请登录");
- U.MD.U.L.login();
- };
- }
- U.MD.U.F.findPasswordByEmail = function (el) {
- var _inputs = U.selectEl("input", el),
- _username = _inputs[0],
- _email = _inputs[1];
-
- if (U.MD.U.F.checkEmail(_email) && U.MD.U.F.checkUserName(_username)) {
- U.A.Request(US.USER, ["FindPasswordByEmail", _username.value, _email.value], U.MD.U.F.asynFindPasswordByEmail);
- }
- }
- U.MD.U.F.asynFindPasswordByEmail = function (r) {
-
- if (r.value == "2") {
- U.alert("已经发送邮箱,请及时查看密码");
- U.MD.U.L.init();
-
- }
-
- else if (r.value == "0") {
- U.alert("您输入的账号不存在");
- }
-
- else if (r.value == "1") {
- U.alert("邮箱账号不匹配");
- }
- }
- U.MD.U.F.checkEmail = function (inputel) {
- var _email = inputel.value;
-
- if (_email == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "请输入邮箱");
- }
-
- else if (!U.UF.S.Email.test(_email)) {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'right' }, "请输入正确邮箱");
- } else {
- return true;
- }
- return false;
- }
- U.MD.U.F.checkPhone = function (inputel) {
- var _password = inputel.value;
-
- if (_password == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "请输入手机号");
- }
-
- else if (!/^1[3|4|5|8][0-9]\d{4,8}$/.test(_password)) {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", "color": "red", 'textAlign': 'right' }, "请输入有效手机号");
- } else {
- return true;
- }
- return false;
- }
- U.MD.U.F.checkPass = function (inputel) {
- var _password = inputel.value;
-
- if (_password == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "6-20位字符或数字");
- }
-
- else if (!U.UF.S.PassWord.test(_password)) {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", "color": "red", 'textAlign': 'right' }, "6-20位字符或数字");
- } else {
- return true;
- }
- return false;
- }
- U.MD.U.F.Verification = function (inputel) {
- var _code = inputel.value;
-
- if (_code == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "请输入验证码");
- }
-
- else if (!/^\d{4,6}$/.test(_code)) {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", "color": "red", 'textAlign': 'right' }, "请输入4-6位数的验证码");
- } else {
- return true;
- }
- return false;
- }
- U.MD.U.F.checkUserName = function (inputel) {
- var _username = inputel.value;
-
- if (_username == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "云端账号");
- }
-
- else if (!U.UF.S.UserName.test(_username)) {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'right' }, "4-14位数字或者字母");
- } else {
- return true;
- }
- return false;
- }
- U.MD.U.F.checkConfirmPassword = function (inputo, inputt) {
- var _password = inputt.value;
-
- if (_password == "") {
- U.MD.U.R.setInputStyle(inputt, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "6-20位字符或数字");
- }
-
- else if (!U.UF.S.PassWord.test(_password)) {
- U.MD.U.R.setInputStyle(inputt, { "display": "block", "color": "red", 'textAlign': 'right' }, "6-20位字符或数字");
- }
-
- else if (inputo.value != inputt.value) {
- U.MD.U.R.setInputStyle(inputt, { "display": "block", "color": "red", 'textAlign': 'right' }, "密码不一致");
- } else {
- return true;
- }
- return false;
- }
-
- ;
- Namespace.register("U.MD.U.L");
- U.MD.U.L.init = function () {
- var _parent = U.selectEl("#U_MD_U_L_login");
- var _child = _parent.Child();
- _child[1].style.display = "none";
- _child[2].style.display = "block";
- _child[3].style.display = "none";
-
- U.selectEl("div", _child[0])[2].innerHTML = "登录";
-
- var _head = U.selectEl(_child[0]).childs()[1];
- U.selectEl(_head).addAttrArray({
- innerHTML: "",
- "className": "",
- title: ""
- });
- var _username = U.UF.Cookie.get("usestudiosso", "username")[0];
- var _input = U.selectEl("input", _child[2]);
- if (_username) {
- _input[0].focus();
- _input[0].value = _username;
- _input = _input[1];
- } else {
- _input = _input[0];
- }
- _input.focus();
- }
- U.MD.U.L.loginEnter = function (inputel, bottomel) {
- var i,
- _parentel = U.selectEl(inputel).Parent(3),
- _inputs = U.selectEl("input", _parentel);
-
- for (i = 0; i < _inputs.length; i++) {
- if (_inputs[i].value == "") {
- _inputs[i].focus();
- return;
- }
- }
-
- bottomel.onclick();
- }
- U.MD.U.L.clickLogin = function (bottomel) {
- var _parentel = U.selectEl(bottomel).Parent(),
- _inputel = U.selectEl("input", _parentel),
- _username = _inputel[0].value,
- _password = _inputel[1].value,
- _static = _inputel[2].checked ? "1" : "0";
-
- if (_username && _username == US.userInfo.username) {
- U.selectEl("#U_MD_HomeC_Pop")[0].close();
- }
-
- else if (U.MD.U.L.loginAjax(_username, _password, _static, U.selectEl(_parentel).Parent())) {
- _inputel[1].value = "";
- }
- }
- U.MD.U.L.loginAjax = function (username, password, staticm, loading, fun) {
- var _logaddress = US.city.userAllLocation || "";
-
- if (username.removeP() && password.removeP()) {
- if (fun) { U.MD.U.L.loginCallBack = fun; }
- U.MD.U.L.isLogining = true;
-
- U.A.Request(US.USER, ["UserLogin", username, password, staticm], U.MD.U.L.asynLoginAjax, [loading, _logaddress, username, password]);
- return true;
- }
- }
- U.MD.U.L.asynLoginAjax = function (r, iscookie) {
- if ($('#U_MD_U_L_Login_B')[0]) {
- U.selectEl('#U_MD_U_L_Login_B')[0].innerHTML = '登录';
- }
- if (U.MD.U.L.loginCallBack) {
- U.MD.U.L.loginCallBack(r, iscookie);
- }
- }
- U.MD.U.L.checkUserName = function (inputel) {
- var _username = inputel.value;
-
- U.selectEl('.U_MD_U_L_Box_B').removeClass('U_MD_U_L_Box_mistakeBorder');
- if ($('.U_MD_U_L_Box_checkUseNameFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkUseNameFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkUseNameFormat')[0]);
- }
- if (_username == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "用户账号");
- return false;
- }
-
- else if (!U.UF.S.UserName.test(_username)) {
- $$("div", { className: 'checkUseNameFormat' }, U.selectEl(".U_MD_U_L_Box_B")[0]);
- U.selectEl('.U_MD_U_L_Box_B').addClass(" U_MD_U_L_Box_mistakeBorder");
- U_MD_U_L_createFormat($('.U_MD_U_L_LB')[1], U.selectEl('.U_MD_U_L_Box_P_B')[1]);
-
- return false;
- }
- return true;
- }
- U_MD_U_L_createFormat = function (parentnode, beforenode) {
- if ($('.U_MD_U_L_Box_checkUseNameFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkUseNameFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkUseNameFormat')[0]);
- }
- var _format = document.createElement('div');
- _format.className = "U_MD_U_L_Box_checkUseNameFormat";
- _format.innerText = "2-10汉字或4-20字符";
- parentnode.insertBefore(_format, beforenode);
- }
- U.MD.U.L.checkpassword = function (inputel) {
- var _password = inputel.value;
-
- if (_password == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "用户密码");
- }
- }
-
- ;
- Namespace.register("U.MD.U.LO");
- U.MD.U.LO.logoutSystem = function (callback) {
-
- if (US.userInfo.userid) {
-
- U.UF.UI.confirm("Do you want to logout of" + US.userInfo.username + "'s account", function () {
- U.MD.U.LO.logout(callback);
- });
- }
- }
- U.MD.U.LO.logout = function (callback) {
- U.MD.U.LO.clearCookie(function () {
- U.MD.U.LO.emptyUserInfo();
- if ($('#UI_Login')[0]) {
- U.selectEl('#UI_Login')[0].contentWindow.U.MD.U.OT.logout();
- }
-
- if ($("#U_MD_D_BDI")[0]) {
-
- U.MD.U.LO.logoutStyle();
- U.MD.D.T.taskbar.clear();
- U.UF.UI.form.closeWindows();
- }
- U.UF.C.isFunction(callback) && callback();
- });
- }
- U.MD.U.LO.clearCookie = function (callback) {
-
- if (US.userInfo.userid) {
- var _iscookie = U.UF.Cookie.get("usestudiosso", "userid").indexOf(US.userInfo.userid) > -1;
-
- if (_iscookie) {
-
- U.A.Request(US.USER, ["UserOffline", US.userInfo.userid], function () { U.UF.C.isFunction(callback) && callback(); });
- } else {
- U.UF.C.isFunction(callback) && callback();
- }
- }
- }
- U.MD.U.LO.emptyUserInfo = function () {
- US.userInfo = {};
- US.friend = {};
- if ($("#U_MD_D_BG")[0]) {
- U.MD.D.B.setBackgroundImage(U.MD.D.B.url);
- }
- }
- U.MD.U.LO.logoutStyle = function () {
-
- U.selectEl("#U_MD_D_BDI").addAttrArray({
- "innerHTML": "",
- "className": "U_MD_D_BDI U_Img"
- });
-
- var _childel = U.selectEl("#U_MD_D_BDL").childs();
- _childel[0].style.display = _childel[1].style.display = "block";
- _childel[2].style.display = "none";
-
- U.selectEl("#U_MD_F_H_R").css("display", "none");
-
- U.selectEl("#U_MD_D_MG_OA").Parent(2).style.display = "none";
-
-
- };
- Namespace.register("U.MD.U.OT");
- U.MD.U.OT.advertisingLanguage = "最新科技:云操作系统,您也来加入吧!点击进入哦!";
- U.MD.U.OT.qqLoadJs = function (bottonstyle) {
-
- U.UF.DL.asynLoadJs({
- "data-appid": "100584402",
- "charset": "utf-8",
- "src": "http://qzonestyle.gtimg.cn/qzone/openapi/qc-1.0.1.js"
- },
- function () {
- U.MD.U.OT.asynQqLoadJs(bottonstyle);
- });
- }
- U.MD.U.OT.asynQqLoadJs = function (bottonstyle) {
-
- QC.Login(bottonstyle, function (qquserinfo) {
- U.MD.U.OT.qqLoginCallBack(qquserinfo);
- });
-
- U.selectEl("a", U.selectEl("#" + bottonstyle["btnId"])[0]).addAttrArray({ "href": "javascript:void(0)" });
- }
- U.MD.U.OT.weiboLoadJs = function (bottonstyle) {
-
- U.UF.DL.asynLoadJs({
- "charset": "utf-8",
- "src": "http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=1242324937",
- "charset": "utf-8",
- "type": "text/javascript"
- },
- function () {
-
- WB2.anyWhere(function (wb) {
- wb.widget.connectButton(bottonstyle);
- U.selectEl("a", U.selectEl("#" + bottonstyle["id"])[0]).addAttrArray({ "href": "javascript:void(0)" });
- });
- });
- }
- U.MD.U.OT.weixinLoadJs = function (bottonstyle) {
-
- U.UF.DL.asynLoadJs({
- "charset": "utf-8",
- "src": "http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js",
- "charset": "utf-8",
- "type": "text/javascript"
- },
- function () {
-
- new WxLogin({
- id: bottonstyle.ID || "",
- appid: "wxae62986df7490c49",
- scope: "snsapi_login",
- redirect_uri: "",
- state: bottonstyle.state || Guid.newGuid(),
- style: bottonstyle.style || "",
- href: bottonstyle.href || ""
- });
- });
- }
- U.MD.U.OT.logout = function () {
- try {
-
- if (WB2 && WB2.checkLogin()) {
- WB2.logout();
- }
- } catch (e) { }
- try {
-
- if (QC && QC.Login.check()) {
- QC.Login.signOut();
- }
- } catch (e) { }
- }
- U.MD.U.OT.qqLoginCallBack = function () {
-
- if (QC.Login.check()) {
-
- QC.Login.getMe(function (openid, token) {
- var _qquserinfo = {};
- _qquserinfo.accessToken = token;
- _qquserinfo.openID = openid;
-
- QC.api("get_user_info", {}).success(function (userinfo) {
- userinfo = userinfo.data;
-
- _qquserinfo.UserNickName = userinfo.nickname;
- _qquserinfo.gender = userinfo == "男" ? 1 : 0;
- _qquserinfo.province = userinfo.province;
- _qquserinfo.city = userinfo.city;
- _qquserinfo.Birthday = U.UF.D.toTimeStamp(_qquserinfo.year + "/01/01");
-
- QC.api("get_info", {}).success(function (weibouserinfo) {
- weibouserinfo = weibouserinfo.data.data;
- var _location = weibouserinfo.location.split(' ');
-
- QC.api("add_pic_t", {
- "content": U.MD.U.OT.advertisingLanguage,
- "pic": "/img/qqew.jpg"
- });
-
- QC.api("add_idol", {
- "name": "雨云科技"
- });
-
- _qquserinfo.nickname = weibouserinfo.nick;
- _qquserinfo.gender = weibouserinfo.sex;
- _qquserinfo.openID = openidp;
- _qquserinfo.accessToken = token;
- _qquserinfo.province = _location[1];
- _qquserinfo.city = _location[2];
- _qquserinfo.description = weibouserinfo.introduction;
- _qquserinfo.UserEmail = weibouserinfo.email;
- _qquserinfo.Birthday = U.UF.D.toTimeStamp(weibouserinfo.birth_year + "-" + weibouserinfo.birth_month + "-" + weibouserinfo.birth_day, "-");
-
- U.MD.U.OT.thirdPartyLogin(_qquserinfo);
- }).error(function () {
-
- U.MD.U.OT.thirdPartyLogin(_qquserinfo);
- });
- }).error(function () { U.alert("获取用户信息失败"); })
- });
- }
- }
- U.MD.U.OT.weiboLoginCallBack = function (userinfo) {
- U.MD.U.OT.thirdPartyLogin(userinfo);
- WB2.anyWhere(function (WB2) {
- WB2.parseCMD("/statuses/update.json",
-
- function (message) { }, {
- "status": U.MD.U.OT.advertisingLanguage
- });
-
- WB2.parseCMD("/friendships/create.json",
- function (message) { }, { "screen_name": "1473云端" });
- });
- }
- U.MD.U.OT.addWeiboFollowBottom = function (id) {
-
- WB2.anyWhere(function (weibo) {
-
- weibo.widget.followButton({
- "nick_name": "1473云端",
- "id": id,
- "show_head": false,
- "show_name": false,
- "show_cancel": false
- });
- });
- }
- U.MD.U.OT.weixin = function () {
-
- U.MD.U.OT.wxData = { "id": Guid.newGuid() };
- window.open("https://open.weixin.qq.com/connect/qrconnect?appid=wxae62986df7490c49&redirect_uri=" + window.encodeURI("/WxDomain.htm") + "&response_type=code&scope=snsapi_login&state=" + U.MD.U.OT.wxData.id);
- }
- U.MD.U.OT.asynWeixin = function (str) {
- var _co = U.UF.C.queryString("code", str),
- _state = U.UF.C.queryString("state", str);
- if (_state == U.MD.U.OT.wxData.id && _state != null) {
- U.A.Request("http://zhifu.1473.cn/weixin/login.php?code=" + _co, [], function (r) {
- if (r.value.openid) {
- U.MD.U.OT.thirdPartyLogin(r.value);
- } else {
- U.alert("微信扫描登录失败");
- }
- });
- }
- }
- U.MD.U.OT.thirdPartyLogin = function (userinfo) {
- var _openid = userinfo.openID || userinfo.id || userinfo.openid;
- U.A.Request(US.USER, ["ThirdPartyLogin", _openid],
- U.MD.U.OT.asynThirdPartyLogin, [null, userinfo]);
- }
- U.MD.U.OT.asynThirdPartyLogin = function (r) {
-
- if (typeof r.value == "object") {
- U.MD.U.L.asynLoginAjax(r);
- }
-
- else {
- U.MD.U.R.isregister[0] = U.MD.U.R.isregister[1] = false;
- window.parent.U.MD.U.L.perfectUserInfo(r.context[1], r.value);
- }
- }
- U.MD.U.OT.perfectUserInfoInit = function (userinfo, username) {
- var i,
- _password = U.UF.Math.getRandom(1000000),
- _el = U.selectEl("#U_MD_U_OT_B"),
- _childs = _el.find("div");
- U.MD.U.R.isregister[0] = U.MD.U.R.isregister[1] = false;
-
- while (username.toString().length < 6) {
- username = "0" + username;
- }
- _childs[4].innerHTML = "账号:<span>" + username + "</span>";
- _childs[5].innerHTML = "密码:" + _password;
-
- _childs[_childs.length - 1].onclick = function () {
- U.MD.U.OT.userRegister(userinfo, false, username, _password);
- }
-
- _childs[_childs.length - 2].onclick = function () {
- U.MD.U.OT.userRegister(userinfo, true);
- }
- }
- U.MD.U.OT.userRegister = function (userinfo, b, username, password) {
- var _openid,
- _el = U.selectEl("#U_MD_U_OT_B"),
- _inputs = _el.find("input");
-
- if (b) {
- username = _inputs[0].value;
- password = _inputs[1].value;
- }
-
- if (U.MD.U.R.isregister[0] && U.MD.U.R.isregister[1]) {
- _openid = userinfo.openID || userinfo.id || userinfo.openid;
-
- U.A.Request(US.USER, ["UserRegister", username, password, "", US.city.userAllLocation || "", _openid],
- U.MD.U.OT.asynUserRegister, [_el[0], userinfo]);
- } else {
- U.alert("注册的信息有问题,请修改。");
- }
- }
- U.MD.U.OT.asynUserRegister = function (r) {
- var _userinfo,
- _context = r.context,
- _outeruserinfo = _context[1];
-
- if (U.MD.U.R.asynRegister(r, true)) {
- _userinfo = US.userInfo;
-
- _userinfo.Country = "中国";
- _userinfo.Province = _outeruserinfo.province || "";
- _userinfo.UserEmail = _outeruserinfo.UserEmail || "";
- _userinfo.Birthday = U.UF.D.getYearMonthDay(_outeruserinfo.Birthday, "String");
- _userinfo.City = _outeruserinfo.city || "";
- _userinfo.UserAddress = _outeruserinfo.location || "";
- _userinfo.UserNickName = _outeruserinfo.screen_name || _outeruserinfo.nickname || "";
- _userinfo.UserRemarks = _outeruserinfo.description || "";
- _userinfo.UserIndividualitysignature = _outeruserinfo.description || "";
- _userinfo.UserThumbnailImageHead = _outeruserinfo.avatar_large || _outeruserinfo.avatar_hd || _outeruserinfo.figureurl_qq_2 || _outeruserinfo.figureurl_qq_1 || "";
- _userinfo.UserSex = (_outeruserinfo.gender == "m" | _outeruserinfo.gender == 1) ? 1 : 0;
-
- U.A.Request(US.USER, ["UpdateUserBasicInfo", _userinfo.UserId, "", _userinfo.UserNickName, "", "", _userinfo.UserIndividualitysignature, _userinfo.UserEmail, "", _userinfo.UserSex, _userinfo.Country, _userinfo.Province, _userinfo.City, _userinfo.Birthday], function () { });
-
- U.A.Request(US.USER, ["UpdateUserHeadPortrait", US.userInfo.userid, _userinfo.UserThumbnailImageHead, _userinfo.UserThumbnailImageHead], function () { });
-
- parent.$("#U_MD_U_OT_B_Pop")[0].close();
- } else {
-
- U.alert("注册失败。请重新尝试");
- }
- }
-
- ;
- Namespace.register("U.MD.U.R");
- U.MD.U.R.isregister = [false, false, false, false, false, true];
- U.MD.U.R.register = function () {
- var _parent = U.selectEl("#U_MD_U_L_login");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var _child = _parent.Child();
- _child[1].style.display = "block";
- _child[2].style.display = "none";
- _child[3].style.display = "none";
- U.selectEl("div", _child[0])[2].innerHTML = "快速注册";
-
- var _head = U.selectEl(_child[0]).childs()[1];
-
- U.selectEl(_head).addAttrArray({
- innerHTML: "已经有账号? <span onclick='U.MD.U.L.init();'>现在登录</div>",
- title: "",
- "className": "U_MD_U_L_Top_Yun"
- });
-
- if (!$("#U_MD_U_R_VC_Img img")[0]) {
-
- $$("img", {
- "alt": "看不清?点击重获验证码",
- "src": "http://main.1473.cn/Uses.ashx?mode=GraphicVerificationCode&n=" + Math.random(),
- "onclick": function () {
- U.MD.U.R.regenerateVerificaCode(this);
- }
- }, U.selectEl("#U_MD_U_R_VC_Img")[0]);
- }
-
- var _input = U.selectEl("input", _child[1])[0];
- _input.focus();
- }
- U.MD.U.R.regenerateVerificaCode = function (image) {
- image.src = "http://main.1473.cn/Uses.ashx?mode=GraphicVerificationCode&n=" + Math.random();
- }
- U.MD.U.R.clickRegister = function (button) {
- var _inputs = U.selectEl("#U_MD_U_R_I").find("input");
-
- if (_inputs[3].checked) {
-
- if (U.MD.U.R.isRegister(_inputs, button) && _inputs[2].value != "") {
- U.MD.U.R.ajaxRegister(_inputs[0].value, _inputs[1].value, "", U.selectEl("#U_MD_U_L_login")[0]);
- _inputs.addAttrArray({ "value": "" });
-
- for (i = 0; i < _inputs.length; i++) {
- if (_inputs[i].offsetWidth && _inputs[i].onblur) {
- _inputs[i].onblur();
- }
- }
- button.innerText = "注册中...";
- }
-
- else if (_inputs[0].value != "" && _inputs[1].value == "") {
- U.alert("请填写密码");
- } else if (_inputs[1].value != "" && _inputs[2].value == "") {
- U.alert("请正确填写信息");
- } else {
- U.alert("请正确的填写信息");
- }
- }
-
- else {
- U.alert("请阅读云端协议");
- }
- }
- U.MD.U.R.isRegister = function (inputs, button) {
- var _checked = U.MD.U.R.isregister.indexOf(false);
-
- if (_checked == -1) {
- return true;
- }
-
- else if (_checked == 4) {
-
- U.MD.U.R.verificationCode(inputs[2], function () {
- U.MD.U.R.clickRegister(button);
- });
- return true;
- }
- return false;
- }
- U.MD.U.R.ajaxRegister = U.MD.U.R.UR = function (username, password, email, loading) {
- U.MD.U.R.isregister = [false, false, false, false, false, true];
-
- U.A.Request(US.USER, ["UserRegister", username, password, email, US.city.userAllLocation, ""],
- U.MD.U.R.asynRegister, [loading, US.city.userAllLocation]);
- }
- U.MD.U.R.asynRegister = function (r, outsite) {
- var value = r.value;
-
- if (value == "notregister") {
- U.alert("已经存在该账号!");
- }
-
- else if (value == "false") {
- U.alert("系统繁忙,请稍后。");
- }
-
- else {
-
- U.MD.U.L.asynLoginAjax(r);
-
-
- return r;
- }
- }
- U.MD.U.R.verificationCode = function (input, cb) {
- var _code = input.value,
- _isnumber = U.UF.S.Number.test(_code);
- if (_isnumber) {
-
- U.A.Request(US.USER, ["ConfirmGraphicVerificationCode", _code],
- U.MD.U.R.asynVerificationCode, ["", input, cb]);
-
- U.MD.U.R.setInputStyle(input, { 'textAlign': 'right', 'color': 'red', "display": "block" }, "验证中...");
- } else if (_code) {
-
- U.MD.U.R.setInputStyle(input, { 'textAlign': 'right', 'color': 'red', "display": "block" }, "格式错误");
- } else {
-
- U.MD.U.R.setInputStyle(input, { 'textAlign': 'right', 'color': '#00aa99', "display": "block" }, "验证码");
- }
- }
- U.MD.U.R.asynVerificationCode = function (r) {
- var _context = r.context,
- _input = _context[1],
- _cb = _context[2]
- ;
- r = r.value;
-
- if (r == "True") {
- U.MD.U.R.setInputStyle(_input, { 'textAlign': 'right', 'marginRight': '0px', 'color': '#00aa99', "display": "block" }, "成功");
- U.MD.U.R.isregister[4] = true;
- if (U.UF.C.isFunction(_cb)) {
- _cb();
- }
- }
-
- else if (r == "False") {
- U.MD.U.R.setInputStyle(_input, { 'textAlign': 'right', 'marginRight': '15px', 'color': 'red', "display": "block" }, "错误");
- return false;
- }
-
- else {
- _input.value = "";
- _input.blur();
- U.MD.U.R.setInputStyle(_input, { 'textAlign': 'center', 'marginRight': '0px', 'color': '#00aa99', "display": "block" }, "验证码");
- U.selectEl("img", U.selectEl(_input).Parent(3))[0].src = "http://main.1473.cn/Uses.ashx?mode=GraphicVerificationCode&n=" + Math.random();
- _input.focus();
- U.alert("验证码错误或者服务器繁忙");
- }
- }
- U.MD.U.R.checkUserName = function (inputel) {
- var _username = inputel.value;
-
- U.selectEl('.U_MD_U_L_Box_U_B').removeClass(" U_MD_U_L_Box_mistakeBorder");
- if ($('.U_MD_U_L_Box_checkUseNameFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkUseNameFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkUseNameFormat')[0]);
- }
- if (_username == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left' }, "用户账号");
- }
-
- else if (!U.UF.S.UserName.test(_username)) {
- U.selectEl('.U_MD_U_L_Box_U_B').addClass(" U_MD_U_L_Box_mistakeBorder");
- U_MD_U_L_createFormat($('.U_MD_U_L_LB')[0], U.selectEl('.U_MD_U_L_Box_P_B')[0]);
-
- }
-
- else {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'right' }, "等待认证,请稍后...");
- U.A.Request(US.USER, ["CheckUserName", _username], U.MD.U.R.asynCheckUserName, ["", inputel]);
- }
- }
- U_MD_U_L_createFormat = function (parentnode, beforenode) {
- if (beforenode == U.selectEl('.U_MD_U_L_Box_P_B')[0] && U.selectEl('.U_MD_U_L_Box_checkUseNameFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkUseNameFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkUseNameFormat')[0]);
- }
- var _format = document.createElement('div');
- _format.className = "U_MD_U_L_Box_checkUseNameFormat";
- _format.innerText = "2-10汉字或4-20字符";
- parentnode.insertBefore(_format, beforenode);
- }
- U.MD.U.R.asynCheckUserName = function (r) {
- var _context = r.context,
- _inputel = _context[1];
- r = r.value;
-
- if (r == true) {
- U.MD.U.R.setInputStyle(_inputel, { "color": "red" }, "已被注册!");
- }
-
- else {
- U.MD.U.R.setInputStyle(_inputel, { "display": "none" });
- U.MD.U.R.isregister[0] = true;
- }
- }
- U.MD.U.R.checkPassword = function (inputel) {
- var _password = inputel.value;
- U.selectEl('.U_MD_U_L_Box_P_B').removeClass(" U_MD_U_L_Box_mistakeBorder");
- if ($('.U_MD_U_L_Box_checkPWFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkPWFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkPWFormat')[0]);
- }
-
- if (_password == "") {
- U.MD.U.R.setInputStyle(inputel, { "display": "block", 'textAlign': 'left', 'marginRight': '0px' }, "6-20位字符或数字");
- }
-
- else if (!U.UF.S.PassWord.test(_password)) {
- U.selectEl('.U_MD_U_L_Box_P_B').addClass(" U_MD_U_L_Box_mistakeBorder");
- U_MD_U_L_checkPWFormat($('.U_MD_U_L_LB')[0], U.selectEl('.U_MD_U_R_VC')[0]);
-
- }
-
- else {
- U.MD.U.R.passwordStrength(inputel);
- U.MD.U.R.isregister[1] = true;
- return true;
- }
- return false;
- }
- U_MD_U_L_checkPWFormat = function (parentnode, beforenode) {
- if (beforenode == U.selectEl('.U_MD_U_R_VC')[0] && U.selectEl('.U_MD_U_L_Box_checkPWFormat')[0]) {
- U.selectEl('.U_MD_U_L_Box_checkPWFormat')[0].parentNode.removeChild($('.U_MD_U_L_Box_checkPWFormat')[0]);
- }
- var _format = document.createElement('div');
- _format.className = "U_MD_U_L_Box_checkPWFormat";
- _format.innerText = "2-10汉字或4-20字符";
- parentnode.insertBefore(_format, beforenode);
- }
- U.MD.U.R.hidePromptBox = function (el) {
- var _parentel = U.selectEl(el).Parent();
- U.selectEl("i", _parentel)[0].style.display = "none";
- try {
- U.selectEl("input", _parentel)[0].focus();
- } catch (e) { }
- }
- U.MD.U.R.setInputStyle = function (input, styles, text) {
-
- var _parent = U.selectEl(input).Parent();
-
- var _el = U.selectEl("i", _parent);
- styles.display = "block";
- _el.addAttrArray({ "style": styles, "innerHTML": text || "" }, 0)[0];
- }
- U.MD.U.R.passwordStrength = function (input) {
- var i = 0,
- _value = input.value,
- _arr = [
- ["弱", "#e64141"],
- ["中", "#0a8cd2"],
- ["强", "#4bb900"]
- ];
-
- if (_value.length > 10) {
- i++;
- }
-
- if (_value.match(/[0-9]/ig)) {
- i++;
- }
-
- if (_value.match(/[a-z]/ig)) {
- i++;
- }
-
- i = i > 0 ? i - 1 : i;
-
- var _parent = U.selectEl(input).Parent();
-
- var _el = U.selectEl("i", _parent);
-
- _el.addAttrArray({
- "style": {
- "textAlign": "right",
- "display": "block",
- "color": _arr[i][1]
- },
- "innerHTML": _arr[i][0]
- }, 0);
- }
-
- ;
- Namespace.register("U.MD.U.S");
- U.MD.U.S.TF = { "Contribute": "找出漏洞", "Introduce": "推广本网站", "Upload": "上传文件", "PostArticle": "发表文章", "Online": "在线时间", "Reply": "回复文章", "SignIn": "登陆签到", "Download": "下载文件", "DiskAddition": "硬盘增加", "IllegalImage": "发布违规图片" }
- U.MD.U.S.FTF = { "Upload": "UseStudioUserDiskDiv", "Download": "UseStudioUserDiskDiv", "PostArticle": "UseStudioStudyControlDiv", "Reply": "UseStudioStudyControlDiv" };
- U.MD.U.S.E = {};
- U.MD.U.S.LoginIC = function () {
- var _UICD = U.selectEl("#UU_IC")[0],
- _UDGG = U.selectEl("#UU_ICBG_GG")[0];
- U.UF.F.windowTopCenter(_UICD);
- U.MD.U.S.GetIC($("div#UU_IC_Pay", _UICD)[0]);
- U.MD.D.T.WindowRestore(_UICD, '', '积分中心');
- }
- U.MD.U.S.SIC = function (TF) {
- U.MD.U.S.YXICD["none", "block"];
- if (TF == 1) { U.MD.U.S.GetIC($("#UU_IC_Pay")[0]); } else { U.MD.U.S.ICSS(1); }
- }
- U.MD.U.S.YXICD = function (TF) {
- U.selectEl('#UU_IC_HB')[0].style.display = TF[0];
- U.selectEl('#UU_IC_Info')[0].style.display = TF[1];
- }
- U.MD.U.S.SUIC = function (UICD) {
- var i, TF = 0,
- _UDAD = U.selectEl("#UU_IC_Avatar", UICD)[0],
- _UET = U.MD.U.S.E[US.userInfo.userid]["ICCSV"][0];
- _UDAD.innerHTML = "";
- for (i = 0; i < _UET.length; i++) { TF += _UET[i].VCSumValue; }
-
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "id": "UU_IC_Avatar_img",
- "src": U.MD.C.getHeadImage(US.userInfo.UserThumbnailImageHead)
- }, _UDAD);
- U.selectEl("#UU_IC_VCSum", UICD)[0].innerHTML = TF;
- }
- U.MD.U.S.ICSS = function (P) {
- var SP = Math.ceil(P * 7 / 70),
- _E = SP * 70,
- _S = _E - 69,
- UPDL = U.MD.U.S.E[US.userInfo.userid];
- if (UPDL && (UPDL = UPDL["Page"]) && (UPDL = UPDL[SP])) {
- var _TP = P % 10;
- _TP = _TP == 0 ? 10 : _TP;
- _E = _TP * 7;
- _S = _E - 7;
- var _UICL = UPDL.slice(_S, _E);
- U.MD.U.S.SetICSS(_UICL, P);
- } else { U.A.Request("UseStudioPay.UserGetSomeVC", [_S, _E], U.MD.U.S.AsynICSS, ["", P, SP, US.userInfo.userid]); }
- }
- U.MD.U.S.AsynICSS = function (r) {
- var _context = r.context;
- r = r.value;
- if (U.MD.U.S.E[_context[3]] == null) {
- U.MD.U.S.E[_context[3]] = { "Page": [] };
- } else if (U.MD.U.S.E[_context[3]]["Page"] == null) {
- U.MD.U.S.E[_context[3]]["Page"] = [];
- }
- U.MD.U.S.E[_context[3]]["Page"][_context[2]] = r[0];
- U.MD.U.S.ICTT(r[1], U.selectEl("#UU_ICM_UU_IC_Heroes")[0]);
- U.MD.U.S.ICSS(_context[1]);
- }
- U.MD.U.S.SetICSS = function (UICL, P) {
- if (UICL.length > 0) {
- U.MD.U.S.ICPL(UICL, ["时间", "来源", "来源", "积分"], U.selectEl("#UU_IC_Info")[0]);
- new U.UF.P.page($("#UU_IC_Pag")[0], UICL[0].AllCount, 7, P, function (P) { U.MD.U.S.ICSS(P); });
- }
- }
- U.MD.U.S.GetIC = function (UICD) {
- if (U.MD.U.S.E[US.userInfo.userid] && U.MD.U.S.E[US.userInfo.userid]["ICCSV"]) {
- U.MD.U.S.SetIC(U.MD.U.S.E[US.userInfo.userid]["ICCSV"], UICD);
- } else {
- U.A.Request("UseStudioPay.UserCountVC", [], U.MD.U.S.AsynGetIC, [UICD, 1, US.userInfo.userid]);
- }
- }
- U.MD.U.S.AsynGetIC = function (r) {
- var _context = r.context;
- r = r.value;
- if (U.MD.U.S.E[_context[2]] == null) {
- U.MD.U.S.E[_context[2]] = {};
- }
- U.MD.U.S.E[_context[2]]["ICCSV"] = r;
- U.MD.U.S.GetIC(_context[0], r);
- }
- U.MD.U.S.SetIC = function (UIC, UICD) {
- U.MD.U.S.ICTT(UIC[1], U.selectEl("div#UU_ICM_UU_IC_Heroes", UICD)[0]);
- U.MD.U.S.ICPL(UIC[0], ["时间", "来源", "积分", "次数"], U.selectEl("div#UU_IC_Info", UICD)[0]);
- U.MD.U.S.SUIC(UICD);
- }
- U.MD.U.S.ICTT = function (UICL, UOD) {
- var i, _UCL, _el, _UDTD,
- _UDFD = $$("frag");
- UOD.innerText = "";
- for (i = 0; i < UICL.length; i++) {
- _UCL = UICL[i];
- _el = $$("div", {
- "style": {
- "marginTop": "8px"
- },
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.U.V.POUW(_UCL.UserId);
- }
- }, _UDFD);
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "src": U.MD.C.getHeadImage(_UCL.UserThumbnailImageHead),
- "className": "UU_IC_Heroes_img"
- }, _el);
- $$("div", { "className": "UU_IC_HSOne", "innerHTML": _UCL.UserNickName }, _el);
- _UDTD = $$("div", { "className": "UU_IC_HSTwo" }, _el);
- $$("span", { "innerHTML": "积分:" }, _UDTD);
- $$("span", { "style": { "color": "#3081fe" }, "innerHTML": _UCL.VCSumValue }, _UDTD);
- }
- UOD.appendChild(_UDFD);
- }
- U.MD.U.S.ICPL = function (UICL, UDTF, UOD) {
- UOD.innerText = U.selectEl("#UU_IC_Pag")[0].innerText = "";
- var i, j, _UCI, _UDSD,
- _el = $$("div", { "className": "UU_IC_Values" }),
- _UDTD = $$("div", { "className": "UU_IC_VP" });
- for (i = 0; i < UDTF.length; i++) {
- $$("div", {
- "innerHTML": UDTF[i],
- "style": { "width": (i == 3 ? "50px " : (i == 1 ? "100px" : i == 2 ? "200px" : "")) }
- }, _el);
- };
- for (j = 0; j < UICL.length; j++) {
- _UCI = UICL[j];
- _UDSD = $$("div", { "className": "UU_IC_SG" }, _UDTD);
- $$("div", { "innerHTML": U.UF.D.getDateInterval(_UCI.VCDateTime) }, _UDSD);
- $$("div", { "innerHTML": U.MD.U.S.TF[_UCI.VCType], "style": { "width": "100px" } }, _UDSD);
- $$("div", {
- "onclick": _UCI.VCCountValue ? "" : U.MD.U.S.FTF[_UCI.VCType] ? function () {
- U.UF.EV.stopBubble();
- U.UF.C.divdoubleClick(U.MD.U.S.FTF[_UCI.VCType],
- _UCI.VCDetailsDataID, null, null, "ART" + _UCI.VCDetailsDataID);
- } : "",
- "className": ("U_MD_D_Text_Abbreviation" + (_UCI.VCCountValue ? "" : " UU_IC_FS")),
- "style": {
- "color": _UCI.VCCountValue ? "" : "#3081fe",
- "width": "200px"
- },
- "innerHTML": _UCI.VCCountValue ? _UCI.VCSumValue : _UCI.VCDetailsDataValue
- }, _UDSD);
- $$("div", { "innerHTML": _UCI.VCCountValue || _UCI.VCValue, "style": { "width": "50px" } }, _UDSD);
- }
- UOD.appendChild(_el);
- UOD.appendChild(_UDTD);
- }
- U.MD.U.S.ICEXC = function (TF) {
- var _UIED = U.selectEl("#UU_IC_EXC")[0];
- if (TF == "block") { U.UF.F.topWindow(_UIED); }
- _UIED.style.display = TF;
- }
- U.MD.U.S.ICGK = function (UICD) {
- var i, _TF = 0,
- _UICE = U.MD.U.S.E[US.userInfo.userid]["ICCSV"][0];
- UICV = UICD.value;
- for (i = 0; i < _UICE.length; i++) {
- _TF += _UICE[i].VCSumValue;
- }
- if (parseFloat(UICV) < 0) {
- U.alert("请输入正整数");
- }
- else if (!U.UF.S.Number.test(UICV)) {
- U.alert("您的输入有误,请输入数字!");
- }
- else if (UICV > _TF) {
- U.alert("您的积分不足");
- }
- else {
- U.UF.UI.confirm("确定确定要兑换" + UICV + "M的空间吗?", function () {
-
- UICD.parentNode.parentNode.parentNode.style.display = "none";
- UICD.value = "";
- })
- }
- }
- U.MD.U.S.AsynICGK = function (r) {
- var _context = r.context;
- r = r.value;
- if (r) {
- var i, _TF = true,
- ICDE = U.MD.U.S.E[US.userInfo.userid]["ICCSV"][0];
- for (i = 0; i < ICDE.length; i++) {
- if (ICDE[i]["VCType"] == "DiskAddition") {
- _TF = false;
- ICDE[i].VCSumValue -= _context[2];
- ICDE[i].VCCountValue += 1;
- }
- }
- if (_TF) {
- var _E = new U.MD.U.S.PICE[1, new Date(), -_context[2], "DiskAddition"],
- _UICE = U.MD.U.S.E[US.userInfo.userid]["Page"];
- ICDE.push(_E);
- if (_UICE && _UICE.length > 0) {
- var _ICE = U.MD.U.S.ICE(_UICE[1][0].AllCount, "0", US.userInfo.userid, new Date(), Guid.newGuid(), "硬盘增加", Guid.newGuid(), "DiskAddition", -_context[2]);
- _UICE[1].unshift(_ICE);
- }
- }
- U.MD.U.S.SUIC();
- U.MD.U.S.ICPL(ICDE, ["时间", "来源", "积分", "次数"], U.selectEl("#UU_IC_Info")[0]);
- US.userInfo.UserDiskSpace += 1;
- }
- }
- U.MD.U.S.PICE = function (E) {
- this.VCCountValue = E[0];
- this.VCDateTime = E[1];
- this.VCSumValue = E[2];
- this.VCType = E[3];
- }
- U.MD.U.S.ICE = function (E) {
- this.AllCount = E[0];
- this.PageNum = E[1];
- this.UserID = E[2];
- this.VCDateTime = E[3];
- this.VCDetailsDataID = E[4];
- this.VCDetailsDataValue = E[5];
- this.VCID = E[6];
- this.VCType = E[7];
- this.VCValue = E[8];
- };
- Namespace.register("U.MD.U.P");
- U.MD.U.P.inpEl = {}
- U.MD.U.P.userDataSet = function () {
- U.MD.U.P.init()
- }
- U.MD.U.P.init = function () {
- if (!U.MD.U.L.isLogin()) {
- var _form = U.selectEl('#U_MD_U_P_Set'),
- _personal = U.selectEl("#U_MD_U_P_Uc_B")[0];
- if (!_form.length) {
- new U.UF.UI.form("<div class='U_MD_F_S_TI'>个人设置</div>", _personal, { "id": "U_MD_U_P_Set", "style": { "width": "664px", "height": "549px" } }, { isenlarge: false, isstretching: false }).form;
- U.MD.U.P.eventBind();
- _personal.style.display = 'block';
- } else {
- U.selectEl('#U_MD_U_P_tab_lable_info')[0].checked = 'checked';
- _form[0].style.display = 'block';
- }
- }
- }
- U.MD.U.P.eventBind = function () {
- U.MD.U.P.EL = {
- "headImage": U.selectEl('#U_MD_U_P_simpleInfo_img')[0],
- "name": U.selectEl('.U_MD_U_P_simpleInfo_name')[0],
- "nickName": U.selectEl('#U_MD_U_P_tab_userNickName')[0],
- "selfIntroduction": U.selectEl('#U_MD_U_P_tab_selfIntroduction')[0],
- "email": U.selectEl('#U_MD_U_P_tab_email')[0],
- "phoneNumber": U.selectEl('#U_MD_U_P_tab_phoneNumber')[0],
- "address": U.selectEl('#U_MD_U_P_tab_address')[0],
- "trueName": U.selectEl('#U_MD_U_P_tab_trueName')[0],
- "birthday": U.selectEl('#U_MD_U_P_tab_birthday')[0],
- "loginName": U.selectEl('#U_MD_U_P_tab_loginName')[0],
- "oldPW": U.selectEl('#U_MD_U_P_tab_oldPW')[0],
- "newPW": U.selectEl('#U_MD_U_P_tab_newPW')[0],
- "confirmPW": U.selectEl('#U_MD_U_P_tab_confirmPW')[0],
- "phone": U.selectEl('#U_MD_U_P_tab_phone')[0],
- "accountNPW": U.selectEl('#U_MD_U_P_tab_lable_accountNext_n')[0],
- "accountCPW": U.selectEl('#U_MD_U_P_tab_lable_accountNext_c')[0]
- };
- var _bindEl = ["nickName", "email", "phoneNumber", "newPW", "confirmPW,newPW", "phone", "accountNPW", "accountCPW,accountNPW"],
- _bindString = ["NickName", "Email", "TelephoneNumber", "PassWord", "contrastPW", "TelephoneNumber", "PassWord", "contrastPW"],
- _lastPage = U.selectEl('.U_MD_U_P_tab_inp')[0],
- _isDataChanged = false,
- _changeDataNum = "",
- _isNextStep = false;
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/Basic/City.js" }, function () { new U.MD.UI.city(); });
- U.UF.DL.asynLoadCss({ "href": "/css/Controls/Basic/City.css", type: "text/css", rel: "stylesheet" });
- U.selectEl('#U_MD_U_P_tab_address').bind({
- click: function () {
- U.MD.UI.city(this);
- U.selectEl("#U_MD_UI_city_cityBox")[0].style.display = "block";
- U.selectEl("#U_MD_UI_city_cityBox")[0].style.zIndex = "999";
- }
- });
- U.selectEl('#U_MD_U_P_tab_birthday').bind({
- click: function () {
- U.MD.UI.calendar(this, U.selectEl('#U_MD_U_P_tab_calendar')[0], false);
- }
- })
- U.selectEl('#U_MD_U_P_save').bind({
- click: function () {
- switch (_lastPage.value) {
- case "0":
- case "1":
- U.MD.U.P.updateUserBasicInfo(_lastPage.value);
- break;
- case "2":
- if ($('.U_MD_U_P_tab_accountRadio:checked')[0].value == 0) {
- U.MD.U.P.setPassword(_bindEl, _bindString);
- } else if ($('.U_MD_U_P_tab_accountRadio:checked')[0].value == 1) {
- U.MD.U.P.updatePassword();
- }
- break;
- }
- U.selectEl('.U_MD_U_P_simpleInfo_address')[0].innerText = U.selectEl("#U_MD_U_P_tab_address")[0].value;
- }
- })
- U.selectEl('.U_MD_U_P_tab_inp').bind({
- change: function () {
- U.MD.U.P.reset(_changeDataNum, _isDataChanged);
- _lastPage = this;
- _isDataChanged = false;
- }
- })
- U.selectEl('.U_MD_U_P_tab_lable_content input').bind({
- change: function () {
- if (!_isDataChanged) {
- _changeDataNum = _lastPage.value;
- _isDataChanged = true;
- }
- }
- })
- U.selectEl('.U_MD_U_P_tab_accountRadio').bind({
- change: function () {
- if (this.value == 0) {
- U.selectEl('#U_MD_U_P_save')[0].style.display = "inline-block";
- U.selectEl('#U_MD_U_P_next')[0].style.display = "none";
- } else {
- U.selectEl('#U_MD_U_P_save')[0].style.display = "none";
- U.selectEl('#U_MD_U_P_next')[0].style.display = "inline-block";
- }
- }
- })
- U.selectEl('#U_MD_U_P_authCodeBtn').bind({
- click: function () {
- _isNextStep = U.MD.U.P.sendAuthCode(_isNextStep);
- }
- })
- U.selectEl('#U_MD_U_P_next').bind({
- click: function () {
- U.MD.U.P.phoneConfirm();
- }
- })
- U.selectEl('#U_MD_U_P_authCodeInp').bind({
- change: function () {
- if (this.value.trim().length > 0) {
- U.selectEl(this).removeClass('U_MD_U_P_tab_user_emptyInp')
- }
- }
- })
- U.selectEl('#U_MD_U_P_cancel').bind({
- click: function () {
- U.selectEl('#U_MD_U_P_Set')[0].style.display = 'none';
- }
- })
- U.selectEl('#U_MD_U_P_tab_oldPW').bind({
- change: function () {
- var _bool = U.MD.U.P.checkEmpty(this);
- !_bool && U.selectEl(this).removeClass('U_MD_U_P_tab_user_emptyInp');
- }
- })
- U.MD.U.P.dataPrint();
- U.MD.U.P.bindCheckFormat(_bindEl, _bindString);
- }
- U.MD.U.P.bindCheckFormat = function (elarr, eventarr) {
- var _len = elarr.length;
- for (var i = 0; i < _len; i++) {
- var _el = U.MD.U.P.EL[elarr[i].split(',')[0]];
- _el.i = i;
- U.selectEl(_el).bind({
- change: function () {
- U.MD.U.P.inpFormatCheck(this, elarr, eventarr);
- }
- })
- }
- }
- U.MD.U.P.inpFormatCheck = function (that, elarr, eventarr) {
- var _bool = false;
- if (U.UF.S[eventarr[that.i]]) {
- _bool = U.UF.S[eventarr[that.i]].test(that.value.trim());
- } else if (eventarr[that.i] == 'contrastPW') {
- _bool = (U.MD.U.P.EL[elarr[that.i].split(',')[0]].value === U.MD.U.P.EL[elarr[that.i].split(',')[1]].value);
- }
- if (!_bool) {
- if (!that.value.trim().length) {
- U.selectEl(that).removeClass('U_MD_U_P_tab_user_errorInp');
- U.selectEl(that).addClass('U_MD_U_P_tab_user_emptyInp');
- U.selectEl(that).next().removeClass('U_MD_U_P_tab_errorAlear');
- } else {
- U.selectEl(that).removeClass('U_MD_U_P_tab_user_emptyInp');
- U.selectEl(that).addClass('U_MD_U_P_tab_user_errorInp');
- U.selectEl(that).next().addClass('U_MD_U_P_tab_errorAlear');
- }
- } else {
- U.selectEl(that).removeClass('U_MD_U_P_tab_user_errorInp');
- U.selectEl(that).removeClass('U_MD_U_P_tab_user_emptyInp');
- U.selectEl(that).next().removeClass('U_MD_U_P_tab_errorAlear');
- }
- }
- U.MD.U.P.reset = function (mark, flag) {
- if (!flag)
- return;
- var _info = US.userInfo,
- _elObj = U.MD.U.P.EL;
- switch (mark) {
- case "0":
- U.MD.U.P.dataPrint.simpleInfo(_info, _elObj);
- break;
- case "1":
- U.MD.U.P.dataPrint.privacy(_info, _elObj);
- break;
- case "2":
- U.MD.U.P.dataPrint.account(_info, _elObj);
- break;
- }
- }
- U.MD.U.P.dataPrint = function () {
- var _info = US.userInfo,
- _elObj = U.MD.U.P.EL;
- U.MD.U.P.dataPrint.privacy(_info, _elObj);
- U.MD.U.P.dataPrint.simpleInfo(_info, _elObj);
- U.MD.U.P.dataPrint.account(_info, _elObj);
- U.MD.U.P.dataPrint.left(_info, _elObj);
- }
- U.MD.U.P.dataPrint.left = function (info, elobj) {
- elobj["headImage"].src = U.MD.C.getHeadImage(info.UserImageHead);
-
- U.selectEl('.U_MD_U_P_simpleInfo_address')[0].innerText = elobj["address"].value;
- elobj["name"].innerText = info.UserNickName || "";
- elobj["name"].title = info.UserNickName || "";
- }
- U.MD.U.P.dataPrint.privacy = function (info, elobj) {
- elobj["trueName"].value = info.TrueName;
- elobj["birthday"].value = U.UF.D.getYearMonthDay(info.Birthday);
- }
- U.MD.U.P.dataPrint.simpleInfo = function (info, elobj) {
- U.selectEl(".U_MD_U_P_tab_user_radio[value$=" + (info.UserSex ? "'1'" : "'0'") + "]")[0].checked = true;
- elobj["selfIntroduction"].value = info.UserIndividualitysignature;
- elobj["address"].innerText = info.Province || "";
- elobj["nickName"].value = info.UserNickName || "";
- elobj["email"].value = info.UserEmail;
- elobj["phoneNumber"].value = info.UserTelephoneNumber;
- elobj["address"].value = info.City;
- elobj["loginName"].innerText = info.UserName;
- }
- U.MD.U.P.dataPrint.account = function (info, elobj) {
- U.selectEl('#U_MD_U_P_tab_lable_accountNext_t')[0].innerText = info.UserName;
- U.selectEl('.U_MD_U_P_tab_lable_account').css('display', 'block');
- U.selectEl('.U_MD_U_P_tab_lable_accountNext').css('display', 'none');
- U.selectEl('.U_MD_U_P_tab_accountRadio')[0].checked = "checked";
- var _arr = Array.prototype.slice.call($('.U_MD_U_P_tab_item')[2].querySelectorAll('[type="text"]')).concat(Array.prototype.slice.call($('.U_MD_U_P_tab_item')[2].querySelectorAll('[type="password"]')));
- for (var i = 0; i < _arr.length; i++) {
- _arr[i].value = "";
- U.selectEl(_arr[i]).removeClass('U_MD_U_P_tab_user_errorInp');
- U.selectEl(_arr[i]).removeClass('U_MD_U_P_tab_user_emptyInp');
- U.selectEl(_arr[i]).next().removeClass('U_MD_U_P_tab_errorAlear');
- }
- U.selectEl('#U_MD_U_P_save').css('display', 'inline-block');
- U.selectEl('#U_MD_U_P_next').css('display', 'none');
- }
- U.MD.U.P.updateUserBasicInfo = function (type) {
- var _info = US.userInfo,
- _elObj = U.MD.U.P.EL,
- _sex = parseInt($('.U_MD_U_P_tab_user_radio:checked')[0].value);
- if (!parseInt(type)) {
- var _bool = U.MD.U.P.checkEmpty(_elObj['nickName']) || U.MD.U.P.checkEmpty(_elObj['email']) || U.MD.U.P.checkEmpty(_elObj['phoneNumber']) || U.MD.U.P.checkEmpty(_elObj['address']);
- if ($('.U_MD_U_P_tab_user_errorInp').length || U.selectEl('.U_MD_U_P_tab_user_emptyInp').length || _bool) {
- if ($(".U_MD_U_P_tab_user_errorInp")[0].id == "U_MD_U_P_tab_email" && U.selectEl(".U_MD_U_P_tab_user_errorInp").length == 1) {
- U.Alert("邮箱填写错误!");
- return;
- } else if ($(".U_MD_U_P_tab_user_errorInp")[0].id == "U_MD_U_P_tab_phoneNumber" && U.selectEl(".U_MD_U_P_tab_user_errorInp").length == 1) {
- U.Alert("手机号码填写错误!");
- return;
- } else {
- U.Alert("信息录入错误!");
- return;
- }
- }
- }
- U.A.Request(US.USER, ["UpdateUserBasicInfo", _info.UserId, _elObj["trueName"].value, _elObj["nickName"].value, _elObj["phoneNumber"].value, '', '', _elObj["selfIntroduction"].value, _sex, _elObj["email"].value,
- "中国", _elObj["address"].textContent, _elObj["address"].value || "", _elObj["birthday"].value
- ],
- function (r) {
- if (r.value) {
- US.userInfo.UserSex = _sex ? true : false;
- US.userInfo.TrueName = _elObj["trueName"].value;
- US.userInfo.UserNickName = _elObj["nickName"].value;
- US.userInfo.UserTelephoneNumber = _elObj["phoneNumber"].value;
- US.userInfo.UserIndividualitysignature = _elObj["selfIntroduction"].value;
- US.userInfo.UserEmail = _elObj["email"];
- US.userInfo.Province = _elObj["address"].value;
- US.userInfo.City = _elObj["address"].value;
- U.Alert("更改个人资料成功");
- } else {
- U.alert("更改个人资料失败");
- }
- })
- }
- U.MD.U.P.setPassword = function (elarr, eventarr) {
- var _elObj = U.MD.U.P.EL,
- _emptyEl = U.selectEl($('.U_MD_U_P_tab_lable_content')[2]).find('.U_MD_U_P_tab_user_emptyInp'),
- _errorEl = U.selectEl($('.U_MD_U_P_tab_lable_content')[2]).find('.U_MD_U_P_tab_user_errorInp');
- if (!_emptyEl.length && !_errorEl.length) {
- if (_elObj["oldPW"].value == "") {
- U.MD.U.P.inpFormatCheck(_elObj["oldPW"], elarr, eventarr);
- return;
- } else if (_elObj["newPW"].value == "") {
- U.MD.U.P.inpFormatCheck(_elObj["newPW"], elarr, eventarr);
- return;
- } else if (_elObj["confirmPW"].value == "") {
- U.MD.U.P.inpFormatCheck(_elObj["confirmPW"], elarr, eventarr);
- return;
- }
- U.A.Request(US.USER, ["UpdateUserPasswordByOldPassword", US.userInfo.userid, _elObj["oldPW"].value, _elObj["confirmPW"].value], function (r) {
- if (r.value) {
- U.Alert("更改密码成功,请重新登录");
- U.MD.U.LO.logout();
- U.MD.U.L.login();
- } else {
- U.Alert("原密码错误");
- U.selectEl(_elObj["oldPW"]).addClass("U_MD_U_P_tab_user_emptyInp");
- }
- });
- }
- }
- U.MD.U.P.updatePassword = function () {
- var _pw = U.selectEl('#U_MD_U_P_tab_lable_accountNext_n')[0];
- var _pwconfirm = U.selectEl('#U_MD_U_P_tab_lable_accountNext_c')[0];
-
- if (U.MD.U.F.checkConfirmPassword(_pw, _pwconfirm)) {
- U.A.Request(US.USER, ["UpdateUserPassword", US.userInfo.userid, _pw.value], function (r) {
- if (r.value) {
- U.Alert('更改密码成功');
- } else {
- U.Alert('更改密码失败');
- }
- });
- }
- }
- U.MD.U.P.sendAuthCode = function (flag) {
- if (flag) {
- U.Aleart('请在60秒后重试');
- return;
- }
- var _phoneInp = U.MD.U.P.EL["phone"],
- _bool = U.MD.U.P.checkEmpty(_phoneInp) || U.MD.U.P.isCanUse(_phoneInp);
- if (_bool) {
- U.Alert('信息录入错误!');
- return;
- }
- U.A.Request(US.CD, [US.DB, "UseStudio_Users", "GetUserinfoByUserName", US.userInfo.username], function (r) {
- if (r.value[0].UserTelephoneNumber != _phoneInp.value) {
- U.Alert('输入的手机号与账号不匹配');
- } else {
- var _xhttp = new XMLHttpRequest();
- _xhttp.onreadystatechange = function () {
- if (this.readyState == 4) {
- if (this.status == 201) {
- U.Alert('发送成功');
- U.MD.U.P.setTime($('#U_MD_U_P_authCodeBtn')[0]);
- return true;
- } else {
- U.Alert(JSON.parse(this.response).err || '验证码发送失败,请重新发送...');
- }
- }
- };
- _xhttp.open("POST", "http://api.cloudsql.1473.cn/postnumber", true);
- _xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- _xhttp.withCredentials = true;
- _xhttp.send("number=" + _phoneInp.value);
- }
- });
- }
- U.MD.U.P.phoneConfirm = function () {
- var _input = U.selectEl('#U_MD_U_P_authCodeInp')[0];
- if (U.MD.U.P.checkEmpty(_input)) {
- U.Alert('验证码不为空');
- return;
- }
- var _xhttp = new XMLHttpRequest();
- _xhttp.onreadystatechange = function (r) {
- if (this.readyState == 4) {
- if (this.status == 201) {
- U.selectEl('#U_MD_U_P_save').css('display', 'inline-block');
- U.selectEl('#U_MD_U_P_next').css('display', 'none');
- U.selectEl('.U_MD_U_P_tab_lable_account').css('display', 'none');
- U.selectEl('.U_MD_U_P_tab_lable_accountNext').css('display', 'block');
- U.Alert("验证成功");
- } else {
- U.Alert(JSON.parse(this.response).err || "验证码有误");
- }
- }
- };
- _xhttp.open("POST", "http://api.cloudsql.1473.cn/verifi", true);
- _xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
- _xhttp.withCredentials = true;
- _xhttp.send("code=" + _input.value);
- }
- U.MD.U.P.setTime = function (inp) {
- if (this._timer) {
- U.Alert('请在60后重试!');
- return;
- }
- var _second = 60,
- _this = this;
- this._timer = setInterval(function () {
- inp.innerText = --_second + 's';
- if (!_second) {
- inp.innerText = '发送验证码';
- clearInterval(_this._timer);
- _this._timer = null;
- }
- }, 1000);
- }
- U.MD.U.P.restoreInp = function (el) {
- el.value = "";
- U.selectEl(el).removeClass('U_MD_U_P_tab_user_errorInp');
- U.selectEl(el).removeClass('U_MD_U_P_tab_user_emptyInp');
- }
- U.MD.U.P.isCanUse = function (el) {
- return U.selectEl(el).hasClass('U_MD_U_P_tab_user_emptyInp') || U.selectEl(el).hasClass('U_MD_U_P_tab_user_errorInp');
- }
- U.MD.U.P.checkEmpty = function (el) {
- if (el.value.trim() == "" || !!!el.value) {
- U.selectEl(el).addClass('U_MD_U_P_tab_user_emptyInp');
- return true;
- }
- return false;
- }
- U.MD.U.P.uploadUserHeadImg = function (input) {
-
-
- if (window.FileReader) {
- var reader = new FileReader();
- } else {
- U.alert("您的设备不支持图片预览功能,如需该功能请升级您的设备!");
- }
-
- var file = input.files[0];
- var imageType = /^image\//;
-
- if (!imageType.test(file.type)) {
- U.alert("请选择图片!");
- return;
- }
- var img = U.selectEl('#U_MD_U_P_simpleInfo_img')[0];
-
- reader.onload = function (e) {
-
-
- img.src = e.target.result;
- };
- reader.readAsDataURL(file);
-
- U.UF.UP.inputUpload([input], "http://disk.1473.cn/USUpfile.ashx?typename=UploadHeadImage", function (url) {
-
-
- U.A.Request(US.USER, ["UpdateUserHeaderImage", US.userInfo.userid, url.value.UserFilesServerName, url.value.UseFilesServerThumbnailName], function (r) {
- if (r.value) {
-
- US.userInfo.UserImageHead = url.value.UserFilesServerName;
- US.userInfo.UserThumbnailImageHead = url.value.UseFilesServerThumbnailName;
- U.Alert('头像修改成功!');
- } else {
- U.Alert('头像修改失败!');
- }
- });
- }, []);
- };
- Namespace.register("U.MD.U.V");
- U.MD.U.V.UIFZX = U.MD.U.V.ViewOtherUserInfo = function (userid) {
- var _userinfoel = U.selectEl("#U_MD_U_UV").clone(true),
- _childs = U.selectEl(_userinfoel[0]).Child(),
- _head = _childs[0],
- _middle = _childs[1],
- _aboutMe = _childs[2];
- var _div = $$('div');
- _div.appendChild(_head);
- _div.appendChild(_middle);
- _div.appendChild(_aboutMe);
-
- if ($('#U_MD_F_S_TI_Info')[0])
- document.body.removeChild($('#U_MD_F_S_TI_Info')[0])
- var _form = new U.UF.UI.form("<div class='U_MD_F_S_TI'>个人信息</div>",
- _div, {
- "style": {
- "min-width": "460px",
- "width": "480px",
- "height": "400px"
- },
- id: "U_MD_F_S_TI_Info"
- }, {
- isenlarge: false,
- isnarrow: false
- }).form;
-
- U.A.Request(US.USER, ["ViewOtherUserInfo", userid],
- U.MD.U.V.ViewOtherUserInfoAsyn, ['', _head, _middle, _aboutMe, _form])
-
- }
- U.MD.U.V.ViewOtherUserInfoAsyn = function (r) {
- var _userinfo = r.value[0],
- _context = r.context,
- _form = _context[4],
- TN = _userinfo.UserTelephoneNumber;
- U.selectEl(_context[1]).find('.U_MD_U_UV_Head_Left')[0].firstElementChild.src = U.MD.C.getHeadImage(_userinfo.UserImageHead || _userinfo.UserThumbnailImageHead);
- U.selectEl(_context[1]).find('.U_MD_U_UV_Name')[0].innerText = _userinfo.TrueName || _userinfo.UserName || "不详";
- U.selectEl(_context[1]).find('.U_MD_U_UV_Desc')[0].innerText = _userinfo.UserIndividualitysignature || "不详";
- U.selectEl(_context[3]).find('.U_MD_U_UV_Place')[0].innerText = _userinfo.City || "不详";
- U.selectEl(_context[3]).find('.U_MD_U_UV_MailBox')[0].innerText = _userinfo.UserEmail != "null" ? _userinfo.UserEmail : "不详";
- U.selectEl(_context[3]).find('.U_MD_U_UV_PhoneNum')[0].innerText = TN ? (TN.substring(0, 3) + "****" + TN.substring(7, TN.length)) : "不详";
- U.selectEl(_context[3]).find('.U_MD_U_UV_Birthday')[0].innerText = _userinfo.Birthday ? U.UF.D.formatDateToArray(_userinfo.Birthday).slice(0, 3).join('-') : "不详";
-
- U.A.Request(US.CD, [US.DB, 'UseStudio_Users', 'GetStatisticData', _userinfo.UserId], function (data) {
- U.selectEl('.U_MD_U_UV_Friend', _context[1])[0].innerText = data.value[0].friendCount;
- U.selectEl('.U_MD_U_UV_Word', _context[1])[0].innerText = data.value[0].wrodCount;
- U.selectEl('.U_MD_U_UV_Excel', _context[1])[0].innerText = data.value[0].excelCount;
- U.selectEl('.U_MD_U_UV_Cloud', _context[1])[0].innerText = data.value[0].diskFileCount;
- });
-
- var _friendinfo,
- _addbutton = U.selectEl('.U_MD_U_UV_Head_Right_Btn', _context[1])[0],
- _functionbtn = U.selectEl(_context[2]).find('.U_MD_U_UV_FuncArea_MarginBox_Btn');
- _functionbtn[1].style.display = '';
- if (_userinfo.UserId == US.userInfo.userid) {
- _addbutton.onclick = function () {
- U.Alert("不可以添加自己为好友哟!");
- };
- _functionbtn[1].style.display = 'none';
- } else if (US.friend.friends && (_friendinfo = U.Json.select(US.friend.friends, { UserId: _userinfo.UserId })[0])) {
- _addbutton.onclick = function () {
- U.MD.F.R.deleteFriendForm(_friendinfo, function () {
- U.UF.F.closeWindow(_form);
- });
-
-
- };
- _addbutton.style.backgroundColor = '#e20f0f';
- _addbutton.innerText = '删除好友';
- } else {
- _addbutton.style.backgroundColor = '';
- _addbutton.onclick = function () {
- U.MD.F.M.addFriend(_userinfo, function () {
- U.UF.F.closeWindow(_form);
- });
- }
- }
-
- _functionbtn[0].onclick = function () {
- U.MD.D.I.openApplication("disk", { "userid": _userinfo.UserId, "directoryid": US.disk.initTree[4][0] });
- }
-
-
-
-
-
- _functionbtn[1].onclick = function () {
- if (!U.MD.U.L.isLogin()) {
- var _friendinfo = U.Json.select(US.friend.friends, { UserId: _userinfo.UserId })[0];
- if (_friendinfo) {
- U.MD.F.W.popupFriendsForm(_friendinfo);
- U.UF.F.closeWindow(_form);
- } else {
- U.UF.UI.confirm((_userinfo.UserNickName || _userinfo.UserName) + "还不是你的好友哟!是否添加" + (_userinfo.UserNickName || _userinfo.UserName) + "为好友呢。", function () {
- U.MD.F.M.addFriend(_userinfo, function () {
- U.UF.F.closeWindow(_form);
- });
- });
- }
- }
- }
- }
- U.MD.U.V.AddFriend = function (button, userinfo) {
- U.MD.F.M.addFriend(userinfo, function () {
- button.innerText = '删除好友';
- button.style.backgroundColor = '#e20f0f';
- button.onclick = function () {
- _friendinfo = U.Json.select(US.friend.friends, { UserId: userInfo.userid })[0];
- U.MD.F.M.deleteFriend(_friendinfo);
- button.innerText = '+好友';
- button.style.backgroundColor = '';
- button.onclick = function () {
- U.MD.U.V.AddFriend(button, userinfo);
- }
- };
- });
- }
- U.MD.U.V.GDCKYHDT = function (UDOD, userid) {
- _UDFE = U.MD.D.H.ET["UIF"][userid][1];
- U.MD.U.V.ViewUserBlogInfo(UDOD, _UDFE, userid, this.P + 2);
- }
- U.MD.U.V.ViewUserBlogInfo = function (UDOD, UDPE, userid, P, TF) {
- var _userinfoel = U.selectEl(UDOD).Child();
- UDPE = U.MD.D.D.FYGBL(UDPE, P);
- if (UDPE[0]) {
- if (TF) { _userinfoel[1].innerText = ""; }
- if (UDPE[0].length) { U.MD.D.Blog.PGBL(_userinfoel[1], UDPE[0], true); } else if (P === 1) { U.MD.U.V.PCKYHDT(_userinfoel[1]); }
- }
- else { U.A.Request(US.USER, ["GFA", US.EMPTYGUID, (UDPE[1] - 1) * 100, UDPE[1] * 100, userid, US.EMPTYGUID], U.MD.U.V.AsynCKYHDT, [(P == 1 ? [_userinfoel[1], true] : [$("#U_MD_U_UV_PL")[0], 1]), UDOD, userid, P, UDPE[1], _userinfoel]); }
-
- U.UF.EV.scrollLoad($("div#U_MD_U_UV_PC", _userinfoel[0])[0], function () { U.MD.U.V.GDCKYHDT(_bloginfoel, userid); });
- }
- U.MD.U.V.AsynCKYHDT = function (r) {
- var _context = r.context,
- UPXD = U.MD.D.H.ET["UIF"][_context[2]];
- r = r.value;
- if (!UPXD) { UPXD = U.MD.D.H.ET["UIF"][_context[2]] = [], UPXD[1] = [] };
- UPXD[1] = UPXD[1] || [];
- UPXD[1][_context[4]] = U.MD.D.Blog.ZFSGBL(r);
- _context[5][1].innerText = "";
- _context[5][0].innerText = r[0] > 0 ? "动静..(" + r[0].SumNumber + ")" : "动静";
- U.MD.U.V.ViewUserBlogInfo(_context[1], UPXD[1], _context[2], _context[3]);
- }
- U.MD.U.V.PCKYHDT = function (UDOD) {
- var _userinfoel = $$("div", { "className": "U_MD_U_UV_T" }, UDOD);
- $$("div", { "className": "U_MD_U_UV_TS", "innerHTML": "他暂时没有相关的消息呢!!稍后再来试试吧~" }, _userinfoel);
- $$("div", { "className": "U_MD_U_UV_TX", "innerHTML": "Noting!!" }, _userinfoel);
- }
- U.MD.U.V.GroupInfo = function (groupinfo) {
- var _userinfoel = U.selectEl("#U_MD_U_GV").clone(true),
- _childs = U.selectEl(_userinfoel[0]).Child(),
- _content = _childs[0];
- U.MD.U.V.syncData(_content, groupinfo);
- var _form = new U.UF.UI.form("<div class='U_MD_F_S_TI'>群信息</div>",
- _content, {
- "style": {
- "min-width": "480px",
- "width": "480px",
- "height": "340px"
- },
- id: "U_MD_G_Info"
- }, {
- isenlarge: false,
- isnarrow: false
- }).form;
- }
- U.MD.U.V.syncData = function (el, groupinfo) {
- var _head = el.children[0],
- _middle = el.children[1],
- _bottom = el.children[2],
- _groupId = groupinfo.GroupManageID,
- _groupCreaterId = groupinfo.GroupManageCreateUserID,
- _groupCreaterEl = U.selectEl(_bottom).find('.U_MD_U_GV_GroupInfo_ImgArea_Creater')[0],
- _groupMember = U.Json.select(US.friend.groupusers, { GroupManageID: _groupId }),
- _cloneEl = $$('img'),
- _createrImg = _cloneEl.cloneNode(),
- _groupMemberEl = U.selectEl(_bottom).find('.U_MD_U_GV_GroupInfo_ImgArea_MemberImg')[0],
- _groupBtn = U.selectEl(_middle).find('.U_MD_U_GV_FuncArea_MarginBox_Btn');
- U.selectEl(_head).find('.U_MD_U_GV_HeadInfo_Name')[0].innerText = groupinfo.GroupManageName;
- U.selectEl(_head).find('.U_MD_U_GV_HeadInfo_Desc')[0].innerText = groupinfo.GroupManageDescript;
- U.selectEl(_bottom).find('.U_MD_U_GV_GroupInfo_Img_TextNum')[0].innerText = _groupMember.length;
- _createrImg.src = U.MD.C.getHeadImage(U.Json.selectOne(US.friend.groupusers, { UserId: _groupCreaterId }).UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg";
- _groupCreaterEl.appendChild(_createrImg)
- _groupCreaterEl.onclick = function () {
- U.MD.U.V.ViewOtherUserInfo(_groupCreaterId);
- }
- _groupBtn[2].onclick = function () {
- top.U.MD.F.W.popupFriendsForm(groupinfo);
- }
- for (var i = 0; i < _groupMember.length; i++) {
- if (i < 6) {
- var _cloneImg = _cloneEl.cloneNode();
- _cloneImg.src = U.MD.C.getHeadImage(_groupMember[i].UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg";
- _cloneImg.onclick = U.UF.C.closure(function (i) {
- U.MD.U.V.ViewOtherUserInfo(_groupMember[i].UserId);
- }, [i])
- _groupMemberEl.appendChild(_cloneImg);
- } else {
- $$('span', {
- className: "U_MD_U_GV_GroupInfo_ImgArea_MemberMore",
- innerText: "···",
- onclick: function () {
- U.MD.U.V.showAllGroupMember(_groupMember, this, _cloneEl, _groupMemberEl);
- }
- }, _groupMemberEl);
- return;
- }
- }
- }
- U.MD.U.V.showAllGroupMember = function (groupmember, el, cloneel, addel) {
- addel.style.display = "none";
- addel.style.height = "82px";
- for (var i = 6; i < groupmember.length; i++) {
- var _cloneImg = cloneel.cloneNode();
- _cloneImg.src = U.MD.C.getHeadImage(groupmember[i].UserThumbnailImageHead) || "/img/UserHead/UseHead.jpg";
- _cloneImg.onclick = U.UF.C.closure(function (i) {
- U.MD.U.V.ViewOtherUserInfo(groupmember[i].UserId);
- }, [i]);
- addel.appendChild(_cloneImg);
- }
- addel.style.display = "block";
- U.selectEl(el).remove();
- }
- Namespace.register("U.MD.U.L");
- Namespace.register("U.MD.U.OT");
- U.MD.U.L.loginCallBack;
- U.MD.U.L.isLogining = false;
- U.MD.U.L.login = U.MD.U.L.DLTC = function (fun) {
- var _iframe = U.selectEl("#U_MD_HomeC_Pop iframe")[0];
- if ($("#U_MD_HomeC_Pop")[0]) {
- U.UF.F.windowTopCenter($("#U_MD_HomeC_Pop")[0]);
- try {
-
- if (U.UF.C.isFunction(fun)) {
- U.MD.U.L.loginCallBack = fun;
- }
- U.selectEl("input", _iframe.contentWindow.document)[0].focus();
- _iframe.contentWindow.U.MD.U.L.init();
- } catch (e) { }
- } else {
- var _iframe = $$("iframe", { "style": { "border": "0", "float": "left" }, "id": "UI_Login", "name": "UI_Login", "frameborder": "no", "border": "0", "scrolling ": "no", "width": "360px", "height": "480px", "src": "//user.1473.cn/Login.htm" });
- new U.UF.UI.form("", _iframe, {
- "id": "U_MD_HomeC_Pop",
- "style": {
- "width": "360px",
- "height": "510px"
- }
- }, {
- isdrag: false,
- isstretching: false,
- isenlarge: false,
- isnarrow: false
- });
-
- U.UF.DL.iframeLoad(_iframe, function () {
-
- if (U.UF.C.isFunction(fun)) {
- U.MD.U.L.loginCallBack = fun;
- }
- _iframe.contentWindow.U.MD.U.L.loginCallBack = U.MD.U.L.defaultCallBack;
- });
- }
- return _iframe;
- }
- U.MD.U.L.register = function (fun) {
- var _iframe = U.MD.U.L.login();
- try {
- _iframe.contentWindow.U.MD.U.R.register();
- } catch (e) {
- U.UF.DL.iframeLoad(_iframe, function () {
-
- if (U.UF.C.isFunction(fun)) {
- U.MD.U.L.loginCallBack = fun;
- }
- _iframe.contentWindow.U.MD.U.L.loginCallBack = U.MD.U.L.defaultCallBack;
- _iframe.contentWindow.U.UF.N.addHash('register');
- });
- }
- }
- U.MD.U.L.retrieve = function () {
- var _iframe = U.MD.U.L.login();
- try {
- _iframe.contentWindow.U.MD.U.F.findPassword();
- } catch (e) {
- U.UF.DL.iframeLoad(_iframe, function () {
- _iframe.contentWindow.U.UF.N.addHash('findPassword');
- });
- }
- }
- U.MD.U.L.defaultCallBack = function (r, iscookie) {
- var _userinfo,
- _backgroudimage,
- _str,
- _context = r.context,
- _address = _context[1],
- _username = _context[2],
- _password = _context[3];
-
- r = r.value;
-
- switch (r) {
- case null:
- _str = "系统繁忙!请重试";
- break;
- case 0:
- _str = "帐号不存在!";
- break;
- case 1:
- _str = "密码错误!";
- break;
- case 2:
- _str = "该用户不允许被访问!请联系管理员";
- break;
- default:
- if (r) {
-
- U.MD.U.LO.emptyUserInfo();
-
- if (!_address) {
- U.UF.CI.getUserLocation(U.MD.U.L.addUserAccess);
- }
- _userinfo = U.MD.U.L.setUserInfo(r);
- U.MD.U.L.getLoginUserInfo(_username || US.userInfo.username);
- if ($("#U_MD_D_BDI")[0] && U.selectEl('#U_MD_D_BG')[0]) {
-
- U.MD.U.L.printUserInfo();
- _backgroudimage = U.MD.D.B.split(US.userInfo.UserBackGroundImage);
- U.MD.D.B.setBackgroundImage(_backgroudimage[0], _backgroudimage[1]);
- }
-
- if (_str && iscookie !== true) {
- U.alert(_str);
- }
-
- if ($("#U_MD_HomeC_Pop")[0]) {
-
- U.selectEl("#U_MD_HomeC_Pop")[0].close();
- }
- U.MD.O && U.MD.O.P.connect();
- }
-
- }
- if (_str) {
- U.alert(_str);
- }
- }
- U.MD.U.L.isLogin = function (fun) {
- if (!US.userInfo.userid) {
- U.MD.U.L.login(fun);
- return true;
- }
- return false;
- }
- U.MD.U.L.setLoginCallBack = function (fun) {
-
- if (U.MD.U.L.isLogin()) {
- U.MD.U.L.loginCallBack = fun;
- }
-
- else {
- fun();
- return true;
- }
- }
- U.MD.U.L.cookieLogin = function () {
- var _cookie = U.MD.U.L.getCookieByUserId(),
- _address = US.city.userAllLocation || "";
-
- if (_cookie && _cookie.userid && _cookie.userid.length == 36) {
- U.MD.U.L.isLogining = "cookie";
- U.A.Request(US.USER, ["LoginByCookie", _cookie.userid, _cookie.username], U.MD.U.L.defaultCallBack, ["", _address]);
- }
- }
- U.MD.U.L.getCookieByUserId = function (userid) {
- var i, _cookiearr = U.MD.U.L.cookieToArray("usestudiosso");
-
- if (_cookiearr.userid) {
-
- if (userid) {
-
- for (i = 0; i < _cookiearr.userid.length; i++) {
- if (_cookiearr.userid[i] == userid) {
- break;
- }
- }
- }
-
- else {
-
- i = _cookiearr.userid.length - 1;
- }
-
- for (var c in _cookiearr) {
-
- _cookiearr[c] = decodeURIComponent(_cookiearr[c][i]);
- }
- }
-
- return _cookiearr;
- }
- U.MD.U.L.cookieToArray = function (key) {
- var i,
- _cookieobj = {},
- _cookie = U.UF.Cookie.get("usestudiosso");
- if (_cookie) {
- _cookie = _cookie.split("&");
- for (i = 0; i < _cookie.length; i++) {
- _cookie[i] = _cookie[i].split("=");
-
- if (!_cookieobj[_cookie[i][0]]) {
- _cookieobj[_cookie[i][0]] = [];
- }
- _cookieobj[_cookie[i][0]].push(decodeURIComponent(_cookie[i][1]));
- }
- }
- return _cookieobj;
- }
- U.MD.U.L.getLoginUserInfo = function (username) {
- U.A.Request(US.USER, ["GetUserLoginData", username], U.MD.U.L.asynGetLoginUserInfo);
- }
- U.MD.U.L.asynGetLoginUserInfo = function (r) {
- r = r.value;
- US.friend = r;
- U.MD.U.L.initUserLogin(US.userInfo);
- if (U.MD.D && U.MD.D.IsUseStudio || U.selectEl("#usestudio_server")[0]) {
- U.MD.F && U.MD.F.N.friendMessageHandle([r.unreadfirendmessage, r.unreadgroupmessage]);
- }
- }
- U.MD.U.L.setUserInfo = function (userinfo) {
- US.userInfo = userinfo[0];
- US.userInfo.LoginId = userinfo[2];
- US.friend.onlinefirendinfo = userinfo[1];
- return US.userInfo;
- }
- U.MD.U.L.initUserLogin = function () {
- var _userinfo = US.userInfo;
- U.MD.UI && U.MD.UI.flashEmptyUpload && U.MD.UI.flashEmptyUpload();
-
- if (U.UF.C.isFunction(U.MD.U.L.loginCallBack)) {
- U.MD.U.L.loginCallBack(_userinfo);
- }
- U.MD.F && U.MD.F.initFriend();
-
- if (U.MD.D && U.MD.D.IsUseStudio) {
- U.MD.D.I.openApplication("disk", { "userid": _userinfo.UserId, "directoryid": US.FTPFOLDERID });
- }
-
- if (!US.userInfo.UserEmail && !$("#usestudio_server")[0]) {
- U.MD.U.P.userDataSet();
- }
- }
- U.MD.U.L.addUserAccess = function () {
-
- if (US.city.userAllLocation) {
- U.A.Request(US.USER, ["RecordUserClientInfo", US.userInfo.username, "", "", US.city.userAllLocation, ""],
- function () { });
- }
- }
- U.MD.U.L.printUserInfo = function () {
- var _childel,
- _userinfo = US.userInfo,
- _userimage = U.MD.C.getHeadImage(_userinfo.UserThumbnailImageHead),
- _el = U.selectEl("#U_MD_D_BDI");
- if (_el[0]) {
-
- _el.addAttrArray({
- "className": "U_MD_D_BDI"
- })[0];
-
- if (_el.find("img")[0]) {
-
- _el.find("img").addAttrArray({
- "onerror": U.MD.C.imgError,
- "title": _userinfo.UserNickName,
- "onclick": function () {
- U.MD.D.I.openApplication("set");
- },
- "src": U.MD.C.getHeadImage(_userinfo.UserThumbnailImageHead)
- });
- }
-
- else {
- $$("img", {
- "onerror": U.MD.C.imgError,
- "onerror": U.MD.C.imgError,
- "title": _userinfo.UserNickName,
- "onclick": function () {
- U.MD.D.I.openApplication("set");
- },
- "src": U.MD.C.getHeadImage(_userinfo.UserThumbnailImageHead)
- }, _el[0])
- }
- _childel = U.selectEl("#U_MD_D_BDL").Child();
- _childel[0].style.display = _childel[1].style.display = "none";
- _childel[2].style.display = "block";
- }
- }
- U.MD.U.L.perfectUserInfo = function (userinfo, username) {
- if ($("#U_MD_U_OT_B_Pop")[0]) {
- U.UF.F.windowTopCenter($("#U_MD_U_OT_B_Pop")[0]);
- } else {
- var _iframe = $$("iframe", { "style": { "border": "0", "float": "left" }, "id": "U_MD_U_OT_B_Iframe", "name": "UI_Login", "frameborder": "0", "width": "400px", "height": "290px", "src": "//user.1473.cn/CompleteInformation.htm" });
- new U.UF.UI.form("", _iframe, {
- "id": "U_MD_U_OT_B_Pop",
- "style": {
- "width": "400px",
- "height": "340px"
- }
- }, {
- isdrag: false,
- isstretching: false,
- isenlarge: false,
- isnarrow: false
- });
-
- U.UF.DL.iframeLoad(_iframe, function () {
- if ($("#U_MD_HomeC_Pop")[0]) {
- U.selectEl("#U_MD_HomeC_Pop")[0].close();
- }
- _iframe.contentWindow.U.MD.U.L.loginCallBack = U.MD.U.L.defaultCallBack;
- _iframe.contentWindow.U.MD.U.OT.perfectUserInfoInit(userinfo, username);
- });
- }
- }
-
- ;;
- Namespace.register("U.UF.DL.C.AD");
- U.UF.DL.C.AD.onloadBaiduJs = function (baiduid) {
- U.UF.DL.asynLoadJs({ "src": "//hm.baidu.com/hm.js?" + baiduid });
- }
- U.UF.DL.C.AD.baidu = function (elementid, baiduid) {
- if (baiduid) {
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "http://cbjs.baidu.com/js/m.js" },
- function () {
- U.UF.DL.C.AD.asynBaidu(elementid, baiduid);
- });
- }
- }
- U.UF.DL.C.AD.asynBaidu = function (elementid, code) {
- BAIDU_CLB_fillSlotAsync(code, elementid);
- }
- U.UF.DL.C.AD.alimama = function (obj) {
-
- var i,
- _aliobj = window.alimamatk_onload = window.alimamatk_onload || [];
- if (Array.isArray(obj)) {
- for (i = 0; i < obj.length; i++) {
- U.UF.DL.C.AD.alimama(obj[i]);
- }
- } else {
- _aliobj.push(U.UF.C.isObject(obj) ? obj : (obj = { pid: obj, appkey: "", unid: "", type: "click" }));
- }
- if (!window.alimamatk_show) {
- U.UF.DL.asynLoadJs({ type: "text/javascript", id: obj.pid, charset: "gbk", async: true, src: "http://a.alimama.cn/tkapi.js" });
- }
- }
- U.UF.DL.C.AD.asynAlimama = function (el, id) {
- $$("a", { style: { "display": "none!important" }, id: "tanx-a-" + id }, el);
- U.UF.DL.asynLoadJs({
- type: "text/javascript",
- id: "tanx-s-" + id,
- async: true,
- charset: "gbk",
- async: true,
- src: "http://p.tanx.com/ex?i=" + id
- });
- }
-
- ;
- Namespace.register("U.MD.C");
- U.MD.C.imgError = function (imgel, type) {
- var _number,
- _url;
-
- imgel = imgel && !imgel.srcElement ? imgel : (event ? event.srcElement || this : this);
-
- if (imgel.src != "/img/error.png") {
- if (type == 2) {
- _url = imgel.src;
- _number = _url.indexOf("?&n=");
-
- if (_number < 0 || _url.length - _number < 10) {
- imgel.src += (_number == -1 ? "?&n=" : "") + 1;
- return
- } else {
- type = 1;
- }
- }
- if (type == 1) {
- U.selectEl(imgel).addAttrArray({ "src": "/img/error.png" });
- } else {
- imgel.src = type || "/img/UserHead/UseHead.jpg";
- }
- }
- }
- U.MD.C.getHeadImage = function (url) {
- return (!url ? "/img/UserHead/UseHead.jpg" : !url.indexOf("http") ? url : ((url.indexOf("www.1473.cn") > -1 ? url : US.FILESYSTEMURL + url.replace(new RegExp(US.FILESYSTEMURL, "gm"), ""))));
- };
- Namespace.register("U.MD.CD");
- U.MD.CD.isLoad;
- U.MD.CD.data;
- if (!window.location.host.indexOf("www.1473.cn")) {
-
-
-
-
-
-
-
-
- window.onerror = function (errorMessage, scripturi, linenumber, columnnumber, errorobj) {
- errorobj = errorobj || {};
- U.A.Request(US.USER, ["SetError", 0, (event.errorMessage || event || errorMessage), (scripturi || event.filename || event.errorUr) + "。行号:" + (linenumber || event.lineno || event.errorLine)], function () { }, []);
- U.UF.C.console(event.errorMessage || event || errorobj);
- return true;
- }
-
- U.UF.CD.loadAjaxCrossDomain(function () {
- U.MD.CD.isLoad = true;
- U.MD.CD.load();
- });
-
- U.MD.CD.me = new U.UF.EV.message(function (data, id, cookie) {
- U.MD.CD.data = [data, id];
- U.MD.CD.load();
- }, false, "domain");
-
- U.MD.CD.load = function () {
-
- if (U.MD.CD.isLoad && U.MD.CD.data) {
- var _data = U.MD.CD.data[0],
- _url = _data[0],
- _params = _data[1];
- try {
-
- US.userInfo = US.userInfo.userid ? US.userInfo : {
- "LoginId": U.UF.Cookie.get("usestudiosso", "loginid")[0],
- "UserId": U.UF.Cookie.get("usestudiosso", "userid")[0]
- };
- } catch (e) { }
-
- U.A.Request(_url, _params, function (r) {
- var _cookie = U.UF.Cookie.get("usestudiosso");
-
- if ("LoginByCookie,uploadUserinfo".indexOf(_params[0]) > -1 && r.value && r.value[0]) {
- US.userInfo = r.value[0];
- US.userInfo.LoginId = r.value[2];
- }
-
- U.MD.CD.me.post(r.value, U.MD.CD.data[1], "usestudiosso=" + (_cookie || ""));
- });
- }
- }
- };
- Namespace.register("U.MD.CD");
- U.MD.CD.me = new U.UF.EV.message(function (data, id) {
-
- U.UF.CD.loadPageCrossDomain(function () {
-
- U.MD.CD.me.post(document.body.innerHTML, id, "usestudiosso=" + (U.UF.Cookie.get("usestudiosso") || ""));
- });
- }, false, "pagedomain");
- ;
- Namespace.register("U.UF.MR");
- U.UF.MR.inputPlaceholder = function (el, str, changestr) {
- if (typeof str == "string") {
- str = { color: "#999", value: str };
- }
- if (typeof changestr == "string") {
- changestr = { color: "#000", value: changestr };
- }
-
- if (str.value == "") {
-
- if (el.value == "") {
- el.value = changestr.value;
- el.style.color = str.color;
- }
- }
-
- if (changestr.value == "") {
- el.style.color = changestr.color;
- if (el.value == str.value) {
- el.value = "";
- }
- }
- }
-
- ;
- US.permission = {};
- US.permission.disk = {
- "isopen": true,
- "isupadte": true,
- "isdelete": true,
- "iscopy": true,
- "isshear": true,
- "isencryption": false,
- "isreply": true,
- "isdownload": true,
- "isnew": true,
- "ispaste": true,
- "isrefresh": true,
- "isupload": true,
- "isview": true,
- "isedit": true
- };
- US.permission.getDiskPermission = function () {
- var i, _obj = {},
- _p = US.permission.disk;
- for (i in _p) {
- _obj[i] = _p[i]
- }
- return _obj;
- };
- Namespace.register("U.MD.C.T");
- U.MD.C.T.timer = null;
- U.MD.C.T.onesetInterval = function () {
- var _num = 0;
- clearInterval(U.MD.C.T.timer);
-
- U.MD.C.T.timer = setInterval(function () {
- var _userid = US.userInfo.userid;
- if (!(_num % 60)) {
- _num = 0;
- }
-
- if (_userid) {
- U.MD.F.N.messageService(_userid);
- }
- }, 5000);
- };
- Namespace.register("U.MD.UI");
- U.MD.UI.upload = function (url, cb, hashcallback) {
-
- var _str = U.UF.CI.isSupportFlash();
-
-
- if (_str == "HTML5") {
- U.MD.UI.upload.html5(url, cb, hashcallback);
- }
-
- else if (_str == "Flash") {
- U.MD.UI.upload.flash(url, cb, hashcallback);
- }
-
- else {
- U.MD.UI.upload.input(url, cb, hashcallback);
- }
- }
- U.MD.UI.upload.uploadFileInfo = [];
- U.MD.UI.upload.html5 = function (url, cb, hashcallback) {
-
- U.MD.UI.create();
- var _clickuploadel = U.selectEl("#U_MD_UI_UP_DRT")[0];
- _clickuploadel.innerText = "";
-
- $$("input", {
- "multiple": "true",
- "type": "file",
- "accept": "*/*",
- "onchange": function () {
- U.MD.UI.inputSelect({
-
- error: function (r) {
- console.log("上传错误:" + r);
- },
-
- getHashCallBack: function (filehash, fileinfo, callback) {
-
- hashcallback(filehash, fileinfo, function (isupload) {
-
- if (isupload) {
-
- U.UF.UP.html5Upload.select(fileinfo, filehash, function (fileservername, filesize) {
-
- U.UF.UP.html5Upload.loop(fileinfo, filehash, fileservername, filesize, function (value) {
-
- if (value == true) {
- callback.getData(filehash, fileservername, fileinfo);
- var _nextuploadfile = U.MD.UI.delUploadFile(fileinfo.fileel, fileinfo);
-
- if (_nextuploadfile) {
- U.MD.UI.inputUpload(_nextuploadfile, callback);
- }
- }
-
- else {
- callback.progress(value, fileinfo.fileid, "上传中");
- }
- });
- });
- } else {
- var _nextuploadfile = U.MD.UI.delUploadFile(fileinfo.fileel, fileinfo);
-
- if (_nextuploadfile) {
- U.MD.UI.inputUpload(_nextuploadfile, callback);
- }
- }
- });
- },
-
- progress: U.MD.UI.progress,
-
- getData: function (filehash, fileservername, file) {
- var _type = file.name.substring(file.name.lastIndexOf('.') + 1, file.name.length),
- _thumbnailname = 'gif|jpg|jpeg|png'.indexOf(_type.toLowerCase()) > -1 ? (Guid.newGuid() + "." + _type) : null;
-
- if (_thumbnailname) {
- U.A.Request(US.DISK, ['CreateThumbnail', fileservername, _thumbnailname], function (r) { });
- }
-
- U.A.Request(US.CD, [US.DB, 'UseStudio_Disk', 'CreateUploadFile', U.UF.C.queryString("UserId", url), file.fileid, U.UF.C.queryString("DirectoryId", url), file.name, fileservername, _thumbnailname, filehash, file.size, 1, file.name, _type, U.UF.C.queryString("Encrypt", url)],
- function (request) {
- cb({ data: [fileservername, fileservername, file.fileid, file.size, U.UF.C.queryString("Encrypt", url), U.UF.C.queryString("DirectoryId", url)] }, file);
- });
- }
- });
- this.value = "";
- },
- "style": { "cssText": "display: block; position: relative; width: 100%; height: 100%; cursor: pointer; border: 0; color: #666; background: #eee; -moz-user-select: -moz-none; -webkit-user-select: none; opacity: 0; filter: alpha(opacity=0); -moz-opacity: 0;" }
- }, _clickuploadel);
- }
- U.MD.UI.upload.flash = function (url, cb, hashcallback) {
- U.MD.UI.create();
- var _url = url,
- _cb = cb,
- _hashcallback = hashcallback,
- _clickuploadel = U.selectEl("#U_MD_UI_UP_DRT")[0];
- _clickuploadel.innerText = "";
-
- U.UF.UP.addFlashUploadBottom(_clickuploadel, "flashupload", { "width": _clickuploadel.clientWidth, "height": _clickuploadel.offsetHeight }, {
- error: U.MD.UI.flashError,
-
- select: function (filesinfo) {
- U.MD.UI.flashSelect(filesinfo, _url, U.UF.C.isFunction(_hashcallback));
- },
-
- getHashCallBack: function (md5, fileid) {
- var _fileinfo = U.MD.UI.getFileInfoById(fileid)[0];
-
- _hashcallback(md5, _fileinfo, function (isupload) {
-
- if (isupload) {
-
- U.UF.UP.flashUpload($("*flashupload")[0], fileid, _url);
- } else {
- U.MD.UI.flashContinueUpload(fileid, _url, U.UF.C.isFunction(_hashcallback));
- }
- });
- },
- progress: U.MD.UI.progress,
- uploadComplete: U.MD.UI.flashUploadComplete,
-
-
- getData: function (r, fileid) {
- if (U.UF.C.isFunction(_cb)) {
- _cb(r, U.MD.UI.getFileInfoById(fileid)[0]);
- }
-
- U.MD.UI.flashContinueUpload(fileid, _url, U.UF.C.isFunction(_hashcallback));
- },
- endUpload: U.MD.UI.deleteUploadAllFile
- }, "*");
- }
- U.MD.UI.upload.input = function (url, cb, hashcallback) {
- U.MD.UI.create();
- var _clickuploadel = U.selectEl("#U_MD_UI_UP_DRT")[0];
- _clickuploadel.innerText = "";
-
- $$("input", {
- "multiple": "true",
- "type": "file",
- "accept": "*/*",
- "onchange": U.MD.UI.inputSelect,
- "style": { "cssText": "display: block; position: relative; width: 100%; height: 100%; cursor: pointer; border: 0; color: #666; background: #eee; -moz-user-select: -moz-none; -webkit-user-select: none; opacity: 0; filter: alpha(opacity=0); -moz-opacity: 0;" }
- }, _clickuploadel);
- }
- U.MD.UI.create = function () {
- var _flashtop = U.selectEl("#U_MD_UI_UP_O")[0];
- if (_flashtop) {
- U.UF.F.windowTopCenter(_flashtop);
- } else {
- var _uploadel,
- _topel,
- _titleel,
- _bottom,
- _switchel;
- _uploadel = $$("div", { "id": "U_MD_UI_UP", "className": "U_MD_UI_UP" });
- _topel = $$("div", { "className": "U_MD_UI_UP_O" }, _uploadel);
-
- _titleel = $$("div", { "className": "U_MD_UI_UP_T" }, _topel);
- $$("div", { "className": "U_MD_UI_UP_TO", "innerHTML": "普通上传" }, _titleel);
- $$("div", { "className": "U_MD_UI_UP_Z", "innerHTML": "提示声明: 严谨上传包括反动、暴力、色情、违法及侵权内容的文件;严格遵守保密法律法规,任何危害用户或犯法的行为,都必须受到法律追究。" }, _topel);
-
- $$("div", { "id": "U_MD_UI_UP_C", "className": "U_MD_UI_UP_C" }, _topel);
-
- _bottom = $$("div", { "className": "U_MD_UI_UP_D" }, _topel);
- _switchel = $$("div", { "className": "U_MD_UI_UP_DR" }, _bottom);
- $$("div", { "className": "U_MD_UI_UP_DRO", "innerHTML": "点击上传" }, _switchel);
- $$("div", { "className": "U_MD_UI_UP_DRO U_MD_UI_UP_DRT", "id": "U_MD_UI_UP_DRT" }, _switchel);
-
- return new U.UF.UI.form("<div class='U_MD_F_S_TI'>上传</div>", _uploadel, {
- "id": "U_MD_UI_UP_O",
- "style": { "width": "700px", "height": "560px" }
- }, { isnarrow: false, isenlarge: false }).form;
- }
- }
- U.MD.UI.getFileInfoById = function (fileid) {
- var i, j,
- _allfiles = U.MD.UI.upload.uploadFileInfo;
- for (i = 0; i < _allfiles.length; i++) {
- j = _allfiles[i].objIndexOf({ "fileid": fileid });
-
- if (j > -1) {
-
- return [_allfiles[i][j], j, i];
- }
- }
- return [null, -1, -1];
- }
- U.MD.UI.inputSelect = function () {
- }
- U.MD.UI.inputSelect = function (callback) {
-
- var event = window.event || arguments.callee.caller.arguments[0];
- var _fileinfo,
- _fileinfos = [],
- _files = event.target.files;
-
- for (var i = 0; i < _files.length; i++) {
- _fileinfos.push(_files[i]);
- }
- U.MD.UI.upload.uploadFileInfo.push(_fileinfos);
- U.MD.UI.printUploadFiles(_fileinfos);
- U.MD.UI.inputUpload(_fileinfos[0], callback);
- }
- U.MD.UI.inputUpload = function (file, callback) {
- file.isupload = true;
-
- U.UF.UP.html5Upload.fileMd5(file, function (progress, finish, filehash) {
-
- if (!progress) {
-
- if (U.UF.C.isFunction(callback.error)) {
- callback.error(finish);
- }
- }
-
- else if (finish) {
- callback.progress({ "Loaded": 1, "Total": 1 }, file.fileid, "");
-
- if (U.UF.C.isFunction(callback.getHashCallBack)) {
- callback.getHashCallBack(filehash, file, callback);
- }
- }
-
- else {
- if (U.UF.C.isFunction(callback.progress)) {
- callback.progress(progress, file.fileid, "解析中");
- }
- }
- });
- }
- U.MD.UI.flashSelect = function (uploadfiles, url, isgethash) {
- U.MD.UI.printUploadFiles(uploadfiles, true);
- U.MD.UI.upload.uploadFileInfo.push(uploadfiles);
- U.MD.UI.flashUpload(uploadfiles[0], url, isgethash);
- }
- U.MD.UI.flashUpload = function (uploadfile, url, isgethash) {
- var _flashbottom = U.selectEl("*flashupload")[0],
- _fileid = uploadfile.fileid
- ;
- uploadfile.isupload = true;
-
- if (isgethash) {
-
- U.UF.UP.generateFileHash($("*flashupload")[0], _fileid);
- }
-
- else {
-
- U.UF.UP.flashUpload(_flashbottom, _fileid, url);
- }
- }
- U.MD.UI.flashUploadComplete = function (fileid) {
-
- }
- U.UF.UP.deleteUploadAllFile = function () {
- }
- U.MD.UI.flashEmptyUpload = function (el) {
- var _flashbottom = U.selectEl("*flashupload")[0];
- if (_flashbottom) {
- U.UF.UP.deleteUploadAllFile(_flashbottom);
- }
- }
- U.MD.UI.flashError = function (errorinfo) {
- if (errorinfo.message) {
- var _meeage = "上传处理失败:" + errorinfo.message;
- if (UE.errorID == 1502) {
- _meeage = "文件太大,电脑内存不足";
- }
- U.alert(_meeage);
- U.UF.C.console(errorinfo);
- }
- }
- U.MD.UI.printUploadFiles = function (uploadfiles, isflash) {
- var _type,
- _info,
- _uploaddiv,
- _panel,
- _panel_one,
- _progressel,
- _uploadcontent = U.selectEl("#U_MD_UI_UP_C"),
- _frag = $$("frag");
-
- for (i = 0; i < uploadfiles.length; i++) {
- uploadfiles[i].fileid = Guid.newGuid();
- _type = U.UF.UP.getFileNameAndExtension(uploadfiles[i]["name"])[1];
-
- _uploaddiv = $$("div", { "className": "U_MD_UI_UP_CO" }, _frag);
- _panel = $$("div", { "className": "U_MD_UI_UP_COO" }, _uploaddiv);
- _panel_one = $$("div", { "className": "U_MD_UI_UP_COI U_Img ", "style": { "cssText": "background-position:-12px 1px" } }, _panel);
- $$("div", { "className": "U_MD_UI_UP_COION", "innerHTML": _type }, _panel_one);
- _panel_one = $$("div", { "className": "U_MD_UI_UP_COT" }, _panel);
- $$("div", { "className": "U_MD_UI_UP_COTS U_MD_D_Text_Abbreviation", "innerHTML": uploadfiles[i].name }, _panel_one);
- $$("div", { "className": "U_MD_UI_UP_COTX", "innerHTML": "容量大小:" + U.UF.UP.minUnitToMaxUnit(uploadfiles[i]["size"]) }, _panel);
- _panel_one = $$("div", { "className": "U_MD_UI_UP_COS U_MD_D_Text_Abbreviation" }, _panel);
- $$("div", { "className": "U_MD_UI_UP_COSN", "innerHTML": "准备上传" }, _panel_one);
- $$("div", { "className": "U_MD_UI_UP_COSI U_Img" }, _panel_one);
- _panel_one = $$("div", { "className": "U_MD_UI_UP_COC U_MD_UI_UP_COX", "title": "等待响应..." }, _panel_one);
- $$("img", { "onerror": U.MD.C.imgError, "src": US.DOMAIN + "img/ULG.gif" }, _panel_one);
- $$("div", {
- "className": "U_MD_UI_UP_COX",
- "titlle": "点击撤销删除上传",
- "innerHTML": "撤销",
- "onclick": function () {
- U.MD.UI.delUploadFile(_uploaddiv, uploadfiles[0], isflash);
- }
- }, _panel);
- _progressel = $$("div", { "className": "U_MD_UI_UP_COU" }, _uploaddiv);
- uploadfiles[i].fileel = _uploaddiv;
- uploadfiles[i].progressel = _progressel;
- }
-
- _uploadcontent.append(_frag);
- }
- U.MD.UI.delUploadFile = function (uploadel, uploadfile, isflash) {
- var i, j,
- _allfiles = U.MD.UI.upload.uploadFileInfo,
- _fileinfo = U.MD.UI.getFileInfoById(uploadfile.fileid),
- _allfilesnum = _fileinfo[2],
- _filesnum = _fileinfo[1];
- U.selectEl(uploadel).remove();
- if (_filesnum != -1) {
-
- _allfiles[_allfilesnum].splice(_filesnum, 1)[0];
-
- if (!_allfiles[_allfilesnum].length) {
- _allfiles.splice(_allfilesnum, 1);
- }
-
- if (isflash) {
- U.UF.UP.deleteUploadFile($("*flashupload")[0], _filesnum, _allfilesnum);
- }
-
- else {
- U.UF.UP.html5Upload.deleteUploadFile(uploadfile);
- }
-
- if (uploadfile.isupload) {
-
- if (_allfiles.length) {
-
- for (i = 0; i < _allfiles.length; i++) {
- for (j = 0; j < _allfiles[i].length; j++) {
- if (!_allfiles[i][j].isupload) {
- return _allfiles[i][j];
- }
- }
- }
- } else {
-
- if (isflash) {
- U.MD.UI.flashEmptyUpload();
- } else {
- U.UF.UP.html5Upload.deleteUploadAllFile();
- }
- }
- }
- }
- }
- U.MD.UI.progress = function (progress, fileid, msg) {
- var _fileinfo = U.MD.UI.getFileInfoById(fileid)[0],
- _progresschilds = U.selectEl($(_fileinfo.fileel).childs(0).childs(0)[3]).Child(),
- _progress = Math.floor((progress.Loaded / progress.Total) * 100);
- _fileinfo.progressel.style.width = _progress + "%";
- _progresschilds[0].innerText = msg;
- _progresschilds[1].style.display = "none";
- _progresschilds[2].style.display = "block";
- }
- U.MD.UI.flashContinueUpload = function (fileid, url, isgethash) {
- var _fileinfo = U.MD.UI.getFileInfoById(fileid)[0],
- _nextuploadfile = U.MD.UI.delUploadFile(_fileinfo.fileel, _fileinfo, true);
-
- if (_nextuploadfile) {
- U.MD.UI.flashUpload(_nextuploadfile, url, isgethash);
- }
- }
- Namespace.register("U.MD.N");
- U.MD.N.urlGuide = function () {
- var _hash = U.UF.C.getUrlHash(),
- _type;
-
- if (_hash[0] == "#!") {
- _hash.shift()
- }
-
- else {
- _hash[0] = _hash[0].substr(1);
- }
- _type = _hash[0];
- switch (_type) {
- case "disk":
-
- U.MD.D.I.openApplication(_type, { "userid": _hash[1], "directoryid": _hash[2] });
- break;
- case "file":
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- var _fileinfo = r.value[0];
- _fileinfo = new U.MD.DK.M.entity(_fileinfo.UserFilesID, _fileinfo.UserFilesSize, _fileinfo.UserDirectoryID, _fileinfo.UserFilesName, _fileinfo.UserFilesName,
- _fileinfo.UserFilesExtendName, _fileinfo.UserFilesServerName, _fileinfo.UserFilesAddTime, null, 999, _fileinfo.UserFilesModifyTime, _fileinfo.UserDirectoryEncrypt,
- 1, _fileinfo.UserFilesExtendName, _fileinfo.GroupID, _fileinfo.UsOffice, _fileinfo.UserID, US.userInfo.UserNikeName, _fileinfo.UserName, _fileinfo.UserThumbnailImageHead);
- U.MD.DK.LE.openFileDirectory(_fileinfo);
- });
- break;
- case "excel":
- if (_hash[1] == 'join') {
- U.MD.N.joinGuide(_hash, _type);
- } else if (_hash[1].length == 36) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
-
- var _fileinfo = {
- UserDirectoryExtendType: r.value[0].UserFilesExtendName,
- UsOffice: r.value[0].UsOffice ? r.value[0].UsOffice.unEscapeQuotes() : null,
- UserId: r.value[0].UserID,
- UserallDirectoryName: r.value[0].UserFilesName,
- UserDirectoryID: r.value[0].UserFilesID,
- GroupID: r.value[0].UserDirectoryEncrypt
- };
-
- if (r.value && r.value.UsOffice !== undefined && r.value.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
- }
- });
- }
- break
- case "word":
- if (_hash[1] == 'join') {
- U.MD.N.joinGuide(_hash, _type);
- } else if (_hash[1].length == 36) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _hash[1]]), function (r) {
- if (r.value[0]) {
- r = r.value[0];
-
- var _fileinfo = {
- UserFilesServerName: r.UserFilesServerName,
- UserDirectoryExtendType: r.UserFilesExtendName,
- UsOffice: r.UsOffice ? r.UsOffice.unEscapeQuotes() : null,
- UserId: r.UserID,
- UserallDirectoryName: r.UserFilesName,
- UserDirectoryID: r.UserFilesID,
- GroupID: r.UserDirectoryEncrypt
- };
-
- if (r && r.UsOffice !== undefined && r.UsOffice != null) {
- U.MD.D.I.openApplication(_type, _fileinfo);
- }
-
- else {
- U.A.Request("http://office.1473.cn/Officetohtml.ashx", ["Open", _fileinfo.UserDirectoryExtendType, _fileinfo.UserFilesServerName], function (r) {
- if (r.value.value != undefined) {
- r = r.value;
- _fileinfo.UsOffice = r.value.getBodyHtml().replace(/src=[\'\"]?([^\'\"]*)[\'\"]?/ig, function (str1, str2) {
- return "src=\"http://office.1473.cn/usoffice/" + str2 + "\"";
- });
- U.MD.D.I.openApplication(_type, _fileinfo);
- } else {
- U.Alert('文档已丢失。。。');
- }
- });
- }
- }
- });
- }
- break;
- case "boomYun":
- case "txt":
- case "friend":
- case "lookupfriend":
- case "set":
- case "systemset":
- U.MD.D.I.openApplication(_type, { "directoryid": _hash[1] });
- if (_hash[1] == "template") {
-
- if (_hash[2] != "undefined") {
- U.Boom.I.GetHomeTemp.particulars(_hash[2]);
- U.MD.N.urlWrite("boomYun/template/" + _hash[2], "互联办公");
- }
- }
- break;
- default:
- break;
- }
- }
- U.MD.N.joinGuide = function (hash, type) {
- var _fileId = hash[2];
- U.MD.U.L.setLoginCallBack(function () {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Disk", "GetFileById", _fileId]), function (r) {
- var _docinfo = r.value[0];
- if (!_docinfo) {
- return U.Alert('添加协同链接有误,请联系群主获取最新协同链接。。。');
- }
- if (US.friend.group) {
- var _groupId = _docinfo.UserDirectoryEncrypt || _docinfo.UserDirectoryID,
- _groupinfo = U.Json.select(US.friend.group, { "GroupManageID": _groupId })[0],
- _docId = _docinfo.UserFilesID;
- if (!_groupinfo) {
- U.A.Request(US.CD, ([US.DB, "UseStudio_Friends", "GetGroupInfo", _groupId]), function (r) {
- U.MD.F.J.selectUserInfo.NeedUser = [US.userInfo];
- US.friend.group.push(r.value[0]);
- top.U.MD.F.J.determineCreateGroupAndAddGroupUser(r.value[0].GroupManageID, null, null, false, "", "", function (groupid, groupdata) {
- U.Json.del(groupdata[0], { UserId: US.userInfo.userid });
- US.friend.groupusers.push.apply(US.friend.groupusers, groupdata[0]);
-
- U.MD.D.I.openApplication(type, U.Json.select(groupdata[1], { UserDirectoryID: _docId })[0], function (contentwindow) { contentwindow.U.MD.O.W.Panel.addUser(US.userInfo.userid); });
- });
- });
- } else {
- var _docdiskinfo = new U.MD.DK.M.entity(_docinfo.UserFilesID, _docinfo.UserFilesSize, _docinfo.UserDirectoryID, _docinfo.UserFilesName, _docinfo.UserFilesName,
- _docinfo.UserFilesExtendName, _docinfo.UserFilesServerName, _docinfo.UserFilesAddTime, null, 999, _docinfo.UserFilesModifyTime, _docinfo.UserDirectoryEncrypt,
- 0, _docinfo.UserFilesExtendName, _groupId, _docinfo.UsOffice, _docinfo.UserID, US.userInfo.UserNikeName, _docinfo.UserName, _docinfo.UserThumbnailImageHead);
- U.Alert("你已经在该文档的群里了!");
- U.MD.D.I.openApplication(type, _docdiskinfo);
- }
- }
- })
- });
- }
- U.MD.N.urlWrite = function (hash, title) {
- setTimeout(function () {
- U.UF.N.addHash(hash);
- document.title = title;
- }, 0);
- }
- Namespace.register("U.MD.U.NP");
- U.MD.U.NP.GN = { "2d9c5d2d-e6e5-4a40-8064-f93a98d0e647": { "Url": "http://pay.1473.cn/?f=hbt&=hbt", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XIH", "", "好笔头", "云笔记产品", "好笔头业务云笔记专为企业团队量身打造,致力为企业团队提供最好、最适合的云笔记产品,记客户,记工作,记知识,重要工作备忘提醒,专为改善企业团队工作效率而生,同时团队围绕笔记交流协作,提高团队执行和分享效率。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBB"] }, "7bc6d08c-7db3-4ef4-8a39-595a4967a189": { "Url": "http://pay.1473.cn/?f=zh&zh=", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XIZ", "", "中恒科技", "兼容生产CD", "深圳市中恒科技实业有限公司坐落于具有中国光盘生产基地之誉称的广东省深圳市,是一家兼容生产CD-R,DVD-R可录入式空白光盘的中外合资企业,总投资3千万美元。第一期拥有10条具有国际先进水平的生产线,年产量可达6千万元。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBD"] }, "ea0efe2e-9167-4698-b9b5-31c27ad5eb73": { "Url": "http://pay.1473.cn/?f=sp&sp=", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XIB", "", "声博配音公司", "各个语种的深圳配音", "声博配音公司拥有全新数字专业录音棚,资深音频工程师、录音师、音乐制作人等。 成立以来,公司在一直致力于中文及各个语种的深圳配音业务、音乐制作等。 为国内外客户录制了大量影视动画、广告、专题等。在深圳配音行业内树立了良好的口碑。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBB"] }, "fd01dd1b-9c87-4e4f-a3fb-af1b91bf56f8": { "Url": "/#!/tg/", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XIY", "", "云端桌面", "体验崭新的云服务", "云端桌面远离单机,基于互联网。提供免费存储,让你远离U盘,排除U盘丢失和携带的麻烦。云端的资源都是共享的,你可以随时获取好友共享的资源。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBY"] }, "ea0efe2e-9167-4698-b9b5-31c27ad5eb73": { "Url": "http://pay.1473.cn/?f=sp&sp=", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XIB", "", "声博配音公司", "各个语种的深圳配音", "声博配音公司拥有全新数字专业录音棚,资深音频工程师、录音师、音乐制作人等。 成立以来,公司在一直致力于中文及各个语种的深圳配音业务、音乐制作等。 为国内外客户录制了大量影视动画、广告、专题等。在深圳配音行业内树立了良好的口碑。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBB"] }, "90f7c5ca-f7ab-4f31-8869-7275b8e8955c": { "Url": "http://pay.1473.cn/?f=bz&bz=", "TT": ["U_MD_U_NP_XI U_MD_U_NP_XID", "", "北京邮电大学", "高新技术产业发展", "北京邮电大学深圳研究院(简称深圳研究院)是依照国家有关法律、行政法规和深圳市人民政府深府办[2000]39号文件以及关于进一步扶持高新技术产业发展的若干规定成立的北京邮电大学全资事业法人机构。", "U_MD_U_NP_XWCB U_MD_U_NP_XWCBD"] } }
- U.MD.U.NP.TF;
- U.MD.U.NP.DTG = function () {
- var _UDPD = U.selectEl("#U_MD_U_NP")[0];
- U.UF.F.windowTopCenter(_UDPD);
-
- }
- U.MD.U.NP.DTGOD = function (TGID) {
- var _UDTD = U.selectEl("#U_MD_U_NP_XW")[0],
- _UDAD = U.selectEl("div", _UDTD),
- _UGN = U.MD.U.NP.GN[TGID]["TT"];
- for (var i = 0; i < _UGN.length; i++) {
- if (i == 1) {
- continue;
- }
- if (i > 0 && i < _UGN.length - 1) {
- _UDAD[i].innerHTML = _UGN[i];
- } else {
- _UDAD[i].className = _UGN[i] + " U_MD_U_NP_I";
- }
- }
- _UDAD[_UDAD.length - 2].onclick = function () {
- U.MD.U.NP.GTGURL(TGID);
- };
- }
- U.MD.U.NP.NTG = function (T) {
- if (!U.MD.U.L.isLogin()) {
- if (US.userInfo.TGD && US.userInfo.TGD["NTG"] && T == null) {
- U.MD.U.NP.PLTG(US.userInfo.TGD["NTG"]);
- U.MD.U.NP.LTTG(US.userInfo.TGD["YXT"]);
- U.selectEl("#U_MD_U_NP_DPI")[0].innerText = "";
- U.MD.U.NP.GTGFW(0);
- } else {
- U.A.Request("UseStudioPay.GetUserAllTG", [US.userInfo.userid], U.MD.U.NP.AsynNTG, [$("#U_MD_U_NP_A")[0]]);
-
- U.UF.EV.scrollLoad($("#U_MD_U_NP_A")[0], function () {
- U.MD.U.NP.GFWTG
- });
- }
- }
- }
- U.MD.U.NP.AsynNTG = function (r) {
- var _context = r.context;
- r = r.value;
- if (US.userInfo.TGD == null) { US.userInfo.TGD = {} };
- US.userInfo.TGD["NTG"] = r[0];
- US.userInfo.TGD["YXT"] = U.MD.U.NP.DT(r[1]);
- US.userInfo.TGD["YXD"] = [r[2]];
- U.MD.U.NP.NTG();
- }
- U.MD.U.NP.DT = function (UTL) {
- var i, j, _TF = [];
- for (i = 0; i < UTL.length; i++) {
- _TF[i] = [];
- _TF[i].push(UTL[i]);
- for (j = i + 1; j < UTL.length; j++) {
- if (UTL[j]["TGUserInfoID"] == UTL[i]["TGUserInfoID"]) {
- _TF[i].push(UTL[j]);
- UTL.splice(j, 1);
- }
- }
- }
- return _TF;
- }
- U.MD.U.NP.PLTG = function (UTL) {
- var i, j, k,
- _UDPD = U.selectEl("#U_MD_U_NP_DTD")[0],
- _el, _UDTD, _UDI,
- _UDFD = $$("frag"),
- _UAFD = [],
- _UAT = ["disk", "photo", "music", "video", "blog"];
- _UDPD.innerText = "";
- if (UTL.length > 0) {
- U.selectEl("#U_MD_U_NP_DUN")[0].innerHTML = US.userInfo.TrueName || US.userInfo.UserNickName;
- for (i = 0; i < UTL.length; i++) {
- _UAFD.push(UTL[i]["TY"] + UTL[i]["TGUserInfoID"]);
- if (UTL[i]["TGID"] == "fd01dd1b-9c87-4e4f-a3fb-af1b91bf56f8") {
- for (j = 0; j < _UAT.length; j++) {
- _UAFD.push(US.DOMAIN + "#!/" + _UAT[j] + "/" + US.userInfo.username);
- }
- }
- _el = $$("div", { "className": "U_MD_U_NP_DTDD" }, _UDFD);
- $$("div", { "className": "U_MD_U_NP_DTDDN", "innerHTML": U.MD.U.NP.GN[UTL[i]["TGID"]]["TT"][2] + ':' }, _el);
- for (k = 0; k < _UAFD.length; k++) {
- _UDTD = $$("div", { "className": "U_MD_U_NP_DTDDA" }, _el);
- _UDI = $$("input", {
- "className": "U_MD_U_NP_DTDDS",
- "readOnly": "true",
- "value": _UAFD[k],
- "oncopy": function () {
- U.UF.EV.stopBubble();
- U.UF.C.copy("retElement.value");
- }
- }, _UDTD);
- $$("div", {
- "innerHTML": "复制",
- "className": "U_MD_U_NP_DTDDF",
- "style": {
- "cssText": "float:right"
- },
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.UF.C.copy(_UDI.value);
- }
- }, _UDTD);
- }
- _UAFD.splice(0, _UAFD.length);
- }
- _UDPD.appendChild(_UDFD);
- } else { _UDPD.innerText = "没有推广分类文类"; }
- }
- U.MD.U.NP.LTTG = function (UTL) {
- var _UDPD = U.selectEl("#U_MD_U_NP_DWP")[0],
- _el, _UDTD, _UDSD,
- _UDFD = $$("frag");
- _UDPD.innerText = "";
- for (var i = 0; i < UTL.length; i++) {
- _el = $$("div", { "className": "U_MD_U_NP_DWP" }, _UDFD);
- _UDTD = $$("div", { "className": "U_MD_U_NP_DWY" }, _el);
- $$("div", { "className": "U_MD_U_NP_DWYN", "innerHTML": U.MD.U.NP.GN[UTL[i][0]["TGID"]]["TT"][2] + "点击次数" }, _UDTD);
- $$("div", { "className": "U_MD_U_NP_DWYS", "innerHTML": UTL[i][0]["C"] }, _UDTD);
- _UDSD = $$("div", { "className": "U_MD_U_NP_DWY" }, _el);
- $$("div", { "className": "U_MD_U_NP_DWYN", "innerHTML": U.MD.U.NP.GN[UTL[i][0]["TGID"]]["TT"][2] + "成功注册" }, _UDSD);
- $$("div", { "className": "U_MD_U_NP_DWYS", "innerHTML": UTL[i][1] ? UTL[i][1]["C"] : "0" }, _UDSD);
- }
- _UDPD.appendChild(_UDFD);
- }
- U.MD.U.NP.GFWTG = function () {
- if (U.MD.U.NP.GTGFW.call(this, (this.P + 1)).length == 0) {
- this.P -= 1;
- this.TF = false;
- return false;
- }
- }
- U.MD.U.NP.GTGFW = function (P) {
- var _UTL = U.MD.U.NP.GYXFW(P);
- if (_UTL) { U.MD.U.NP.FWTG(_UTL); } else {
- var _FP = Math.floor(P / 5);
- U.A.Request("UseStudioPay.GetTGYXSL", [US.userInfo.userid, _FP * 50, (_FP + 1) * 50 - 1], U.MD.U.NP.AsynGTGFW, ["", P, this]);
- return [];
- }
- return _UTL;
- }
- U.MD.U.NP.AsynGTGFW = function (r) {
- var _context = r.context;
- r = r.value;
- US.userInfo.TGD["YXD"].push(r);
- U.MD.U.NP.GTGFW(_context[1]);
- _context[2].TF = true;
- }
- U.MD.U.NP.GYXFW = function (P) {
- if (US.userInfo.TGD) {
- var _UTGP = US.userInfo.TGD["YXD"],
- TP = Math.floor(P / 5),
- FP = (P - TP * 5);
- if (_UTGP[TP]) {
- return _UTGP[TP].slice(FP * 10, (FP + 1) * 10);
- }
- }
- }
- U.MD.U.NP.FWTG = function (UTL) {
- if (UTL.length > 0) {
- var _UDPD = U.selectEl("#U_MD_U_NP_DPI")[0],
- _el,
- _UTD,
- _UDFD = $$("frag");
- for (var i = 0; i < UTL.length; i++) {
- eval("0,_UTD =" + UTL[i]["TGAdress"]);
- _el = $$("div", { "className": "U_MD_U_NP_DPH U_MD_U_NP_DPIF", "style": { "backgroundColor": "White" } }, _UDPD);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "style": { "marginLeft": "0px" }, "innerHTML": UTL[i]["UserIp"] }, _el);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": _UTD["province"] + " " + _UTD["city"] }, _el);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": U.UF.D.getYearMonthDay(UTL[i]["Time"], "String") }, _el);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": U.MD.U.NP.GN[UTL[i]["TGID"]]["TT"][2] }, _el);
- $$("div", { "className": "U_MD_D_Text_Abbreviation", "innerHTML": UTL[i]["IsRegistration"] ? "成功" : "失败", "style": { "color": UTL[i]["IsRegistration"] ? "Red" : "" } }, _el);
- }
- _UDPD.appendChild(_UDFD);
- }
- }
- U.MD.U.NP.GPMTG = function (TF) {
- if (US.userInfo.TGD && US.userInfo.TGD["TGP"] && TF == null) {
- U.MD.U.NP.PMTG(US.userInfo.TGD["TGP"]);
- } else {
- U.A.Request("UseStudioPay.GetTGPM", [], U.MD.U.NP.AsynGPMTG, [$("#U_MD_U_NP_A")[0]]);
- }
- }
- U.MD.U.NP.AsynGPMTG = function (r) {
- r = r.value;
- if (US.userInfo.TGD == null) { US.userInfo.TGD = {} };
- US.userInfo.TGD["TGP"] = r;
- U.MD.U.NP.GPMTG();
- }
- U.MD.U.NP.PMTG = function (UTL) {
- var _UDPD = U.selectEl("#U_MD_U_NP_PG")[0],
- _el, _UDTD,
- _UDFD = $$("frag");
- _UDPD.innerText = "";
- for (var i = 0; i < UTL.length; i++) {
- _el = $$("div", { "className": "U_MD_U_NP_PH" + (i < 3 ? "" : " U_MD_U_NP_PHV") }, _UDFD);
- $$("div", { "className": "U_MD_U_NP_PHM", "innerHTML": (i + 1 < 10 ? "0" : "") + (i + 1) + ".", "style": { "color": i == 0 ? "#e06767" : "" } }, _el);
- _UDTD = $$("div", { "className": (i < 3 ? "U_MD_U_NP_PHH" : "U_MD_U_NP_PHHM") }, _el);
- $$("img", {
- "className": (i < 3 ? "U_MD_U_NP_PHHI" : "U_MD_U_NP_PHHIO"),
- "alt": UTL[i]["TrueName"] || UTL[i]["UserName"],
- "src": U.MD.C.getHeadImage(UTL[i].UserThumbnailImageHead),
- "onclick": [U.MD.U.V.POUW, [UTL[i]["UserID"]]]
- }, _UDTD);
- $$("div", { "className": "U_MD_U_NP_PHHS U_MD_D_Text_Abbreviation" + (i < 3 ? "" : " U_MD_U_NP_PHHSM"), "innerHTML": UTL[i]["TrueName"] || UTL[i]["UserName"] }, _UDTD);
- $$("div", { "className": "U_MD_U_NP_PHHS U_MD_D_Text_Abbreviation" + (i < 3 ? "" : " U_MD_U_NP_PHHSM"), "innerHTML": U.MD.U.NP.GN[UTL[i]["TGID"]]["TT"][2] }, _UDTD);
- }
- _UDPD.appendChild(_UDFD);
- }
- U.MD.U.NP.AddUr = function (TGID) {
- U.A.Request("UseStudioPay.SetYXTG", [TGID, U.UF.C.jsonToStr(US.city)], U.MD.U.NP.AsynAddUr, [""]);
- }
- U.MD.U.NP.AddUrID = function (userid) {
- U.A.Request("UseStudioPay.SetYXTGBYUID", [userid, U.UF.C.jsonToStr(US.city)], U.MD.U.NP.AsynAddUr, [""]);
- }
- U.MD.U.NP.AsynAddUr = function (r) {
- r = r.value;
- U.MD.U.NP.TF = r;
- U.MD.U.NP.TGR();
- }
- U.MD.U.NP.GTGURL = function (TGID) {
- if (!U.MD.U.L.isLogin()) {
- if (US.userInfo.TGD && US.userInfo.TGD["NTG"] && U.MD.U.NP.GISTGURL(TGID)) {
- U.MD.U.NP.STG(1, U.selectEl("#U_MD_U_NP_A")[0]);
- return false;
- }
- U.alert("正在获取中...");
- U.A.Request("UseStudioPay.SetUserTG", [US.userInfo.userid, TGID], U.MD.U.NP.AsynGTGURL, ["", TGID]);
- }
- }
- U.MD.U.NP.AsynGTGURL = function (r) {
- _context = r.context;
- r = r.value
- if (r) {
- if (US.userInfo.TGD && US.userInfo.TGD["NTG"]) {
- r = r.toLocaleLowerCase();
- var _ET = new U.MD.U.NP.TGE[_context[1], r, U.MD.U.NP.GN[_context[1]]["Url"]];
- };
- US.userInfo.TGD["NTG"].push(_ET);
- }
- U.MD.U.NP.STG(1, U.selectEl("#U_MD_U_NP_A")[0]);
- }
- U.MD.U.NP.GISTGURL = function (TGID) {
- var _UNTG = US.userInfo.TGD["NTG"];
- for (var i = 0; i < _UNTG.length; i++) {
- if (_UNTG[i]["TGID"] == TGID) {
- return _UNTG[i];
- }
- }
- return false;
- }
- U.MD.U.NP.TGR = function () {
- if (U.MD.U.NP.TF && US.userInfo.userid) {
- U.A.Request("UseStudioPay.UpAddR", [U.MD.U.NP.TF], function () { }, []);
- U.MD.U.NP.TF = false;
- }
- }
- U.MD.U.NP.STG = function (TF, UTFD) {
- TF = TF + 1;
- var _UTAD = U.UF.EL.getChildrenNoText(UTFD.childNodes);
- for (var i = 1; i < _UTAD.length; i++) {
- if (TF == 2 && US.userInfo.userid == null) {
- break;
- };
- if (TF == i) {
- _UTAD[i].style.display = "block";
- } else {
- _UTAD[i].style.display = "none";
- }
- }
- if (TF == 3) {
- U.MD.U.NP.GPMTG();
- }
- else if (TF > 1) {
- if (!U.MD.U.L.isLogin()) {
- U.MD.U.NP.NTG();
- }
- }
- }
- U.MD.U.NP.TGE = function (E) {
- this.TGID = E[0];
- this.TGUserInfoID = E[1];
- this.TY = E[2];
- };
|