123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832 |
-
- Namespace.register("U.MD.UI.slider");
- U.MD.UI.slider = function (box, imgarr, attr) {
-
- var _speed = attr.speed;
- var _arrow = attr.arrow;
- var _dot = attr.dot;
- var _moveFun = attr.moveFun;
-
- var _sliderimgul = $$("ul", { className: 'U_MD_UI_slider_ImgList' }, box);
-
- imgarr.unshift(imgarr[imgarr.length - 1]);
-
- imgarr.push(imgarr[1]);
-
- for (i = 0; i < imgarr.length; i++) {
- var _sliderimgli = $$("li", { className: '' }, _sliderimgul),
- _sliderImg = $$("img", { className: '', src: imgarr[i] }, _sliderimgli);
- }
-
- var _sliderbtnul = $$("ul", { className: 'U_MD_UI_slider_Btn' }, box),
- _sliderbtnlil = $$("li", { className: 'U_MD_UI_slider_Left', innerHTML: '<' }, _sliderbtnul),
- _sliderbtnlir = $$("li", { className: 'U_MD_UI_slider_Right', innerHTML: '>' }, _sliderbtnul);
-
- var _sliderpointul = $$("ul", { className: 'U_MD_UI_slider_Point' }, box);
-
- for (i = 0; i < imgarr.length - 3; i++) {
-
- if (i == 0) {
- $$("li", { className: 'U_MD_UI_slider_On' }, _sliderpointul)[0];
- }
- $$("li", { className: '' }, _sliderpointul)[i];
- }
-
- var _boxidwidth = box.offsetWidth;
-
- var _boxidheight = box.offsetHeight;
-
- var _sliderimglist = box.getElementsByClassName("U_MD_UI_slider_ImgList")[0];
- var _sliderimgli = _sliderimglist.getElementsByTagName("li");
-
- var _sliderbtn = document.getElementsByClassName("U_MD_UI_slider_Btn")[0];
-
- var _sliderpoint = box.getElementsByClassName('U_MD_UI_slider_Point')[0];
-
- var _btnli = _sliderbtn.getElementsByTagName("li");
-
- var _listlen = _sliderimglist.getElementsByTagName("li").length;
-
- var _listindex = 1;
-
- var _pointdot = _sliderpoint.getElementsByTagName("li");
-
- var _dotlen = _pointdot.length;
-
- var _dotindex = 0;
-
- var timer = null;
-
- if (_dot) {
- _sliderpoint.style.display = "block";
- } else {
- _sliderpoint.style.display = "none";
- }
-
-
- var _sliderli = _sliderimglist.getElementsByTagName("li");
-
- for (var i = 0; i < _sliderli.length; i++) {
- _sliderli[i].style.width = _boxidwidth + "px";
- _sliderli[i].style.height = _boxidheight + "px";
- }
-
- _sliderimglist.style.width = (_boxidwidth * imgarr.length) + "px";
-
- _sliderimglist.style.left = -_boxidwidth + "px";
-
- _sliderbtn.style.width = _boxidwidth + "px";
-
-
- box.onmouseover = function () {
-
- if (_arrow) {
- _sliderbtn.style.display = "block";
- } else {
- _sliderbtn.style.display = "none";
- }
-
- clearInterval(timer);
- }
-
- box.onmouseout = function () {
- _sliderbtn.style.display = "none";
-
- timer = setInterval(auto, _speed);
- }
-
- var sTime = new Date();
-
- _btnli[0].onclick = function () {
-
- var nTime = new Date();
-
- if (nTime - sTime > 500) {
-
- _listindex--;
- _dotindex--;
- if (_listindex == 0) {
-
- move(_sliderimglist, { left: -_boxidwidth * _listindex }, function () {
- _listindex = _listlen - 2;
- this.style.left = -_listindex * _boxidwidth + "px";
- });
- } else {
- move(_sliderimglist, { left: -_boxidwidth * _listindex });
- }
-
- _dotindex = _dotindex == -1 ? _dotlen - 1 : _dotindex;
- moveBtn(_dotindex);
- _moveFun && _moveFun(_dotindex + 1);
- }
- sTime = new Date();
- }
-
- _btnli[1].onclick = function () {
-
- var nTime = new Date();
-
- if (nTime - sTime > 500) {
-
- _listindex++;
- _dotindex++;
-
- _dotindex = _dotindex % _dotlen;
-
- if (_listindex == _listlen - 1) {
- move(_sliderimglist, { left: -_boxidwidth * _listindex }, function () {
- _listindex = 1;
- this.style.left = -_listindex * _boxidwidth + "px";
- });
- } else {
- move(_sliderimglist, { left: -_boxidwidth * _listindex });
- }
-
- moveBtn(_dotindex);
- _moveFun && _moveFun(_dotindex + 1);
- }
- sTime = new Date();
- }
-
- timer = setInterval(auto, _speed);
- if (_dotindex == 0) {
- console.log(_dotindex + 1);
- }
-
- function auto() {
-
-
- _listindex = ++_listindex % _listlen;
- _dotindex++;
-
- _dotindex = _dotindex % _dotlen;
-
- if (_listindex == _listlen - 1) {
- move(_sliderimglist, { left: -_boxidwidth * _listindex }, function () {
- _listindex = 1;
- this.style.left = -_listindex * _boxidwidth + "px";
- });
- } else {
- move(_sliderimglist, { left: -_boxidwidth * _listindex });
- }
- moveBtn(_dotindex);
- _moveFun && _moveFun(_dotindex + 1);
- }
-
- for (var i = 0; i < _dotlen; i++) {
- _pointdot[i]._listindex = i;
-
- _pointdot[i].onclick = function () {
- _dotindex = this._listindex;
- _listindex = _dotindex + 1;
- move(_sliderimglist, { left: -_boxidwidth * _listindex });
- moveBtn(_dotindex);
-
- }
- }
-
- function moveBtn(_dotindex) {
- for (var j = 0; j < _dotlen; j++) {
- _pointdot[j].className = "";
- }
- _pointdot[_dotindex].className = "U_MD_UI_slider_On";
- }
- }
- function move(dom, json, callback) {
-
- clearInterval(dom.timer);
- dom.timer = setInterval(function () {
-
- var mark = true;
- for (var attr in json) {
- var cur = null;
- if (attr == "opacity") {
- cur = getStyle(dom, attr) * 100;
- } else {
- cur = parseInt(getStyle(dom, attr)) || 0;
- }
- var target = json[attr];
-
-
- var speed = (target - cur) * .2;
- speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed);
- if (cur != target) {
- if (attr == "opacity") {
- dom.style.filter = "alpha(opacity = " + (cur + speed) + ")";
- dom.style[attr] = (cur + speed) / 100;
- } else {
- dom.style[attr] = cur + speed + "px";
- }
-
- mark = false;
- }
-
-
- }
- if (mark) {
- clearInterval(dom.timer);
- callback && callback.call(dom);
- }
- }, 100 / 3);
- }
- function getStyle(dom, attr) {
- return dom.currentStyle ? dom.currentStyle[attr] : getComputedStyle(dom, null)[attr];
- };
- Namespace.register("U.MD.UI.calendar");
- U.MD.UI.Calendar = U.MD.UI.calendar = function (el, parentnode, datetimeboolean) {
- if (!el)
- return
- if (typeof datetimeboolean == 'boolean' && datetimeboolean == false) {
- U.MD.UI.calendar.datetimeformat = datetimeboolean
- } else {
- U.MD.UI.calendar.datetimeformat = true;
- }
- U.MD.UI.calendar.create(el, parentnode);
- }
- U.MD.UI.calendar.NOW = new Date();
- U.MD.UI.calendar.CURRENTYEAR = U.MD.UI.calendar.NOW.getFullYear();
- U.MD.UI.calendar.CURRENTMONTH = U.MD.UI.calendar.NOW.getMonth();
- U.MD.UI.calendar.CURRENTDAY = U.MD.UI.calendar.NOW.getDate();
- U.MD.UI.calendar.year = U.MD.UI.calendar.CURRENTYEAR;
- U.MD.UI.calendar.month = U.MD.UI.calendar.CURRENTMONTH;
- U.MD.UI.calendar.day = U.MD.UI.calendar.CURRENTDAY;
- U.MD.UI.calendar.hour = '00';
- U.MD.UI.calendar.minute = '00';
- U.MD.UI.calendar.second = '00';
- U.MD.UI.calendar.datetimeformat = true;
- U.MD.UI.calendar.fouseinp = null;
- U.MD.UI.calendar.board = null;
- U.MD.UI.calendar.tit = null;
- U.MD.UI.calendar.mark = 1;
- U.MD.UI.calendar.template = [
-
- '<div class="U_MD_UI_calendar_features">' +
- '<div class="U_MD_UI_calendar_closeBtn" id="U_MD_UI_calendar_closeBtn">关闭</div>' +
- '<div class="U_MD_UI_calendar_features_a">' +
- '<div class="U_MD_UI_calendar_prev U_MD_UI_calendar_btn" id="prevDate"></div>' +
- '<div class="U_MD_UI_calendar_tit" id="calendar_tit"></div>' +
- '<input type="text" id="calendar_tit_btn" style="display: none;">' +
- '<div class="U_MD_UI_calendar_next U_MD_UI_calendar_btn" id="nextDate"></div>' +
- '</div>' +
- '<i></i>' +
- '</div>',
-
- '<div id="calendar_day">' +
- '<ul class="U_MD_UI_calendar_week">' +
- '<li>日</li>' +
- '<li>一</li>' +
- '<li>二</li>' +
- '<li>三</li>' +
- '<li>四</li>' +
- '<li>五</li>' +
- '<li>六</li>' +
- '</ul>' +
- '<ul class="U_MD_UI_calendar_c" id="calendar_week_c"></ul>' +
- '</div>',
-
- '<div class="U_MD_UI_calendar_month" id="calendar_month" style="display: none">' +
- '<ul class="U_MD_UI_calendar_month_c">' +
- '<li><span>1月</span></li>' +
- '<li><span>2月</span></li>' +
- '<li><span>3月</span></li>' +
- '<li><span>4月</span></li>' +
- '<li><span>5月</span></li>' +
- '<li><span>6月</span></li>' +
- '<li><span>7月</span></li>' +
- '<li><span>8月</span></li>' +
- '<li><span>9月</span></li>' +
- '<li><span>10月</span></li>' +
- '<li><span>11月</span></li>' +
- '<li><span>12月</span></li>' +
- '</ul>' +
- '</div>',
-
- '<div id="calendar_year" class="U_MD_UI_calendar_month" style="display: none">' +
- '<ul class="U_MD_UI_calendar_month_c">' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '<li></li>' +
- '</ul>' +
- '</div>',
-
- '<span id="U_MD_UI_calendar_timeText" class="U_MD_UI_calendar_timeText">选择时间</span>' +
- '<div class="U_MD_UI_calendar_timeBox">' +
- '<div id="U_MD_UI_calendar_clearText" class="U_MD_UI_calendar_timeBtn">清空</div>' +
- '<div id="U_MD_UI_calendar_nowTime" class="U_MD_UI_calendar_timeBtn">现在</div>' +
- '<div id="U_MD_UI_calendar_okBtn" class="U_MD_UI_calendar_timeBtn">确定</div>' +
- '</div>',
-
- '<div id="calendar_timeChoose" class="U_MD_UI_calendar_timeChoose" style="display: none">' +
- '</div>'
- ];
- U.MD.UI.calendar.create = function (els, parentnode) {
- if (els == U.MD.UI.calendar.fouseinp && U.MD.UI.calendar.board.style.display == 'block')
- return
- if (parentnode && U.MD.UI.calendar.board) {
- U.MD.UI.calendar.board.parentNode.removeChild(U.MD.UI.calendar.board);
- U.MD.UI.calendar.board = null;
- }
- var _top = document.documentElement.scrollTop || document.body.scrollTop,
- _left = document.documentElement.scrollLeft || document.body.scrollLeft;
- var _offsetHtml = [Math.abs(els.getBoundingClientRect().left) + _left, Math.abs(els.getBoundingClientRect().top) + _top];
- U.MD.UI.calendar.fouseinp = els;
- if (!U.MD.UI.calendar.board) {
- U.MD.UI.calendar.showBoard(els, _offsetHtml, parentnode);
- } else {
- U.MD.UI.calendar.resetData(_offsetHtml);
- }
- U.MD.UI.calendar.showDay();
- }
- U.MD.UI.calendar.toggleChooseText = function (that) {
- var _child = U.selectEl('.U_MD_UI_calendar_c_a')[0].children,
- _len = _child.length;
- if (that.innerText == '返回日期') {
- U.MD.UI.calendar.changeDisplay(_lastTemplate, _child[_len - 1]);
- that.innerText = "选择时间";
- U.selectEl(that).removeClass("U_MD_UI_calendar_timeTextClick");
- return;
- }
- for (var i = 0; i < _len - 1; i++) {
- _child[i].style.display != 'none' && (_child[i].style.display = 'none', _lastTemplate = _child[i]);
- }
- _child[_len - 1].style.display = 'block';
- that.innerText = "返回日期";
- U.selectEl(that).addClass("U_MD_UI_calendar_timeTextClick");
- }
- U.MD.UI.calendar.resetData = function (offsethtml) {
- U.MD.UI.calendar.board.style.display = 'block';
- U.MD.UI.calendar.mark = 1;
- U.selectEl('#calendar_day')[0].style.display = 'block';
- U.selectEl('#calendar_month')[0].style.display = 'none';
- U.selectEl('#calendar_year')[0].style.display = 'none';
- U.MD.UI.calendar.board.style.left = offsethtml[0] + 'px';
- U.MD.UI.calendar.board.style.top = offsethtml[1] + U.MD.UI.calendar.fouseinp.clientHeight + 10 + 'px';
- U.MD.UI.calendar.year = U.MD.UI.calendar.CURRENTYEAR;
- U.MD.UI.calendar.month = U.MD.UI.calendar.CURRENTMONTH;
- U.MD.UI.calendar.ChooseDefault(true);
- }
- U.MD.UI.calendar.createChooseTime = function (addel) {
- var _dataObj = [
- ["时", "分", "秒"],
- [24, 60, 60],
- ["hour", "minute", "second"]
- ],
- _lastTemplate;
- var _ct = $$('div', { id: 'calendar_time', className: 'U_MD_UI_calendar_time', innerHTML: U.MD.UI.calendar.template[4] }, U.MD.UI.calendar.board);
- for (var i = 0; i < _dataObj[0].length; i++) {
- var _row = $$('div', { className: "U_MD_UI_calendar_timeRow" }, addel);
- $$('span', { className: "U_MD_UI_calendar_timeRowText", innerText: _dataObj[0][i] }, _row);
- var _rowCon = $$('div', { className: "U_MD_UI_calendar_timeRowCon" }, _row),
- _ul = $$('ul', { className: "U_MD_UI_calendar_timeRowUl", name: _dataObj[2][i] }, _rowCon);
- for (var j = 0; j < _dataObj[1][i]; j++) {
- var _text = j.toString().length == 1 ? '0' + j : j;
- $$('li', {
- innerText: _text,
- onclick: function () {
- var _parentUl = this.parentNode,
- _activeLi = _parentUl.querySelector('.U_MD_UI_calendar_timeRowActive');
- U.selectEl(_activeLi).removeClass('U_MD_UI_calendar_timeRowActive');
- U.selectEl(this).addClass('U_MD_UI_calendar_timeRowActive');
- switch (_parentUl.name) {
- case 'hour':
- U.MD.UI.calendar.hour = this.innerText;
- break;
- case 'minute':
- U.MD.UI.calendar.minute = this.innerText;
- break;
- case 'second':
- U.MD.UI.calendar.second = this.innerText;
- break;
- }
- }
- }, _ul);
- }
- }
- if (!U.MD.UI.calendar.datetimeformat) {
- _ct.style.display = 'none';
- }
- U.selectEl('#U_MD_UI_calendar_timeText')[0].onclick = function () {
- U.MD.UI.calendar.toggleChooseText(this)
- }
- U.selectEl('#U_MD_UI_calendar_clearText')[0].onclick = function () {
- U.MD.UI.calendar.fouseinp.value ? U.MD.UI.calendar.fouseinp.value = '' : U.MD.UI.calendar.fouseinp.innerText = '';
- U.MD.UI.calendar.ChooseDefault(true);
- U.MD.UI.calendar.board.style.display = 'none';
- }
- U.selectEl('#U_MD_UI_calendar_nowTime')[0].onclick = function () {
- U.MD.UI.calendar.outPutDate(true);
- }
- U.selectEl('#U_MD_UI_calendar_okBtn')[0].onclick = function () {
- U.MD.UI.calendar.outPutDate(false);
- }
- }
- U.MD.UI.calendar.showBoard = function (input, offsetHtml, parentnode) {
- var _template = U.MD.UI.calendar.template,
-
- _parentNode = parentnode || document.body,
- _templateHTML = _template[1] + _template[2] + _template[3] + _template[5];
- if (!parentnode) {
- U.MD.UI.calendar.board = $$('div', { "className": "U_MD_UI_calendar_bigboard", style: { left: offsetHtml[0] + "px", top: offsetHtml[1] + input.clientHeight + 10 + "px" } }, _parentNode);
- } else {
- U.MD.UI.calendar.board = $$('div', { "className": "U_MD_UI_calendar_bigboard" }, parentnode);
- }
- U.MD.UI.calendar.board.innerHTML = _template[0];
- _dayC = $$('div', { "className": 'U_MD_UI_calendar_c_a', innerHTML: _templateHTML }, U.MD.UI.calendar.board);
- U.MD.UI.calendar.tit = U.selectEl('#calendar_tit')[0];
- _mc = U.selectEl('#calendar_month > ul > li');
- _titInp = U.selectEl('#calendar_tit_btn')[0];
- _timer = null;
- U.MD.UI.calendar.createChooseTime($('#calendar_timeChoose')[0]);
- U.MD.UI.calendar.tit.onclick = function () {
- clearTimeout(_timer);
- if (U.MD.UI.calendar.mark == 1) {
- U.MD.UI.calendar.tit.innerText = U.MD.UI.calendar.year;
- U.MD.UI.calendar.changeDisplay($('#calendar_month')[0], U.selectEl('#calendar_day')[0]);
- U.MD.UI.calendar.mark = 2;
- U.MD.UI.calendar.ChooseDefault();
- } else if (U.MD.UI.calendar.mark == 2) {
- _timer = setTimeout(function () {
- U.MD.UI.calendar.changeDisplay($('#calendar_year')[0], U.selectEl('#calendar_month')[0]);
- U.MD.UI.calendar.dateTenYear();
- U.MD.UI.calendar.mark = 3;
- U.MD.UI.calendar.ChooseDefault();
- }, 250);
- }
- }
- U.MD.UI.calendar.tit.ondblclick = function () {
- clearTimeout(_timer);
- if (U.MD.UI.calendar.mark === 2) {
- _obj = U.MD.UI.calendar.changeDisplay(_titInp, this, 'inline-block');
- _obj[0].value = this.innerText;
- _obj[0].focus();
- }
- }
- _titInp.onkeydown = function (e) {
- switch (e.keyCode) {
- case 13:
-
- var _arr2 = U.MD.UI.calendar.changeDisplay(U.MD.UI.calendar.tit, this, 'inline-block');
- _arr2[0].innerText = U.MD.UI.calendar.year = !isNaN(parseInt(this.value)) ? parseInt(this.value) : U.MD.UI.calendar.CURRENTYEAR;
- break;
- }
- };
- _titInp.onblur = function () {
- var _arr3 = U.MD.UI.calendar.changeDisplay(U.MD.UI.calendar.tit, this, 'inline-block');
- _arr3[0].innerText = U.MD.UI.calendar.year = !isNaN(parseInt(this.value)) ? parseInt(this.value) : U.MD.UI.calendar.CURRENTYEAR;
- }
- U.selectEl('#prevDate')[0].onclick = function () {
- if (U.MD.UI.calendar.mark == 1) { _lessNum = -1 }
- else if (U.MD.UI.calendar.mark == 2) { _lessNum = -12 }
- else if (U.MD.UI.calendar.mark == 3) { _lessNum = -120 };
- U.MD.UI.calendar.fullDate(_lessNum, false);
- };
- U.selectEl('#nextDate')[0].onclick = function () {
- if (U.MD.UI.calendar.mark == 1) { _addNum = 1 }
- else if (U.MD.UI.calendar.mark == 2) { _addNum = 12 }
- else if (U.MD.UI.calendar.mark == 3) { _addNum = 120 };
- U.MD.UI.calendar.fullDate(_addNum, true);
- };
- for (var i = 0; i < _mc.length; i++) {
- _mc[i].onclick = function () {
- U.MD.UI.calendar.changeDisplay($('#calendar_day')[0], U.selectEl('#calendar_month')[0]);
- U.MD.UI.calendar.month = parseInt(this.innerText) - 1;
- U.MD.UI.calendar.showDay();
- U.MD.UI.calendar.mark = 1;
- }
- }
- U.selectEl('#U_MD_UI_calendar_closeBtn')[0].onclick = function () {
- U.UF.EV.stopBubble();
- U.MD.UI.calendar.board.style.display = 'none';
- }
- }
- U.MD.UI.calendar.showDay = function () {
- _monthFristDay = new Date(U.MD.UI.calendar.year, U.MD.UI.calendar.month, 1).getDay();
- _lastMonthDay = new Date(U.MD.UI.calendar.year, U.MD.UI.calendar.month, 0).getDate();
- _fullDay = new Date(U.MD.UI.calendar.year, U.MD.UI.calendar.month + 1, 0).getDate();
- _totalDay = (_t = _monthFristDay + _fullDay) % 7 === 0 ? _t : _t + (7 - _t % 7);
- _dayC = U.selectEl('#calendar_week_c')[0];
- _dayC.innerHTML = '';
- for (var _i = 0; _i < _totalDay; _i++) {
- _li = $$('li', {}, _dayC);
- if (_i < _monthFristDay) {
- $$('span', { "className": 'U_MD_UI_calendar_unavailable', innerText: (_lastMonthDay - _monthFristDay + _i + 1) }, _li);
- } else if (_i < (_fullDay + _monthFristDay)) {
- var _d = _i - _monthFristDay + 1,
- _week = new Date(U.MD.UI.calendar.year, U.MD.UI.calendar.month, _d).getDay(),
- _today = U.MD.UI.calendar.NOW.getDate() === _d && (U.MD.UI.calendar.CURRENTMONTH === U.MD.UI.calendar.month && U.MD.UI.calendar.CURRENTYEAR === U.MD.UI.calendar.year);
- _dayV = _d;
- if (_week === 6 || _week === 0) {
- _today ? $$('span', {
- "className": 'U_MD_UI_calendar_day U_MD_UI_calendar_today U_MD_UI_calendar_weekend', innerText: _d, "onclick": function () {
- U.MD.UI.calendar.day = this.innerText;
- U.MD.UI.calendar.outPutDate()
- }
- }, _li) : $$('span', {
- "className": 'U_MD_UI_calendar_day U_MD_UI_calendar_weekend', innerText: _d, "onclick": function () {
- U.MD.UI.calendar.day = this.innerText;
- U.MD.UI.calendar.outPutDate()
- }
- }, _li);
- } else if (_today) {
- $$('span', {
- "className": 'U_MD_UI_calendar_day U_MD_UI_calendar_today', innerText: _d, "onclick": function () {
- U.MD.UI.calendar.day = this.innerText;
- U.MD.UI.calendar.outPutDate()
- }
- }, _li)
- } else {
- $$('span', {
- "className": 'U_MD_UI_calendar_day', innerText: _d, "onclick": function () {
- U.MD.UI.calendar.day = this.innerText;
- U.MD.UI.calendar.outPutDate()
- }
- }, _li)
- }
- } else {
- $$('span', { "className": 'U_MD_UI_calendar_unavailable', innerText: (_i - (_fullDay + _monthFristDay) + 1) }, _li)
- }
- }
- U.MD.UI.calendar.tit.innerText = U.MD.UI.calendar.year + '-' + (U.MD.UI.calendar.month + 1) + '月';
- }
- U.MD.UI.calendar.fullDate = function (num, check) {
- var _year = (_n = Math.abs(num) / 12) >= 1 ? _n >>> 0 : 0,
-
- _month = Math.abs(num) % 12;
- !check && (_month = -_month);
- !check && (_year = -_year);
- U.MD.UI.calendar.month += _month;
- U.MD.UI.calendar.year += _year;
- if (check) {
- if (U.MD.UI.calendar.month > 11) {
- U.MD.UI.calendar.month = 0;
- U.MD.UI.calendar.year++;
- }
- } else {
- if (U.MD.UI.calendar.month < 0) {
- U.MD.UI.calendar.month = 11;
- U.MD.UI.calendar.year--;
- }
- }
- if (U.MD.UI.calendar.mark == 1) { U.MD.UI.calendar.showDay() };
- if (U.MD.UI.calendar.mark == 2) { U.MD.UI.calendar.tit.innerText = U.MD.UI.calendar.year };
- if (U.MD.UI.calendar.mark == 3) { U.MD.UI.calendar.dateTenYear() };
- }
- U.MD.UI.calendar.formartDate = function (symbol, isnow) {
- var _symbol, y, m, d, h, m, s;
- _symbol = symbol || '-'
- y = isnow ? U.MD.UI.calendar.CURRENTYEAR : U.MD.UI.calendar.year;
- m = isnow ? U.MD.UI.calendar.CURRENTMONTH + 1 : U.MD.UI.calendar.month + 1;
- d = isnow ? U.MD.UI.calendar.CURRENTDAY : U.MD.UI.calendar.day;
- m = (m.toString())[1] ? m : '0' + m;
- d = (d.toString())[1] ? d : '0' + d;
- var _dateStr = y + _symbol + m + _symbol + d;
- if (typeof U.MD.UI.calendar.datetimeformat == 'boolean' && U.MD.UI.calendar.datetimeformat) {
- if (isnow) {
- var _nowDate = new Date();
- U.MD.UI.calendar.hour = _nowDate.getHours();
- U.MD.UI.calendar.minute = _nowDate.getMinutes();
- U.MD.UI.calendar.second = _nowDate.getSeconds();
- }
- h = (U.MD.UI.calendar.hour.toString())[1] ? U.MD.UI.calendar.hour : '0' + U.MD.UI.calendar.hour;
- m = (U.MD.UI.calendar.minute.toString())[1] ? U.MD.UI.calendar.minute : '0' + U.MD.UI.calendar.minute;
- s = (U.MD.UI.calendar.second.toString())[1] ? U.MD.UI.calendar.second : '0' + U.MD.UI.calendar.second;
- _dateStr += " " + h + ":" + m + ":" + s;
- }
- return _dateStr;
- }
- U.MD.UI.calendar.outPutDate = function (isNow) {
- if (U.MD.UI.calendar.fouseinp.tagName === 'INPUT') {
- U.MD.UI.calendar.fouseinp.value = U.MD.UI.calendar.formartDate('-', isNow);
- } else {
- U.MD.UI.calendar.fouseinp.innerText = U.MD.UI.calendar.formartDate('-', isNow);
- }
- U.MD.UI.calendar.CheckedDay && U.MD.UI.calendar.CheckedDay();
- U.MD.UI.calendar.board.style.display = 'none';
- }
- U.MD.UI.calendar.changeDisplay = function (blockEl, noneEl, val) {
- val = val || 'block';
- if (blockEl && typeof blockEl === 'object') { blockEl.setAttribute('style', 'display:' + val) }
- if (noneEl && typeof noneEl === 'object') { noneEl.setAttribute('style', 'display:none') };
- return [blockEl, noneEl];
- }
- U.MD.UI.calendar.dateTenYear = function () {
- _yearArr = U.selectEl('#calendar_year > ul > li');
- _startYear = U.MD.UI.calendar.year - (U.MD.UI.calendar.year % 10);
- for (var i = 0; i < _yearArr.length; i++) {
- _yearArr[i].onclick = function () {
- U.MD.UI.calendar.mark = 2;
- U.MD.UI.calendar.year = parseInt(this.innerText);
- U.MD.UI.calendar.changeDisplay($('#calendar_month')[0], U.selectEl('#calendar_year')[0]);
- U.MD.UI.calendar.tit.innerText = this.innerText;
- }
- _yearArr[i].innerHTML = '';
- if (i == 0 || i == _yearArr.length - 1) {
- $$('span', { "className": "U_MD_UI_calendar_unavailable", innerText: (_startYear + i - 1) }, _yearArr[i]);
- } else if ((_startYear + i - 1) === U.MD.UI.calendar.CURRENTYEAR) {
- $$('span', { style: { "background-color": "#eed1bc" }, innerText: (_startYear + i - 1) }, _yearArr[i])
- } else {
- $$('span', { innerText: (_startYear + i - 1) }, _yearArr[i])
- }
- }
- U.MD.UI.calendar.tit.innerText = (t = (U.MD.UI.calendar.year - (U.MD.UI.calendar.year % 10))) + '-' + (t + 9);
- }
- U.MD.UI.calendar.ChooseDefault = function (deafultflag) {
- if (U.MD.UI.calendar.datetimeformat) {
- if (deafultflag) {
- U.MD.UI.calendar.hour = '00';
- U.MD.UI.calendar.minute = '00';
- U.MD.UI.calendar.second = '00';
- U.selectEl(U.MD.UI.calendar.board).find('.U_MD_UI_calendar_timeRowActive').removeClass('U_MD_UI_calendar_timeRowActive');
- !$('#U_MD_UI_calendar_timeText').length && U.MD.UI.calendar.createChooseTime($('#calendar_timeChoose')[0]);
- }
- U.selectEl('#calendar_time')[0].style.display = "block";
- U.selectEl('#calendar_timeChoose')[0].style.display = 'none';
- U.selectEl('#U_MD_UI_calendar_timeText')[0].innerText = "选择时间";
- U.selectEl('#U_MD_UI_calendar_timeText').removeClass("U_MD_UI_calendar_timeTextClick");
- } else {
- U.selectEl('#calendar_time')[0].style.display = 'none';
- U.selectEl('#calendar_timeChoose')[0].style.display = 'none';
- }
- }
- U.MD.UI.calendar.SetCallBack = function (funcname, func) {
- if (typeof func != 'function' || !"CheckedDay ".match(funcname + ' '))
- return 0;
- U.MD.UI.calendar[funcname] = func
- };
- Namespace.register("U.MD.UI.city");
- U.MD.UI.city = function (element) {
- U.UF.EV.stopBubble();
- if (!element || !element.tagName) {
- return;
- }
- if (_cityBox = U.selectEl("#U_MD_UI_city_cityBox")[0]) {
- var _rect = element.getBoundingClientRect();
- _cityBox.style.top = _rect.top + _rect.height + document.documentElement.scrollTop + "px";
-
- _cityBox.style.left = _rect.left + document.documentElement.scrollLeft + "px";
-
- U.selectEl(_cityBox).removeClass("U_MD_UI_city_hidden");
-
- U.MD.UI.city.Attr.inputNode = element;
- return;
- }
- var _city = U.MD.UI.city;
- _city.create(element);
- _city.Attr = {
- "inputNode": element
- };
- _city.init();
- };
- U.MD.UI.city.Attr = {};
- U.MD.UI.city.usedCity = null;
- U.MD.UI.city.province = null;
- U.MD.UI.city.city = {};
- U.MD.UI.city.area = {};
- U.MD.UI.city.htmlTemplate = ' <ul class="U_MD_UI_city_menuBox"> <!--控件的头部-->\n' +
- '\n' +
- ' <!--U_MD_UI_city_menuChecked 选中菜单的按钮时所用的"className":红色-->\n' +
- ' <!--U_MD_UI_city_filled 表示待填写class 为增删class占位置 防出错 以下都是-->\n' +
- ' <!--U_MD_UI_city_menuoChecked 选择城市后所添加的class 红色小圆点-->\n' +
- ' <li id="U_MD_UI_city_usedCityMenu" data-city-mark="U_MD_UI_city_usedCityCont" class="U_MD_UI_city_menuChecked" data-city-res="">\n' +
- ' <span>常用市</span>\n' +
- ' </li>\n' +
- '\n' +
- ' <li id="U_MD_UI_city_provinceMenu" data-city-mark="U_MD_UI_city_provinceCont" class="U_MD_UI_city_filled" data-city-res="">\n' +
- ' <span>省/直辖市</span>\n' +
- ' </li>\n' +
- '\n' +
- ' <li id="U_MD_UI_city_cityMenu" data-city-mark="U_MD_UI_city_cityCont" class="U_MD_UI_city_filled U_MD_UI_city_hidden" data-city-res="">\n' +
- ' <span>请选择</span>\n' +
- ' </li>\n' +
- '\n' +
- ' <li id="U_MD_UI_city_areaMenu" data-city-mark="U_MD_UI_city_areaCont" class="U_MD_UI_city_filled U_MD_UI_city_hidden" data-city-res="">\n' +
- ' <span>请选择</span>\n' +
- ' </li>\n' +
- ' </ul>\n' +
- '\n' +
- '\n' +
- ' <!--以下为主要内容区域-->\n' +
- ' <!-- ----------------------------------------------------------------------------- -->\n' +
- ' <ul id="U_MD_UI_city_usedCityCont" class="U_MD_UI_city_filled U_MD_UI_city_Cont"> <!-- <!–常用城市盒子节点–> -->\n' +
- ' <li id="U_MD_UI_city_liTemplate"><span>光明新区</span></li>\n' +
- ' <!-- U_MD_UI_city_liTemplate 为内容区域的li的模板 可无视 已display为none -->\n' +
- ' <!--U_MD_UI_city_Cont_ochecked 选中城市的按钮时所用的"className":红色-->\n' +
- ' </ul>\n' +
- '\n' +
- '\n' +
- ' <ul class="U_MD_UI_city_filled U_MD_UI_city_Cont U_MD_UI_city_hidden" id="U_MD_UI_city_provinceCont"> <!-- <!–存放省的盒子节点–> -->\n' +
- ' </ul>\n' +
- '\n' +
- '\n' +
- ' <ul class="U_MD_UI_city_filled U_MD_UI_city_Cont U_MD_UI_city_hidden" id="U_MD_UI_city_cityCont"> <!-- <!–存放市的盒子节点–> -->\n' +
- ' </ul>\n' +
- '\n' +
- '\n' +
- ' <ul class="U_MD_UI_city_filled U_MD_UI_city_Cont U_MD_UI_city_hidden" id="U_MD_UI_city_areaCont"> <!-- <!–存放地区的盒子节点–> -->\n' +
- ' </ul>';
- U.MD.UI.city.create = function (element) {
- var _cityBox = $$("div", { id: 'U_MD_UI_city_cityBox', className: 'U_MD_UI_city_cityBox U_MD_UI_city_hidden' }, document.body);
- _cityBox.innerHTML += U.MD.UI.city.htmlTemplate;
- var _rect = element.getBoundingClientRect();
- _cityBox.style.top = _rect.top + _rect.height + document.documentElement.scrollTop + "px";
-
- _cityBox.style.left = _rect.left + document.documentElement.scrollLeft + "px";
-
- U.MD.UI.city.Attr.inputNode = element;
-
- U.selectEl(_cityBox).removeClass("U_MD_UI_city_hidden");
-
- };
- U.MD.UI.city.init = function () {
- var _city = U.MD.UI.city;
- _city.getUsedCity();
- _city.inputEvent();
- _city.menuEvent();
- };
- U.MD.UI.city.inputEvent = function () {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _hidden = "U_MD_UI_city_hidden";
- var _cityBox = U.selectEl("#U_MD_UI_city_cityBox")[0];
- U.selectEl(document).bind('click', function () {
- U.selectEl(_cityBox).addClass(_hidden);
-
- }, false);
- U.selectEl(_cityBox).bind('click', function (e) {
- U.UF.EV.stopBubble(e);
-
- });
- U.selectEl("#U_MD_UI_city_areaCont")[0].onclick = function () {
- if ($("#U_MD_UI_city_areaCont")[0]) {
- U.selectEl("#U_MD_UI_city_cityBox")[0].style.display = "none";
- }
- }
- };
- U.MD.UI.city.menuEvent = function () {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _menuAllNode = U.selectEl("[data-city-mark]");
- var _hidden = "U_MD_UI_city_hidden";
- for (var i = 0, len = _menuAllNode.length; i < len; i++) {
- var _el = _menuAllNode[i];
- U.selectEl(_el).bind('click', function () {
- _city.menuClassControl(this, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden);
- });
- if (_el.id === "U_MD_UI_city_provinceMenu") {
- U.selectEl(_el).bind('click', function () {
- _city.getProvince();
- })
- }
- }
- };
- U.MD.UI.city.getUsedCity = function () {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _usedCityMenu = U.selectEl("#U_MD_UI_city_usedCityMenu")[0];
- var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0];
- var _usedCityCont = U.selectEl("#U_MD_UI_city_usedCityCont")[0];
- if (!_city.usedCity) {
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Controls", "City_UsedCity"], function (r) {
- _city.usedCity = r.value;
- _city.allDataPrint(_usedCityMenu, _city.usedCity, _liTemplate, "usedCity", _usedCityCont);
- });
- }
- };
- U.MD.UI.city.getProvince = function () {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _provinceMenu = U.selectEl("#U_MD_UI_city_provinceMenu")[0];
- var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0];
- var _provinceCont = U.selectEl("#U_MD_UI_city_provinceCont")[0];
- if (!_city.province) {
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Controls", "City_Province"], function (r) {
- _city.province = r.value;
- _city.allDataPrint(_provinceMenu, _city.province, _liTemplate, "province", _provinceCont);
- });
- }
- };
- U.MD.UI.city.getCity = function (code) {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _cityMenu = U.selectEl("#U_MD_UI_city_cityMenu")[0];
- var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0];
- var _cityCont = U.selectEl("#U_MD_UI_city_cityCont")[0];
- var _hidden = "U_MD_UI_city_hidden";
- if (!_city.city[code]) {
- _city.menuClassControl(_cityMenu, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden);
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Controls", "City_PidFind", code, 1], function (r) {
- _city.city[code] = r.value;
-
-
-
-
- _city.allDataPrint(_cityMenu, _city.city[code], _liTemplate, "city", _cityCont);
- });
- } else {
- _city.menuClassControl(_cityMenu, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden);
- _city.allDataPrint(_cityMenu, _city.city[code], _liTemplate, "city", _cityCont);
- }
- };
- U.MD.UI.city.getarea = function (code) {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _areaMenu = U.selectEl("#U_MD_UI_city_areaMenu")[0];
- var _hidden = "U_MD_UI_city_hidden";
- var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0];
- var _areaCont = U.selectEl("#U_MD_UI_city_areaCont")[0];
- if (!_city.area[code]) {
- _city.menuClassControl(_areaMenu, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden);
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Controls", "City_PidFind", code, 2], function (r) {
- _city.area[code] = r.value;
- _city.allDataPrint(_areaMenu, _city.area[code], _liTemplate, "area", _areaCont);
- });
- } else {
- _city.menuClassControl(_areaMenu, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden);
- _city.allDataPrint(_areaMenu, _city.area[code], _liTemplate, "area", _areaCont);
- }
- };
- U.MD.UI.city.allDataPrint = function (menu, data, template, type, parent) {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _usedCityMenu = U.selectEl("#U_MD_UI_city_usedCityMenu")[0];
- var _provinceMenu = U.selectEl("#U_MD_UI_city_provinceMenu")[0];
- var _len = data.length;
- var _menu = menu;
- for (var i = 0; i < _len; i++) {
-
- var _span = _city.dataPrint(data[i], template, type, parent);
-
- _span.onclick = function () {
- var _type = U.selectEl(this).attr("data-city-type");
-
- var _code = U.selectEl(this).attr("data-city-code");
-
- U.selectEl(_menu.children[0]).addClass("U_MD_UI_city_menuoChecked");
-
- _menu.children[0].innerText = this.innerText;
-
- U.selectEl(_menu).attr("data-city-res", this.innerText);
-
- _city.contClassControl(this, "U_MD_UI_city_Cont_ochecked");
-
- switch (_type) {
-
- case "province":
- _city.getCity(_code);
-
- _city.initAllClass(_usedCityMenu);
-
- break;
- case "usedCity":
- if (this.innerText === "重庆") {
- _city.getCity(_code);
- } else {
- _city.getarea(_code);
- }
-
- _city.initAllClass(_provinceMenu);
-
- break;
- case "city":
- _city.getarea(_code);
-
- break;
- case "area":
- _city.getRes("data-city-res");
-
- break;
- }
- }
- }
- };
- U.MD.UI.city.dataPrint = function (data, template, type, parent) {
- var _city = U.MD.UI.city;
- var _liNode = _city.clone(template),
- _spanNode = _liNode.children[0];
- var _shortName = data.short_name;
- var _name = data.name;
- _liNode.id = type + data.id;
- _spanNode.innerText = _shortName;
- if (_shortName === "北京" || _shortName === "上海" || _shortName === "天津" || _shortName === "重庆") {
- if (parent.id === "U_MD_UI_city_cityCont") {
- _spanNode.innerText = _name;
- }
- }
- if (parent.id === "U_MD_UI_city_areaCont") {
- _spanNode.innerText = _name;
- }
- _spanNode.id = "span_" + type + data.id;
- U.selectEl(_spanNode).attr("data-city-code", data.id);
- U.selectEl(_spanNode).attr("data-city-type", type);
- parent.appendChild(_liNode);
- return _spanNode;
- };
- U.MD.UI.city.menuClassControl = function (el, cs, dataattr, hiddenCs) {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _cityMenu = U.selectEl("#U_MD_UI_city_cityMenu")[0];
- var _areaMenu = U.selectEl("#U_MD_UI_city_areaMenu")[0];
- var _cityCont = U.selectEl("#U_MD_UI_city_cityCont")[0];
- var _areaCont = U.selectEl("#U_MD_UI_city_areaCont")[0];
- var _oEl = U.selectEl("." + cs)[0];
-
- if (_oEl) { U.selectEl(_oEl).removeClass(cs) };
-
- U.selectEl(el).addClass(cs);
-
- var _oElCont = U.selectEl("#" + U.selectEl(_oEl).attr(dataattr))[0];
-
- var _elCont = U.selectEl("#" + U.selectEl(el).attr(dataattr))[0];
-
- U.selectEl(_oElCont).addClass(hiddenCs);
-
- U.selectEl(_elCont).removeClass(hiddenCs);
-
- var _id = el.id;
- switch (_id) {
- case "U_MD_UI_city_usedCityMenu":
- case "U_MD_UI_city_provinceMenu":
- U.selectEl(_cityMenu).addClass(hiddenCs);
- U.selectEl(_areaMenu).addClass(hiddenCs);
- U.selectEl(_cityCont).addClass(hiddenCs);
- U.selectEl(_areaCont).addClass(hiddenCs);
- _cityMenu.children[0].innerText = "请选择";
- _areaMenu.children[0].innerText = "请选择";
- _cityCont.innerHTML = "";
- _areaCont.innerHTML = "";
- U.selectEl(_cityMenu).attr("data-city-res", "");
- U.selectEl(_areaMenu).attr("data-city-res", "");
- break;
- case "U_MD_UI_city_cityMenu":
- U.selectEl(el).removeClass(hiddenCs);
- U.selectEl(_areaMenu).addClass(hiddenCs);
- U.selectEl(_areaCont).addClass(hiddenCs);
- _areaMenu.children[0].innerText = "请选择";
- _areaCont.innerHTML = "";
- break;
- case "U_MD_UI_city_areaMenu":
- U.selectEl(el).removeClass(hiddenCs);
- break;
- }
- };
- U.MD.UI.city.contClassControl = function (el, ocheckcs) {
- var _city = U.MD.UI.city;
- var _oEls = U.selectEl("." + ocheckcs);
-
- var _type = U.selectEl(el).attr("data-city-type");
-
- for (var i = 0, len = _oEls.length; i < len; i++) {
- var _otype = U.selectEl(_oEls[i]).attr("data-city-type");
- if (_oEls[i] && _otype === _type) {
-
- U.selectEl(_oEls[i]).removeClass(ocheckcs)
- }
- }
- U.selectEl(el).addClass(ocheckcs);
-
- };
- U.MD.UI.city.initAllClass = function (el) {
- var _city = U.MD.UI.city;
- el.className = "U_MD_UI_city_filled";
- el.children[0].className = "";
- U.selectEl(el).attr("data-city-res", "");
- var oEl = U.selectEl(".U_MD_UI_city_Cont_ochecked");
- for (var i = 0; i < oEl.length; i++) {
- U.selectEl(oEl[i]).removeClass("U_MD_UI_city_Cont_ochecked");
- }
- if (el.id === "U_MD_UI_city_provinceMenu") {
- el.children[0].innerText = "省/直辖市";
- }
- if (el.id === "U_MD_UI_city_usedCityMenu") {
- el.children[0].innerText = "常用市";
- }
- };
- U.MD.UI.city.getRes = function (dataattr) {
- var _city = U.MD.UI.city;
- var _attr = _city.Attr;
- var _inputNode = _attr.inputNode;
- var _cityBox = U.selectEl("#U_MD_UI_city_cityBox")[0];
- var _hidden = "U_MD_UI_city_hidden";
- var resAll = U.selectEl("[" + dataattr + "]");
- var _arr = [];
- for (var i = 0, len = resAll.length; i < len; i++) {
- var _val = U.selectEl(resAll[i]).attr(dataattr);
- if (_val) {
- _arr.push(_val);
- }
- }
- _inputNode.value = (_arr.join("-"));
- U.selectEl(_cityBox).addClass(_hidden);
- };
- U.MD.UI.city.clone = function (ele) {
- var node = ele.cloneNode();
- var child = ele.children;
- for (var i = 0; i < child.length; i++) {
- var childNode = child[i].cloneNode();
- node.appendChild(childNode);
- }
- return node;
- };;
- Namespace.register("U.MD.UI.ColorPicker");
- U.MD.UI.colorPicker = U.MD.UI.ColorPicker = function (barelement, callfun) {
- var div = $$("div", {
- style: {
- width: "180px",
- height: "140px",
- border: "1px solid #CDCDCD",
- backgroundColor: " #FFF",
- padding: "10px 10px 10px 5px",
- zIndex: 1
- },
- "className": "MD_ColorPicker"
- }, barelement);
- var _i,
- _colorarea = [
- "#ffffff",
- "#ffccc9",
- "#ffce93",
- "#fffc9e",
- "#ffffc7",
- "#9aff99",
- "#96fffb",
- "#cdffff",
- "#cbcefb",
- "#cfcfcf",
- "#fd6864",
- "#fe996b",
- "#fffe65",
- "#fcff2f",
- "#67fd9a",
- "#38fff8",
- "#68fdff",
- "#9698ed",
- "#c0c0c0",
- "#fe0000",
- "#f8a102",
- "#ffcc67",
- "#f8ff00",
- "#34ff34",
- "#68cbd0",
- "#34cdf9",
- "#6665cd",
- "#9b9b9b",
- "#cb0000",
- "#f56b00",
- "#ffcb2f",
- "#ffc702",
- "#32cb00",
- "#00d2cb",
- "#3166ff",
- "#6434fc",
- "#656565",
- "#9a0000",
- "#ce6301",
- "#cd9934",
- "#999903",
- "#009901",
- "#329a9d",
- "#3531ff",
- "#6200c9",
- "#343434",
- "#680100",
- "#963400",
- "#986536",
- "#646809",
- "#036400",
- "#34696d",
- "#00009b",
- "#303498",
- "#000000",
- "#330001",
- "#643403",
- "#663234",
- "#343300",
- "#013300",
- "#003532",
- "#010066",
- "#340096"
- ];
- var button;
- for (_i = 0; _i < _colorarea.length; _i++) {
- button = $$('button', {
- style: {
- background: _colorarea[_i],
- width: "15px",
- height: "15px",
- float: "left",
- margin: "5px 0 0 5px",
- border: " 1px solid transparent"
- }
- }, div);
- button.onclick = function (e) {
- div.style.display = 'none'
- U.UF.EV.stopBubble(e);
- callfun(this.style.background);
- }
- }
- U.selectEl(document).bind('click', function () {
- if (div.style.display != 'none')
- div.style.display = 'none'
- });
- U.UF.EV.stopBubble();
- return div;
- };
- Namespace.register("U.MD.UI.Font");
- Namespace.register("U.MD.UI.WordSize");
- U.MD.UI.Font = function () {
- var font = $$("select", { style: { fontFamily: "宋体", fontSize: "16px" }, "className": "MD_fontFamily" });
- $$("option", { value: "宋体", style: { fontFamily: "宋体" }, innerHTML: "宋体" }, font);
- $$("option", { value: "sans-serif", style: { fontFamily: "sans-serif" }, innerHTML: "sans-serif" }, font);
- $$("option", { value: "微软雅黑", style: { fontFamily: "微软雅黑" }, innerHTML: "微软雅黑" }, font);
- $$("option", { value: "楷体", style: { fontFamily: "楷体" }, innerHTML: "楷体" }, font);
- $$("option", { value: "黑体", style: { fontFamily: "黑体" }, innerHTML: "黑体" }, font);
- $$("option", { value: "隶书", style: { fontFamily: "隶书" }, innerHTML: "隶书" }, font);
- $$("option", { value: "andale mono", style: { fontFamily: "andale mono" }, innerHTML: "andale mono" }, font);
- $$("option", { value: "arial black", style: { fontFamily: "arial black" }, innerHTML: "arial black" }, font);
- return font;
- }
- U.MD.UI.WordSize = function () {
- var fontsize = $$("select", { "className": "MD_fontSize" });
- $$("option", { value: "56px", style: { fontSize: "14px" }, innerHTML: "初号" }, fontsize);
- $$("option", { value: "48px", style: { fontSize: "14px" }, innerHTML: "小初" }, fontsize);
- $$("option", { value: "34.7px", style: { fontSize: "14px" }, innerHTML: "一号" }, fontsize);
- $$("option", { value: "32px", style: { fontSize: "14px" }, innerHTML: "小一" }, fontsize);
- $$("option", { value: "29.3px", style: { fontSize: "14px" }, innerHTML: "二号" }, fontsize);
- $$("option", { value: "24px", style: { fontSize: "14px" }, innerHTML: "小二" }, fontsize);
- $$("option", { value: "21.3px", style: { fontSize: "14px" }, innerHTML: "三号" }, fontsize);
- $$("option", { value: "20px", style: { fontSize: "14px" }, innerHTML: "小三" }, fontsize);
- $$("option", { value: "18.7px", style: { fontSize: "14px" }, innerHTML: "四号" }, fontsize);
- $$("option", { value: "16px", style: { fontSize: "14px" }, innerHTML: "小四" }, fontsize);
- $$("option", { value: "14px", style: { fontSize: "14px" }, innerHTML: "五号" }, fontsize);
- $$("option", { value: "12px", style: { fontSize: "14px" }, innerHTML: "小五" }, fontsize);
- $$("option", { value: "10px", style: { fontSize: "14px" }, innerHTML: "10" }, fontsize);
- $$("option", { value: "12px", style: { fontSize: "14px" }, innerHTML: "12" }, fontsize);
- $$("option", { value: "14px", style: { fontSize: "14px" }, innerHTML: "14" }, fontsize);
- $$("option", { value: "16px", style: { fontSize: "14px" }, innerHTML: "16" }, fontsize);
- $$("option", { value: "18px", style: { fontSize: "14px" }, innerHTML: "18" }, fontsize);
- $$("option", { value: "20px", style: { fontSize: "14px" }, innerHTML: "20" }, fontsize);
- $$("option", { value: "22px", style: { fontSize: "14px" }, innerHTML: "22" }, fontsize);
- $$("option", { value: "24px", style: { fontSize: "14px" }, innerHTML: "24" }, fontsize);
- $$("option", { value: "26px", style: { fontSize: "14px" }, innerHTML: "26" }, fontsize);
- $$("option", { value: "28px", style: { fontSize: "14px" }, innerHTML: "28" }, fontsize);
- $$("option", { value: "36px", style: { fontSize: "14px" }, innerHTML: "36" }, fontsize);
- $$("option", { value: "42px", style: { fontSize: "14px" }, innerHTML: "42" }, fontsize);
- $$("option", { value: "48px", style: { fontSize: "14px" }, innerHTML: "48" }, fontsize);
- $$("option", { value: "72px", style: { fontSize: "14px" }, innerHTML: "72" }, fontsize);
- return fontsize;
- };
- Namespace.register("U.UF.UI")
- U.UF.UI.Confirm = U.UF.UI.confirm = function (content, determineFun, cancelFun) {
-
- var _confirm = $$("div", { "style": { "cssText": "width: 100%; background: rgb(255,255,255);overflow:hidden; " } });
-
- var _content = $$("div", { "style": { "cssText": "width: 100%;" } }, _confirm);
-
- if (U.UF.C.isElement(content)) {
-
- U.selectEl(_content).append(content);
- } else {
- _content.style.cssText = "text-align: center; margin: 10px;";
-
- _content.innerHTML = content || '内容';
- }
-
- var _footer = $$("div", { "style": { "cssText": "height:28px; margin:14px 0;" } }, _confirm);
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 92px; line-height:28px; background: rgb(48,126,208); border-radius: 5px;float: right; margin-right:29px; "
- },
- innerHTML: "确定",
- onclick: function () {
- var _bool = true;
- if (U.UF.C.isFunction(determineFun)) {
- _bool = determineFun();
- }
- if (_bool !== false) {
- U.UF.F.closeWindow(_form.form);
- }
- }
- }, _footer);
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: rgb(255,255,255); width: 92px; line-height:28px; background: rgb(48,126,208); border-radius: 5px;background: rgb(170,170,170); float: right; margin-right:21px;margin-left:29px;"
- },
- "innerHTML": "取消",
- "onclick": function () {
- U.UF.C.isFunction(cancelFun) && cancelFun();
- U.UF.F.closeWindow(_form.form);
- }
- }, _footer);
-
- var _form = new U.UF.UI.form(
- "提示",
- _confirm, {
- "style": {
- "cssText": "font-size: 14px; background: rgb(255,255,255); width: 310px; 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: 5px; color: rgb(255,255,255); "
- }
- });
- return _form;
- }
- U.UF.UI.Dialog = U.UF.UI.Dialog = function (content, callBackFun) {
- var _dialog = $$("div", { "style": { "cssText": "width: 100%; background: #fff; overflow:hidden; " } });
- var _content = $$("div", { "style": { "cssText": "text-align: center; margin: 30px 20px 30px 20px; " } }, _dialog);
-
- if (U.UF.C.isElement(content)) {
- U.selectEl(_content).append(content);
- } else {
- _content.innerHTML = content || '内容';
- }
-
- var footer = $$("div", { "style": { "cssText": "height:45px;" } }, _dialog);
-
- var _form = new U.UF.UI.form("提示框", _dialog, {
- "style": {
- "cssText": "font-size: 14px; width: 300px; background:#fff; position: fixed; top: 100px; left: 40%; box-shadow: 0 0 10px 3px black; border-radius: 5px;"
- }
- },
- null, {
- "style": { "cssText": "background: #3b5878; padding: 10px; color:#fff;" }
- });
-
- $$("div", {
- "style": {
- "cssText": "text-align: center; color: #fff; width: 30%; padding: 5px; background: #307ed0; border-radius: 5px;float: right; margin: 0 12px 12px 0;"
- },
- innerHTML: "确定",
- onclick: function () {
- U.UF.C.isFunction(callBackFun) && callBackFun();
- U.UF.F.closeWindow(_form.form);
- }
- }, footer);
- }
- U.UF.UI.alertClick = function (content, attr) {
-
- var _content = $$("div", { "class": "USBalert_text", "style": { width: "100%" } });
-
- if (U.UF.C.isElement(content)) {
-
- U.selectEl(_content).append(content);
- } else {
- $$("div", { "style": { cssText: "text-align:center;padding:10px; margin:10px auto; word-break:break-word;" }, innerHTML: content || '内容' }, _content);
- }
-
- var _footer = $$("div", { "class": "USBalert_onclicks", style: { height: "43px" } }, _content);
-
- var _form = new U.UF.UI.form("提示框", _content, {
- "style": {
- "cssText": "font-size: 16px; width:320px; background: rgb(255,255,255);box-shadow: 0 0 10px 3px rgb(0,0,0); border-radius: 5px;"
- }
- }, {
- "isnarrow": false,
- "isenlarge": false,
- isstretching: false
- }, {
- "style": {
- "cssText": "background: rgb(59,88,120); padding: 10px; color: rgb(255,255,255);"
- }
- });
-
- $$("div", { "style": { "cssText": "text-align: center; color: #fff; width: 30%;max-width:150px; padding: 5px; background: #307ed0; border-radius: 5px;float: right; margin: 0 12px 12px 0;" }, innerHTML: "确定", onclick: function () { U.UF.F.closeWindow(_form.form); } }, _footer);
- }
- U.Alert = U.alert = function (c, t) {
- !t ? t = 3000 : "";
- var bg = $$("div", {
- "style": {
- "cssText": "padding: 12px 25px 12px 25px;font-size: 16px;max-width:300px;min-width:100px;color: rgba(255,255,255,1);background: rgba(0,0,0,0.75);border-radius: 10px;position: fixed;top:20%;left:0px;right:0px;margin:0px auto;text-align:center; word-break: break-word; "
-
- },
- innerHTML: c
- }, document.body);
- U.UF.F.topWindow(bg);
- setTimeout(function () {
- bg.parentNode.removeChild(bg);
- }, t);
- }
-
-
- ;
- Namespace.register("U.MD.UI.email");
- U.MD.UI.email = function () {
- };
- Namespace.register("U.MD.UI.face");
- U.MD.UI.face = function (button, el) {
- var i, _el1, _el2;
- if ($("#U_MD_UI_face")[0]) {
- if ($("#U_MD_UI_face")[0].style.display == "none") {
- U.selectEl("#U_MD_UI_face")[0].style.display = "block";
- } else {
- U.selectEl("#U_MD_UI_face")[0].style.display = "none";
- }
- } else {
- var _el = $$("div", { "style": { "position": "relative" } }, U.selectEl(button)[0]);
- _el1 = $$("div", { "id": "U_MD_UI_face", "className": "U_MD_UI_face", "onmousedown": U.UF.EV.stopBubble }, _el);
- _el2 = $$("div", { "className": "U_MD_UI_face_H" }, _el1);
- for (i = 0; i <= 104; i++) {
- $$("button", {
- "className": "U_MD_UI_face_C",
- "style": { "opacity": "0" },
- "onclick": U.UF.C.closure(function (i) {
- U.UF.EV.stopBubble();
- U.MD.UI.face.printEmoticon(_el1, i, U.UF.E.getRangeAt(), el)
- }, [i])
- }, _el2);
- }
-
- U.selectEl('body').unbind('click', U.MD.UI.face.externalClick);
- U.selectEl('body').bind('click', U.MD.UI.face.externalClick);
- }
- el.focus();
- };
- U.MD.UI.face.externalClick = function (e) {
- if (window.event.srcElement.tagName != "BUTTON" && U.selectEl("#U_MD_UI_face")[0]) {
- U.selectEl("#U_MD_UI_face")[0].style.display = "none";
- }
- }
- U.MD.UI.face.printEmoticon = function (el1, i, range, el) {
- var _imageurl = "/img/ChatingFaceGif/[face](" + i + ").gif";
- if (!range) {
- $$("img", { "onerror": U.MD.C.imgError, "src": _imageurl, "contentEditable": "true" }, U.selectEl(el)[0]);
- } else {
- var img = '<img contentEditable="true" src="' + _imageurl + '">';
- U.UF.E.addRange(img, null, true);
- }
- U.selectEl(el1)[0].style.display = "none";
- };
- Namespace.register("U.UF.UI")
- U.UF.UI.form = function (title, content, formattr, formfun, headattr, contentattr, headbottomattr, parentel) {
- var _this = this;
-
- if (formattr && U.UF.UI.form.allForm[formattr.id]) {
- var _this = U.UF.UI.form.allForm[formattr.id];
- }
-
- else {
-
- this.id = formattr && formattr.id ? formattr.id : Guid.newGuid();
-
- U.UF.UI.form.allForm[this.id] = this;
- }
- _this.form;
- _this.header;
- _this.middle;
- _this.title = title;
- _this.content = content;
- _this.formattr = formattr;
- _this.headattr = headattr;
- _this.contentattr = contentattr;
- _this.headbottomattr = headbottomattr;
-
-
- if (formfun == null) {
- formfun = {};
- }
- _this.istop = null;
- if (formfun.istop != null) {
- _this.istop = formfun.istop;
- }
- _this.isdrag = true;
- if (formfun.isdrag != null) {
- _this.isdrag = formfun.isdrag;
- }
- _this.isstretching = true;
- if (formfun.isstretching != null) {
- _this.isstretching = formfun.isstretching;
- }
- _this.isenlarge = true;
- if (formfun.isenlarge != null) {
- _this.isenlarge = formfun.isenlarge;
- }
- _this.isnarrow = true;
- if (formfun.isnarrow != null) {
- _this.isnarrow = formfun.isnarrow;
- }
- _this.isclose = true;
- _this.closecallback = formfun.closecallback;
- if (formfun.isclose != null) {
- _this.isclose = formfun.isclose;
- }
- _this.parentel = parentel || document.body;
- _this.create();
- return _this;
- }
- U.UF.UI.form.allForm = {};
- U.UF.UI.form.prototype = {
-
- create: function () {
- var i,
- _resizefun,
- _formel,
- _headel,
- _contentel,
- _contentchildel,
- _stretchingel,
- _stretchinginfo,
- _headbottom,
- _enlargeel,
- _mousedown,
- _formattr = this.formattr || {},
- _headattr = this.headattr || {},
- _contentattr = this.contentattr || {},
- _replaceel = U.UF.UI.form.allForm[_formattr.id] ? U.UF.UI.form.allForm[_formattr.id].form : null
- ;
-
- if (_formattr.style) {
- _formattr.style.cssText = _formattr.style.cssText || "";
- _formattr.style.cssText = "width: 70%; position: fixed; border: 1px solid #444; background-color: #fff; z-index: 10; border-radius: 1px; overflow: hidden; -moz-box-shadow:0 0 30px 5px #555; -webkit-box-shadow:0 0 30px 5px #555; box-shadow:0 0 30px 5px #555; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;" + _formattr.style.cssText;
- } else {
- _formattr.style = {
- cssText: "width: 70%; position: fixed; border: 1px solid #444; background-color: #fff; z-index: 10; border-radius: 1px; overflow: hidden; -moz-box-shadow:0 0 30px 5px #555; -webkit-box-shadow:0 0 30px 5px #555; box-shadow:0 0 30px 5px #555; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:5px;"
- };
- }
- _formattr.close = U.UF.C.apply(this, function () {
- U.UF.F.closeWindow(this.form);
- });
- _formattr.usform = "true";
- _formattr.id = _formattr.id || "";
- _formattr.style = _formattr.style || {};
- if (_formattr.onresize) {
- _resizefun = _formattr.onresize;
- _mousedown = _formattr.onmousedown;
- _formattr.onresize = U.UF.C.apply(this, function () {
- this.size();
- if (_resizefun) {
- _resizefun();
- }
- });
- _formattr.onmousedown = U.UF.C.apply(this, function () {
-
- if (this.istop !== false) {
- this.top();
- }
- if (_mousedown) {
- _mousedown();
- }
- });
- } else if (_formattr.onresize !== false) {
- _formattr.onresize = U.UF.C.apply(this, function () {
- this.size();
- });
- }
-
- var _formel = $$("div", this.formattr);
-
- if (this.istop === true) {
- _formel.style.zIndex = "9999";
- _formel["__top__"] = "false";
- } else if (this.istop === false) {
- _formel["__top__"] = "false";
- }
- this.form = _formel;
-
- if (this.title !== false) {
-
- if (_headattr.style) {
- _headattr.style.cssText = _headattr.style.cssText || "";
- _headattr.style.cssText = "text-indent: 10px; color: White; line-height: inherit; font-size: 14px; height: 30px; line-height: 30px; background-color: #2967A7; overflow: hidden; color: White; font-size: 14px; overflow: hidden; " + _headattr.style.cssText;
- } else {
- _headattr.style = {
- cssText: "text-indent: 10px; color: White; line-height: inherit; font-size: 14px; height: 30px; line-height: 30px; background-color: #2967A7; overflow: hidden; color: White; font-size: 14px; overflow: hidden; "
- }
- }
-
- if (this.isdrag) {
- _headattr.onmousedown = function () {
- U.UF.F.drag(_formel);
- };
- }
-
- _headel = $$("div", _headattr, _formel);
-
- if (U.UF.C.isString(this.title)) {
- _headel.innerHTML = this.title;
- }
-
- else if (U.UF.C.isElement(this.title)) {
- _headel.appendChild(this.title);
- }
- this.header = _headel;
- }
-
- _contentel = $$("div", { "style": { "cssText": "width: 100%; height:100%; position: relative;" } }, _formel);
-
- _contentattr.usbody = "true";
-
- if (_contentattr.style) {
- _contentattr.style.cssText = _contentattr.style.cssText || "";
-
- _contentattr.style.cssText = "text-align: left; overflow: hidden;" + _contentattr.style.cssText;
- } else {
- _contentattr.style = {
- cssText: "text-align: left; overflow: auto;"
- };
- }
-
- _contentchildel = $$("div", _contentattr, _contentel);
-
- if (U.UF.C.isString(this.content)) {
- _contentchildel.innerHTML = this.content;
- }
-
- else if (U.UF.C.isElement(this.content)) {
- _contentchildel.appendChild(this.content);
- }
- this.middle = _contentchildel;
-
- if (this.title === false && this.isdrag) {
- _contentel.onmousedown = function () {
- U.UF.F.drag(_formel);
- };
- }
-
- if (this.isstretching !== false) {
-
- _stretchingel = $$("div", { style: { "cssText": "display: block;" } }, _formel);
-
- _stretchinginfo = {
- "top": "cursor: n-resize; left: 0px; top: 0px; width: 100%; height: 5px;",
- "rightTop": "cursor: ne-resize; right: -2px; top: -2px; width: 12px; height: 12px;",
- "leftTop": "cursor: nw-resize; top: 0px; left: 0px; width: 12px; height: 12px;",
- "left": "cursor: w-resize; left: 0px; top: 0px; width: 5px; height: 100%;",
- "right": "cursor: e-resize; right: 0px; top: 0px; width: 5px; height: 100%;",
- "bottom": "cursor: s-resize; left: 0px; bottom: 0px; width: 100%; height: 5px;",
- "leftBottom": "cursor: sw-resize; left: -2px; bottom: -2px; width: 12px; height: 12px;",
- "rightBottom": "cursor: se-resize; right: -2px; bottom: -2px; width: 12px; height: 12px;"
- }
-
- for (i in _stretchinginfo) {
- $$("div", {
- "style": {
- "cssText": "position: absolute; overflow: hidden; display: block; z-index: 10;" + _stretchinginfo[i]
- },
- "onmousedown": U.UF.C.closure(function (scope, typename) {
-
- U.UF.F.stretching(_formel, typename, U.UF.C.apply(scope, scope.size));
- }, [this, i])
- }, _stretchingel);
- }
- }
-
- if (this.title !== false) {
- _headbottom = $$("div", {
- "style": { "cssText": "position: absolute; top: 3px; right: 0px; width: 80px; display: table-cell; vertical-align: middle;" }
- }, _formel);
- }
- if (this.isclose !== false) {
-
- $$("div", {
- "style": {
- "cssText": "background-image:url(../../../img/close.png); _background-image:url(/img/close.png);width: 14px; height: 14px; background-repeat: no-repeat; background-size: 100%; float: right; margin-right: 5px;margin-top:6px; cursor: pointer;"
- },
- "title": "点击关闭",
- "onmousedown": U.UF.EV.stopBubble,
- "onclick": U.UF.C.apply(this, function () {
- U.UF.F.closeWindow(this.form);
- try {
-
- if (U.MD.D.T.taskbar.close) {
- U.MD.D.T.taskbar.close({ "forms": _formel });
-
- }
- } catch (e) { }
-
- if (U.UF.C.isFunction(this.closecallback)) {
- this.closecallback();
- }
- })
- }, _headbottom);
- }
-
- if (this.isenlarge !== false) {
-
- _enlargeel = $$("div", {
- "style": {
- "cssText": "background-image:url(../../../img/max.png); _background-image:url(/img/max.png); background-size: 100%; float: right; margin-right: 10px; width: 17px; height: 17px; cursor: pointer;margin-top: 4px;"
- },
- "title": "最大化",
- "onmousedown": U.UF.EV.stopBubble,
-
- "onclick": function () {
- U.UF.F.windowZooming(_formel);
- }
- }, _headbottom);
-
- if (_headel) {
-
- _headel.ondblclick = U.UF.C.apply(_headel, function () {
-
- if (event.srcElement == this || U.UF.EL.isChild(this, event.srcElement)) {
- _enlargeel.onclick();
- }
- });
- }
- }
-
- if (this.isnarrow !== false) {
-
- $$("div", {
- "style": {
- "cssText": "background-image:url(../../../img/min.png); _background-image:url(/img/min.png);background-size: 100%; float: right; margin-right: 10px; margin-top: 3px; width: 20px; height: 20px; cursor: pointer;background-repeat: no-repeat;"
- },
- "title": "最小化",
- "onmousedown": U.UF.EV.stopBubble,
- "onclick": function () {
- U.UF.F.windowMinimize(_formel);
- }
- }, _headbottom);
- }
-
- if (_replaceel && _replaceel.parentNode != null) {
- _replaceel.parentNode.replaceChild(_formel, _replaceel);
- }
-
- else {
- this.parentel.appendChild(_formel);
- }
-
- if (_formel.style.top == "" && _formel.style.left == "" && _formel.style.right == "" && _formel.style.bottom == "") {
-
- U.UF.F.windowTopCenter(_formel);
- }
-
- else {
- U.UF.F.topWindow(_formel);
- }
-
- this.size();
- },
-
- top: function () {
- U.UF.F.topWindow(this.form);
- },
-
- size: function () {
- var _headheight = 0;
-
- if (this.header) {
- _headheight = this.header.clientHeight;
- }
-
- if (this.header) {
- this.middle.style.height = this.form.clientHeight - this.header.clientHeight + "px";
- } else {
- this.middle.style.height = this.form.clientHeight + "px";
- }
- }
- }
- U.UF.UI.form.windowResize = function () {
- var i,
- _style,
- _bodywidth = US.width,
- _bodyheight = US.height,
- _sizeinfo,
- _width,
- _height,
- _formel,
- _forms = U.UF.UI.form.allForm
- ;
-
- for (i in _forms) {
- _formel = _forms[i].form;
- if ($(_formel).css("display") != "none") {
- _style = {};
- _width = U.selectEl(_formel).css("width");
- _height = U.selectEl(_formel).css("height");
-
- _width = _width.indexOf("%") > -1 ? _width.toInt() / 100 : _formel.offsetWidth / _bodywidth;
- _height = _height.indexOf("%") > -1 ? _height.toInt() / 100 : _formel.offsetWidth / _bodyheight;
-
- if (_formel.style.right == "" || _formel.style.right == "auto") {
- _style.left = _formel.offsetLeft + (document.body.offsetWidth - _bodywidth) * ((1 - _width) / 2) + "px";
- }
-
- if (_formel.style.bottom == "" || _formel.style.bottom == "auto") {
- _style.top = _formel.offsetTop + (document.body.offsetHeight - _bodyheight) * ((1 - _height) / 2) + "px";
- }
-
- U.selectEl(_formel).addAttrArray({ "style": _style });
- }
- }
- }
- U.UF.UI.form.closeWindows = function () {
- var i;
- for (i in U.UF.UI.form.allForm) {
- if (U.UF.UI.form.allForm[i].isclose) {
- U.UF.UI.form.allForm[i].form.close();
- }
- }
- }
- Namespace.register("U.MD.UI.music");
- U.MD.UI.music = function (musicList, index, autoplay, parentEl) {
- var _music = U.MD.UI.music;
- var _musicBox;
- if (_musicBox = U.selectEl("#U_MD_UI_music_musicBox")[0]) {
-
-
-
-
-
-
-
-
- _musicBox.remove();
- }
- _music.create(parentEl);
- _music.Attr = {
- 'musicList': musicList,
- 'musicIndex': index,
- 'autoplay': autoplay,
- 'currentTime': null,
- 'endTime': null
- };
- _music.init();
- };
- U.MD.UI.music.Attr = null;
- U.MD.UI.music.htmlTemplate = ' <div class="U_MD_UI_music_leftCont">\n' +
- ' <div class="U_MD_UI_music_CoverBox">\n' +
- ' <img src="/img/Controls/Audio/pc/电脑图标.png" alt="" id="U_MD_UI_music_Cover">\n' +
- ' </div> <!-- 音乐封面图片 -->\n' +
- ' </div>\n' +
- ' <div class="U_MD_UI_music_rightCont">\n' +
- ' <div class="U_MD_UI_music_Name" id="U_MD_UI_music_Name"></div> <!-- 音乐名字 -->\n' +
- ' <div class="U_MD_UI_music_leftBtn" id="U_MD_UI_music_leftBtn"></div> <!-- 左按钮 -->\n' +
- ' <div class="U_MD_UI_music_pauseBtn U_MD_UI_music_playBtn" id="U_MD_UI_music_playBtn"></div> <!-- 播放/暂停 按钮 -->\n' +
- ' <div class="U_MD_UI_music_rightBtn" id="U_MD_UI_music_rightBtn"></div> <!-- 右按钮 -->\n' +
- ' <div class="U_MD_UI_music_soundOpen" id="U_MD_UI_music_soundSwitch"></div> <!-- 声音开关按钮 -->\n' +
- ' <div class="U_MD_UI_music_soundBox" id="U_MD_UI_music_soundBox"> <!-- 声音条盒子节点 -->\n' +
- ' <div class="U_MD_UI_music_soundBar" id="U_MD_UI_music_soundBar" style="width: 31px;"></div> <!-- 声音条 -->\n' +
- ' <div class="U_MD_UI_music_soundBall" id="U_MD_UI_music_soundBall" style="left: 31px;"></div> <!-- 声音球 -->\n' +
- ' </div>\n' +
- ' <div class="U_MD_UI_music_listBtn"></div> <!-- 右上角的列表按钮 -->\n' +
- ' <div class="U_MD_UI_music_shrinkBtn" id="U_MD_UI_music_shrinkBtn"></div> <!-- 右上角的缩小按钮 -->\n' +
- ' <div class="U_MD_UI_music_closeBtn" id="U_MD_UI_music_closeBtn"></div> <!-- 右上角的关闭按钮 -->\n' +
- ' </div>\n' +
- ' <div class="U_MD_UI_music_progressBox" id="U_MD_UI_music_progressBox"> <!-- 时间条盒子节点 -->\n' +
- ' <div class="U_MD_UI_music_progressBar" id="U_MD_UI_music_progressBar" style="width: 0.64px;"></div> <!-- 时间条 -->\n' +
- ' <div class="U_MD_UI_music_progressBall" id="U_MD_UI_music_progressBall" style="left: 0.64px;"></div> <!-- 时间球 -->\n' +
- ' </div>\n' +
- ' <audio id="U_MD_UI_music_audio" autoplay="" src=""></audio>';
- U.MD.UI.music.create = function (parentEl) {
- var _parentEl = parentEl || document.body;
- var _formclass = { "style": { "border": "none" }, "id": "U_MD_UI_music_musicBox", "className": "U_MD_UI_music_musicBox" };
- var _formattr = { isclose: false, isstretching: false, isenlarge: false, isnarrow: false };
- var _headclass = { "style": { "height": "13px", "background-color": "#cc5b5b" } };
- U.MD.UI.music.player = new U.UF.UI.form(false, U.MD.UI.music.htmlTemplate, _formclass, _formattr, _headclass);
- U.selectEl("#U_MD_UI_music_musicBox")[0].style.overflow = "";
-
- };
- U.MD.UI.music.init = function () {
- var _music = U.MD.UI.music;
- var _attr = _music.Attr;
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- var _musicList = _attr.musicList;
- var _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- var _playBtn = U.selectEl("#U_MD_UI_music_playBtn");
- var _Name = U.selectEl("#U_MD_UI_music_Name");
- var _corver = U.selectEl("#U_MD_UI_music_Cover");
- if (!_attr.autoplay) {
- _audio[0].pause();
- }
- _music.openBtnEvent();
- _music.shrinkBtnEvent();
- _music.soundControl();
- _music.playEvent();
- _music.switchMusic();
- _music.progressControl();
- _audio.bind('durationchange', function () {
- _attr.endTime = this.duration;
- _musicIndex = _attr.musicIndex;
- _Name[0].innerText = _musicList[_musicIndex].title;
- });
- _audio.bind("ended", function () {
- _musicIndex = _attr.musicIndex;
- var _listLength = _musicList.length - 1;
- if (_musicIndex === _listLength) {
- _attr.musicIndex = 0;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- } else {
- _attr.musicIndex++;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- }
- });
- };
- U.MD.UI.music.openBtnEvent = function () {
- var _music = U.MD.UI.music;
-
-
-
- U.selectEl("#U_MD_UI_music_closeBtn").bind('click', function () {
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- if (!_audio[0].paused) {
- U.selectEl("#U_MD_UI_music_playBtn").addClass('U_MD_UI_music_playBtn');
- _audio[0].pause();
- }
- U.UF.F.closeWindow(_music.player.form);
- U.selectEl('#U_MD_D_T_taskbar_music').remove();
-
-
- });
- };
- U.MD.UI.music.shrinkBtnEvent = function () {
- U.selectEl('#U_MD_UI_music_shrinkBtn').bind('click', function () {
- U.UF.F.windowMinimize(U.MD.UI.music.player.form);
- });
- };
- U.MD.UI.music.playEvent = function () {
- var _music = U.MD.UI.music;
- var _attr = _music.Attr;
- var _playbtn = U.selectEl("#U_MD_UI_music_playBtn");
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- _playbtn.bind('click', function () {
- if (!_audio[0].paused) {
- _playbtn.addClass('U_MD_UI_music_playBtn');
- _audio[0].pause();
- } else {
- _playbtn.removeClass('U_MD_UI_music_playBtn');
- _audio[0].play();
- }
- });
- };
- U.MD.UI.music.switchMusic = function () {
- var _music = U.MD.UI.music;
- var _attr = _music.Attr;
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- var _rightBtn = U.selectEl("#U_MD_UI_music_rightBtn");
- var _leftBtn = U.selectEl("#U_MD_UI_music_leftBtn");
- var _musicList = _attr.musicList;
- var _musicIndex = _attr.musicIndex;
- var _listLength = _musicList.length - 1;
- _rightBtn.bind('click', function () {
- _musicIndex = _attr.musicIndex;
- if (_musicIndex === _listLength) {
- _attr.musicIndex = 0;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- } else {
- _attr.musicIndex++;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- }
- });
- _leftBtn.bind('click', function () {
- _musicIndex = _attr.musicIndex;
- if (_musicIndex === 0) {
- _attr.musicIndex = _listLength;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- } else {
- _attr.musicIndex--;
- _musicIndex = _attr.musicIndex;
- _audio[0].src = _musicList[_musicIndex].src;
- }
- });
- };
- U.MD.UI.music.soundControl = function () {
- var _music = U.MD.UI.music;
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- var _soundBox = U.selectEl("#U_MD_UI_music_soundBox");
- var _soundBall = U.selectEl("#U_MD_UI_music_soundBall");
- var _soundBar = U.selectEl("#U_MD_UI_music_soundBar");
- var _boxWidth = _soundBox[0].clientWidth;
- var _volume = 0.5;
- var _soundSwitch = U.selectEl("#U_MD_UI_music_soundSwitch");
- _audio[0].volume = _volume;
- _soundBall[0].style.left = (_boxWidth * _volume) + "px";
- _soundBar[0].style.width = (_boxWidth * _volume) + "px";
- _soundSwitch.bind('click', function () {
- _music.toggleClass(this, 'U_MD_UI_music_soundClose');
- if ($(this).hasClass('U_MD_UI_music_soundClose')) {
- this._volume = _audio[0].volume;
- this._soundBallX = parseFloat(_soundBall.css("left"));
- this._soundBarW = parseFloat(_soundBar.css("width"));
- _soundBall[0].style.left = 0;
- _soundBar[0].style.width = 0;
- _audio[0].volume = 0;
- } else {
- if (!this._volume) {
- return;
- }
- _audio[0].volume = this._volume;
- _soundBall[0].style.left = this._soundBallX + "px";
- _soundBar[0].style.width = this._soundBarW + "px";
- }
- });
- _soundBox.bind('mousedown', function (e) {
- var _boxLeft = _music.getOffsetLeft(this);
- var _boxRight = _boxLeft + _boxWidth;
- var _mouseX = e.pageX;
- _mouseX = Math.max(_mouseX, _boxLeft);
- _mouseX = Math.min(_mouseX, _boxRight);
- var _dis = _mouseX - _boxLeft;
- _volume = Math.round(parseFloat(_dis / _boxWidth) * 100) / 100;
- _soundBall[0].style.left = (_boxWidth * _volume) + "px";
- _soundBar[0].style.width = (_boxWidth * _volume) + "px";
- _audio[0].volume = _volume;
- if (_audio[0].volume <= 0) {
- _soundSwitch.addClass('U_MD_UI_music_soundClose');
- } else {
- _soundSwitch.removeClass('U_MD_UI_music_soundClose');
- }
- });
- _soundBall.bind('mousedown', function (e) {
- U.UF.EV.stopBubble(e);
- var _oMouseX = e.pageX;
- var _soundDrapMove = function (e) {
- U.UF.EV.stopDefault(e);
- var _mouseX = e.pageX;
- var _dis = _mouseX - _oMouseX + _oX;
- _dis = Math.max(0, _dis);
- _dis = Math.min(_boxWidth, _dis);
- _soundBall[0].style.left = _dis + "px";
- _soundBar[0].style.width = _dis + "px";
- _volume = Math.round(parseFloat(_dis / _boxWidth) * 100) / 100;
- _audio[0].volume = _volume;
- if (_audio[0].volume <= 0) {
- _soundSwitch.addClass('U_MD_UI_music_soundClose');
- } else {
- _soundSwitch.removeClass('U_MD_UI_music_soundClose');
- }
- };
- var _soundDragUp = function () {
- U.selectEl(document).unbind('mousemove', _soundDrapMove);
- U.selectEl(document).unbind('mouseup', _soundDragUp);
- };
- var _oX = parseFloat(_soundBall.css("left"));
- U.selectEl(document).bind('mousemove', _soundDrapMove);
- U.selectEl(document).bind('mouseup', _soundDragUp)
- });
- };
- U.MD.UI.music.progressControl = function () {
- var _music = U.MD.UI.music;
- var _attr = _music.Attr;
- var _audio = U.selectEl("#U_MD_UI_music_audio");
- var _progressBox = U.selectEl("#U_MD_UI_music_progressBox");
- var _progressBall = U.selectEl("#U_MD_UI_music_progressBall");
- var _progressBar = U.selectEl("#U_MD_UI_music_progressBar");
- var _playbtn = U.selectEl("#U_MD_UI_music_playBtn");
- var _boxWidth = _progressBox[0].clientWidth;
- var _barFlag = true,
- _currentTime;
- _audio.bind('timeupdate', function () {
- if (!this.paused) {
- _playbtn.removeClass('U_MD_UI_music_playBtn');
- } else {
- _playbtn.addClass('U_MD_UI_music_playBtn');
- }
- if (_barFlag) {
- _currentTime = this.currentTime;
- var _speed = Math.round(parseFloat(_currentTime / _attr.endTime) * 10000) / 10000;
- _progressBall[0].style.left = (_boxWidth * _speed) + "px";
- _progressBar[0].style.width = (_boxWidth * _speed) + "px";
- }
- });
- _progressBox.bind('mousedown', function (e) {
- var _boxLeft = _music.getOffsetLeft(this);
- var _boxRight = _boxLeft + _boxWidth;
- var _mouseX = e.pageX;
- _mouseX = Math.max(_mouseX, _boxLeft);
- _mouseX = Math.min(_mouseX, _boxRight);
- var _dis = _mouseX - _boxLeft;
- _speed = Math.round(parseFloat(_dis / _boxWidth) * 10000) / 10000;
- _progressBall[0].style.left = (_boxWidth * _speed) + "px";
- _progressBar[0].style.width = (_boxWidth * _speed) + "px";
- _audio[0].currentTime = _attr.endTime * _speed;
- });
- _progressBall.bind('mousedown', function (e) {
- _barFlag = false;
- U.UF.EV.stopBubble(e);
- var _oMouseX = e.pageX;
- var _progressDrapMove = function (e) {
- U.UF.EV.stopDefault(e);
- var _mouseX = e.pageX;
- var _dis = _mouseX - _oMouseX + _oX;
- _dis = Math.max(0, _dis);
- _dis = Math.min(_boxWidth, _dis);
- _progressBall[0].style.left = _dis + "px";
- _progressBar[0].style.width = _dis + "px";
- _speed = Math.round(parseFloat(_dis / _boxWidth) * 10000) / 10000;
- _progressBall[0].style.left = (_boxWidth * _speed) + "px";
- _progressBar[0].style.width = (_boxWidth * _speed) + "px";
- _currentTime = _attr.endTime * _speed;
- };
- var _progressDragUp = function () {
- _barFlag = true;
- _audio[0].currentTime = _currentTime;
- U.selectEl(document).unbind('mousemove', _progressDrapMove);
- U.selectEl(document).unbind('mouseup', _progressDragUp);
- };
- var _oX = parseFloat(_progressBall.css("left"));
- U.selectEl(document).bind('mousemove', _progressDrapMove);
- U.selectEl(document).bind('mouseup', _progressDragUp)
- });
- };
- U.MD.UI.music.getOffsetLeft = function (obj) {
- var tmp = obj.offsetLeft;
- var val = obj.offsetParent;
- while (val != null) {
- tmp += val.offsetLeft;
- val = val.offsetParent;
- }
- return tmp;
- };
- U.MD.UI.music.secondToDate = function (result) {
- var m = Math.floor((result / 60 % 60));
- var s = Math.floor((result % 60));
- if (m < 10) {
- m = "0" + m;
- }
- if (s < 10) {
- s = "0" + s;
- }
- return result = m + ":" + s;
- };
- U.MD.UI.music.toggleClass = function (ele, cls) {
- if ($(ele).hasClass(cls)) {
- U.selectEl(ele).removeClass(cls);
- } else {
- U.selectEl(ele).addClass(cls);
- }
- };;
- Namespace.register("U.UF.P");
- U.UF.P.apply = function (fun, arr, el) {
- return function () {
- fun.apply(el, arr);
- }
- }
- U.UF.P.pagepId = 0;
- U.UF.P.PPage = U.UF.P.page = function (el, num, pagenum, page, fun) {
- this.PageNum = 0;
- this.Index = 0;
- this.Pageall = 0;
- this.init(el, num, pagenum, page, fun);
- }
- U.UF.P.page.prototype = {
- init: function (el, num, pagenum, page, fun) {
- this.PageNum = page;
- this.Index = page - 1;
- var _el = U.selectEl(el)[0];
- var _pagesum = Math.ceil(num / pagenum);
- this.Pageall = _pagesum;
-
- if (_el.getElementsByClassName('U_MD_F_Y')[0]) {
- return false;
- }
- U.UF.P.pagepId++;
- var _page = $$("div", { "className": "U_MD_F_Y" }, _el);
- var _pagenode = $$("div", { "className": "U_MD_F_YL" }, _page);
- var _firstEle = $$("div", { "className": "U_MD_F_YLO U_MD_F_Y_Button", "innerHTML": "首页", "title": "首页", "pid": U.UF.P.pagepId + "1" }, _pagenode);
- var _previousEle = $$("div", { "className": "U_MD_F_YLT U_MD_F_Y_Button", "title": "上一页", "pid": U.UF.P.pagepId + "3" }, _pagenode);
- var _pagenum = $$("div", { "className": "U_MD_F_YN" }, _pagenode);
- var _startpage;
- var _endpage = Math.min(_pagesum, Math.max(page + 5, 10));
- for (_startpage = Math.max(1, Math.min(page - 5, _pagesum - 10)); _startpage <= _endpage; _startpage++) {
- (function (i, el) {
-
-
-
- var _centerEle = $$("div", {
- "innerHTML": i,
- "pid": U.UF.P.pagepId + "5"
- }, _pagenum);
- i == page && (_centerEle.className = "U_MD_F_Y_Button_Active");
- _centerEle.onclick = U.UF.P.apply(function (i) {
- U.UF.P.centerEle(el, _centerEle);
- }, [_startpage], el)
- })(_startpage, this);
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var _nextEle = $$("div", { "className": "U_MD_F_YLS U_MD_F_Y_Button", "title": "下一页", "pid": U.UF.P.pagepId + "4" }, _pagenode);
- var _lastEle = $$("div", { "className": "U_MD_F_YLF U_MD_F_Y_Button", "innerHTML": "尾页", "title": "尾页", "pid": U.UF.P.pagepId + "2" }, _pagenode);
- var _pages = $$("div", { "className": "U_MD_F_YR" }, _page);
-
- $$("span", { "innerHTML": "到" }, _pages);
-
- var _input = $$("input", { "type": "text" }, _pages);
- $$("span", { "innerHTML": "页" }, _pages);
- var _rightEle = $$("div", { "className": "U_MD_F_YRZ", "pid": U.UF.P.pagepId + "6", "innerHTML": "确定" }, _pages);
- if (this.PageNum < _pagesum + 1) {
- var _list = U.selectEl(".list" + U.UF.P.pagepId);
- for (var j = 1; j < _list.length + 1; j++) {
- if (this.PageNum == j) {
- U.selectEl(_list[this.PageNum - 1]).addClass("U_MD_F_Y_Button_Active");
- }
- }
- }
- _firstEle.onclick = U.UF.P.apply(this.fPage, [_firstEle, _pagesum, fun], this);
- _previousEle.onclick = U.UF.P.apply(this.fPage, [_previousEle, _pagesum, fun], this);
-
- U.UF.P.centerEle = function (el, el1) {
- U.UF.P.apply(el.fPage, [el1, _pagesum, fun], el)();
- }
- _nextEle.onclick = U.UF.P.apply(this.fPage, [_nextEle, _pagesum, fun], this);
- _lastEle.onclick = U.UF.P.apply(this.fPage, [_lastEle, _pagesum, fun], this);
- _rightEle.onclick = U.UF.P.apply(this.fPage, [_rightEle, _pagesum, fun, _input], this);
- _input.onkeyup = function () {
- if (event.keyCode == "13") {
- _rightEle.onclick();
- }
- }
- },
-
- fPage: function (el, pagesum, fun, input) {
- _el1 = el.pid;
- _el = _el1.charAt(_el1.length - 1);
- if (_el == 5) {
- _list = U.selectEl($(el).Parent()).Parent().children[2].children;
- } else if (_el == 6) {
- _list = U.selectEl($(el).Parent()).Parent().children[0].children[2].children;
- } else {
- _list = U.selectEl(el).Parent().children[2].children;
- }
- U.selectEl(".U_MD_F_Y_Button_Active").removeClass("U_MD_F_Y_Button_Active");
- if (_el == 1) {
- if (this.Index == 0) { this.Index++ }
- if (this.PageNum > 1) {
- U.selectEl(_list[0]).addClass("U_MD_F_Y_Button_Active");
- this.Index = 0;
- this.PageNum = 1
- this.pagefun(this.PageNum, _list);
- fun(this.PageNum);
- return;
- }
- U.selectEl(_list[--this.Index]).addClass("U_MD_F_Y_Button_Active");
- } else if (_el == 2) {
- if (this.PageNum < this.Pageall) {
- this.Index = pagesum;
- this.PageNum = this.Pageall;
- this.pagefun(this.PageNum, _list);
- fun(this.PageNum);
- return
- } else {
- U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");
- }
- } else if (_el == 3) {
- if (this.Index > 0) {
- U.selectEl(_list[--this.Index]).addClass("U_MD_F_Y_Button_Active");
- this.PageNum--;
- this.pagefun(this.PageNum, _list);
- fun(this.PageNum);
- return
- } else {
- U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");
- }
- } else if (_el == 4) {
- if (this.PageNum < this.Pageall) {
- U.selectEl(_list[++this.Index]).addClass("U_MD_F_Y_Button_Active");
- this.PageNum++;
- this.pagefun(this.PageNum, _list);
- fun(this.PageNum);
- return
- } else {
- U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");
- }
- } else if (_el == 5) {
- this.pagefun(el, _list);
- fun(this.PageNum);
- return
- } else if (_el == 6) {
- var _number = new RegExp("^[0-9]*$")
- if (input.value.match(_number)) {
- if (input.value >= 1 && input.value <= this.Pageall) {
- this.PageNum = input.value;
- this.pagefun(this.PageNum, _list);
- fun(this.PageNum);
- } else {
- U.alert("无效的输入");
- U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");
- }
- }
- }
- },
-
- pagefun: function (el, list) {
- var _list = list;
- var elNum = parseInt(el.innerHTML) || el;
- U.selectEl(".U_MD_F_Y_Button_Active").removeClass("U_MD_F_Y_Button_Active");
- var _listLength = Math.ceil(_list.length / 2);
- var Index;
- var preIndex = this.Index;
- var difference = null;
- var lastPage = parseInt($(_list)[$(_list).length - 1].innerText);
-
- if (!(elNum < _listLength || (elNum > this.Pageall - _listLength && elNum <= this.Pageall))) {
-
-
- if (!(Math.ceil(lastPage / elNum) < lastPage - elNum) && this.Index != 0) {
- difference = elNum - parseInt(_list[_listLength - 1].innerText);
- [].__proto__.forEach.apply($(_list), [function (value, index, ar) {
- value.innerText = parseInt(value.innerText) + difference;
- }])
- this.Index = _listLength - 1;
- } else {
-
- difference = elNum - parseInt(_list[_listLength - 1].innerText);
- [].__proto__.forEach.apply($(_list), [function (value, index, ar) {
- value.innerText = parseInt(value.innerText) + difference;
- }])
- this.Index = _listLength - 1;
- }
- } else if (elNum > this.Pageall - _listLength && elNum <= this.Pageall) {
- var elthis = this;
- [].__proto__.forEach.apply($(_list), [
- function (value, index, ar) {
- value.innerText = elthis.Pageall + 1 - ar.length + index;
- }
- ])
- } else if (elNum < _listLength) {
- [].__proto__.forEach.apply($(_list), [function (value, index, ar) {
- value.innerText = index + 1;
- }])
- }
-
- [].__proto__.forEach.apply(_list, [function (value, index, ar) {
- if (parseInt(value.innerHTML) == elNum) {
- Index = index;
- }
- }])
- this.Index = Index;
- this.PageNum = elNum;
- U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");
- }
- };
- Namespace.register("U.MD.UI.picture");
- U.MD.UI.picture = function (arr, startPicNum) {
- if ($('#U_MD_UI_PictureForm')[0]) {
- if ($('#U_MD_UI_PictureForm')[0].style.display === 'none')
- U.selectEl('#U_MD_UI_PictureForm')[0].style.display = 'block';
- U.MD.UI.picture.DIVBOX = {
- "USERPICS": arr,
- "PICAREA": U.selectEl('#U_MD_UI_Picture_picArea')[0],
-
- "PICBOX": U.selectEl('#U_MD_UI_Picture_picBox')[0],
-
- 'FA': U.selectEl('#U_MD_UI_Picture_fa')[0]
- };
- U.MD.UI.picture.initloadPic(arr, startPicNum)
- return;
- }
- if (!arr.length)
- return
- U.MD.UI.picture.create(arr, startPicNum);
- U.MD.UI.picture.DIVBOX.PICAREA.onmousedown = function (e) { U.MD.UI.picture.mDown(U.MD.UI.picture.DIVBOX.PICAREA, U.MD.UI.picture.DIVBOX.PICBOX, e) }
- U.MD.UI.picture.wheel();
- }
- U.MD.UI.picture.FA = [
- { src: "/img/pictureView/add.png", id: "U_MD_UI_Picture_add" },
- { src: "/img/pictureView/narrow.png", id: "U_MD_UI_Picture_narrow" },
- { src: "/img/pictureView/prev.png", id: "U_MD_UI_Picture_prev" },
- { src: "/img/pictureView/next.png", id: "U_MD_UI_Picture_next" },
- { src: "/img/pictureView/turnLeft.png", id: "U_MD_UI_Picture_turnLeft" },
- { src: "/img/pictureView/turnRight.png", id: "U_MD_UI_Picture_turnRight" }
- ];
- U.MD.UI.picture.picnumber = 0;
- U.MD.UI.picture.rotatenum = 0;
- U.MD.UI.picture.originalSize = []
- U.MD.UI.picture.pics = [];
- U.MD.UI.picture.scalingvalue = 50;
- U.MD.UI.picture.focuspicsrc = '';
- U.MD.UI.picture.focuspicsize = '';
- U.MD.UI.picture.create = function (arr, startPicNum) {
- var _c = $$('div', { style: { height: "100%", "overflow": "hidden" }, id: "U_MD_UI_Picture_bossBox" });
- var _box = $$('div', { id: "U_MD_UI_Picture_picBox", className: 'U_MD_UI_Picture_picBox' }, _c);
- $$('div', { id: 'U_MD_UI_Picture_picArea', className: 'U_MD_UI_Picture_picArea' }, _box);
- var _functionalarea = $$('div', { style: { height: "60px", width: "100%", position: "absolute", bottom: "0", "background-color": "#ffffff", "text-align": "center" }, id: "U_MD_UI_Picture_fa" }, _c);
- new U.UF.UI.form(
- "<span id='U_MD_UI_Picture_imgInfo'></span> - <span id='U_MD_UI_Picture_r'>100%</span>",
- _c, { style: { width: document.documentElement.clientWidth / 1.5 + 'px', height: document.documentElement.clientHeight / 1.5 + 'px', position: "absolute" }, id: "U_MD_UI_PictureForm" }, { isdrag: true, isstretching: true, isenlarge: true, isclose: true, isnarrow: true }, { style: { "padding": "10px", "background-color": "#22508c" } }
- );
- _box.style.height = _box.clientHeight - 60 + 'px';
-
- U.MD.UI.picture.DIVBOX = {
- "USERPICS": arr,
- "PICAREA": U.selectEl('#U_MD_UI_Picture_picArea')[0],
-
- "PICBOX": U.selectEl('#U_MD_UI_Picture_picBox')[0],
-
- 'FA': U.selectEl('#U_MD_UI_Picture_fa')[0]
- };
-
- var _oDiv = $$('div', { style: { display: "inline-block", "line-height": "40px", "margin-top": "10px" } }, U.MD.UI.picture.DIVBOX.FA);
-
- for (var j = 0; j < U.MD.UI.picture.FA.length; j++) {
-
- var _span = $$('span', { style: { "background-image": "url(" + U.MD.UI.picture.FA[j].src + ")", width: "40px", height: "40px", display: "inline-block", margin: "0 15px" }, id: U.MD.UI.picture.FA[j].id }, _oDiv);
- }
- U.MD.UI.picture.initloadPic(null, startPicNum);
-
- U.selectEl('#U_MD_UI_Picture_add')[0].onclick = U.UF.C.apply(this, function () {
- this.changeSize(U.MD.UI.picture.scalingvalue, U.MD.UI.picture.rotatenum)
- });
-
- U.selectEl('#U_MD_UI_Picture_narrow')[0].onclick = U.UF.C.apply(this, function () {
- this.changeSize(-U.MD.UI.picture.scalingvalue, U.MD.UI.picture.rotatenum)
- });
-
- U.selectEl('#U_MD_UI_Picture_prev')[0].onclick = U.UF.C.apply(this, function () {
- this.prevPic(0)
- });
-
- U.selectEl('#U_MD_UI_Picture_next')[0].onclick = U.UF.C.apply(this, function () {
- this.prevPic(1)
- });
-
- U.selectEl('#U_MD_UI_Picture_turnLeft')[0].onclick = U.UF.C.apply(this, function () {
- this.turn(1)
- });
-
- U.selectEl('#U_MD_UI_Picture_turnRight')[0].onclick = U.UF.C.apply(this, function () {
- this.turn(0)
- });
- _c.onresize = function () {
- _box.style.height = _c.clientHeight - 60 + 'px';
- };
- _box.onresize = function () {
- U.MD.UI.picture.checkHeight();
- }
- }
- U.MD.UI.picture.initloadPic = function (arr, startPicNum) {
- if (arr) {
- U.MD.UI.picture.DIVBOX.PICAREA.innerHTML = "";
- U.MD.UI.picture.DIVBOX.PICAREA.style = null;
- U.MD.UI.picture.picnumber = startPicNum || 0;
- U.MD.UI.picture.rotatenum = 0;
- U.MD.UI.picture.DIVBOX.USERPICS = arr
- } else {
- U.MD.UI.picture.picnumber = startPicNum >= 0 ? startPicNum : 0;
- }
-
- U.MD.UI.picture.createPic();
-
- U.MD.UI.picture.pics = U.selectEl('#U_MD_UI_Picture_picArea > ul > li > img');
- U.MD.UI.picture.pics[U.MD.UI.picture.picnumber].onload = U.UF.C.apply(this, function () {
-
- this.originalSize = this.getImgNaturalDimensions(U.MD.UI.picture.pics[U.MD.UI.picture.picnumber]);
-
- this.checkHeight();
- });
- }
- U.MD.UI.picture.createPic = function () {
-
- var _ul = $$('ul', { id: "ul" }, U.MD.UI.picture.DIVBOX.PICAREA);
-
- for (var i = 0; i < U.MD.UI.picture.DIVBOX.USERPICS.length; i++) {
-
- var _li = $$('li', {}, _ul);
- if (typeof U.MD.UI.picture.DIVBOX.USERPICS[i] === 'object') {
-
- if (i === U.MD.UI.picture.picnumber) {
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.UI.picture.DIVBOX.USERPICS[i].src }, _li);
- U.MD.UI.picture.focuspicsrc = U.MD.UI.picture.DIVBOX.USERPICS[i].src;
- if (U.MD.UI.picture.DIVBOX.USERPICS[i].size)
- U.MD.UI.picture.focuspicsize = U.MD.UI.picture.DIVBOX.USERPICS[i].size;
- } else {
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.UI.picture.DIVBOX.USERPICS[i].src, style: { display: "none" } }, _li);
- }
- } else if (typeof U.MD.UI.picture.DIVBOX.USERPICS[i] === 'string') {
- if (i === U.MD.UI.picture.picnumber) {
-
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.UI.picture.DIVBOX.USERPICS[i] }, _li);
- U.MD.UI.picture.focuspicsrc = U.MD.UI.picture.DIVBOX.USERPICS[i];
- } else {
- $$('img', { "onerror": U.MD.C.imgError, src: U.MD.UI.picture.DIVBOX.USERPICS[i], style: { display: "none" } }, _li);
- }
- }
- }
- }
- U.MD.UI.picture.turn = function (num) {
-
- if (num) {
- U.MD.UI.picture.rotatenum--;
- U.MD.UI.picture.rotatenum < 0 ? U.MD.UI.picture.rotatenum = 3 : U.MD.UI.picture.rotatenum;
- } else {
- U.MD.UI.picture.rotatenum++;
- U.MD.UI.picture.rotatenum > 3 ? U.MD.UI.picture.rotatenum = 0 : U.MD.UI.picture.rotatenum;
- }
- U.MD.UI.picture.rotating();
- }
- U.MD.UI.picture.rotating = function () {
-
- var val = "rotate(" + U.MD.UI.picture.rotatenum * 90 + "deg)";
-
- if (U.MD.UI.picture.rotatenum % 2 !== 0) {
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.width = U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - 20 + 'px';
-
- U.MD.UI.picture.compatibleRotate(U.MD.UI.picture.DIVBOX.PICAREA, val);
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = (U.MD.UI.picture.DIVBOX.PICAREA.clientWidth / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / 2) + 10 + 'px';
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth / 2 + 'px';
-
- if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i) == "8.") || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i) == "7.")) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = "10px";
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / 2 + 'px';
- }
- } else {
-
- U.MD.UI.picture.DIVBOX.PICAREA.setAttribute('style', '');
-
- U.MD.UI.picture.compatibleRotate(U.MD.UI.picture.DIVBOX.PICAREA, val);
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.width = U.MD.UI.picture.originalSize[0] > U.MD.UI.picture.DIVBOX.PICAREA.clientWidth + 150 ? '1290px' : U.MD.UI.picture.DIVBOX.PICAREA.clientWidth + 150;
-
- U.MD.UI.picture.checkHeight();
- }
-
- U.selectEl('#U_MD_UI_Picture_r')[0].innerText = Math.round((U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / U.MD.UI.picture.originalSize[1]) * 100) + '%';
- }
- U.MD.UI.picture.compatibleRotate = function (el, val) {
-
- el.style.webkitTransform = val;
- el.style.MozTransform = val;
- el.style.mturnsTransform = val;
- el.style.OTransform = val;
- el.style.transform = val;
-
- if ((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i) == "8.") || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i) == "7."))
- el.style.filter = "progid:DXImageTransform.Microsoft.BasicImage(rotation=" + Math.abs(U.MD.UI.picture.rotatenum) + ")";
- }
- U.MD.UI.picture.prevPic = function (num) {
-
- U.MD.UI.picture.pics[U.MD.UI.picture.picnumber].style.display = 'none';
- if (num) {
-
- U.MD.UI.picture.picnumber++;
-
- if (U.MD.UI.picture.picnumber > U.MD.UI.picture.pics.length - 1)
- U.MD.UI.picture.picnumber = 0;
- } else {
-
- U.MD.UI.picture.picnumber--;
-
- if (U.MD.UI.picture.picnumber < 0)
- U.MD.UI.picture.picnumber = U.MD.UI.picture.pics.length - 1;
- }
- if (U.MD.UI.picture.DIVBOX.USERPICS[U.MD.UI.picture.picnumber].size)
- U.MD.UI.picture.focuspicsize = U.MD.UI.picture.DIVBOX.USERPICS[U.MD.UI.picture.picnumber].size;
- if (U.MD.UI.picture.DIVBOX.USERPICS[U.MD.UI.picture.picnumber].src)
- U.MD.UI.picture.focuspicsrc = U.MD.UI.picture.DIVBOX.USERPICS[U.MD.UI.picture.picnumber].src;
-
- U.MD.UI.picture.pics[U.MD.UI.picture.picnumber].style.display = 'block';
-
- U.MD.UI.picture.originalSize = U.MD.UI.picture.getImgNaturalDimensions(U.MD.UI.picture.pics[U.MD.UI.picture.picnumber]);
-
- U.MD.UI.picture.DIVBOX.PICAREA.setAttribute('style', '');
-
- U.MD.UI.picture.checkHeight();
-
- U.MD.UI.picture.rotatenum = 0;
- }
- U.MD.UI.picture.checkHeight = function () {
-
- var _proportion = U.MD.UI.picture.originalSize[0] / U.MD.UI.picture.originalSize[1];
-
- if (U.MD.UI.picture.originalSize[1] > U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - 40 || U.MD.UI.picture.originalSize[0] > U.MD.UI.picture.DIVBOX.PICBOX.clientWidth) {
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.width = Math.floor((U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - 40) * _proportion) + 'px';
- } else {
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.width = U.MD.UI.picture.originalSize[0] + 'px';
-
- }
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = (U.MD.UI.picture.DIVBOX.PICBOX.clientWidth - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth) / 2 + 'px';
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = (U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + 'px';
- if (typeof U.MD.UI.picture.DIVBOX.USERPICS[0] === 'object')
- U.selectEl('#U_MD_UI_Picture_imgInfo')[0].innerText = U.MD.UI.picture.focuspicsrc.toLowerCase().split('/').splice(-1)[0] + "(" + U.MD.UI.picture.originalSize[0] + "*" + U.MD.UI.picture.originalSize[1] + "px " + U.MD.UI.picture.focuspicsize + ")";
- else if (typeof U.MD.UI.picture.DIVBOX.USERPICS[0] === 'string')
- U.selectEl('#U_MD_UI_Picture_imgInfo')[0].innerText = U.MD.UI.picture.DIVBOX.USERPICS[U.MD.UI.picture.picnumber].toLowerCase().split('/').splice(-1)[0] + "(" + U.MD.UI.picture.originalSize[0] + "*" + U.MD.UI.picture.originalSize[1] + "px)";
- U.selectEl('#U_MD_UI_Picture_r')[0].innerText = Math.round((U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / U.MD.UI.picture.originalSize[1]) * 100) + '%';
- }
- U.MD.UI.picture.getImgNaturalDimensions = function (img) {
- var nWidth, nHeight;
- if (img.naturalWidth) {
- nWidth = img.naturalWidth;
- nHeight = img.naturalHeight
- } else {
- var image = new Image();
- image.src = img.src;
- nWidth = image.width;
- nHeight = image.height;
- }
- return [nWidth, nHeight]
- }
- U.MD.UI.picture.drag = function (dragEl, bossEl) {
- dragEl.onmousedown = function (e) {
- U.MD.UI.picture.mDown(dragEl, bossEl, e)
- }
- }
- U.MD.UI.picture.mDown = function (dragEl, bossEl, e) {
- e = e || window.event;
-
- var _distanceX = e.clientX - dragEl.offsetLeft;
-
- var _distanceY = e.clientY - dragEl.offsetTop;
- bossEl.onmousemove = function (e) {
- U.MD.UI.picture.mMove(dragEl, bossEl, _distanceX, _distanceY, e);
- }
-
- bossEl.onmouseup = function (e) {
- bossEl.onmousemove = null;
- bossEl.onmouseup = null;
- };
-
- if (e.preventDefault) {
-
- e.preventDefault();
- } else {
-
- dragEl.ondragstart = function () {
- return false;
- };
- dragEl.onselectstart = function () {
- return false;
- };
- }
- }
- U.MD.UI.picture.mMove = function (dragEl, bossEl, _distanceX, _distanceY, e) {
- e = e || window.event;
-
- var _left = e.clientX - _distanceX,
- _top = e.clientY - _distanceY;
-
- _left = U.MD.UI.picture.rotatenum % 2 === 0 ? Math.min(bossEl.clientWidth - bossEl.clientWidth / 8, _left) : Math.min(bossEl.clientWidth - bossEl.clientWidth / 8 - dragEl.clientWidth / 2 + dragEl.clientHeight / 2, _left);
-
- _left = U.MD.UI.picture.rotatenum % 2 === 0 ? Math.max(-dragEl.clientWidth + bossEl.clientWidth / 8, _left) : Math.max(-dragEl.clientWidth + bossEl.clientWidth / 8 + dragEl.clientWidth / 2 - dragEl.clientHeight / 2, _left);
-
- _top = U.MD.UI.picture.rotatenum % 2 === 0 ? Math.min(bossEl.clientHeight - bossEl.clientHeight / 8, _top) : Math.min(bossEl.clientHeight - bossEl.clientHeight / 8 + (dragEl.clientWidth - dragEl.clientHeight) / 2, _top);
-
- _top = U.MD.UI.picture.rotatenum % 2 === 0 ? Math.max(-dragEl.clientHeight + bossEl.clientHeight / 8, _top) : Math.max(-dragEl.clientHeight + bossEl.clientHeight / 8 - (dragEl.clientWidth - dragEl.clientHeight) / 2, _top);
-
- dragEl.style.left = _left + 'px';
- dragEl.style.top = _top + 'px';
- }
- U.MD.UI.picture.wheel = function () {
- U.MD.UI.picture.DIVBOX.PICBOX.onmousewheel = function () {
- this.getWheelDalta()
- }.bind(this);
- }
- U.MD.UI.picture.getWheelDalta = function (e) {
- e = e || window.event;
- var delta = 0;
-
- if (e.wheelDelta) {
-
- delta = e.wheelDelta / 120;
- if (window.opera) delta = -delta;
- } else if (e.detail) {
-
- delta = -e.detail / 3;
- }
-
- if (delta > 0) {
- U.MD.UI.picture.changeSize(U.MD.UI.picture.scalingvalue);
- } else {
- U.MD.UI.picture.changeSize(-U.MD.UI.picture.scalingvalue);
- }
-
- prevent(event);
- function prevent(evt) {
- if (evt.preventDefault) {
- evt.preventDefault();
- } else {
- evt.returnValue = false;
- }
- }
- }
- U.MD.UI.picture.changeSize = function (multiple) {
-
- var _addOver, _afterH, _afterW;
-
- _afterH = U.MD.UI.picture.DIVBOX.PICAREA.clientHeight;
- _afterW = U.MD.UI.picture.DIVBOX.PICAREA.clientWidth;
- _addOver = U.MD.UI.picture.DIVBOX.PICAREA.clientWidth + multiple;
-
- if ((_addOver / U.MD.UI.picture.originalSize[0]) * 100 < 20 && _addOver < 200) {
- return;
- } else if (((U.MD.UI.picture.DIVBOX.PICAREA.clientHeight + multiple) / U.MD.UI.picture.originalSize[1]) * 100 > 1000) {
- return
- }
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.width = _addOver + 'px';
-
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop - (U.MD.UI.picture.DIVBOX.PICAREA.clientHeight - _afterH) / 2 + 'px';
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft - multiple / 2 + 'px';
-
- if (((navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/8./i) == "8.") || (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/7./i) == "7.")) && U.MD.UI.picture.rotatenum % 2 !== 0) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / 2 + 'px';
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICBOX.clientHeight / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth / 2 + 'px';
- }
-
- var topY = U.MD.UI.picture.DIVBOX.PICAREA.clientHeight + U.MD.UI.picture.DIVBOX.PICAREA.offsetTop <= U.MD.UI.picture.DIVBOX.PICBOX.clientHeight / 8 ||
- ((U.MD.UI.picture.DIVBOX.PICAREA.clientWidth - (U.MD.UI.picture.DIVBOX.PICAREA.clientWidth - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + U.MD.UI.picture.DIVBOX.PICAREA.offsetTop <= U.MD.UI.picture.DIVBOX.PICBOX.clientHeight / 8) && U.MD.UI.picture.rotatenum % 2 !== 0),
- bottomY = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop >= U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - U.MD.UI.picture.DIVBOX.PICBOX.clientHeight / 8 ||
- ((Math.abs(U.MD.UI.picture.DIVBOX.PICBOX.clientHeight - (U.MD.UI.picture.DIVBOX.PICAREA.clientWidth - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 - U.MD.UI.picture.DIVBOX.PICAREA.offsetTop) <= U.MD.UI.picture.DIVBOX.PICBOX.clientHeight / 8) && U.MD.UI.picture.rotatenum % 2 !== 0),
- leftX = U.MD.UI.picture.DIVBOX.PICAREA.clientWidth + U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft <= U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 8 ||
- (U.MD.UI.picture.DIVBOX.PICAREA.clientHeight + (U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft + (U.MD.UI.picture.DIVBOX.PICAREA.clientWidth - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight / 2) <= U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 8 && U.MD.UI.picture.rotatenum % 2 !== 0),
- rightX = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft >= U.MD.UI.picture.DIVBOX.PICBOX.clientWidth - U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 8 ||
- ((U.MD.UI.picture.DIVBOX.PICBOX.clientWidth - (U.MD.UI.picture.DIVBOX.PICAREA.clientWidth - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 - U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft) <= U.MD.UI.picture.DIVBOX.PICBOX.clientWidth / 8 && U.MD.UI.picture.rotatenum % 2 !== 0);
- if (topY) {
- if (U.MD.UI.picture.rotatenum % 2 === 0) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop + (_afterH - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + 'px';
- } else {
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop + (_afterW - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth) / 2 + 'px';
- }
- }
- if (bottomY) {
- if (U.MD.UI.picture.rotatenum % 2 === 0) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop - (_afterH - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + 'px';
- } else {
- U.MD.UI.picture.DIVBOX.PICAREA.style.top = U.MD.UI.picture.DIVBOX.PICAREA.offsetTop - (_afterW - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth) / 2 + 'px';
- }
- }
- if (leftX) {
- if (U.MD.UI.picture.rotatenum % 2 === 0) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft + (_afterW - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth) / 2 + 'px';
- } else {
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft + (_afterH - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + 'px';
- }
- }
- if (rightX) {
- if (U.MD.UI.picture.rotatenum % 2 === 0) {
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft - (_afterW - U.MD.UI.picture.DIVBOX.PICAREA.clientWidth) / 2 + 'px';
- } else {
- U.MD.UI.picture.DIVBOX.PICAREA.style.left = U.MD.UI.picture.DIVBOX.PICAREA.offsetLeft - (_afterH - U.MD.UI.picture.DIVBOX.PICAREA.clientHeight) / 2 + 'px';
- }
- }
- U.selectEl('#U_MD_UI_Picture_r')[0].innerText = Math.floor((U.MD.UI.picture.DIVBOX.PICAREA.clientWidth / U.MD.UI.picture.originalSize[0]) * 100) + '%';
- };
- Namespace.register("U.MD.UI.video");
- U.MD.UI.video = function (src, width, height, autoplay, parent) {
- var _autoplay = autoplay || false;
- var _intervalTemp = null;
- var _volumeTemp = null;
- var _moving = false;
- var _tempHeight = "";
- var _tempWidth = "";
- var _fullscreen = false;
-
- var _els = U.MD.UI.video.appendEle(src, width, height, _autoplay, parent);
-
- U.MD.UI.video.addEvent(_els, _intervalTemp, _volumeTemp, _moving, height, width, _fullscreen);
- return _els;
- };
- U.MD.UI.video.appendEle = function (src, width, height, autoplay, parent) {
- var els = {};
-
- els.videoDiv = $$("div", { "className": "U_MD_UI_video_VideoDiv", "style": { "width": width + "px", "height": height + "px" } }, parent);
-
- els.video = $$("video", {
- "src": src,
- "className": "U_MD_UI_video_VideoMain",
- "autoplay": autoplay,
- "preload": "auto"
- }, els.videoDiv);
-
- els.controls = $$("div", { "className": "U_MD_UI_video_VideoControls" }, els.videoDiv);
-
- els.playPauseBtn = $$("div", { "className": "U_MD_UI_video_PlayPauseButton U_MD_UI_video_PlayIcon" }, els.controls);
-
- els.currentTimeDiv = $$("div", { "className": "U_MD_UI_video_Time", "innerHTML": "00:00" }, els.controls);
-
- els.progress = $$("div", { "className": "U_MD_UI_video_Progress" }, els.controls);
-
- els.progressCurrentTime = $$("div", { "className": "U_MD_UI_video_ProgressCurrentTime" }, els.progress);
-
- els.progressCircle = $$("div", { "className": "U_MD_UI_video_ProgressCircle" }, els.progressCurrentTime);
-
- els.DurationDiv = $$("div", {
- "className": "U_MD_UI_video_Time",
- "innerHTML": "00:00",
- "onselectstart": "return false;"
- }, els.controls);
-
- els.soundControls = $$("div", { "className": "U_MD_UI_video_SoundControls" }, els.controls);
-
- els.soundProgress = $$("div", { "className": "U_MD_UI_video_SoundProgress" }, els.controls);
-
- els.soundProgressCurrent = $$("div", { "className": "U_MD_UI_video_SoundProgressCurrent", "style": { "width": "100%" } }, els.soundProgress);
-
- els.fullScreenBtn = $$("div", { "className": "U_MD_UI_video_FullScreen" }, els.controls);
- return els;
- };
- U.MD.UI.video.addEvent = function (els, intervalTemp, volumeTemp, moving, tempHeight, tempWidth, fullscreen) {
-
- els.playPauseBtn.onclick = function (event) {
- U.MD.UI.playPauseBtnClick(event, els);
- };
- if (els.videoDiv.onwebkitfullscreenchange !== undefined) {
- els.videoDiv.onwebkitfullscreenchange = function () {
- var rtn = U.MD.UI.video.fullscreenChange(fullscreen, tempHeight, tempWidth, els);
- fullscreen = rtn[0];
- tempHeight = rtn[1];
- tempWidth = rtn[2];
- }
- } else if (els.videoDiv.onfullscreenchange !== undefined) {
- els.videoDiv.onfullscreenchange = function () {
- var rtn = U.MD.UI.video.fullscreenChange(fullscreen, tempHeight, tempWidth, els);
- fullscreen = rtn[0];
- tempHeight = rtn[1];
- tempWidth = rtn[2];
- }
- } else if (els.videoDiv.onmozfullscreenchange !== undefined) {
- els.videoDiv.onmozfullscreenchange = function () {
- var rtn = U.MD.UI.video.fullscreenChange(fullscreen, tempHeight, tempWidth, els);
- fullscreen = rtn[0];
- tempHeight = rtn[1];
- tempWidth = rtn[2];
- }
- }
-
- els.fullScreenBtn.onclick = function () {
- U.MD.UI.video.fullscreenClick(fullscreen, els);
- };
-
- els.progressCircle.onmousedown = function (event) {
- U.MD.UI.video.circleMove(event, moving, els);
- };
-
- els.soundProgress.onmousedown = function (event) {
- U.MD.UI.video.soundProgressMove(event, els, moving);
- };
-
- els.progress.onmousedown = function (event) {
- U.MD.UI.video.progressMove(event, els, moving);
- };
-
- els.video.onpause = function () {
- els.playPauseBtn.className = "U_MD_UI_video_PlayPauseButton U_MD_UI_video_PlayIcon";
- clearInterval(intervalTemp);
- };
-
- els.video.onplay = function () {
- els.playPauseBtn.className = "U_MD_UI_video_PlayPauseButton U_MD_UI_video_PauseIcon";
- intervalTemp = U.MD.UI.video.setInterval(moving, els);
- };
-
- els.video.oncanplay = function () {
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
- };
-
- els.soundControls.onclick = function () {
- volumeTemp = U.MD.UI.video.muteClick(els, volumeTemp, moving);
- };
-
- els.videoDiv.onclick = function () {
-
- };
- };
- U.MD.UI.video.displayControls = function (event, els) {
- var _target = event.target;
- if (_target === els.video || _target === els.videoDiv) {
- if (els.controls.style.display === "none") {
- els.controls.style.display = "block";
- } else {
- els.controls.style.display = "none";
- }
- }
- };
- U.MD.UI.playPauseBtnClick = function (event, els) {
- var _el = event.target;
- if (_el.className === "U_MD_UI_video_PlayPauseButton U_MD_UI_video_PlayIcon") {
- els.video.play();
- } else {
- els.video.pause();
- }
- };
- U.MD.UI.video.muteClick = function (els, volumeTemp, moving) {
- if (els.video.volume !== 0) {
- volumeTemp = els.video.volume;
- els.video.volume = 0;
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
- } else if (els.video.volume === 0 && volumeTemp !== null) {
- els.video.volume = volumeTemp;
- volumeTemp = null;
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
- }
- return volumeTemp;
- };
- U.MD.UI.video.fullscreenClick = function (fullscreen, els) {
- if (!fullscreen) {
- if (els.videoDiv.requestFullScreen) {
- els.videoDiv.requestFullScreen();
- } else if (els.videoDiv.webkitRequestFullScreen) {
- els.videoDiv.webkitRequestFullScreen();
- } else if (els.videoDiv.mozRequestFullScreen) {
- els.videoDiv.mozRequestFullScreen();
- }
- } else {
- if (document.exitFullScreen) {
- document.exitFullScreen();
- } else if (document.webkitCancelFullScreen) {
- document.webkitCancelFullScreen();
- } else if (document.webkitExitFullscreen) {
- document.webkitExitFullscreen();
- } else if (document.mozExitFullScreen) {
- document.mozExitFullScreen();
- }
- }
- };
- U.MD.UI.video.fullscreenChange = function (fullscreen, tempHeight, tempWidth, els) {
- if (!fullscreen) {
-
-
- els.videoDiv.style.height = "100vh";
- els.videoDiv.style.width = "100vw";
- els.videoDiv.style.position = "absolute";
- els.videoDiv.style.top = "0";
- els.videoDiv.style.left = "0";
- els.videoDiv.style.zIndex = "999";
- } else {
- els.videoDiv.style.height = tempHeight + "px";
- els.videoDiv.style.width = tempWidth + "px";
- els.videoDiv.style.position = "";
- els.videoDiv.style.top = "";
- els.videoDiv.style.left = "";
- els.videoDiv.style.zIndex = "";
- }
- fullscreen = !fullscreen;
- return [fullscreen, tempHeight, tempWidth];
- };
- U.MD.UI.video.timeFormat = function (time) {
- var _sec = parseInt(time % 60);
- var _min = parseInt(parseInt(time) / 60);
- (_sec < 10) ? _sec = "0" + _sec : _sec;
- (_min < 10) ? _min = "0" + _min : _min;
- return _min + ":" + _sec;
- };
- U.MD.UI.video.flushInfo = function (moving, currentTimeDiv, DurationDiv, progressCurrentTime, soundProgressCurrent, video) {
- if (moving) return;
- currentTimeDiv.innerHTML = U.MD.UI.video.timeFormat(video.currentTime);
- DurationDiv.innerHTML = U.MD.UI.video.timeFormat(video.duration);
- progressCurrentTime.style.width = video.currentTime / video.duration * 100 + "%";
- soundProgressCurrent.style.width = video.volume * 100 + "%";
- };
- U.MD.UI.video.getScreenLeft = function (el) {
- var _rtnLeft = el.offsetLeft;
- var _parent = el.offsetParent;
- while (_parent != null) {
- _rtnLeft += _parent.offsetLeft;
- _parent = _parent.offsetParent;
- }
- return _rtnLeft;
- };
- U.MD.UI.video.setInterval = function (_moving, _els) {
- return setInterval(function () {
- U.MD.UI.video.flushInfo(_moving, _els.currentTimeDiv, _els.DurationDiv, _els.progressCurrentTime, _els.soundProgressCurrent, _els.video);
- }, 500);
- };
- U.MD.UI.video.circleMove = function (event, moving, els) {
- moving = true;
- var _e = event;
- var _content = event.currentTarget;
- var _startX = _e.pageX;
- var _currentProgress = _content.parentElement;
- var _progress = _currentProgress.parentElement;
- els.videoDiv.onmousemove = function (e) {
- if (e.pageX - U.MD.UI.video.getScreenLeft(_progress) < 0 || e.pageX - U.MD.UI.video.getScreenLeft(_progress) > _progress.offsetWidth) {
- return;
- }
- var _iL = e.pageX - _startX;
-
- if (!(_currentProgress.offsetWidth + _iL > _progress.offsetWidth || _currentProgress.offsetWidth + _iL < 0) && (e.currentTarget.children[0].offsetWidth <= e.currentTarget.children[0].offsetWidth)) {
-
- _currentProgress.style.width = (_currentProgress.offsetWidth + _iL) / _progress.offsetWidth * 100 + "%";
-
- els.video.currentTime = (_currentProgress.offsetWidth + _iL) / _progress.offsetWidth * els.video.duration;
- }
- _startX = e.pageX;
- };
- els.videoDiv.onmouseup = function () {
- moving = false;
- els.videoDiv.onmousemove = function () {
- };
- els.videoDiv.onmouseup = function () {
- };
- };
- };
- U.MD.UI.video.soundProgressMove = function (event, els, moving) {
- event.preventDefault();
- var _e = event;
- var _content = event.currentTarget;
- var _startX = _e.pageX;
- var _currentSound = els.soundProgressCurrent;
- var _x = event.offsetX;
- var _length = _content.offsetWidth;
- els.video.volume = _x / _length;
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
-
- els.videoDiv.onmousemove = function (e) {
- if (e.pageX - U.MD.UI.video.getScreenLeft(els.soundProgress) < 0 || e.pageX - U.MD.UI.video.getScreenLeft(els.soundProgress) > els.soundProgress.offsetWidth) {
- return;
- }
- var _iL = e.pageX - _startX;
- if (!(_currentSound.offsetWidth + _iL > _content.offsetWidth || _currentSound.offsetWidth + _iL < 0)) {
- _currentSound.style.width = (_currentSound.offsetWidth + _iL) / _content.offsetWidth * 100 + "%";
- els.video.volume = _currentSound.offsetWidth / _content.offsetWidth;
- }
- _startX = e.pageX;
- };
- els.videoDiv.onmouseup = function (e) {
- els.videoDiv.onmousemove = function () {
- };
- els.videoDiv.onmouseup = function () {
- };
- };
- };
- U.MD.UI.video.progressMove = function (event, els, moving) {
- event.preventDefault();
- if (event.target.className === "U_MD_UI_video_ProgressCircle") {
- return;
- }
- var _e = event;
- var _content = event.currentTarget;
- var _startX = _e.pageX;
- var _currentProgress = els.progressCurrentTime;
- var _x = event.layerX || event.offsetX;
- var _length = _content.offsetWidth;
- els.video.currentTime = els.video.duration * (_x / _length);
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
- els.videoDiv.onmousemove = function (e) {
- if (e.pageX - U.MD.UI.video.getScreenLeft(els.progress) < 0 || e.pageX - U.MD.UI.video.getScreenLeft(els.progress) > els.progress.offsetWidth) {
- return;
- }
- moving = true;
- var _iL = e.pageX - _startX;
- if (!(_currentProgress.offsetWidth + _iL > els.progress.offsetWidth || _currentProgress.offsetWidth + _iL < 0)) {
- _currentProgress.style.width = (_currentProgress.offsetWidth + _iL) / els.progress.offsetWidth * 100 + "%";
- els.video.currentTime = (_currentProgress.offsetWidth + _iL) / els.progress.offsetWidth * els.video.duration;
- }
- _startX = e.pageX;
- };
- els.videoDiv.onmouseup = function () {
- moving = false;
- U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video);
- els.videoDiv.onmousemove = function () {
- };
- els.videoDiv.onmouseup = function () {
- };
- };
- };
- ;
- Namespace.register("U.MD.UI.BTree");
- U.MD.UI.BTree = function (arr, bookfun, dateDeleteFun, dateUpdateFun, dateInsertFun, tree, directory, list, listimg, deteimg, upimg) {
- U.MD.UI.BTree.jsonStartLeft(arr, tree[0], bookfun);
- U.MD.UI.BTree.jsonStartRight(tree[1], bookfun, dateDeleteFun, dateUpdateFun, dateInsertFun, directory, list, listimg, deteimg, upimg);
- }
- U.MD.UI.BTree.treeCreate = function (json, tree, onclickfun) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree);
- var _li = $$("li", { id: json[_i].id, parentid: json[_i].parentid, className: "U_MD_UI_Tree_listyle", parentid: json[_i].id, deep: json[_i].deep }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li);
- _ul.style.display = "none";
- if (json[_i].deep == "1") { _ul.style.display = "block" }
- _img.aa = false;
- var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0];
- _ul.style.display = _liobj.style.display;
- _li.onclick = function () {
- onclickfun(this);
- _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);
- if (_img.aa === true) {
- _img.aa = false;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "none";
- }
- } else {
- _img.aa = true;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "block";
- }
- }
- }
- if (json[_i].child) {
- U.MD.UI.BTree.treeCreate(json[_i].child, _ul, onclickfun);
- }
- }
- }
- U.MD.UI.BTree.JsonSelect = function (json, parentID) {
- var _json = [];
- for (var _i = 0; _i < json.length; _i++) {
- if (parentID == 0) {
- return json;
- }
- if (json[_i].id == parentID) {
- _json = json[_i].child;
- return _json;
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.JsonSelect(json[_i].child, parentID);
- }
- }
- return _return;
- }
- U.MD.UI.BTree.DirectoryCreate = function (json, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i, j) {
- if (i == 0) {
- list[1].style.display = "none";
- list[2].style.display = "none";
- } else {
- list[2].style.display = "none";
- list[i].style.display = "block";
- }
- var _buttonText = "修改";
- var _button1Text = "删除";
- if (deteurl && upurl) {
- _buttonText = "";
- _button1Text = "";
- }
- tree[i].innerHTML = "";
- list[i].parentID = jsonpid;
- list[i].deep = i + 1;
- if (j) {
- tree[j].innerHTML = "";
- }
- if (json) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_styleul", parentid: json[_i].parentID, deep: json[_i].deep }, tree[i]);
- var _li = $$("li", { className: "U_MD_UI_Tree_styleli", innerHTML: json[_i].name, parentid: json[_i].id }, _ul);
- var _button = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _buttonText, className: "U_MD_UI_Tree_button" }, _ul);
- var _button1 = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _button1Text, className: "U_MD_UI_Tree_button1" }, _ul);
-
- _button.onclick = function () {
- jsonupdate(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- _button1.onclick = function () {
- jsondelete(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- _li.onclick = function () {
- if (j) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, this.parentid), tree, list, this.parentid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, j);
- } else {
- if (i == 2) {
- } else {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, this.parentid), tree, list, this.parentid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- }
- }
- }
- }
- var add = U.selectEl(".U_MD_UI_Tree_add");
- if (add[i]) {
- list[i].removeChild(add[i]);
- }
- var _div = $$("div", { className: "U_MD_UI_Tree_add", innerHTML: "添加新分类" }, list[i]);
- _div.onclick = function () {
- jsonadd(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- }
- U.MD.UI.BTree.jsonAdd = function (json, addjson) {
- var _addid = addjson.parentID;
- if (_addid == "0") {
- json[json.length] = addjson;
- return json;
- }
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == _addid) {
- if (json[_i].child) {
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- } else {
- json[_i].child = [];
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- }
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonAdd(json[_i].child, addjson);
- json[_i].child = _return;
- }
- }
- return json;
- }
- U.MD.UI.BTree.jsonStartA = function (arr, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, tree, directory, mulu, muluimg, deteimg, upimg) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.BTree.jsonAdd(json, _json[_i]);
- }
- tree.innerHTML = "";
- U.MD.UI.BTree.jsonStartRight(tree, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, directory, mulu, muluimg, deteimg, upimg);
- }
- U.MD.UI.BTree.jsonStartRight = function (tree, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, directory, mulu, muluimg, deteimg, upimg) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " }, tree);
- var _li = $$("li", { className: "U_MD_UI_Tree_listyle", yid: "1" }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: muluimg, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: "目录管理", className: "U_MD_UI_Tree_spanstyle" }, _li);
- _li.onclick = function () {
- bookfun(this);
- U.MD.UI.BTree.DirectoryCreate(json, directory, mulu, 0,
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _ret = jsonDeleteFun(objects.pid);
- if (_ret) {
- json = U.MD.UI.BTree.jsonDelete(json, objects.pid);
- var _id = U.selectEl("#" + objects.pid)[0];
- if (_id) { _id.parentNode.remove(); }
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- }
- },
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _ret = jsonUpdateFun(U.MD.UI.BTree.jsonSelectA(json, objects.pid));
- json = U.MD.UI.BTree.jsonUpdate(json, _ret);
- var _id = U.selectEl("#" + objects.pid)[0];
- if (_id) {
- _id.childNodes[0].src = _ret.img_url;
- _id.childNodes[1].innerHTML = _ret.name;
- }
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- },
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _json = {};
- _json.parentID = objects.parentNode.parentID;
- _json.deep = objects.parentNode.deep;
- var _ret = jsonInsertFun(_json);
- var _post;
- if (_ret) {
- _post = U.selectEl(".U_MD_UI_Tree_a")[1];
- if (_post) {
- if (_ret.parentID == 0) {
- _post = U.selectEl(".U_MD_UI_Tree_a")[0].parentNode;
- } else {
- _post = U.selectEl("#" + _ret.parentID)[0].parentNode;
- }
- _js = [];
- _js[0] = _ret;
- U.MD.UI.BTree.treeCreate(_js, _post, bookfun);
- }
- json = U.MD.UI.BTree.jsonAdd(json, _ret);
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, _json.parentID), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, _json.parentID), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- }
- }, deteimg, upimg, 0);
- }
- }
- U.MD.UI.BTree.jsonStartLeft = function (arr, tree, bookfun) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.BTree.jsonAdd(json, _json[_i]);
- }
- tree.innerHTML = "";
- U.MD.UI.BTree.treeCreate(json, tree, bookfun);
- }
- U.MD.UI.BTree.jsonDelete = function (json, pid) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == pid) {
- json.splice(_i, 1);
- return json;
- } else {
- if (json[_i].child) {
- json[_i].child = U.MD.UI.BTree.jsonDelete(json[_i].child, pid);
- }
- }
- }
- return json;
- }
- U.MD.UI.BTree.jsonSelectA = function (json, id) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == id) {
- return json[_i];
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonSelectA(json[_i].child, id);
- if (_return) {
- return _return;
- }
- }
- }
- return false;
- }
- U.MD.UI.BTree.jsonUpdate = function (json, upjson) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == upjson.id) {
- json[_i] = upjson;
- return json;
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonUpdate(json[_i].child, upjson);
- if (_return) {
- json[_i].child = _return;
- return json;
- }
- }
- }
- return false;
- }
- U.MD.UI.BTree.createID = function (arr) {
- var _return = 0;
- for (var _i = 0; _i < arr.length; _i++) {
- if (parseInt(arr[_i].id) > _return) {
- _return = parseInt(arr[_i].id);
- }
- }
- return _return;
- };
- Namespace.register("U.MD.UI.editor");
- U.MD.UI.Editor = U.MD.UI.editor = function (parent, callback) {
- U.UF.DL.asynLoadCss({ "rel": "stylesheet", "type": "text/css", "href": "/css/Controls/Complex/Editor.css" });
-
-
-
-
- U.MD.UI.editor.createEditor(parent);
-
- U.UF.E.initEditor($('.editor', parent)[0], callback);
-
- U.MD.UI.editor.EditorEventBind(parent);
-
- U.MD.UI.editor.operateJson.editor = U.selectEl('.editor', parent)[0];
-
- return U.MD.UI.editor.operateJson;
-
- }
- U.MD.UI.editor.operateJson = {
-
- loadContent: function (text) {
- this.editor.focus();
- U.UF.E.onpaste(null, this.editor, text);
-
-
-
-
-
-
-
-
-
- },
-
- getContent: function () {
- return this.editor.innerHTML;
-
- }
- };
- U.MD.UI.editor.createEditor = function (parent) {
- parent.innerHTML =
- "<div class='toolbar' style=\"width: 788px;background-color: #f5f5f5;border: 1px solid #c7d3e1;line-height: 0;padding: 6px;height: 25px;\">\n" +
- " <button class=\"last\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/left.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"future\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/right.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- "<div class='setFont' style='float: left;margin: 0 3px;position: relative;padding:0px'></div>" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- "<div class='setSize' style='float: left;margin: 0 3px;position: relative;padding:0px'></div>" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <label style=\"float: left;margin: 0 3px;position: relative;\">\n" +
- " <button class=\"pic\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/pic.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <input multiple accept='image/*' type='file' class='picUpload' style='display: none;' />\n" +
- " </label>\n" +
- " <label style=\"float: left;margin: 0 3px;position: relative;\">\n" +
- " <button class=\"attachment\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;width: 25px;height: 25px;background: url(/img/YS2017.png) no-repeat;background-position: -1054px -593.5px;\"></button>\n" +
- " <input multiple=\"\" type=\"file\" class=\"attachmentUpload\" style=\"display: none;\">\n" +
- " </label>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <div style=\"float: left;margin: 0 3px;position: relative;padding:0px\">\n" +
- " <button class=\"fontColor\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/fontColor.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <div class='fontColorBar colorBar' style='display:none;position: absolute;'>\n" +
- " </div>\n" +
- " </div>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <div style=\"float: left;margin: 0 3px;position: relative;padding:0px\">\n" +
- " <button class=\"backgroundColor\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/blockColor.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <div class='backgroundColorBar colorBar' style='display:none;position: absolute;'>\n" +
- " </div>\n" +
- " </div>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"bIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/strong.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"iIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/i.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"UIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/x.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"SIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/-S-.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"textLeft\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textLeft.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"textCenter\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textCenter.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"textRight\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textRight.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\" >\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"a\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/a.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"b\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/b.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"c\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/c.png') no-repeat center;\">\n" +
- " </button>\n" +
- " </div>\n" +
- " <div class=\"editor\" contenteditable=\"true\" style=\"width: 800px;min-height: 300px;border: 1px solid #E6E5E5;overflow: auto;\">\n" +
- " </div>";
- U.selectEl('input.picUpload[type="file"]', parent)[0].onchange = function () {
- U.UF.E.picture(this, U.selectEl('.editor', parent)[0])
- }
- U.selectEl('input.attachmentUpload[type="file"]', parent)[0].onchange = function () {
- U.UF.E.attachment(this, U.selectEl('.editor', parent)[0])
- }
- };
- U.MD.UI.editor.EditorEventBind = function (parent) {
-
-
-
- var _font = U.MD.UI.Font();
-
- _font.style.cssText += "vertical-align: super;";
- var _size = U.MD.UI.WordSize();
-
- _size.style.cssText += "vertical-align: super;";
- U.selectEl('.setFont', parent).append(_font);
- _font.onchange = function () {
- U.UF.E.setRangeStyle({ 'font-family': _font.value });
- };
-
- U.selectEl('.setSize', parent).append(_size);
- _size.onchange = function () {
- U.UF.E.setRangeStyle({ 'font-size': _size.value });
- };
-
- U.selectEl('.pic', parent)[0].onclick = function () {
- U.selectEl('.picUpload', parent)[0].click();
- };
-
- U.selectEl('.attachment', parent)[0].onclick = function () {
- U.selectEl('.attachmentUpload', parent)[0].click();
- };
-
- U.selectEl('.bIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'font-weight': 'bold' });
- };
-
- U.selectEl('.iIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'font-style': 'italic' });
- };
-
- U.selectEl('.UIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'text-decoration': 'underline' });
- };
-
- U.selectEl('.SIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'text-decoration': 'line-through' });
- };
-
- U.selectEl('.fontColor', parent).bind('click', function () {
-
- if ($('.fontColorBar', parent).css('display') == "none") {
- U.MD.UI.colorPicker($('.fontColorBar', parent)[0], function (r) {
- U.selectEl('.MD_ColorPicker', U.selectEl('.fontColorBar', parent)[0]).remove();
- U.selectEl('.fontColorBar', parent).hide();
- U.UF.E.setRangeStyle({ 'color': r });
- });
- U.selectEl('.fontColorBar', parent).show();
- }
- });
- U.selectEl('.backgroundColor', parent).bind('click', function () {
-
- if ($('.backgroundColorBar', parent).css('display') == "none") {
- U.MD.UI.colorPicker($('.backgroundColorBar', parent)[0], function (r) {
- U.selectEl('.MD_ColorPicker', U.selectEl('.backgroundColorBar', parent)[0]).remove();
- U.selectEl('.backgroundColorBar', parent).hide();
- U.UF.E.setRangeStyle({ 'backgroundColor': r });
- });
- U.selectEl('.backgroundColorBar', parent).show();
- }
- });
-
-
-
-
-
-
-
-
-
-
-
- U.selectEl('.a', parent).bind('click', function () {
- U.UF.E.addHref();
- });
-
- U.selectEl('.c', parent).bind('click', function () {
- U.UF.E.clearStyle(U.UF.E.getRangeAt());
- });
-
- U.selectEl('.textLeft', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'left' });
- });
-
- U.selectEl('.textCenter', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'center' });
- });
-
- U.selectEl('.textRight', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'right' });
- });
-
- };
- U.MD.UI.editor.Select = function (choosecon, selattr, optionevent, parentnode) {
- var _id = "";
- selattr.id && (_id = selattr.id) && (delete selattr.id);
- var _selectEl = $$('div', { id: _id }, parentnode || null),
- _value = $$('div', selattr, _selectEl),
- _textarea = $$('div', {}, _value);
- $$('div', { style: { cssText: 'border-width: 6px 4px; border-style: solid; border-color: rgb(166, 178, 192) transparent transparent; width: 0; position: absolute; right: 4px; top: 50%; margin-top: -3px' } }, _value);
-
- var _con = $$('div', {
- datacontent: '',
- style: { cssText: 'display: none;position: absolute; margin-top:-1px; min-width: 100%; max-width: 280px; max-height: 200px ;border: 1px solid silver; overflow-x: hidden; cursor: pointer;' }
- }, _selectEl),
- _range;
-
-
-
-
-
- (selattr.style && !selattr.style.position) ? _selectEl.style.position = 'relative' : '';
- (selattr.style && !selattr.style.textIndent) ? _textarea.style.textIndent = '6px' : '';
-
- _textarea.style.whiteSpace = 'pre';
- _textarea.style.overflow = 'hidden'
- _textarea.style.width = _selectEl.offsetWidth - 15 + "px";
- for (var i in choosecon) {
- $$('div', {
- value: i,
- innerText: choosecon[i],
- style: { cssText: 'padding: 4px 6px; background: #fff' },
- onmouseover: function () {
- this.style.background = '#ccc'
- },
- onmouseout: function () {
- this.style.background = '#fff'
- },
- onclick: function () {
- _textarea.innerText = this.innerText;
- U.UF.E.reSelectRange(_range)
- optionevent(this.value || this.innerText);
- }
- }, _con);
- }
- for (var i in choosecon) {
- _textarea.innerText = choosecon[i];
- break;
- }
- _textarea.style.lineHeight = parseInt(_textarea.style.height) + 'px';
- _selectEl.onclick = function () {
- var _el = this.querySelector('div[datacontent]');
- U.UF.E.reSelectRange(_range)
- _el.style.display === 'block' ? _el.style.display = 'none' : _el.style.display = 'block';
- };
- U.selectEl(document).bind('click', function () {
- if (_con.style.display != 'none')
- _con.style.display = 'none'
- if ($(".BD_BorderPicker")[0]) {
- if ($(".BD_BorderPicker")[0].style.display != 'none')
- U.selectEl(".BD_BorderPicker")[0].style.display = 'none'
- }
- }, false);
- U.selectEl(_selectEl).bind('click', function (e) {
- U.UF.EV.stopBubble(e);
-
- });
- _selectEl.onmousedown = function () {
- _range = U.UF.E.getRangeAt()
- }
- return _selectEl;
- };
- ;
- Namespace.register("U.MD.UI.excel");;
- Namespace.register("U.MD.R");
- U.MD.R.data = {
- PID: "",
- AID: "",
- URL: "",
- PageIndex: 1,
- PageSize: 20,
- AllCount: "",
- CB: null
- }
- U.MD.R.reply = function (obj) {
-
-
- U.MD.R.login.cookieLogin(function () {
- var _type = obj.type,
- _el = obj.el,
- _cb = obj.cb;
- U.MD.R.data.PID = obj.pid;
- U.MD.R.data.AID = U.MD.R.reply.getUrlHash();
- U.MD.R.data.URL = U.MD.R.reply.getUrl();
- U.MD.R.data.CB = _cb;
-
- if (!_type) {
- _el = new U.UF.UI.form('', $$("div"), {
- "style": {
- "width": "800px",
- "height": "800px"
- }
- }).content;
- }
- U.MD.R.reply.init(_el);
- 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" });
- });
- }
- U.MD.R.reply.init = function (el) {
- var _pageindex = U.MD.R.data.PageIndex,
- _pagesize = U.MD.R.data.PageSize;
- U.MD.R.initPrintHtml(el);
- U.MD.R.getReplyData(_pageindex, _pagesize, function (data) {
- U.MD.R.data.AllCount = data[0][0] ? Math.ceil(data[0][0].allcount / U.MD.R.data.PageSize) : "";
- U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false);
- U.MD.R.initLoadMoreBtn(data[0]);
- });
- }
- U.MD.R.reply.getUrl = function () {
- return window.location.href;
- }
- U.MD.R.reply.getUrlHash = function () {
- return U.UF.EC.SparkMD5.hash(window.location.href);
- }
- U.MD.R.getReplyData = function (pageindex, pagesize, cb) {
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "test", U.MD.R.data.AID, "1", "", pageindex, pagesize], function (r) {
- cb && cb(r.value);
- });
- }
- U.MD.R.initPrintHtml = function (el) {
- var _el = el,
- _comment,
- _content,
- _content_operation,
- _userhead,
- _headimg,
- _operation,
- _username,
- _editorbox,
- _bottom,
- _picturewarp,
- _picture,
- _clear,
- _emoji_frame,
- _input,
- _button,
- _img_warp,
- _box;
- _comment = $$("div", { "className": "U_MD_R_comment" }, _el);
- _content = $$("div", { "className": "U_MD_R_content" }, _comment);
- _content_operation = $$("div", { "className": "U_MD_R_content_operation" }, _content);
- _userhead = $$("div", { className: "U_MD_R_content_operation_userhead U_MD_R_Reply_Header" }, _content_operation);
- _headimg = $$("img", {
- "className": "img",
- "src": "/img/UserHead/UseHead.jpg",
- "onerror": function () { this.src = '/img/UserHead/UseHead.jpg' }
- }, _userhead);
- _operation = $$("div", {
- "className": "U_MD_R_content_operation_right",
- style: { width: "calc(100% - 40px - 20px )" }
- }, _content_operation);
- U.selectEl(_operation).attr({
- "data-RPID": null,
- "data-RD": 1,
- "data-RPUID": null
- });
- _username = $$("div", {
- "innerHTML": "登录/注册",
- "className": "U_MD_R_content_operation_userlogin U_MD_R_Reply_Name"
- }, _operation);
-
- if (US.userInfo.userid) {
- _username.innerHTML = US.userInfo.username;
- _headimg.src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- } else {
- _username.onclick = function () {
- U.MD.R.login();
- }
- }
- _editorbox = $$("div", {
- "id": "editorbox",
- "className": "U_MD_R_Reply_Content",
- "contenteditable": "true",
- "style": { "min-height": "100px", "background": "#fff", "border": "1px solid black" }
- }, _operation)
- var _scrolltop = document.documentElement.scrollTop;
- U.UF.E.initEditor(_editorbox);
- document.documentElement.scrollTop = _scrolltop;
- _bottom = $$("div", { "className": "U_MD_R_content_operation_right_bottom" }, _operation);
- $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_emoji",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.UI.face(this, U.selectEl('#editorbox')[0]);
-
-
- U.selectEl("#U_MD_UI_face").css({ "position": "relative", "height": "140px", "overflow-y": "scroll", "top": "-150px", "width": "450px", "display": "block" });
- }
- }, _bottom);
- _picturewarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_picturewarp" }, _bottom);
- _picture = $$("img", { src: "/img/reply/img.png" }, _picturewarp);
- _input = $$("input", { "type": "file" }, _picturewarp);
- _button = $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_release",
- "innerHTML": "发表评论"
- }, _bottom);
- _button.onclick = function () {
- if ($(".U_MD_R_Reply_Content")[0].textContent != '' || U.selectEl(".U_MD_R_Reply_Content")[0].innerHTML != '') {
- U.MD.R.release(_operation, 1, false, 1);
- } else {
- U.alert("评论不能为空!");
- }
- }
- _img_warp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image" }, _operation);
- _box = $$("div", { "className": "U_MD_R_content_comment", "id": "U_MD_R_content_user_comment" }, _content);
- _input.onchange = function () {
- U.MD.R.uploadImages(this, _img_warp);
- }
- U.MD.R.data.CB && U.MD.R.data.CB();
- }
- U.MD.R.initLoadMoreBtn = function (data) {
- var _btn = $$("div", { "className": "U_MD_R_content_loading" }, U.selectEl(".U_MD_R_comment")[0]);
- if (data.length > 0) {
- if (U.MD.R.data.PageIndex < U.MD.R.data.AllCount) {
- _btn.innerHTML = "点击加载更多评论";
- _btn.onclick = function () {
- var _pageindex = ++U.MD.R.data.PageIndex,
- _pagesize = U.MD.R.data.PageSize;
- if (U.MD.R.data.PageIndex <= U.MD.R.data.AllCount) {
- U.MD.R.getReplyData(_pageindex, _pagesize, function (data) {
- U.MD.R.data.AllCount = Math.ceil(data[0][0].allcount / U.MD.R.data.PageSize);
- U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false);
- });
- } else {
- U.selectEl(_btn).hide();
- }
- }
- }
- } else {
-
- }
- }
- U.MD.R.printComment = function (el, type, data, appendtype, isreply, readmore) {
- var _count = U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", U.MD.R.data.PID]);
- if (_count.value[0].ProjectReplyEnable == 1) {
- var _el = el,
- _type = type,
- _data = data,
- _appendtype = appendtype,
- _isreply = isreply,
- _readmore = readmore,
- _shownum;
- for (var i = 0; i < data[0].length; i++) {
- if (readmore) {
- _shownum = data[0][i].TopReplyNum;
- } else {
- _shownum = U.Json.select(_data[2], { ReplyID: _data[0][i].ReplyID }).length > 0 ? U.Json.select(_data[2], { ReplyID: _data[0][i].ReplyID })[0].AllReplyNum : "0";
- }
- U.MD.R.printCommentHtml(_el, _type, {
- rid: _data[0][i].ReplyID,
- rpid: _data[0][i].ReplyParentID,
- deep: _data[0][i].ReplyDeep,
- topid: _data[0][i].ReplyID,
- uid: _data[0][i].UserID,
- un: _data[0][i].UserName,
- tx: _data[0][i].ReplyUserThumbnailImageHead,
- time: _data[0][i].ReplyAddTime,
- content: _data[0][i].ReplyContent,
- shownum: _shownum,
- likesnum: _type == 2 ? U.Json.select(_data[4], { ReplyID: _data[0][i].ReplyID })[0] : U.Json.select(_data[1], { ReplyID: _data[0][i].ReplyID })[0]
- }, _appendtype, _isreply, _readmore);
- }
- } else {
- var _btn = $$("div", { "className": "U_MD_R_content_loading" }, U.selectEl(".U_MD_R_comment")[0]);
- _btn.innerHTML = "该评论系统已关闭";
- U.selectEl("#U_MD_R_content_loading")[0].innerHTML = '';
- }
- }
- U.MD.R.viewComment = function (rid, type) {
- if (US.userInfo.userid) {
- var
- _rid = rid,
- _form,
- _data,
- _firstbox,
- _secondbox,
- _thirdbox,
- _type = type;
- _form = new U.UF.UI.form('', $$("div", { "style": { "padding": "20px" } }), {
- "style": {
- "width": "800px",
- "height": "600px"
- }
- });
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectThisReply", _rid], function (r) {
- _data = r.value;
- U.MD.R.printComment(_form.content, 2, _data, true, true, true);
- if (_type) {
- U.selectEl(_form.content).find(".U_MD_R_content_box_content_edit").show();
- }
- _firstbox = $$("div", { "className": "U_MD_R_content_warp_box" }, _form.content);
-
- for (var i = 0; i < _data[1].length; i++) {
- _secondbox = U.MD.R.printCommentHtml(_firstbox, 2, {
- rid: _data[1][i].ReplyID,
- rpid: _data[1][i].ReplyParentID,
- deep: _data[1][i].ReplyDeep,
- topid: _data[1][i].ReplyTopID,
- uid: _data[1][i].UserID,
- tx: _data[1][i].ReplyUserThumbnailImageHead,
- un: _data[1][i].UserName,
- time: _data[1][i].ReplyAddTime,
- content: _data[1][i].ReplyContent,
- likesnum: U.Json.select(_data[3], { ReplyID: _data[1][i].ReplyID })[0]
- }, false, true, true);
-
- _thirdbox = $$("div", { "className": "U_MD_R_content_warp_box" }, _secondbox);
- U.selectEl(_thirdbox).attr({ "data-replyid": _data[1][i].ReplyID });
- for (var j = 0; j < _data[2].length; j++) {
- if (_data[1][i].ReplyID == _data[2][j].ReplyParentID) {
- U.MD.R.printCommentHtml(_thirdbox, 3, {
- rid: _data[2][j].ReplyID,
- rpid: _data[2][j].ReplyParentID,
- deep: _data[2][j].ReplyDeep,
- topid: _data[2][j].ReplyTopID,
- uid: _data[2][j].UserID,
- tx: _data[2][j].ReplyUserThumbnailImageHead,
- un: _data[2][j].UserName,
- time: _data[2][j].ReplyAddTime,
- content: _data[2][j].ReplyContent,
- likesnum: U.Json.select(_data[3], { ReplyID: _data[2][j].ReplyID })[0],
- replyinfo: {
- uid: _data[2][j].uid,
- un: _data[2][j].un,
- tx: _data[2][j].tx
- }
- }, false, true, true);
- }
- }
- }
- });
- } else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.printCommentHtml = function (el, type, data, appendtype, isreply, readmore) {
- var _data = data,
- _el = el,
- _type = type,
-
-
- _rid = _data.rid,
- _rpid = _data.rpid,
- _deep = _data.deep,
- _topid = _data.topid,
- _uid = _data.uid,
- _tx = _data.tx,
- _un = _data.un,
- _time = _data.time,
- _datacontent = _data.content,
- _likesnumjson = _data.likesnum,
- _showmoretxtjson = _data.shownum,
- _replyinfo_uid = _data.replyinfo ? _data.replyinfo.uid : "",
- _replyinfo_un = _data.replyinfo ? _data.replyinfo.un : "",
- _replyinfo_tx = _data.replyinfo ? _data.replyinfo.tx : "",
- _appendtype = appendtype,
- _isreply = isreply,
- _readmore = readmore,
- _box,
- _info,
- _head,
- _headimg,
- _content,
- _content_top,
- _username,
- _commenttime,
- _text,
- _content_bottom,
- _likeswarp,
- _likesimg,
- _likesnum,
- _replywarp,
- _showmorewarp,
- _showmoretext,
- _position,
- _contenteditable,
- _bottom,
- _picturewarp,
- _picture,
- _input,
- _button,
- _img_warp,
- _childrenbox;
- _box = $$("div", { "className": "U_MD_R_content_box" });
- if (_appendtype) {
- U.selectEl(_el).append(_box, 0, U.selectEl(_el)[0].firstChild);
- } else {
- U.selectEl(_el).append(_box);
- }
- _info = $$("div", { "className": "U_MD_R_content_box_warp" }, _box);
- U.selectEl(_info).attr({
- "data-rid": _rid,
- "data-RPID": _rpid,
- "data-RD": _deep,
- "data-RBID": _topid,
- "data-RPUID": _uid
- });
- _head = $$("div", { "className": "U_MD_R_content_box_userhead" }, _info);
- _headimg = $$("img", {
- "src": _tx,
- onerror: "U.MD.R.imgError(this)"
- }, _head);
- _content = $$("div", {
- "className": "U_MD_R_content_box_content",
- style: { width: "calc(100% - 40px - 20px )" }
- }, _info);
- _content_top = $$("div", { "className": "U_MD_R_content_box_content_top" }, _content);
- _username = $$("div", {
- "className": "U_MD_R_content_box_content_top_name",
- "innerHTML": _un
- }, _content_top);
- if (_type == 3) {
- _username.innerHTML = _un + '回复@' + _replyinfo_un;
- }
- _commenttime = $$("div", {
- "className": "U_MD_R_content_box_content_top_time",
- "innerHTML": _time
- }, _content_top);
- _text = $$("div", { "className": "U_MD_R_content_box_content_text", "innerHTML": _datacontent }, _content);
- if ($(_text).find("img").length > 0) {
- U.selectEl(_text).find("img")[0].onclick = function () {
-
- U.MD.UI.picture([this.src], 0);
- U.selectEl("#U_MD_UI_PictureForm").css("position", "fixed");
- U.UF.F.topWindow($('#U_MD_UI_PictureForm')[0], true);
- }
- }
- _content_bottom = $$("div", { "className": "U_MD_R_content_box_content_bottom" }, _content);
- _likeswarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_likeswarp" }, _content_bottom);
- _likeswarp.onclick = function () {
- U.MD.R.like(this, _rid, US.userInfo.userid);
- }
- _likesimg = $$("img", { "src": "/img/reply/NOFabulous.png" }, _likeswarp);
- _likesnum = $$("div", {
- "className": "U_MD_R_content_box_content_bottom_likeswarp_text",
- "innerHTML": 0
- }, _likeswarp);
- if (_likesnumjson) {
- _likesnum.innerHTML = _likesnumjson.ReplyNum;
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectRepeatLikes_Moblie", _rid, US.userInfo.userid], function (r) {
- if (r.value[0].mode == 1) {
- _likesimg.src = "/img/reply/NOFabulous.png";
- } else if (r.value[0].mode == 0) {
- _likesimg.src = "/img/reply/Fabulous.png";
- } else {
- _likesimg.src = "/img/reply/NOFabulous.png";
- }
- })
-
- }
- _replywarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_replywarp" }, _content_bottom);
- if (_readmore) {
- _replywarp.onclick = function () {
- U.MD.R.subsetReply(this);
- }
- } else {
- _replywarp.onclick = function () {
- U.MD.R.viewComment(_rid, true);
- }
- }
- $$("img", {
- "src": "/img/reply/reply.png"
- }, _replywarp);
- $$("div", {
- "innerHTML": "回复",
- "className": "U_MD_R_content_box_content_bottom_replywarp_text"
- }, _replywarp);
- if (_type == 1) {
- _showmorewarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_showmorewarp" }, _content_bottom);
- $$("img", {
- "src": "/img/reply/list.png"
- }, _showmorewarp);
- _showmoretext = $$("div", {
- "className": "U_MD_R_content_box_content_bottom_showmore_text"
- }, _showmorewarp);
- if (_readmore) {
- _showmoretext.className = "U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_secondary"
- _showmoretext.innerHTML = _showmoretxtjson ? "共有(" + "<span>" + _showmoretxtjson + "</span>" + ")条评论" : "没有评论(" + "<span>0</span>" + ")";
- } else {
- _showmoretext.className = "U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_important"
- _showmoretext.innerHTML = _showmoretxtjson ? "查看更多(" + "<span>" + _showmoretxtjson + "</span>" + ")" : "查看更多(" + "<span>" + 0 + "</span>" + ")";
- _showmorewarp.onclick = function () {
- U.MD.R.viewComment(_rid, false);
- }
- }
- }
- if (_type == 1 && !readmore && U.selectEl(".U_MD_R_content_loading")[0]) {
- if (U.MD.R.data.PageIndex < U.MD.R.data.AllCount) {
- U.selectEl(".U_MD_R_content_loading")[0].innerHTML = "点击加载更多评论";
- } else {
- U.selectEl(".U_MD_R_content_loading").hide();
- }
- }
- if (_type == 2 || _type == 3 || (_type == 1 && readmore)) {
- _contenteditable = $$("div", {
- "className": "U_MD_R_content_box_content_edit",
- "style": { "display": "none" }
- }, _content);
- _replyinput = $$("div", { "className": "U_MD_R_Reply_Content", "contenteditable": "true" }, _contenteditable);
- _bottom = $$("div", { "className": "U_MD_R_content_operation_right_bottom" }, _contenteditable);
- $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_emoji",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.UI.face(this, _replyinput);
- U.selectEl(this)[0].append($("#U_MD_UI_face")[0]);
- U.selectEl("#U_MD_UI_face").css({ "position": "relative", "height": "140px", "overflow-y": "scroll", "top": "-150px", "width": "450px", "display": "block" });
- }
- }, _bottom);
- _picturewarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_picturewarp" }, _bottom);
- _picture = $$("img", { src: "/img/reply/img.png" }, _picturewarp);
- _input = $$("input", { "type": "file" }, _picturewarp);
- _input.onchange = function () {
- U.MD.R.uploadImages(this, _img_warp);
- }
- _button = $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_release",
- "innerHTML": "发表评论"
- }, _bottom);
- _button.onclick = function () {
- if (_type == 1) {
- _position = 2;
- } else if (_type == 2) {
- _position = 3;
- } else if (_type == 3) {
- _position = 4;
- }
- U.MD.R.release(_info, _type, false, _position);
- }
- _img_warp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image" }, _contenteditable);
- if (_type != 3) {
- _childrenbox = $$("div", { "className": "U_MD_R_content_comment" }, _box);
- }
- return _childrenbox;
- }
- }
- U.MD.R.uploadImages = function (input, el) {
- var _el = el,
- _imgwarp, _img, _filetype, _imgtype = /.*(jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG)$/;
- U.selectEl(_el)[0].innerHTML = "";
- _imgwarp = $$("div", {}, _el);
- _img = $$("img", {
- "src": "/img/Reply/loading.gif",
- "style": { "width": "100px", "height": "100px", "margin-right": "10px" }
- }, _imgwarp);
- U.UF.UP.inputUpload([input], "http://disk.1473.cn/USUpfile.ashx?typename=UseStudioEditor&UserId=FA92AAC5-4134-449F-9659-0DC12F4F68E9", function (r) {
- _filetype = r.value[0].split(".")[1];
- if (_filetype.match(_imgtype)) {
- U.selectEl(_imgwarp).remove();
- _imgwarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox_warp" }, _el);
- $$("img", { "src": "http://fs.1473.cn/" + r.value[0] }, _imgwarp);
- $$("div", { "className": "closebtn", "onclick": "U.MD.R.uploadImages.close(this)" }, _imgwarp);
- U.alert("上传成功");
- } else {
- U.alert("请上传图片文件");
- return;
- }
- }, []);
- }
- U.MD.R.uploadImages.close = function (el) {
- U.selectEl(el).Parent().remove();
- }
- U.MD.R.subsetReply = function (el) {
-
- var _el = U.selectEl($(el).Parent(2)).find(".U_MD_R_content_box_content_edit");
- if (_el[0].style.display == "block") {
- _el.hide();
- } else {
- _el.show();
- }
- }
- U.MD.R.release = function (el, type, isreply, position) {
- if (US.userInfo.userid) {
- var _el = el,
- _type = type,
- _isreply = isreply,
- _position = position,
- _content = U.selectEl(_el).find(".U_MD_R_Reply_Content")[0],
- _imgwarp = U.selectEl(_el).find(".U_MD_R_Reply_Image"),
- _uid = US.userInfo.userid,
- _un = US.userInfo.username,
- _utx = "http://fs.1473.cn/" + US.userInfo.UserImageHead,
- _box;
- if (_content.innerHTML.trim() != "" || _imgwarp.find("img").length > 0) {
- var _rid = Guid.newGuid(),
- _rpid = U.selectEl(el).attr("data-rid"),
- _pid = U.MD.R.data.PID,
- _aid = U.MD.R.data.AID,
- _rc = "",
- _rip = US.userInfo.RegisterIP,
- _url = U.MD.R.data.URL,
- _ra = null,
- _rd = U.selectEl(el).attr("data-rd"),
- _rbid = U.selectEl(el).attr("data-rbid"),
- _rpuid = U.selectEl(el).attr("data-rpuid"),
- _re = 1;
- if (position == 1) {
- _rd = 1;
- } else if (position == 2 || position == 3) {
- _rd = parseInt($(el).attr("data-rd")) + 1;
- } else {
- _rd = 3;
- _rpid = U.selectEl(el).attr("data-rpid");
- }
- if ($(_imgwarp).find("img").length > 0) {
- _rc = _content.innerHTML.trim() + _imgwarp.find("img")[0].outerHTML;
- } else {
- _rc = _content.innerHTML;
- }
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_InsertReply", _rid, _rpid, _pid, _aid, _uid, _un, _utx, _rc, _rip, _url, _ra, _rd, _rpuid, _re, U.MD.R.getNowFormatDate()], function (r) {
- var _data = r.value[0],
- _appendtype, _readmore,
- _more = U.selectEl("div[data-rid='" + _data.ReplyParentID + "']").find(".U_MD_R_content_box_content_bottom_showmore_text_important span")[0],
- _more1 = U.selectEl("div[data-rid='" + _data.ReplyParentID + "']").find(".U_MD_R_content_box_content_bottom_showmore_text_secondary span")[0];
- U.selectEl(_el).find(".U_MD_R_Reply_Content")[0].innerHTML = "";
- U.UF.E.initEditor($(_el).find(".U_MD_R_Reply_Content")[0]);
- U.selectEl(_el).find(".U_MD_R_Reply_Image")[0].innerHTML = "";
- if (_position == 1) {
- _readmore = false;
- _appendtype = true;
- _el = U.selectEl("#U_MD_R_content_user_comment")[0];
- } else {
- _readmore = true;
- _val = _more.innerText;
-
- if (_position == 2) {
- _el = U.selectEl(_el).Parent().nextSibling;
- _type = 2;
- _appendtype = true;
- }
- if (_position == 3) {
- if ($($(_el)[0].nextSibling).find(".U_MD_R_content_warp_box").length > 0) {
- _el = U.selectEl($(_el)[0].nextSibling).find(".U_MD_R_content_warp_box");
- } else {
- _el = $$("div", { "className": "U_MD_R_content_warp_box" }, U.selectEl($(_el)[0].nextSibling)[0]);
-
- }
- _type = 2;
- }
- if (_position == 4) {
- _el = U.selectEl($(_el).Parent()).Parent();
- _type = 3;
- }
- _more.innerText = ++_val;
-
- U.selectEl($(_content).Parent()).hide();
- }
- var _box = U.MD.R.printCommentHtml(_el, _type, {
- rid: _data.ReplyID,
- rpid: _data.ReplyParentID,
- deep: _data.ReplyDeep,
- topid: _data.ReplyTopID,
- uid: _data.UserID,
- tx: _data.ReplyUserThumbnailImageHead,
- un: _data.UserName,
- time: U.MD.R.getNowFormatDate() + '.0',
- content: _data.ReplyContent,
- replyinfo: {
- uid: _data.uid,
- un: _data.un,
- tx: _data.tx
- }
- }, _appendtype, _isreply, _readmore);
-
-
-
-
- U.alert("评论成功");
- });
- } else {
- U.alert("请输入评论内容");
- }
- } else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.like = function (e, rid, uid) {
- if (US.userInfo.userid) {
- var _el = e,
- _rid = rid,
- _uid = uid;
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectRepeatLikes", _rid, _uid], function (r) {
- var _img = U.selectEl(_el).find("img")[0],
- _text = U.selectEl(_el).find(".U_MD_R_content_box_content_bottom_likeswarp_text")[0],
- _val = parseInt(_text.innerHTML);
- if (r.value[0].mode == 0) {
- _img.src = "/img/reply/NOFabulous.png";
- _text.innerHTML = --_val;
- } else {
- _img.src = "/img/reply/Fabulous.png";
- _text.innerHTML = ++_val;
- }
- });
- } else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.imgError = function (el) {
- U.selectEl(el)[0].src = "/img/UserHead/UseHead.jpg";
- }
- U.MD.R.login = function () {
- if ($("#U_MD_HomeC_Pop")[0]) {
- U.UF.F.windowTopCenter($("#U_MD_HomeC_Pop")[0]);
- } else {
- U.UF.CD.loadPageCrossDomain(function () { });
- U.MD.U.L.setLoginCallBack(function () {
- U.MD.R.login.cb();
- });
- }
- }
- U.MD.R.login.cookieLogin = function (cb) {
- if (U.UF.Cookie.get("usestudiosso") && U.UF.Cookie.get("usestudiosso", "userid")[0]) {
- U.UF.CD.loadPageCrossDomain(function () {
- U.MD.U.L.loginCallBack = function () {
- cb && cb();
- U.selectEl(".U_MD_R_content_operation_userhead img")[0].src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML = US.userInfo.username;
- }
- });
- } else {
- cb && cb();
- }
- }
- U.MD.R.login.cb = function () {
- U.selectEl(".U_MD_R_content_operation_userhead img")[0].src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML = US.userInfo.username;
- }
- U.MD.R.getNowFormatDate = function () {
- var date = new Date();
- var seperator1 = "-";
- var seperator2 = ":";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
- " " + date.getHours() + seperator2 + date.getMinutes() +
- seperator2 + date.getSeconds();
- return currentdate;
- }
- ;
- Namespace.register("U.MD.UI.table");
- U.MD.UI.table = function (datasource, titles, css, parent) {
- U.MD.UI.table.thead(datasource, titles, css, parent);
-
- }
- U.MD.UI.table.thead = function (datasource, titles, css, parent, index, prows) {
- if (!index) {
-
- index = 1;
-
- prows = datasource.length;
- }
- var _table, _thead, _tr, _tbody;
-
- _table = $$("table", {
- style: {
- "text-align": "center",
- "position": "relative",
- "width": " 100%",
- "border-collapse": " collapse",
- "border-width": " 1px",
- "border-style": " solid",
- "border-color": " rgb(213, 213, 213)",
- "border-image": " initial",
- "display": "table"
- }
- }, parent);
-
- _thead = $$("thead", {}, _table);
-
- _tr = $$("tr", {}, _thead);
-
- for (var num in titles) {
-
- if (typeof titles[num] === "object") {
-
- $$("th", {
- innerHTML: titles[num].name,
- style: {
- "cssText": css[num],
- "padding": "10px 0",
- "font-weight": "normal",
- "border": "1px solid #d5d5d5"
- },
- id: "th"
- }, _tr);
-
- } else {
- $$("th", {
- innerHTML: titles[num],
- style: {
- "cssText": css[num],
- "padding": "10px 0",
- "font-weight": "normal",
- "border": "1px solid #d5d5d5"
- },
- id: "th"
- }, _tr);
-
- }
- }
- _tbody = $$("tbody", { style: { cssText: "width:100%;" }, id: "tbody" }, _table);
-
- U.MD.UI.table.tbody(_tbody, datasource, titles, css, index, prows);
-
- return _tbody;
-
- }
- U.MD.UI.table.tbody = function (parent, datasource, titles, css, index, prows) {
- var _tr, _td, _div, _neirong;
-
- for (var num = (index - 1) * prows; num < index * prows && num < datasource.length; num++) {
-
- if (num % 2 != 0) {
-
- _tr = $$("tr", { style: { cssText: "background-color: #FFF;" }, id: "tr" }, parent);
-
- } else {
- _tr = $$("tr", { style: { cssText: "background-color: #dde4ee;" }, id: "tr" }, parent);
-
- }
- for (var name in titles) {
-
- _td = $$("td", { id: "td" }, _tr);
-
- if (titles[name].content) {
- for (var k = 0; k < titles[name].content.length; k++) {
-
- _div = U.MD.UI.table.printDiv(_td, titles[name].content[k]);
-
- if (titles[name].content[k].onclick) {
- U.MD.UI.table.onclick(_div, datasource[num], titles[name].content[k].onclick);
- }
-
- }
- } else {
- _div = $$("div", { innerHTML: datasource[num][name], style: { "overflow": "hidden", "cssText": css[name] } }, _td);
- if (titles[name].id) {
- _div.id = datasource[num][titles[name].id];
- }
- }
- }
- }
- }
- U.MD.UI.table.pageTable = function (datasource, titles, css, prows, index, parent) {
- var _div = $$("div", {
- "style": {
- "left": "0px",
- "right": "0px",
- "width": "100%",
- "margin": "0 auto",
- "top": "200px"
- }
- }, parent);
-
- var _tdiv = $$("div", {}, _div);
-
- var _tbody = U.MD.UI.table.thead(datasource, titles, css, _tdiv, index, prows);
-
- var _pdiv = $$("div", { "style": { "width": "650px", "margin": "20px auto 0 auto" } }, _div);
- new U.UF.P.page(_pdiv, datasource.length, prows, index, function (page) {
-
- U.MD.UI.table.delChild(_tbody);
-
- U.MD.UI.table.tbody(_tbody, datasource, titles, css, page, prows);
-
- });
- }
- U.MD.UI.table.delChild = function (obj) {
- for (var num = obj.children.length - 1; num >= 0; num--) {
-
- obj.removeChild(obj.children[num])
-
- }
- }
- U.MD.UI.table.onclick = function (obj, datasource, fun) {
- obj.onclick = function () {
-
- fun(datasource);
- }
- }
- U.MD.UI.table.printDiv = function (parent, content) {
- var _div;
-
- if (typeof content.name == "string") {
-
- _div = $$("div", { "innerHTML": content.name }, parent);
- }
-
- if (typeof content.name == "object") {
-
- var _dd = content.name.cloneNode(true);
- parent.appendChild(_dd);
- _div = _dd;
- }
- return _div;
- };
- Namespace.register("U.MD.UI.Tree");
- U.MD.UI.Tree = function (arr, treeaction, bookfun, leftfun) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.Tree.jsonAdd(json, _json[_i]);
- }
- treeaction.innerHTML = "";
- U.MD.UI.Tree.treeCreate(json, treeaction, bookfun);
- treeaction.oncontextmenu = function (e) {
- e.preventDefault();
- };
- treeaction.onmousedown = function (e) {
- if (e.button == 2) {
- leftfun(e, bookfun);
- }
- }
- }
- U.MD.UI.Tree.treeCreate = function (json, tree, onclickfun) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree);
- var _li = $$("li", { id: json[_i].id, parentid: json[_i].parentid, className: "U_MD_UI_Tree_listyle", parentid: json[_i].id, deep: json[_i].deep }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li);
- _ul.style.display = "none";
- if (json[_i].deep == "1") { _ul.style.display = "block" }
- _img.aa = false;
- var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0];
- _ul.style.display = _liobj.style.display;
- _li.onclick = function () {
- onclickfun(this);
- _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);
- if (_img.aa === true) {
- _img.aa = false;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "none";
- }
- } else {
- _img.aa = true;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "block";
- }
- }
- }
- if (json[_i].child) {
- U.MD.UI.Tree.treeCreate(json[_i].child, _ul, onclickfun);
- }
- }
- }
- U.MD.UI.Tree.jsonAdd = function (json, addjson) {
- var _addid = addjson.parentID;
- if (_addid == "0") {
- json[json.length] = addjson;
- return json;
- }
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == _addid) {
- if (json[_i].child) {
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- } else {
- json[_i].child = [];
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- }
- }
- if (json[_i].child) {
- var _return = U.MD.UI.Tree.jsonAdd(json[_i].child, addjson);
- json[_i].child = _return;
- }
- }
- return json;
- }
- U.MD.UI.Tree.rightOnclick = function (rightButton, e) {
- var _li = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "新建文件夹", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep) + 1 }, rightButton);
- var _li1 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "重命名", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep) + 1 }, rightButton);
- var _li2 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "删除", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep + 1) }, rightButton);
- var _return = [];
- _return[0] = _li;
- _return[1] = _li1;
- _return[2] = _li2;
- return _return;
- }
- U.MD.UI.Tree.createID = function (arr) {
- var _return = 0;
- for (var _i = 0; _i < arr.length; _i++) {
- if (parseInt(arr[_i].id) > _return) {
- _return = parseInt(arr[_i].id);
- }
- }
- return _return;
- };
- Namespace.register("U.MD.UI.txt");;
- ;
|