12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840 |
-
- 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: "Confirm",
- 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": "Cancel",
- "onclick": function() {
- U.UF.C.isFunction(cancelFun) && cancelFun();
- U.UF.F.closeWindow(_form.form);
- }
- }, _footer);
-
- var _form = new U.UF.UI.form(
- "Reminder",
- _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": "Close",
- "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 });
- U.MD.N.urlWrite("", "智慧课堂平台");
- }
- } 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": "Maximize",
- "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": "Minimize",
- "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");;
- ;
|