| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816 | ///<jscompress sourcefile="Banner.js" />//电脑端banner滑块控件命名空间Namespace.register("U.MD.UI.slider");/**电脑端banner滑块控件*//**@box {object} 存放控件的div的id@imgarr {array} 存放图片的数组@speed {string} 轮播速度@cut {bool} 判断左右切换按钮是否出现@dot {bool} 判断小圆点是否出现@cb {回调callback} 引用方法**/U.MD.UI.slider = function(box, imgarr, attr) {        //定义传输进来的参数        var _speed = attr.speed;        var _arrow = attr.arrow;        var _dot = attr.dot;        var _moveFun = attr.moveFun;        //快速创建存放图片的ul        var _sliderimgul = $$("ul", { className: 'U_MD_UI_slider_ImgList' }, box);        //在数组的第一个插入最后一张图片        imgarr.unshift(imgarr[imgarr.length - 1]);        //在arrImg[]最后放第一张图片        imgarr.push(imgarr[1]);        //for循环创建需要的li        for (i = 0; i < imgarr.length; i++) {            var _sliderimgli = $$("li", { className: '' }, _sliderimgul),                _sliderImg = $$("img", { className: '', src: imgarr[i] }, _sliderimgli); //"onerror": U.MD.C.imgError,         }        //快速创建存放左右按钮的ul        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);        //快速创建存放小圆点的ul        var _sliderpointul = $$("ul", { className: 'U_MD_UI_slider_Point' }, box);        //快速创建li,li的长度为图片的减两张(补图法)        for (i = 0; i < imgarr.length - 3; i++) {            //第一个li时,定义第一个li的class            if (i == 0) {                $$("li", { className: 'U_MD_UI_slider_On' }, _sliderpointul)[0];            }            $$("li", { className: '' }, _sliderpointul)[i];        }        //定义父元素的宽度        var _boxidwidth = box.offsetWidth;        //定义父元素的高度        var _boxidheight = box.offsetHeight;        //定义class为U_MD_UI_slider_ImgList        var _sliderimglist = box.getElementsByClassName("U_MD_UI_slider_ImgList")[0];        var _sliderimgli = _sliderimglist.getElementsByTagName("li");        //定义class为U_MD_UI_slider_Btn        var _sliderbtn = document.getElementsByClassName("U_MD_UI_slider_Btn")[0];        //定义class为U_MD_UI_slider_Point        var _sliderpoint = box.getElementsByClassName('U_MD_UI_slider_Point')[0];        //定义class为_sliderbtn的所有li        var _btnli = _sliderbtn.getElementsByTagName("li");        //定义class为_sliderimglist的li长度        var _listlen = _sliderimglist.getElementsByTagName("li").length;        //定义图片索引为1        var _listindex = 1;        //定义_sliderpoint里的li        var _pointdot = _sliderpoint.getElementsByTagName("li");        //定义_pointdot.length        var _dotlen = _pointdot.length;        //定义小圆点索引为0        var _dotindex = 0;        //初始化timer        var timer = null;        //如果obj.dot为true则显示小圆点        if (_dot) {            _sliderpoint.style.display = "block";        } else {            _sliderpoint.style.display = "none";        }        /** Banner宽度和高度跟随父元素 **/        //定义_sliderimglist里的li        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";        }        //存放图片的ul的总宽度(盒子长度*图片数量)        _sliderimglist.style.width = (_boxidwidth * imgarr.length) + "px";        //第一张图片的位置        _sliderimglist.style.left = -_boxidwidth + "px";        //左右切换按钮宽度跟随盒子宽度        _sliderbtn.style.width = _boxidwidth + "px";        /** 鼠标停留计时器停止或启动、左右按钮显示 **/        //鼠标停留        box.onmouseover = function() {            //如果obj.cut为true则显示按钮            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();            //点击后时间距离下次点击要大于500ms才能继续下次点击            if (nTime - sTime > 500) {                //图片索引和小圆点索引减少                _listindex--;                _dotindex--;                if (_listindex == 0) {                    //调用move函数                    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();                //点击后时间距离下次点击要大于500ms才能继续下次点击                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() {            /* for (var i = 0; i < _sliderimgli.length; i++) {            _sliderimgli[i]._listindex = i;            //点击小圆点            //_listindex = this._listindex;            console.log(_listindex+1);            }*/            //图片索引和小圆点索引            _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);                //console.log(_dotindex);            }        }        //小圆点样式        function moveBtn(_dotindex) {            for (var j = 0; j < _dotlen; j++) {                _pointdot[j].className = "";            }            _pointdot[_dotindex].className = "U_MD_UI_slider_On";        }    }    /*    切换过程函数    @dom {object} 需要移动的对象    @json {Array}向某个方向移动的距离    @callback {回调callback}    */function move(dom, json, callback) {    //清除计时器    clearInterval(dom.timer);    dom.timer = setInterval(function() {        //true这个计时器用来标记json中所有的attr已到达target目标        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];            // console.log(target);            // console.log(cur);            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) + ")"; //ie                    dom.style[attr] = (cur + speed) / 100; //0~1                } else {                    dom.style[attr] = cur + speed + "px";                }                //false表明当前的这个attr没有达到目标                mark = false;            }            //console.log(cur);            //console.log(1);        }        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];};///<jscompress sourcefile="Calendar.js" />Namespace.register("U.MD.UI.calendar");/** * 日历控件调用API函数 * @param el 对象元素 * @param parentnode 添加到的父元素 * @param datetimeboolean 【boolean】是否显示选择时分秒功能 */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; /*当前聚焦的input*/U.MD.UI.calendar.board = null; /*最外层div*/U.MD.UI.calendar.tit = null; /*日期标题*/U.MD.UI.calendar.mark = 1; /*标记量*/U.MD.UI.calendar.template = [ /*html模板块*/    /*功能*/    '<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>'];/** * 创建日历的壳 * @param els 对象元素 * @param els 父元素 */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]; /*获取元素相对于html文档的距离*/    U.MD.UI.calendar.fouseinp = els; /*当前聚焦的input*/    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(); /*日期显示*/}/** * 时分秒模板控制 * @param that 对象元素 * @param text 改变的文字 */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"); //删除选中class            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"); //添加class    }    /**     * 数据重置     * @param offsethtml 偏移量      */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'; /*改变日历显示的x轴*/    U.MD.UI.calendar.board.style.top = offsethtml[1] + U.MD.UI.calendar.fouseinp.clientHeight + 10 + 'px'; /*改变日历显示的y轴*/    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);}/** * 创建时间选择模块 * @param addel 添加父元素  */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);    }}/** * 创建日历 * @param input 当前聚焦的input * @param offsetHtml 元素相对于html文档的距离 */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]; /*给上html模板的第一个*/    _dayC = $$('div', { "className": 'U_MD_UI_calendar_c_a', innerHTML: _templateHTML }, U.MD.UI.calendar.board); /*创建剩下的内容,把html模板内容丢进去*/    U.MD.UI.calendar.tit = U.selectEl('#calendar_tit')[0]; /*获取日历标题*/    _mc = U.selectEl('#calendar_month > ul > li'); /*获取选择月模块的li*/    _titInp = U.selectEl('#calendar_tit_btn')[0]; /*获取日历标题的input*/    _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) { /*标记数是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; /*标记数赋值2,以表示当前停留在选择月模块*/            U.MD.UI.calendar.ChooseDefault();        } else if (U.MD.UI.calendar.mark == 2) { /*标记数是2*/            _timer = setTimeout(function() { /*赋值一个定时器*/                U.MD.UI.calendar.changeDisplay($('#calendar_year')[0], U.selectEl('#calendar_month')[0]); /*选择年显示,选择月隐藏*/                U.MD.UI.calendar.dateTenYear(); /*调用显示10年内容函数*/                U.MD.UI.calendar.mark = 3; /*标记数复制3,以表示档期那停球在选择年模块*/                U.MD.UI.calendar.ChooseDefault();            }, 250); /*0.25秒后执行*/        }    }    U.MD.UI.calendar.tit.ondblclick = function() { /*给日历标题绑定双击事件*/        clearTimeout(_timer); /*清除定时器,防止进入单击事件*/        if (U.MD.UI.calendar.mark === 2) { /*标记数是2*/            _obj = U.MD.UI.calendar.changeDisplay(_titInp, this, 'inline-block'); /*日历标题文本框显示,日历标题隐藏*/            _obj[0].value = this.innerText; /*把日历title赋值给编辑input*/            _obj[0].focus(); /*编辑input给上聚焦*/        }    }    _titInp.onkeydown = function(e) { /*给日历标题文本框一个键盘事件*/        switch (e.keyCode) {            case 13:                /*编辑input 回车来更改内容*/                var _arr2 = U.MD.UI.calendar.changeDisplay(U.MD.UI.calendar.tit, this, 'inline-block'); /*显示日历title, 隐藏编辑input*/                _arr2[0].innerText = U.MD.UI.calendar.year = !isNaN(parseInt(this.value)) ? parseInt(this.value) : U.MD.UI.calendar.CURRENTYEAR; /*把编辑input的内容赋值给日历title*/                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 } /*标记数是1,-1月*/        else if (U.MD.UI.calendar.mark == 2) { _lessNum = -12 } /*标记数是2,-12月*/        else if (U.MD.UI.calendar.mark == 3) { _lessNum = -120 }; /*标记数是3, -120月*/        U.MD.UI.calendar.fullDate(_lessNum, false);    };    U.selectEl('#nextDate')[0].onclick = function() { /*给向右的小三角绑定点击事件*/        if (U.MD.UI.calendar.mark == 1) { _addNum = 1 } /*标记数是1,+1月*/        else if (U.MD.UI.calendar.mark == 2) { _addNum = 12 } /*标记数是1,+12月*/        else if (U.MD.UI.calendar.mark == 3) { _addNum = 120 }; /*标记数是1,+120月*/        U.MD.UI.calendar.fullDate(_addNum, true);    };    for (var i = 0; i < _mc.length; i++) { /*给选择月的模块li循环*/        _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; /*标记量赋值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) + '月'; /*转换格式,然后丢到日历标题文本框里*/}/** * 年月控制器 * @param num 需要减的月数 * @param check 如果是true表示点击了向右的小三角,是false表示点击了向左的小三角 */U.MD.UI.calendar.fullDate = function(num, check) {    var _year = (_n = Math.abs(num) / 12) >= 1 ? _n >>> 0 : 0,        /*如果月份/12大于1,也就是超过12月或者说1年, _n>>>0取出整数部分*/        _month = Math.abs(num) % 12; /*月份膜上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) { /*如果月份大于11*/            U.MD.UI.calendar.month = 0; /*月份清空*/            U.MD.UI.calendar.year++; /*年份加一*/        }    } else {        if (U.MD.UI.calendar.month < 0) { /*如果月份小于0*/            U.MD.UI.calendar.month = 11; /*可变月赋值11,即表示12月*/            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 }; /*标记数是2,即代表在选择月模块,*/    if (U.MD.UI.calendar.mark == 3) { U.MD.UI.calendar.dateTenYear() }; /*标记数是3,即代表在选择年模块,*/}/** * 转换输出格式 * @param symbol 分割符号 * @param isnow 【boolean】 是否获取当前时间 * @returns {*} 返回字符串 */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 () {    if (U.MD.UI.calendar.fouseinp.value) {        U.MD.UI.calendar.fouseinp.value = U.MD.UI.calendar.formartDate(U.MD.UI.calendar.year, U.MD.UI.calendar.month + 1, this.innerText);     } else {        U.MD.UI.calendar.fouseinp.innerText = U.MD.UI.calendar.formartDate(U.MD.UI.calendar.year, U.MD.UI.calendar.month + 1, this.innerText);     }    U.MD.UI.calendar.board.style.display = 'none';}*//** * 创建选择天时需要循环绑定的函数 */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'; /*隐藏日历控件*/}/** * 显示与隐藏 * @param blockEl 需要显示的元素 * @param noneEl 需要隐藏的元素 * @param val 显示的方式 * @returns {*[]} 返回数组[显示元素,隐藏元素] */U.MD.UI.calendar.changeDisplay = function(blockEl, noneEl, val) {    val = val || 'block'; /*默认block*/    if (blockEl && typeof blockEl === 'object') { blockEl.setAttribute('style', 'display:' + val) } /*如果blockEL存在且blockEl是个对象,进行属性的赋值*/    if (noneEl && typeof noneEl === 'object') { noneEl.setAttribute('style', 'display:none') }; /*如果noneEl存在且noneEl是个对象,进行属性的赋值*/    return [blockEl, noneEl];}/** * 更新选择年的模块内容 */U.MD.UI.calendar.dateTenYear = function() {    _yearArr = U.selectEl('#calendar_year > ul > li'); /*获取选择年模块里的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; /*标记数赋值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; /*改变日历title显示格式*/        }        _yearArr[i].innerHTML = ''; /*清空li里面的内容*/        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); /*改变日历title显示格式*/}/** * 时分秒数据初始化 * @param deafultflag 【boolean】是否初始化数据 */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};///<jscompress sourcefile="City.js" />Namespace.register("U.MD.UI.city");/** * [Control description] 城市控件接口 * @param {[html元素]} element [需要使用城市控件的元素(默认放置到element下面)] */U.MD.UI.city = function(element) {    U.UF.EV.stopBubble(); //阻止事件冒泡 防止被body的事件覆盖    if (!element || !element.tagName) { //如果element存在tagName 则一定是html元素 否则不执行城市控件        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";        //调整控件的top位置        _cityBox.style.left = _rect.left + document.documentElement.scrollLeft + "px";        //调整控件的left位置        U.selectEl(_cityBox).removeClass("U_MD_UI_city_hidden");        //删除掉hidden的class名(显示城市控件)  目的: 去除掉display为none的样式        U.MD.UI.city.Attr.inputNode = element; //获取最终结果的表单元素 可能会不同 因此 inputNode需要重新赋值        return;    }    var _city = U.MD.UI.city; //简写命名空间    _city.create(element); //将控件html代码添加到body上 并调整控件位置    _city.Attr = { //存放节点 与 变量 的json对象        "inputNode": element //判断是哪个表单点击的 为赋值所用    };    _city.init(); //函数初始化(添加js功能)};U.MD.UI.city.Attr = {}; //存放元素与变量的json全局变量 未赋值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>';//html代码/** * 添加html代码,并且判断html代码是否存在 若存在 则不添加 * @param {[html元素]} element [需要使用城市控件的元素(默认放置到element下面)] */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";    //调整控件的top位置    _cityBox.style.left = _rect.left + document.documentElement.scrollLeft + "px";    //调整控件的left位置    U.MD.UI.city.Attr.inputNode = element;    //获取最终结果的表单元素 可能会不同 因此 inputNode需要重新赋值    U.selectEl(_cityBox).removeClass("U_MD_UI_city_hidden");    //删除掉hidden的class名(显示城市控件)  目的: 去除掉display为none的样式};/** * 函数初始化 */U.MD.UI.city.init = function() {    var _city = U.MD.UI.city; //简写命名空间    _city.getUsedCity(); //获取常用市所有数据    _city.inputEvent(); //添加监听事件: 点击表单显示城市控件并发送后台请求数据 与 点击body区域隐藏城市控件    _city.menuEvent(); //添加监听事件: 点击菜单显示对应的内容};/** * 为表单添加点击事件 */U.MD.UI.city.inputEvent = function() {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    var _hidden = "U_MD_UI_city_hidden"; //class样式名 由于太长赋值给变量 _hidden 控制元素display的样式    var _cityBox = U.selectEl("#U_MD_UI_city_cityBox")[0]; //城市控件总盒子节点    U.selectEl(document).bind('click', function() { //点击body时 隐藏城市控件        U.selectEl(_cityBox).addClass(_hidden);        //添加掉hidden的class名  目的: 添加display为none的样式    }, false);    U.selectEl(_cityBox).bind('click', function(e) { //防止点击城市控件时 被body的事件覆盖而隐藏 因此加上防止冒泡处理        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; //简写全局属性json名    var _menuAllNode = U.selectEl("[data-city-mark]"); //所有菜单节点;    var _hidden = "U_MD_UI_city_hidden"; //class样式名 由于太长赋值给变量 _hidden 控制元素display的样式    for (var i = 0, len = _menuAllNode.length; i < len; i++) { //循环所有菜单元素        var _el = _menuAllNode[i]; //获取每个菜单 赋值给变量el        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; //简写全局属性json名    var _usedCityMenu = U.selectEl("#U_MD_UI_city_usedCityMenu")[0]; //常用市菜单按钮    var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0]; //要clone的li的模板    var _usedCityCont = U.selectEl("#U_MD_UI_city_usedCityCont")[0]; //常用市内容区域    if (!_city.usedCity) { //如果 常用市(_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; //简写全局属性json名    var _provinceMenu = U.selectEl("#U_MD_UI_city_provinceMenu")[0]; //省菜单按钮    var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0]; //要clone的li的模板    var _provinceCont = U.selectEl("#U_MD_UI_city_provinceCont")[0]; //省内容区域    if (!_city.province) { //如果 省/直辖市(_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); //打印数据        });    }};/** * 通过code 获取市的所有数据 * @param code 省级的id */U.MD.UI.city.getCity = function(code) {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    var _cityMenu = U.selectEl("#U_MD_UI_city_cityMenu")[0]; //市菜单按钮    var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0]; //要clone的li的模板    var _cityCont = U.selectEl("#U_MD_UI_city_cityCont")[0]; //市内容区域    var _hidden = "U_MD_UI_city_hidden"; //class样式名 由于太长赋值给变量 _hidden 控制元素display的样式    if (!_city.city[code]) { //_city.city = json 而_city.city[code]则是对应的数组值 例如:我点击广东后 获取到了广东的id  则我要通过 广东的id  获取下级的市数据 因此如果json中没有该值 则向后台发送请求获取        _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.city = {}            //r.value = [{},{},{}]            //为了能判断该code下是否有数据 因此需要在_city.city下添加一个 以code为键名 r.value为值的数组            //例如:_city.city = {}  code = 123 r.value = [{a:1},{a:1},{a:1}] 最后会变成 _city.city = {123:[{a:1},{a:1},{a:1}]}            _city.allDataPrint(_cityMenu, _city.city[code], _liTemplate, "city", _cityCont); //打印数据        });    } else { //如果json下有数据 则直接打印该数据        _city.menuClassControl(_cityMenu, "U_MD_UI_city_menuChecked", "data-city-mark", _hidden); //相当于点击菜单 将城市的菜单与内容区域 显示出来        _city.allDataPrint(_cityMenu, _city.city[code], _liTemplate, "city", _cityCont); //打印数据    }};/** * 通过code 获取区级的所有数据  函数的意思可参看上面getCity的注释 * @param code 参数为市级的id */U.MD.UI.city.getarea = function(code) {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    var _areaMenu = U.selectEl("#U_MD_UI_city_areaMenu")[0]; //区菜单按钮    var _hidden = "U_MD_UI_city_hidden"; //class样式名 由于太长赋值给变量 _hidden 控制元素display的样式    var _liTemplate = U.selectEl("#U_MD_UI_city_liTemplate")[0]; //要clone的li的模板    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);    }};/** * 打印传过来的数组json数据 * @param  {[type]} menu     [与之对应的菜单元素] * @param  {[type]} data     [是一个数组json] * @param  {[type]} template [是一个li模板 clone用的] * @param  {[type]} type     [数据类型("province"、"usedCity"....) 为判断所用] * @param  {[type]} parent   [父节点("cityCont,areaCont...") 也叫做内容区域 ] */U.MD.UI.city.allDataPrint = function(menu, data, template, type, parent) {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    var _usedCityMenu = U.selectEl("#U_MD_UI_city_usedCityMenu")[0]; //常用市菜单按钮    var _provinceMenu = U.selectEl("#U_MD_UI_city_provinceMenu")[0]; //省菜单按钮    var _len = data.length; //数组json的长度    var _menu = menu; //菜单元素 赋值给 _menu变量    for (var i = 0; i < _len; i++) {        // 遍历 data数据(数组json)        var _span = _city.dataPrint(data[i], template, type, parent);        //单个数据打印 PS:由于data是一个 数组json([{a:1},{a:2},{a:3}])  因此 需要将获取对应的数据 并添加在 对应的 parent(内容区域) 上        _span.onclick = function() {            var _type = U.selectEl(this).attr("data-city-type");            //获取点击的span标签的属于哪一类型 (比如: 点击省的数据 是 province  市的数据 则时 city)            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;            //改变对应菜单的名字为:点击数据的值    例如:点击"省/直辖市"菜单 下的广东 则 菜单的名字则变为 广东 PS: children[0] 为 li下的span标签            U.selectEl(_menu).attr("data-city-res", this.innerText);            //给自定义属性 data-city-res 添加为: 点击数据的值  PS: 为获取最终值给表单所用            _city.contClassControl(this, "U_MD_UI_city_Cont_ochecked");            //给所选的内容数据添加红色背景 并且删除同一内容区域拥有红色背景的其他元素            switch (_type) {                //此处为 判断 点击 各类型数据需要做的动作 type为判断哪种类型    比如: type值为 "province"  则是 省/直辖市菜单下的 数据 点击这些数据后 就是要做的事情                 case "province":                    _city.getCity(_code);                    //将数据的 code 值传入给 城市函数 来获取城市数据 PS: 获取市的数据需要获取他们的parentid 而code则是他们的parentid                    _city.initAllClass(_usedCityMenu);                    //点击省/直辖市下的数据的话 则初始化 常用市菜单 与 相对应的内容区域样式                    break;                case "usedCity":                    if (this.innerText === "重庆") { //由于重庆这个城市比较特殊 因此需要在常用市那将重庆转为省数据                        _city.getCity(_code);                    } else {                        _city.getarea(_code);                    }                    //在将数据的 code 值传入给 城市函数 来获取城市数据 PS: 获取市的数据需要获取他们的parentid 而code则是他们的parentid                    _city.initAllClass(_provinceMenu);                    //点击常用市下的数据的话 则初始化 省/直辖市菜单 与 相对应的内容区域样式                    break;                case "city":                    _city.getarea(_code);                    //在将数据的 code 值传入给 区函数 来获取区数据 PS: 获取区的数据需要获取他们的parentid 而code则是他们的parentid                    break;                case "area":                    _city.getRes("data-city-res");                    //由于该控件是  省-市-区  因此 当点击区里的数据时 则调用获取最终值的函数                    break;            }        }    }};/** * 打印单个数据api(创建节点,赋id 赋innerText 等等) * @param  {[json对象]} data     [json对象的数据] * @param  {[元素]} template [需要clone的li模板] * @param  {[字符串]} type     [属于哪种城市类型] * @param  {[元素]} parent   [父节点] * @return {[元素]}          [克隆完后的一条li下的span节点] */U.MD.UI.city.dataPrint = function(data, template, type, parent) {    var _city = U.MD.UI.city; //简写命名空间    var _liNode = _city.clone(template), //克隆已建好的li模板        _spanNode = _liNode.children[0]; //获取li的span节点    var _shortName = data.short_name; //获取城市名字缩写    var _name = data.name; //获取名字全称    _liNode.id = type + data.id; //添加id    _spanNode.innerText = _shortName; //添加文字内容    if (_shortName === "北京" || _shortName === "上海" || _shortName === "天津" || _shortName === "重庆") { //由于这4个城市的 缩写 和省的名字相同 因此 需要将数据名 改成name 详见数据库        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); //添加到parent节点上    return _spanNode; //返回该元素};/** * 添加选中时的class 并删除已有该class的元素 * @param {[元素]} el [点击菜单的元素] * @param {[字符串]} cs [选中菜单时的class] * @param {[字符串]} dataattr   [菜单的自定义属性 与 对应内容区域的id相同] * @param {[字符串]} hiddenCs [对应内容区域的class] */U.MD.UI.city.menuClassControl = function(el, cs, dataattr, hiddenCs) {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    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];    //找到拥有该class的元素    if (_oEl) { U.selectEl(_oEl).removeClass(cs) };    //如果找的到该元素 则删除此元素的class    U.selectEl(el).addClass(cs);    //为el元素添加该class    var _oElCont = U.selectEl("#" + U.selectEl(_oEl).attr(dataattr))[0];    //找到拥有该class的菜单元素的自定义属性的值  并找到对应区域块的元素(区域块元素的id 与 自定义属性的值相等)    var _elCont = U.selectEl("#" + U.selectEl(el).attr(dataattr))[0];    //同上 找到点击菜单元素的自定义属性的值    U.selectEl(_oElCont).addClass(hiddenCs);    //添加名为hiddenCs 的className (添加与删除 display为none)    U.selectEl(_elCont).removeClass(hiddenCs);    //elCont元素的display为block    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;    }};/** * 内容区域的class 的控制函数 PS:添加红色背景的样式 * @param  {[type]} el       [所选中的数据元素] * @param  {[type]} ocheckcs [所需要对el添加的样式] */U.MD.UI.city.contClassControl = function(el, ocheckcs) {    var _city = U.MD.UI.city; //简写命名空间    var _oEls = U.selectEl("." + ocheckcs);    //找到拥有该class的所有元素    var _type = U.selectEl(el).attr("data-city-type");    //获取他们的该元素的类型    for (var i = 0, len = _oEls.length; i < len; i++) { //遍历oEls        var _otype = U.selectEl(_oEls[i]).attr("data-city-type");        if (_oEls[i] && _otype === _type) {            //如果找的到该元素  并且还是同一内容区域的元素 则删除他的class 例如:(市内容区域下)点击深圳后 在点广州 则 广州的背景颜色为红色 深圳的背景颜色为初始颜色            U.selectEl(_oEls[i]).removeClass(ocheckcs)        }    }    U.selectEl(el).addClass(ocheckcs);    //为el元素添加该class};/** * 此函数专门为 初始化 常用市 或者 省/直辖市的样式而写的 例如:点击常用市下的数据后 省/直辖市的菜单与对应的内容 样式初始化为不选中 * @param el  只能放 常用市菜单(元素) 和 省/直辖市菜单(元素) */U.MD.UI.city.initAllClass = function(el) {    var _city = U.MD.UI.city; //简写命名空间    el.className = "U_MD_UI_city_filled"; //将菜单li的样式初始化 U_MD_UI_city_filled无样式属性 摆设占位置用    el.children[0].className = ""; //将li里的span样式也初始化    U.selectEl(el).attr("data-city-res", ""); //将span的自定义属性也初始化    var oEl = U.selectEl(".U_MD_UI_city_Cont_ochecked"); //获取内容区域中被选中的span元素    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则会是常用市菜单元素 然后常用市菜单的innerText则会初始化回常用市        el.children[0].innerText = "省/直辖市";    }    if (el.id === "U_MD_UI_city_usedCityMenu") { //同上        el.children[0].innerText = "常用市";    }};/** *  通过获取自定义属性的值 查出最终值 * @param dataattr 自定义属性的名字 */U.MD.UI.city.getRes = function(dataattr) {    var _city = U.MD.UI.city; //简写命名空间    var _attr = _city.Attr; //简写全局属性json名    var _inputNode = _attr.inputNode;    var _cityBox = U.selectEl("#U_MD_UI_city_cityBox")[0]; //城市控件总盒子节点    var _hidden = "U_MD_UI_city_hidden"; //class样式名 由于太长赋值给变量 _hidden 控制元素display的样式    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); //若存在 则将最终值依次添加到arr数组里        }    }    _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;};;///<jscompress sourcefile="Color.js" />//色板Namespace.register("U.MD.UI.ColorPicker");/** * 创建颜色选区 * @barelement  [object] 要插入表格的地方 * @ callfun  [fun]  点击事件 */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); //创建外部div对象    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对象        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; //返回div对象};///<jscompress sourcefile="Common.js" />//工具空间,宝航字体、字号。。。//字体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" }); //创建select对象    $$("option", { value: "宋体", style: { fontFamily: "宋体" }, innerHTML: "宋体" }, font); //定义option对象宋体,附属select    $$("option", { value: "sans-serif", style: { fontFamily: "sans-serif" }, innerHTML: "sans-serif" }, font); //定义option对象sans-serif,附属select    $$("option", { value: "微软雅黑", style: { fontFamily: "微软雅黑" }, innerHTML: "微软雅黑" }, font); //定义option对象微软雅黑,附属select    $$("option", { value: "楷体", style: { fontFamily: "楷体" }, innerHTML: "楷体" }, font); //定义option对象楷体,附属select    $$("option", { value: "黑体", style: { fontFamily: "黑体" }, innerHTML: "黑体" }, font); //定义option对象黑体,附属select    $$("option", { value: "隶书", style: { fontFamily: "隶书" }, innerHTML: "隶书" }, font); //定义option对象隶书,附属select    $$("option", { value: "andale mono", style: { fontFamily: "andale mono" }, innerHTML: "andale mono" }, font); //定义option对象andale mono,附属select    $$("option", { value: "arial black", style: { fontFamily: "arial black" }, innerHTML: "arial black" }, font); //定义option对象arial black,附属select    return font; //返回select对象}/* * 字号选择框生成方法 */U.MD.UI.WordSize = function() {    var fontsize = $$("select", { "className": "MD_fontSize" }); //创建select对象    $$("option", { value: "56px", style: { fontSize: "14px" }, innerHTML: "初号" }, fontsize); //定义option对象初号,附属select    $$("option", { value: "48px", style: { fontSize: "14px" }, innerHTML: "小初" }, fontsize); //定义option对象小初,附属select    $$("option", { value: "34.7px", style: { fontSize: "14px" }, innerHTML: "一号" }, fontsize); //定义option对象一号,附属select    $$("option", { value: "32px", style: { fontSize: "14px" }, innerHTML: "小一" }, fontsize); //定义option对象小一,附属select    $$("option", { value: "29.3px", style: { fontSize: "14px" }, innerHTML: "二号" }, fontsize); //定义option对象二号,附属select    $$("option", { value: "24px", style: { fontSize: "14px" }, innerHTML: "小二" }, fontsize); //定义option对象小二,附属select    $$("option", { value: "21.3px", style: { fontSize: "14px" }, innerHTML: "三号" }, fontsize); //定义option对象三号,附属select    $$("option", { value: "20px", style: { fontSize: "14px" }, innerHTML: "小三" }, fontsize); //定义option对象小三,附属select    $$("option", { value: "18.7px", style: { fontSize: "14px" }, innerHTML: "四号" }, fontsize); //定义option对象四号,附属select    $$("option", { value: "16px", style: { fontSize: "14px" }, innerHTML: "小四" }, fontsize); //定义option对象小四,附属select    $$("option", { value: "14px", style: { fontSize: "14px" }, innerHTML: "五号" }, fontsize); //定义option对象五号,附属select    $$("option", { value: "12px", style: { fontSize: "14px" }, innerHTML: "小五" }, fontsize); //定义option对象小五,附属select    $$("option", { value: "10px", style: { fontSize: "14px" }, innerHTML: "10" }, fontsize); //定义option对象10px,附属select    $$("option", { value: "12px", style: { fontSize: "14px" }, innerHTML: "12" }, fontsize); //定义option对象12px,附属select    $$("option", { value: "14px", style: { fontSize: "14px" }, innerHTML: "14" }, fontsize); //定义option对象14px,附属select    $$("option", { value: "16px", style: { fontSize: "14px" }, innerHTML: "16" }, fontsize); //定义option对象16px,附属select    $$("option", { value: "18px", style: { fontSize: "14px" }, innerHTML: "18" }, fontsize); //定义option对象18px,附属select    $$("option", { value: "20px", style: { fontSize: "14px" }, innerHTML: "20" }, fontsize); //定义option对象20px,附属select    $$("option", { value: "22px", style: { fontSize: "14px" }, innerHTML: "22" }, fontsize); //定义option对象22px,附属select    $$("option", { value: "24px", style: { fontSize: "14px" }, innerHTML: "24" }, fontsize); //定义option对象24px,附属select    $$("option", { value: "26px", style: { fontSize: "14px" }, innerHTML: "26" }, fontsize); //定义option对象26px,附属select    $$("option", { value: "28px", style: { fontSize: "14px" }, innerHTML: "28" }, fontsize); //定义option对象28px,附属select    $$("option", { value: "36px", style: { fontSize: "14px" }, innerHTML: "36" }, fontsize); //定义option对象36px,附属select    $$("option", { value: "42px", style: { fontSize: "14px" }, innerHTML: "42" }, fontsize); //定义option对象42px,附属select    $$("option", { value: "48px", style: { fontSize: "14px" }, innerHTML: "48" }, fontsize); //定义option对象48px,附属select    $$("option", { value: "72px", style: { fontSize: "14px" }, innerHTML: "72" }, fontsize); //定义option对象72px,附属select    return fontsize; //返回select对象};///<jscompress sourcefile="Dialog.js" />//#region alert弹窗代码、confirm对话框//UI窗体区域Namespace.register("U.UF.UI") //窗体的命名空间//#region 对话框/** * 创建对话框 * @content      {string/elemnet}  内容 * @determineFun {function}        确认回调函数 * @cancelFun    {function}        取消回调函数 */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;";        //如果为文字则修改inerHTML。        _content.innerHTML = content || '内容';    }    //创建页脚部分    var _footer = $$("div", { "style": { "cssText": "height:28px; margin:14px 0;" } }, _confirm);    //创建确定按钮 绑定点击事件,默认点击后执行关闭窗体函数    $$("div", {        "style": {            "cssText": "text-align: center; color: rgb(255,255,255); width: 92px; line-height:28px; background: rgb(48,126,208); border-radius: 5px;float: right; margin-right:29px; "        },        innerHTML: "确定",        onclick: function() {            var _bool = true;            if (U.UF.C.isFunction(determineFun)) {                _bool = determineFun(); //判断是否存在回调 有则执行。            }            if (_bool !== false) {                U.UF.F.closeWindow(_form.form); //关闭窗口函数            }        }    }, _footer);    //创建取消按钮 绑定点击事件,默认点击后执行关闭窗体函数    $$("div", {        "style": {            "cssText": "text-align: center; color: rgb(255,255,255); width: 92px; line-height:28px; background: rgb(48,126,208); border-radius: 5px;background: rgb(170,170,170); float: right; margin-right:21px;margin-left:29px;"        },        "innerHTML": "取消",        "onclick": function() {            U.UF.C.isFunction(cancelFun) && cancelFun(); //判断是否存在回调 有则执行。            U.UF.F.closeWindow(_form.form); //关闭窗口函数        }    }, _footer);    //调用Uform窗体创建函数将主体内容添加到窗体中    var _form = new U.UF.UI.form(        "提示",        _confirm, {            "style": {                "cssText": "font-size: 14px; background: rgb(255,255,255); width: 310px; position: fixed; box-shadow: 0 0 10px 3px rgb(0,0,0); border-radius: 5px;"            }        }, {            "istop": true,            "isenlarge": false,            "isstretching": false,            "isnarrow": false        }, {            "style": {                "cssText": " background: rgb(59,88,120); padding: 5px; color: rgb(255,255,255); "            }        });    return _form;}/** * 创建提示框 * @content     {string/elemnet}  内容 * @callBackFun {function}        回调函数 */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 || '内容'; //如果为文字则修改inerHTML。    }    //创建页脚部分    var footer = $$("div", { "style": { "cssText": "height:45px;" } }, _dialog);    //调用Uform窗体创建函数将主体内容添加到窗体中    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: "确定", // 绑定innerHTML        onclick: function() {            U.UF.C.isFunction(callBackFun) && callBackFun(); //判断是否存在回调 有则执行。            U.UF.F.closeWindow(_form.form); //关闭窗口函数        }    }, footer);}//#endregion//#region alert/*创建点击确认对话框*/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);    //调用Uform窗体创建函数将主体内容添加到窗体中    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; "                    //white-space: nowrap; -o-text-overflow: ellipsis; text-overflow: ellipsis;             },            innerHTML: c        }, document.body);        U.UF.F.topWindow(bg);        setTimeout(function() {            bg.parentNode.removeChild(bg);        }, t);    }    //#endregion//#endregion;///<jscompress sourcefile="Email.js" />//电脑端banner滑块控件命名空间Namespace.register("U.MD.UI.email");/**电脑端banner滑块控件*/U.MD.UI.email = function() {};///<jscompress sourcefile="Face.js" />//PC端表情包Namespace.register("U.MD.UI.face");/* **  添加表情包 **  @param {element} button 插入表情包的元素 **  @param {element} el  输入框的元素 */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++) { //循环打印所有的表情包 共104个            $$("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); //创建单个表情,并且给每个表情赋值一个点击事件,参数为表情框元素,第几个表情,光标位置,输入框的位置,点击后打印表情到输入框的位置        }        //获取整个body部分的点击事件        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"; //如果不是,则隐藏掉表情包        }    }    /* 点击表情框处理    *    * @param  {element} el1 表情框元素    * @param  {number}  i 第几个表情。通过i的值代表是哪个表情    * @param  {range}   range 光标的位置,先获取光标对象,然后通过光标对象获取光标位置    * @param  {element}    对应路径 /img/ChatingFaceGif/[face](i).gif    */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";};///<jscompress sourcefile="Form.js" />//#region 窗体//UI窗体区域Namespace.register("U.UF.UI") //窗体的命名空间//#region 窗体/** 初始化uform窗体,创建一个窗体,调用方式如下 *       new new U.UF.UI.form( *                    "测试内容", *                    "中间内容", *                    { "style": { "width": "570px", "height": "80%", "maxHeight": "700px"} }, *           ); * @param	string	头部标题  必填 * @param	string|element	中间区域的内容 必填 * @param	object	窗体的属性 {id :"1", style:{"width":"100px", "height":"100px"}} 选填 有默认的属性,原函数有注释 * @param	object	窗体功能的属性 { istop: true, isdrag: true, isstretching:true,isenlarge:true,isnarrow:true,isclose:true } 选填  * @param	object	头部的属性 {style:{"width":"100px"}} 选填 有默认的属性,原函数有注释 * @param	object	内容的属性 { style:{"height":"100px"}} 选填 有默认属性,原函数有注释 * @param	object	关闭、放大、缩小按钮区域的属性设置 { "style":{"left":"100px"}} 选填,有默认属性,原函数有注释 * @param	element	窗体追加到制定的元素 选填 有默认的属性,原函数有注释 */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; //需要插入的元素,包含div和iframe等元素,以前站外应用的功能是靠这个方式去实现的    _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 = {    /** 初始化uform窗体     */    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"; //设置窗体的属性,作为窗体的识别,有助于调用的用户通过js找到所有的窗体        _formattr.id = _formattr.id || ""; //窗体的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; //窗体全局变量设置        //如果用户设置了false,那么就不加载头部        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: auto;" + _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);            //拉伸的信息 key代表样式的结尾,value代表拉伸的方向            _stretchinginfo = {                    "top": "cursor: n-resize; left: 0px; top: 0px; width: 100%; height: 5px;",                    "rightTop": "cursor: ne-resize; right: -2px; top: -2px; width: 12px; height: 12px;",                    "leftTop": "cursor: nw-resize; top: 0px; left: 0px; width: 12px; height: 12px;",                    "left": "cursor: w-resize; left: 0px; top: 0px; width: 5px; height: 100%;",                    "right": "cursor: e-resize; right: 0px; top: 0px; width: 5px; height: 100%;",                    "bottom": "cursor: s-resize; left: 0px; bottom: 0px; width: 100%; height: 5px;",                    "leftBottom": "cursor: sw-resize; left: -2px; bottom: -2px; width: 12px; height: 12px;",                    "rightBottom": "cursor: se-resize; right: -2px; bottom: -2px; width: 12px; height: 12px;"                }                //循环创建拉伸条,包含上、下、左、右、上左、下左、上右、下右            for (i in _stretchinginfo) {                $$("div", {                    "style": {                        "cssText": "position: absolute; overflow: hidden; display: block; z-index: 10;" + _stretchinginfo[i]                    },                    "onmousedown": U.UF.C.closure(function(scope, typename) {                        //拉伸函数的调用                        U.UF.F.stretching(_formel, typename, U.UF.C.apply(scope, scope.size));                    }, [this, i])                }, _stretchingel);            }        }        //头部功能区域        if (this.title !== false) {            _headbottom = $$("div", {                "style": { "cssText": "position: absolute; top: 3px; right: 0px; width: 80px; display: table-cell; vertical-align: middle;" }            }, _formel);        }        if (this.isclose !== false) {            //关闭窗体的按钮            $$("div", {                "style": {                    "cssText": "background-image:url(../../../img/close.png); _background-image:url(/img/close.png);width: 14px; height: 14px; background-repeat: no-repeat; background-size: 100%; float: right; margin-right: 5px;margin-top:6px; cursor: pointer;"                },                "title": "点击关闭",                "onmousedown": U.UF.EV.stopBubble,                "onclick": U.UF.C.apply(this, function() {                    U.UF.F.closeWindow(this.form); //调用窗体关闭函数                    try {                        //关闭任务栏处理                        if (U.MD.D.T.taskbar.close) {                            U.MD.D.T.taskbar.close({ "forms": _formel });                            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": "最大化",                "onmousedown": U.UF.EV.stopBubble,                //最大化点击事件处理                "onclick": function() {                    U.UF.F.windowZooming(_formel); //调用窗体最大化函数                }            }, _headbottom);            //如果有head头部的处理            if (_headel) {                //头部双击放大缩小处理处理                _headel.ondblclick = U.UF.C.apply(_headel, function() {                    //判断双击的元素是否在头部导航上,否则如果头部上有其他的按钮什么的双击了,也会触发放大方法                    if (event.srcElement == this || U.UF.EL.isChild(this, event.srcElement)) {                        _enlargeel.onclick(); //放大的处理                    }                });            }        }        //是否允许最小化        if (this.isnarrow !== false) {            //最小化的按钮处理            $$("div", {                "style": {                    "cssText": "background-image:url(../../../img/min.png); _background-image:url(/img/min.png);background-size: 100%; float: right; margin-right: 10px;    margin-top: 3px; width: 20px; height: 20px; cursor: pointer;background-repeat: no-repeat;"                },                "title": "最小化",                "onmousedown": U.UF.EV.stopBubble,                "onclick": function() {                    U.UF.F.windowMinimize(_formel); //窗体最小化处理                }            }, _headbottom);        }        //如果窗体已经创建,那么直接替换        if (_replaceel && _replaceel.parentNode != null) {            _replaceel.parentNode.replaceChild(_formel, _replaceel);        }        //元素添加到制定的元素中        else {            this.parentel.appendChild(_formel);        }        //如果没有设置top和left那么居中弹出        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; //head头部的高度        //如果存在head头部,那么获取head头部处理        if (this.header) {            _headheight = this.header.clientHeight;        }        //设置窗体content区域大小设置        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, //获取原本在窗体大小没有变化前的width        _bodyheight = US.height, //获取原本在窗体大小没有变化前的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();        }    }}//#endregion//#endregion;///<jscompress sourcefile="Music.js" />Namespace.register("U.MD.UI.music");/** * [Control description]     音乐控件总函数 * @param {[type]} musicList [数组json 格式请看文档] * @param {[type]} index     [需要播放第几首歌(索引)] * @param {[type]} autoplay  [是否自动播放] 可填可不填 默认 false * @param {[type]} parentEl  所需要添加到的父元素 可填可不填 默认document.body */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]) {        //        U.selectEl(_musicBox).removeClass('U_MD_UI_music_hidden');        //        var _attr = _music.Attr;              //简写全局属性json名        //        var _audio = U.selectEl("#U_MD_UI_music_audio"); //audio标签        //        _attr.musicList = musicList;  //全局赋值        //        _attr.musicIndex = index;    //全局赋值        //        _audio[0].src = musicList[index].src;  //添加音乐路径        //        var _Name = U.selectEl("#U_MD_UI_music_Name");  //音乐名字节点        //        _Name[0].innerText = musicList[index].title;    //音乐名字赋值        _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; //存放元素与变量的json全局变量 未赋值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>';/** *  添加音乐控件html代码 并且判断是否存在html 防止多次添加 */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.UF.F.windowMinimize(_formel);};/** *  音乐控件初始化 */U.MD.UI.music.init = function() {    var _music = U.MD.UI.music; //简写命名空间    var _attr = _music.Attr; //简写全局属性json名    var _audio = U.selectEl("#U_MD_UI_music_audio"); //audio标签    var _musicList = _attr.musicList; //音乐列表数组    var _musicIndex = _attr.musicIndex; //需要播放的音乐(数组中的第index个)    _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) { //若autoplay属性 = false 则第一首音乐暂停        _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; //由于_attr.musicIndex是一个变量 因此 需要重新赋值        var _listLength = _musicList.length - 1; //获取数组中音乐的长度        if (_musicIndex === _listLength) { //当音乐在数组中为最后一首时 下一首则为第一首 也就是索引 0            _attr.musicIndex = 0;            _musicIndex = _attr.musicIndex;            _audio[0].src = _musicList[_musicIndex].src;        } else { //否则则索引+1            _attr.musicIndex++;            _musicIndex = _attr.musicIndex;            _audio[0].src = _musicList[_musicIndex].src;        }    });};/** *  关闭按钮点击事件 */U.MD.UI.music.openBtnEvent = function() {    var _music = U.MD.UI.music; //简写命名空间    //    var _attr = _music.Attr;                     //简写全局属性json名    //    var _musicBox = U.selectEl("#U_MD_UI_music_musicBox"); //获取音乐控件盒子    //    var _closeBtn = U.selectEl("#U_MD_UI_music_closeBtn"); //获取关闭按钮 在控件里 右上角的 叉叉    U.selectEl("#U_MD_UI_music_closeBtn").bind('click', function() {        var _audio = U.selectEl("#U_MD_UI_music_audio"); //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();        //        _musicBox.addClass("U_MD_UI_music_hidden");   //点击关闭按钮后 隐藏音乐控件        //        _musicBox.addClass("U_MD_UI_music_hidden");   //点击关闭按钮后 隐藏音乐控件    });};/** *  缩小按钮事件绑定 */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; //简写全局属性json名    var _playbtn = U.selectEl("#U_MD_UI_music_playBtn"); //暂停/播放 按钮    var _audio = U.selectEl("#U_MD_UI_music_audio"); //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; //简写全局属性json名    var _audio = U.selectEl("#U_MD_UI_music_audio"); //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; //由于_attr.musicIndex是一个变量 因此 需要重新赋值        if (_musicIndex === _listLength) { //如果当前的歌曲是最后一首时            _attr.musicIndex = 0; //则条转到第一首歌            _musicIndex = _attr.musicIndex; //给全局属性赋值            _audio[0].src = _musicList[_musicIndex].src; //并修改音乐路径        } else { //否则跳转到下一首歌            _attr.musicIndex++; //数组索引加1            _musicIndex = _attr.musicIndex; //给全局属性赋值            _audio[0].src = _musicList[_musicIndex].src; //并修改音乐路径        }    });    _leftBtn.bind('click', function() { //同上 此处是左按钮(上一首)        _musicIndex = _attr.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"); //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; //给audio标签添加声音    _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")); //获取音量球的 left值            this._soundBarW = parseFloat(_soundBar.css("width")); //获取音量条的 宽            _soundBall[0].style.left = 0; //音量球的left为0            _soundBar[0].style.width = 0; //音量条的宽为 0            _audio[0].volume = 0; //audio声音也为0        } else { //播放状态            if (!this._volume) { //如果this._volume不存在 则声音赋值时会报错                return;            }            _audio[0].volume = this._volume; //在点一遍开关后 复原到之前记录的值            _soundBall[0].style.left = this._soundBallX + "px"; //给音量球的left赋值            _soundBar[0].style.width = this._soundBarW + "px"; //给音量条的宽赋值        }    });    _soundBox.bind('mousedown', function(e) { //点击进度条后 音量球跳转到鼠标点击位置 并且声音跟随增大或减小        var _boxLeft = _music.getOffsetLeft(this); //body距离盒子左端的left值 =  声音球left的最小值        var _boxRight = _boxLeft + _boxWidth; //body距离盒子右端的left值 = 声音球left的最大值        var _mouseX = e.pageX; //获取鼠标按下时的X坐标        _mouseX = Math.max(_mouseX, _boxLeft); //mouseX 与 boxLeft距离不能小于0 因此 获取两数最大值 原因:声音不能小于0        _mouseX = Math.min(_mouseX, _boxRight); //mouseX 与 boxRight因此 获取两数最大值 原因:声音不能大于1        var _dis = _mouseX - _boxLeft; //鼠标划过的距离        _volume = Math.round(parseFloat(_dis / _boxWidth) * 100) / 100; //距离相对于盒子宽度的值 = 声音百分比大小(此处为保留两位小数点)        _soundBall[0].style.left = (_boxWidth * _volume) + "px"; //音量球left值 改变成 = 总宽*百分比        _soundBar[0].style.width = (_boxWidth * _volume) + "px"; //音量条width 改变成 = 总宽*百分比        _audio[0].volume = _volume; //改变audio标签值        if (_audio[0].volume <= 0) { //如果声音小于=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; //获取鼠标按下时的X坐标        var _soundDrapMove = function(e) { //拖拽时移动用的函数            U.UF.EV.stopDefault(e); //取消默认拖拽            var _mouseX = e.pageX; //鼠标移动时的x坐标            var _dis = _mouseX - _oMouseX + _oX; //移动的距离            _dis = Math.max(0, _dis); //限制音量球left不得小于0            _dis = Math.min(_boxWidth, _dis); //限制音量球left不得大于盒子宽度            _soundBall[0].style.left = _dis + "px"; //音量球位置            _soundBar[0].style.width = _dis + "px"; //音量条宽度            _volume = Math.round(parseFloat(_dis / _boxWidth) * 100) / 100; //声音球距离盒子宽度的left值 = 声音百分比大小(此处为保留两位小数点)            _audio[0].volume = _volume; //音乐的声音赋值            if (_audio[0].volume <= 0) { //判断声音小于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; //简写全局属性json名    var _audio = U.selectEl("#U_MD_UI_music_audio"); //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) { //barFlag = true 为 时间球不在拖拽状态时            _currentTime = this.currentTime; //获取音乐当前播放时间            var _speed = Math.round(parseFloat(_currentTime / _attr.endTime) * 10000) / 10000; //_speed = 当前时间相对于总时长的 百分比            _progressBall[0].style.left = (_boxWidth * _speed) + "px"; //时间球的left = _speed(百分比)*总宽度            _progressBar[0].style.width = (_boxWidth * _speed) + "px"; //时间条的width = _speed(百分比)*总宽度        }    });    _progressBox.bind('mousedown', function(e) { //点击进度条后 时间球跳转到鼠标点击位置 时间跟随改变        var _boxLeft = _music.getOffsetLeft(this); //body距离盒子左端的left值 =  时间球left的最小值        var _boxRight = _boxLeft + _boxWidth; //body距离盒子右端的left值 = 时间球left的最大值        var _mouseX = e.pageX; //获取鼠标按下时的X坐标        _mouseX = Math.max(_mouseX, _boxLeft); //mouseX 与 boxLeft距离不能小于0 因此 获取两数最大值 原因:声音不能小于0        _mouseX = Math.min(_mouseX, _boxRight); //mouseX 与 boxRight因此 获取两数最大值 原因:声音不能大于1        var _dis = _mouseX - _boxLeft; //鼠标划过的距离        _speed = Math.round(parseFloat(_dis / _boxWidth) * 10000) / 10000; //时间球距离盒子宽度的left值 = 时间当前值/总时长(此处为保留4位小数点)        _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; //拖拽时 时间球跟随声音播放向前移动状态暂时屏蔽 详细见 timeupdate监听        U.UF.EV.stopBubble(e); //阻止冒泡        var _oMouseX = e.pageX; //获取鼠标按下时的X坐标        var _progressDrapMove = function(e) { //拖拽移动时的函数            U.UF.EV.stopDefault(e); //取消默认拖拽            var _mouseX = e.pageX; //鼠标移动时的x坐标            var _dis = _mouseX - _oMouseX + _oX; //移动的距离            _dis = Math.max(0, _dis); //限制音量球left不得小于0            _dis = Math.min(_boxWidth, _dis); //限制音量球left不得大于盒子宽度            _progressBall[0].style.left = _dis + "px"; //音量球位置            _progressBar[0].style.width = _dis + "px"; //音量条宽度            _speed = Math.round(parseFloat(_dis / _boxWidth) * 10000) / 10000; //时间球距离盒子宽度的left值 = 时间当前值/总时长(此处为保留4位小数点)            _progressBall[0].style.left = (_boxWidth * _speed) + "px"; //时间球的left = 总宽*百分比            _progressBar[0].style.width = (_boxWidth * _speed) + "px"; //时间条的width = 总宽*百分比            _currentTime = _attr.endTime * _speed; //当前时间 = 音乐总时长*百分比        };        var _progressDragUp = function() { //拖拽松开后的函数            _barFlag = true; //拖拽后松开时 时间球跟随声音播放向前移动            _audio[0].currentTime = _currentTime; //当前重新赋值            U.selectEl(document).unbind('mousemove', _progressDrapMove); //删除 mousemove的监听事件            U.selectEl(document).unbind('mouseup', _progressDragUp); //删除mouseup的监听事件        };        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);    }};;///<jscompress sourcefile="Page.js" />//窗体功能命名空间Namespace.register("U.UF.P");/* *   作用:给不同的域添加this的指定方向 *   @param {function}   fun 执行函数 *   @param {array}  arr 执行函数的参数数组 *   @param {element}    el 用于指向域     */U.UF.P.apply = function(fun, arr, el) {    return function() {        fun.apply(el, arr);    }}U.UF.P.pagepId = 0; //全局变量 分页控件数量/* **  @param {element} el 需要插入分页控件的位置 **  @param {number} num 数据的数量 **  @param {number} pagenum 一页中数据量的多少 **  @param {number} page 显示当前是第几页 **  @param {function} fun 回调函数 */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); //创建中间页码数的整体 , "style": { "cssText": "float:left"}         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) {                //创建中间的页码数,最高十页的页码数                //"className": "list" + U.UF.P.pagepId,                //"style": { "text-align": "center", "line-height": "31px;" },                 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 j = 0;        //        for (j; j < _forpagesum && i <= _pagesum; j++) {//循环有多少个页码,并且进行创建        //            (function (i, el) {        //                //创建中间的页码数,最高十页的页码数        //                //"className": "list" + U.UF.P.pagepId,        //                //"style": { "text-align": "center", "line-height": "31px;" },         //                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); //实现点击页码进行跳转        //                }, [i], el)        //            })(i, this);        //            i++;        //        }        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); //创建跳转页面的整体        //        var _pagesk = $$("div", { "className": "U_MD_F_YRL" }, _pages); //创建跳转页面的父级        $$("span", { "innerHTML": "到" }, _pages); //创建跳转元素        //        var _pagejump = $$("div", {}, _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); //上一页功能        //中间点击页码跳转功能 参数一:el  指向U.UF.P.page这个域   参数二:el1 点击中间页码的元素         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(); //如果是回车键,则 执行确定按钮功能            }        }    },    /*     **  作用:用于首页 上一页 下一页 尾页 输入框跳转 点击中间页码数的功能实现     **  @param {element} el 获取当前元素     **  @param {number} pagesum 总页数     **  @param {function} fun   回调函数     **  @param {element}  input 获取输入框的元素     */    fPage: function(el, pagesum, fun, input) {        _el1 = el.pid; //获取点击元素的pid,用于判断是首页 上一页 下一页 尾页 输入框跳转 点击中间页码数的功能        _el = _el1.charAt(_el1.length - 1); //截取pid最后一个数字,用于判断是首页 上一页 下一页 尾页 输入框跳转 点击中间页码数的功能        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) { //pid为1时,执行首页的功能            if (this.Index == 0) { this.Index++ } //判断当前索引是否为0,如果是 则执行索引++            if (this.PageNum > 1) { //判断当前页数是否大于1                U.selectEl(_list[0]).addClass("U_MD_F_Y_Button_Active");                this.Index = 0; //获取索引为0                this.PageNum = 1 //获取当前页数为1                this.pagefun(this.PageNum, _list); //执行页码跳转功能                fun(this.PageNum); //执行数据的跳转 this.PageNum 当前页数                return;            }            U.selectEl(_list[--this.Index]).addClass("U_MD_F_Y_Button_Active");        } else if (_el == 2) { //pid为2时,执行尾页功能            if (this.PageNum < this.Pageall) { //判断当前页码是否小于总页数                this.Index = pagesum; //获取索引值为总页数                this.PageNum = this.Pageall; //获取全局变量的当前页为总页数                this.pagefun(this.PageNum, _list); //执行页码跳转功能                fun(this.PageNum); //执行数据的跳转 this.PageNum 当前页数                return            } else {                U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");            }        } else if (_el == 3) { //pid为3时,执行上一页功能            if (this.Index > 0) { //判断当前索引是否大于0                U.selectEl(_list[--this.Index]).addClass("U_MD_F_Y_Button_Active"); //获取当前页的上一个页码的点击样式                this.PageNum--; //并且当前页减一                this.pagefun(this.PageNum, _list); //执行页码跳转功能                fun(this.PageNum); //执行数据的跳转 this.PageNum 当前页数                return            } else { // 判断第一页                U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active");            }        } else if (_el == 4) { //pid为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); //执行数据的跳转 this.PageNum 当前页数                return            } else { // 判断最后一页                U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active"); //获取最后一页的点击样式            }        } else if (_el == 5) { //pid为5时,执行点击中间页码跳转功能            this.pagefun(el, _list); //执行页码跳转功能            fun(this.PageNum); //执行数据的跳转 this.PageNum 当前页数            return        } else if (_el == 6) { //pid为6时,执行输入框功能            var _number = new RegExp("^[0-9]*$") //写一个正则表达式,只能够输入数字            if (input.value.match(_number)) { //判断输入的是否是数字                if (input.value >= 1 && input.value <= this.Pageall) { //判断输入的数字是否大于等于1,并且,输入的数字小于等于总页数                    this.PageNum = input.value; //输入的值为当前页码数                    this.pagefun(this.PageNum, _list); //执行页码跳转功能                    fun(this.PageNum); //执行数据的跳转 this.PageNum 当前页数                } else { //如果输入的不是数字                    U.alert("无效的输入"); //则弹窗提示                    U.selectEl(_list[this.Index]).addClass("U_MD_F_Y_Button_Active"); //并且点击样式不改变                }            }        }    },    /*     **  作用:用于首页、上一页、下一页、尾页、输入框、点击页码进行页码跳转的功能     **  @param {element} el  当前页码数     */    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))) { //这里有个取反            // 点击页码中间以后的页码处理 例如 1 2 3 4 .... 8 9 则 5以后的页码点击处理事件            //判断当前页码的最后一个数除以当前点击页码,向上取整,是否小于当前页码的最后一个数减去当前点击页码,并且索引值不为0            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) { //forEach循环数组,循环所有获取到的中间页码数,并且获取数组中的每一个元素的索引                    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) { //forEach循环数组,循环所有获取到的中间页码数,并且获取数组中的每一个元素的索引                    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) { //forEach循环数组,循环所有获取到的中间页码数,并且获取数组中的每一个元素的索引                    value.innerText = elthis.Pageall + 1 - ar.length + index;                }            ])        } else if (elNum < _listLength) { // 最小页码设置            [].__proto__.forEach.apply($(_list), [function(value, index, ar) { //forEach循环数组,循环所有获取到的中间页码数,并且获取数组中的每一个元素的索引                value.innerText = index + 1; // 跟中间的值进行比较            }])        }        // 页码点击处理事件        [].__proto__.forEach.apply(_list, [function(value, index, ar) { //forEach循环数组,循环所有获取到的中间页码数,并且获取数组中的每一个元素的索引            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"); //并且点击样式不改变    }};///<jscompress sourcefile="Picture.js" />Namespace.register("U.MD.UI.picture");/** * 图片控件调用接口函数 * @arr {Array || Object}  图片信息数组 * 形如:   *   ['//img/1.jpg', *   '//img/2.jpg', *   '//img/3.jpg', *   '//img/4.jpg', *   '//img/5.jpeg', *   '//img/6.jpg'] */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; /*定义缩放大小单位:px*/U.MD.UI.picture.focuspicsrc = ''; /*当前图片的src*/U.MD.UI.picture.focuspicsize = ''; /*当前图片的文件大小*//** * 图片控件创建函数 * @arr {Array || Object}  图片信息数组 */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'; /*让可拖拽区域的宽-60px*/    // 全局属性    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++) {        /*创建span*/        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() {        /*创建ul*/        var _ul = $$('ul', { id: "ul" }, U.MD.UI.picture.DIVBOX.PICAREA);        /*循环数据源*/        for (var i = 0; i < U.MD.UI.picture.DIVBOX.USERPICS.length; i++) {            /*创建li*/            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);                }            }        }    }    /**     * 旋转检测     * @param num 为整数     * 如果是0也就是false,调用右旋转。如果是1也就是true,调用左旋转。因为有万恶的ie8,所以要滤镜旋转 0-0°,1-90°,2-180°,3-270°,如果需要任意角度旋转去学习阵矩。     *     */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)";        /*U.MD.UI.picture.rotatenum % 2 !== 0 判断是否选转90°或者270°*/        if (U.MD.UI.picture.rotatenum % 2 !== 0) {            /*赋值大小,-20px是为了留间隙*/            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';            /*检测是否是ie8 or ie7*/            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 {            /*清空拖拽元素的style*/            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();        }        /*改变左上角的title的缩放比*/        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) + '%';    }    /**     * 兼容旋转     * @param el 旋转的元素     * @param val 旋转的属性值     */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;        /*检测是否是ie8 or ie7*/        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) + ")";    }    /**     * 图片切换     * @param num 整数orTRUE,FALSE     * true代表下一张,false代表上一张     */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]);        /*清空拖拽元素的style值*/        U.MD.UI.picture.DIVBOX.PICAREA.setAttribute('style', '');        /*调整大小,位置*/        U.MD.UI.picture.checkHeight();        /*旋转数初始0*/        U.MD.UI.picture.rotatenum = 0;    }    /**     * 功能:调整图片的大小,图片居中显示,改变左上角的title缩放比例     */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) {            /*-40px上下留白*/            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.height = U.MD.UI.picture.originalSize[1] + '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) + '%';    }    /**     * 获取图片的原来的大小     * @param img     * @returns {*[]} 返回值1:原始长度,值2:原始宽度     */U.MD.UI.picture.getImgNaturalDimensions = function(img) {        var nWidth, nHeight;        if (img.naturalWidth) { // 现代浏览器            nWidth = img.naturalWidth;            nHeight = img.naturalHeight        } else { // IE6/7/8            var image = new Image();            image.src = img.src;            nWidth = image.width;            nHeight = image.height;        }        return [nWidth, nHeight]    }    /**     * 拖拽     * @param dragEl 拖拽的元素     * @param bossEl 拖拽限制的范围元素     */U.MD.UI.picture.drag = function(dragEl, bossEl) {    dragEl.onmousedown = function(e) {        U.MD.UI.picture.mDown(dragEl, bossEl, e)    }}/** * 点击图片所触发的事件 * @param  {[object]} dragEl [拖拽的元素] * @param  {[object]} bossEl [拖拽限制的范围元素] * @param  {[event]} e      [] */U.MD.UI.picture.mDown = function(dragEl, bossEl, e) {    e = e || window.event;    /*定义拖拽元素到父级的X距离*/    var _distanceX = e.clientX - dragEl.offsetLeft;    /*定义拖拽元素到父级的Y距离*/    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 {        /*ie8*/        dragEl.ondragstart = function() {            return false;        };        dragEl.onselectstart = function() {            return false;        };    }}/** * 点击拖动图片时触发的事件 * @param  {[object]} dragEl     [拖拽的元素] * @param  {[object]} bossEl     [拖拽限制的范围元素] * @param  {[object]} _distanceX [拖拽元素到父级的X距离] * @param  {[object]} _distanceY [拖拽元素到父级的Y距离] * @param  {[event]} e          [] */U.MD.UI.picture.mMove = function(dragEl, bossEl, _distanceX, _distanceY, e) {    e = e || window.event;    /*移动距离*/    var _left = e.clientX - _distanceX,        _top = e.clientY - _distanceY;    /*判断是否是最顶部,默认显示窗体宽的1/8*/    _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);    /*判断是否是最底部,默认显示窗体宽的1/8*/    _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);    /*判断是否是最左部,默认显示窗体长的1/8*/    _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);    /*判断是否是最右部,默认显示窗体长的1/8*/    _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);}/** * 滚轮事件 * @param e */U.MD.UI.picture.getWheelDalta = function(e) {        e = e || window.event;        var delta = 0;        // delta的返回值为正时,表示向前滚动;delta的返回值为负时,表示向后滚动;        if (e.wheelDelta) {            // IE中,鼠标滚轮信息存放在wheelDelta属性中;向前滚动时,wheelDelta的值是120的倍数;向后滚动时,wheelDelta的值是-120的倍数;            delta = e.wheelDelta / 120;            if (window.opera) delta = -delta;        } else if (e.detail) {            // Firefox的鼠标滚轮信息存放在detail属性中;向前滚动,detail的值是-3的倍数;向后滚动,detail的值是3的倍数;            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;            }        }    }    /**     * 改变图片大小     * @param multiple 缩放大小     */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;    /*最小缩放长400px*/    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) { /*最大缩放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';    /*ie8,7,中心缩放位移*/    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) + '%';};///<jscompress sourcefile="Video.js" />Namespace.register("U.MD.UI.video"); //注册命名空间/** * 创建视频 * @param src 资源地址 * @param width 视频宽度 * @param height 视频高度 * @param autoplay 是否自动播放 * @param parent 生成在哪个元素 */U.MD.UI.video = function(src, width, height, autoplay, parent) {    var _autoplay = autoplay || false; //检测自动播放    var _intervalTemp = null; //用于记录interval的值    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;};/** * 生成元素 * @param src 视频资源地址 * @param width 视频宽度 * @param height 视频高度 * @param autoplay 是否自动播放 * @param parent 父元素 */U.MD.UI.video.appendEle = function(src, width, height, autoplay, parent) {    var els = {};    //包括视频和控制器的大div    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", //视频class        "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);    //显示当前时间的div    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);    //显示实际时间的div    els.DurationDiv = $$("div", {        "className": "U_MD_UI_video_Time", //设置class        "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); //设置class    //全屏按钮    els.fullScreenBtn = $$("div", { "className": "U_MD_UI_video_FullScreen" }, els.controls);    return els;};/** * 给元素添加事件 * @param els 传入所有元素 * @param intervalTemp 传入intervalTemp * @param volumeTemp 传入volumeTemp * @param moving 传入moving * @param tempHeight 传入tempHeight * @param tempWidth 传入tempWidth * @param fullscreen 传入fullscreen */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) { //设置全屏状态事件(webkit)        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) { //设置全屏状态事件(w3)        els.videoDiv.onfullscreenchange = function() {            var rtn = U.MD.UI.video.fullscreenChange(fullscreen, tempHeight, tempWidth, els); //设置全屏状态事件(w3)            fullscreen = rtn[0];            tempHeight = rtn[1];            tempWidth = rtn[2];        }    } else if (els.videoDiv.onmozfullscreenchange !== undefined) { //设置全屏状态事件(moz)        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);    };    /**     * 进度条圆点按下事件     * @param event 按下事件     */    els.progressCircle.onmousedown = function(event) {        U.MD.UI.video.circleMove(event, moving, els);    };    /**     * 音量条鼠标按下事件     * @param event 事件     */    els.soundProgress.onmousedown = function(event) {        U.MD.UI.video.soundProgressMove(event, els, moving); //执行soundProgressMove函数    };    /**     * 进度条鼠标按下事件     * @param event 事件     */    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"; //设置暂停按钮的icon(修改class)        clearInterval(intervalTemp); //清除刷新的interval    };    /**     * 视频播放事件,用于设置播放按钮与启动刷新     */    els.video.onplay = function() {        els.playPauseBtn.className = "U_MD_UI_video_PlayPauseButton U_MD_UI_video_PauseIcon"; //设置开始按钮的icon(修改class)        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(event, els);    };};/** * 让控制栏可以隐藏 * @param event 视频点击事件 * @param els 元素集合 */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(); //暂停播放    }};/** * 静音按钮 * @param els 元素集合 * @param volumeTemp 临时记录音量 * @param moving 记录是否正在移动(刷新数据用) * @returns {*} 返回volumeTemp */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) { //如果音量等于0(即静音),且用户没有按过静音键        els.video.volume = volumeTemp; //设置音量        volumeTemp = null; //将变量值重置        U.MD.UI.video.flushInfo(moving, els.currentTimeDiv, els.DurationDiv, els.progressCurrentTime, els.soundProgressCurrent, els.video); //刷新信息    }    return volumeTemp; //返回volumeTemp};/** * 全屏按钮点击事件 * @param fullscreen 是否全屏 * @param els 元素集合 */U.MD.UI.video.fullscreenClick = function(fullscreen, els) {    if (!fullscreen) { //如果没全屏        if (els.videoDiv.requestFullScreen) { //请求全屏(w3)            els.videoDiv.requestFullScreen(); //请求全屏(w3)        } else if (els.videoDiv.webkitRequestFullScreen) { //请求全屏(webkit)            els.videoDiv.webkitRequestFullScreen(); //请求全屏(webkit)        } else if (els.videoDiv.mozRequestFullScreen) { //请求全屏(moz)            els.videoDiv.mozRequestFullScreen(); //请求全屏(moz)        }    } else { //如果已全屏        if (document.exitFullScreen) { //取消全屏(w3)            document.exitFullScreen(); //取消全屏(w3)        } else if (document.webkitCancelFullScreen) { //取消全屏(webkit)            document.webkitCancelFullScreen(); //取消全屏(webkit)        } else if (document.webkitExitFullscreen) { //取消全屏(webkit)            document.webkitExitFullscreen(); //取消全屏(webkit)        } else if (document.mozExitFullScreen) { //取消全屏(moz)            document.mozExitFullScreen(); //取消全屏(moz)        }    }};/** * 全屏状态改变事件 * @param fullscreen 记录是否全屏 * @param tempHeight 临时高度 * @param tempWidth 临时宽度 * @param els 元素集合 * @returns {*[]} 返回部分改变后的变量 */U.MD.UI.video.fullscreenChange = function(fullscreen, tempHeight, tempWidth, els) {    if (!fullscreen) { //如果没全屏,则进行全屏准备操作        //tempHeight = els.videoDiv.offsetHeight + "px";//备份视频div高度        //tempWidth = els.videoDiv.offsetWidth + "px";//备份视频div宽度        els.videoDiv.style.height = "100vh"; //100vh为覆盖整个页面        els.videoDiv.style.width = "100vw"; //100vw为覆盖整个页面        els.videoDiv.style.position = "absolute"; //将视频设置绝对定位        els.videoDiv.style.top = "0"; //移动到最上        els.videoDiv.style.left = "0"; //移动到最左        els.videoDiv.style.zIndex = "999"; //设置zIndex最高    } else { //退出全屏        els.videoDiv.style.height = tempHeight + "px"; //恢复高度        els.videoDiv.style.width = tempWidth + "px"; //恢复宽度        els.videoDiv.style.position = ""; //清除绝对定位        els.videoDiv.style.top = ""; //清除top属性        els.videoDiv.style.left = ""; //清除left属性        els.videoDiv.style.zIndex = ""; //清除zIndex属性    }    fullscreen = !fullscreen; //设置全屏状态    return [fullscreen, tempHeight, tempWidth];};/** * 时间格式化(数字秒转换成00:00的格式) * @param time 待转换的时间(秒) 例:30 * @returns {string} 返回的时间  例:00:30 */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; //返回生成的时间};/** * 刷新数据 * @param moving 是否正在移动(用于判断要不要刷新) * @param currentTimeDiv 当前时间元素 * @param DurationDiv 视频总长度元素 * @param progressCurrentTime 进度条当前长度 * @param soundProgressCurrent 音量当前长度 * @param video 视频元素 */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 + "%"; //音量刷新};/** * 获取当前元素左边到屏幕最左边的距离 * @param el 元素 * @returns {number} 返回距离(不包括单位) */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; //返回距离};/** * 循环刷新信息 * @param _moving 是否正在移动 * @param _els 元素 * @returns {number} interval */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); //每半秒刷新一次};/** * 进度条(圆点)移动事件函数 * @param event 鼠标按下事件 * @param moving 是否正在移动 * @param els 元素 */U.MD.UI.video.circleMove = function(event, moving, els) { //进度条移动函数(圆点)    moving = true; //设置移动状态    var _e = event; //读取event    var _content = event.currentTarget; //获取目标    var _startX = _e.pageX; //设置一个开始的x点    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; //重置开始的x点    };    els.videoDiv.onmouseup = function() { //清除事件        moving = false; //恢复移动状态        els.videoDiv.onmousemove = function() { //清除移动事件        };        els.videoDiv.onmouseup = function() { //清除mouseup事件        };    };};/** * 声音进度条拖动函数 * @param event 事件 * @param els 元素集合 * @param moving 是否正在移动 */U.MD.UI.video.soundProgressMove = function(event, els, moving) { //注释见move函数    event.preventDefault(); //取消事件的默认动作    var _e = event; //声明event    var _content = event.currentTarget; //获取soundprogress    var _startX = _e.pageX; //设置一个开始的x点    var _currentSound = els.soundProgressCurrent; //当前的音量条元素    var _x = event.offsetX; //获取现在鼠标相对于音量条的x点    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); //刷新信息    /**     * mousemove函数     * @param e 事件     */    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; //重置开始的x点    };    els.videoDiv.onmouseup = function(e) {        els.videoDiv.onmousemove = function() { //清除mousemove事件        };        els.videoDiv.onmouseup = function() { //清除mouseup事件        };    };};/** * 进度条拖动函数 * @param event 事件 * @param els 元素集合 * @param moving 是否正在移动 */U.MD.UI.video.progressMove = function(event, els, moving) { //部分注释见move函数    event.preventDefault(); //清除默认事件    if (event.target.className === "U_MD_UI_video_ProgressCircle") { //如果class是圆点的话返回        return;    }    var _e = event; //记录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() { //清除事件        };    };};;///<jscompress sourcefile="BTree.js" />Namespace.register("U.MD.UI.BTree");//json要求://里面需要包含id,name,deep(依赖),img_url(显示图片源),child(附属目录),为一个数值,每一个值为一个json,child的格式也是一样//案例// [{ id: "1", name: "文件夹", deep: 0, img_url: 'http://api.1473.cn/Uform/Image/tree/folder.png',//child: [{ id: "2", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png",//  child: [{ id: "5", name: "文件夹", deep: 2, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]// },//{ id: "3", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png" },//{ id: "4", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]//}]//var json = [{ id: "1", name: "文件夹", deep: 0, img_url: 'http://api.1473.cn/Uform/Image/tree/folder.png',// child: [{ id: "2", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png",//   child: [{ id: "5", name: "文件夹", deep: 2, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]// },// { id: "3", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png" },//{ id: "4", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]//},{ id: "6", name: "文件夹", deep: 0, img_url: 'http://api.1473.cn/Uform/Image/tree/folder.png', child: [{ id: "8", name: "文件夹", deep: 6, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png",//      child: [{ id: "9", name: "文件夹", deep: 8, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]//  },// { id: "10", name: "文件夹", deep: 6, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png" },//{ id: "11", name: "文件夹", deep: 6, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]},{ id: "7", name: "文件夹", deep: 0, img_url: 'http://api.1473.cn/Uform/Image/tree/folder.png',}];/*开始方法一,用来生成树和后台管理页面arr {arr} 要解析的json arr对象bookfun {function} 点击事件dateDeleteFun {function} date的删除方法dateUpdateFun {function} date的修改方法dateInsertFun {function} date的添加方法tree {object} 右侧要插入后台li的地方directory {object} 要插入后台li的地方list {object} 左侧放添加标签的的地方listimg {String} 后台页面的imgdeteimg {String} 是否启用删除标签的图片upimg {String} 是否启用修改标签的图片*/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); //调用方法,生成管理页面}/*将二维数组转化为列表的方法json {arr} 数据源json里面需要包含id,name,deep(依赖),img_url(显示图片源),child(附属目录),外部是数组tree {object} 要插入列表的地方bookfun {function} 没一行的点击事件*/U.MD.UI.BTree.treeCreate = function(json, tree, onclickfun) {    for (var _i = 0; _i < json.length; _i++) { //创建循环,解析json数组,得到每一个json        var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree); //创建var对象,在tree中创建ul        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对象,在ul中创建li,id为a+jsonid        var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li); //创建var对象,在li中创建img        var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li); //创建var对象,在li中创建span,内容为json的name        _ul.style.display = "none";        if (json[_i].deep == "1") { _ul.style.display = "block" } //进行判断,判断是否为一级目录,不是的先隐藏        _img.aa = false; //定义img的一个变量,用来控制列表的展开和关闭        var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0]; //定义一个let对象为获取到的对应的li对象        _ul.style.display = _liobj.style.display; //如果是展开状态,显示ul        _li.onclick = function() { //定义li的点击事件            onclickfun(this); //执行bookconlick函数,改变book对象的内容            _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);            if (_img.aa === true) { //如果img.aa等于true                _img.aa = false; //修改img.aa对象为false                for (var _ii = 0; _ii < _liobj.length; _ii++) { //定义循环,循环对象为获取到的li对象集合                    _liobj[_ii].style.display = "none"; //将集合隐藏                }            } else { //如果img.aa等于false                _img.aa = true; //修改img.aa等于true                for (var _ii = 0; _ii < _liobj.length; _ii++) { //定义循环,循环对象为获取到的li对象集合                    _liobj[_ii].style.display = "block"; //将集合显示                }            }        }        if (json[_i].child) {            U.MD.UI.BTree.treeCreate(json[_i].child, _ul, onclickfun); //重新调用函数,参数为child的对象数组,ul对象,20的边距值,隐藏,改变的book对象        }    }}/*在json中查找指定id下的childjson {arr} 要查找的arr对象parentID {String} 要查找的id*/U.MD.UI.BTree.JsonSelect = function(json, parentID) {        var _json = []; //创建一个变量_json,来接收筛选后的json        for (var _i = 0; _i < json.length; _i++) { //创建循环,循环对象为json            if (parentID == 0) { //判断parentID是否为0,如果是                return json; //返回json            } //如果不是            if (json[_i].id == parentID) { //判断json中各个对象的id是否与parentID相等,如果是                _json = json[_i].child; //变量_json等于json中对应对象的child值                return _json; //返回变量_json            } //如果不是            if (json[_i].child) { //判断json中对象是否有child值,如果有                var _return = U.MD.UI.BTree.JsonSelect(json[_i].child, parentID); //定义变量_return 值为调用方法本身的返回值            }        }        return _return; //返回_return    }    /*    创建查询管理目录的方法    json {arr} 要解析的json arr对象    tree {object} 左侧要插入后台li的地方    list {object} 左侧放添加标签的的地方    jsonpid {String} 添加标签的深度    jsondelete {function} json的删除方法    jsonupdate {function} json的修改方法    jsonadd {function} json的添加方法    deteurl {String} 是否启用删除标签的图片    upurl {String} 是否启用修改标签的图片    i {String} tree的对象值,控制下一级    j {String} tree的对象值,控制上一级    */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 = "修改"; //定义变量_buttonText,代表修改按钮的默认值        var _button1Text = "删除"; //定义变量_button1Text,代表删除按钮的默认值        if (deteurl && upurl) { //进行判断,是否提供默认按钮,如果不是            _buttonText = ""; //消除_buttonText            _button1Text = ""; //消除_button1Text        }        tree[i].innerHTML = ""; //将tree中的内容清空        list[i].parentID = jsonpid; //给list定义一个变量        list[i].deep = i + 1; //给list定义深度变量        if (j) { //判断是否有输入上一级            tree[j].innerHTML = ""; //如果有,清空上一级        }        if (json) { //如果json存在            for (var _i = 0; _i < json.length; _i++) { //创建循环,循环对象为json                var _ul = $$("ul", { className: "U_MD_UI_Tree_styleul", parentid: json[_i].parentID, deep: json[_i].deep }, tree[i]); //创建在tree中创建ul                var _li = $$("li", { className: "U_MD_UI_Tree_styleli", innerHTML: json[_i].name, parentid: json[_i].id }, _ul); //创建li在tree的下一级中,css为styleli                var _button = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _buttonText, className: "U_MD_UI_Tree_button" }, _ul); //创建修改button在在li中,css为stylebutton                var _button1 = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _button1Text, className: "U_MD_UI_Tree_button1" }, _ul); //创建删除button在在li中,css为stylebutton                //创建删除button在在li中,css为stylebutton                _button.onclick = function() { //给修改按钮定义onclick事件                    jsonupdate(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i); //事件为调用jsonupdate方法,输入this为变量                }                _button1.onclick = function() { //给删除按钮定义oncick事件                    jsondelete(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i); //事件为调用jsondelete方法,输入this为变量                }                _li.onclick = function() { //给li定义onclick事件                    if (j) { //判断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); //调用添加方法,进行添加        }    }    /*    在json中插入json的方法    json {arr} 要被插入的json对象    addjson {json} 要查入的json对象    */U.MD.UI.BTree.jsonAdd = function(json, addjson) {    var _addid = addjson.parentID; //定义要目的地id,等于插入json的parentID值    if (_addid == "0") { //进行判断,判断目的地id是否在第一层(0)        json[json.length] = addjson; //如果在,直接在json的第一层中加入要插入的json        return json; //结束方法,返回json对象    }    for (var _i = 0; _i < json.length; _i++) { //创建循环,解析json数组,得到每一个json        if (json[_i].id == _addid) { //进行判断,判断json的id是否等于获取到的目的地id,如果是            if (json[_i].child) { //进行判断,判断json的child有没有值                json[_i].child[json[_i].child.length] = addjson; //如果有,就在其中添加插入对象                return json; //结束方法,返回json对象            } else { //如果json中没有child                json[_i].child = [];                json[_i].child[json[_i].child.length] = addjson; //将json的child等于插入的对象                return json; //结束方法,返回json对象            }        }        if (json[_i].child) { //如果json的id不与目的地id相等且json中存在child            var _return = U.MD.UI.BTree.jsonAdd(json[_i].child, addjson); //定义函数,调用自己,变量为json的child,要插入的json            json[_i].child = _return; //json的child等于返回的json        }    }    return json; //返回json对象}/*开始方法二,生成后台管理页面arr {arr} 要解析的json arr对象bookfun {function} 点击事件jsonDeleteFun {function} json的删除方法jsonUpdateFun {function} json的修改方法jsonInsertFun {function} json的添加方法tree {object} 右侧要插入后台li的地方directory {object} 要插入后台li的地方mulu {object} 左侧放添加标签的的地方muluimg {String} 后台页面的imgdeteimg {String} 是否启用删除标签的图片upimg {String} 是否启用修改标签的图片*/U.MD.UI.BTree.jsonStartA = function(arr, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, tree, directory, mulu, muluimg, deteimg, upimg) {        json = []; //将外变量josn清空        var _json = arr; //定义局部变量_json,值为r        for (var _i = 0; _i < _json.length; _i++) { //定义循环,循环对象为            U.MD.UI.BTree.jsonAdd(json, _json[_i]); //运行函数,生成json        }        tree.innerHTML = ""; //清空tree的内容        U.MD.UI.BTree.jsonStartRight(tree, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, directory, mulu, muluimg, deteimg, upimg); //调用方法,生成管理页面    }    /*    生成后台管理页面及管理页面li    tree {object} 右侧要插入后台li的地方    bookfun {function} 点击事件    jsonDeleteFun {function} json的删除方法    jsonUpdateFun {function} json的修改方法    jsonInsertFun {function} json的添加方法    directory {object} 要插入后台li的地方    mulu {object} 左侧放添加标签的的地方    muluimg {String} 后台页面的img    deteimg {String} 是否启用删除标签的图片    upimg {String} 是否启用修改标签的图片    */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); //创建对象,在tree中创建ul        var _li = $$("li", { className: "U_MD_UI_Tree_listyle", yid: "1" }, _ul); //创建对象,在ul中创建li,id为a+jsonid        var _img = $$("img", { "onerror": U.MD.C.imgError, src: muluimg, className: "U_MD_UI_Tree_imgstyle" }, _li); //创建对象,在li中创建img        var _span = $$("span", { innerHTML: "目录管理", className: "U_MD_UI_Tree_spanstyle" }, _li); //创建对象 在li中创建span        _li.onclick = function() { //设置li的点击事件            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); //运行方法,修改json                        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); //运行方法,修改json                    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; //获取添加的parentid                    _json.deep = objects.parentNode.deep; //获取添加的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); //创建li                        }                        json = U.MD.UI.BTree.jsonAdd(json, _ret); //刷新json                        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); //调用方法,生成一级目录        }    }    /*    生成左边树状图的方法    arr {arr} 要处理的arrjson对象    tree {object} 要插入树状图的地方    bookfun {function} 点击事件    */U.MD.UI.BTree.jsonStartLeft = function(arr, tree, bookfun) {        json = []; //将外变量josn清空        var _json = arr; //定义局部变量_json,值为r        for (var _i = 0; _i < _json.length; _i++) { //定义循环,循环对象为            U.MD.UI.BTree.jsonAdd(json, _json[_i]); //运行函数,生成json        }        tree.innerHTML = ""; //清空tree的内容        U.MD.UI.BTree.treeCreate(json, tree, bookfun); //运行方法,在tree中生成树状图    }    /*    json的删除方法    json {arr} 要处理的arrjson对象    pid {String} 要删除的id    */U.MD.UI.BTree.jsonDelete = function(json, pid) {        for (var _i = 0; _i < json.length; _i++) { //定义循环,循环对象为json            if (json[_i].id == pid) { //进行判断,判断json[_i]是否为目标pid                json.splice(_i, 1); //删除                return json; //返回json            } else {                if (json[_i].child) { //如果有child                    json[_i].child = U.MD.UI.BTree.jsonDelete(json[_i].child, pid); //重复调用方法                }            }        }        return json; //返回json    }    /*    json的搜索方法    json {arr} 要处理的arrjson对象    id {String} 要删除的id    */U.MD.UI.BTree.jsonSelectA = function(json, id) {        for (var _i = 0; _i < json.length; _i++) { //定义循环,循环对象为json            if (json[_i].id == id) { //进行判断,判断json[_i]是否为目标pid                return json[_i]; //返回目标            }            if (json[_i].child) { //如果有child                var _return = U.MD.UI.BTree.jsonSelectA(json[_i].child, id); //重复调用方法                if (_return) { //当返回有值                    return _return; //返回结果                }            }        }        return false;    }    /*    json的修改方法    json {arr} 要处理的arrjson对象    upjson {json}要插入的json    */U.MD.UI.BTree.jsonUpdate = function(json, upjson) {        for (var _i = 0; _i < json.length; _i++) { //定义循环,循环对象为json            if (json[_i].id == upjson.id) { //进行判断,判断json[_i]是否为目标pid                json[_i] = upjson; //进行替换                return json; //返回json            }            if (json[_i].child) { //如果有child                var _return = U.MD.UI.BTree.jsonUpdate(json[_i].child, upjson); //重复调用方法                if (_return) { //当返回有值                    json[_i].child = _return;                    return json; //返回结果                }            }        }        return false;    }    /*    搜索arr中最高的id方法    arr {arr} 要搜索的arr对象    */U.MD.UI.BTree.createID = function(arr) {    var _return = 0; //定义变量    for (var _i = 0; _i < arr.length; _i++) { //定义循环,循环对象为arr        if (parseInt(arr[_i].id) > _return) { //进行判断,如果arr的id比_return大            _return = parseInt(arr[_i].id); //修改_return的值        }    }    return _return; //返回变量};///<jscompress sourcefile="Editor.js" />//编辑器Namespace.register("U.MD.UI.editor");/* 默认编辑器,嵌入到指定元素内 *  @param parent {element} 创建在指定的父亲元素 *  @param callback {function} 非必传  操作处理函数 *         操作处理函数 该函数默认第一个参数为操作记录。 *         格式形如 : { updateLine : [修改行ID, 修改行ID,], addLine : [添加行ID], deleteLine : [删除行ID] } * */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" });    //  parent.innerHTML = ''; //清空区域内容    //!$(parent).find($('.editorBar'))[0] ? "" : U.selectEl('.editorBar').remove();    //_div = $$("div", { "className": "editorBar" }, parent);    //创建div    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];    //把编辑区域赋值给editor    return U.MD.UI.editor.operateJson;    //返回可操作集合}U.MD.UI.editor.operateJson = {    /*     * U.MD.UI.editor.loadContent  加载编辑器内容     * param1 text(str) 需要加载的文本内容     * */    loadContent: function(text) {        this.editor.focus();        U.UF.E.onpaste(null, this.editor, text);        // var _div = $$("div", { innerHTML: text, style: { display: "none"} }, document.body);        // var _pdiv = U.UF.E.unifiedFormat(_div);        //        var _range = U.UF.E.getRangeAt();        //        var _block = U.UF.E.getLineElement(_range.startContainer);        //        for (var i = 0; i < _pdiv.children.length; i++) {        //            _block.parentElement.appendChild(_pdiv.children[i]);        //        }        //        U.selectEl(_block).remove();        // U.selectEl(_div).remove();    },    /*     * U.MD.UI.editor.getContent 得到编辑器内容     * */    getContent: function() {        return this.editor.innerHTML;        //直接返回编辑区域的内容    }};/*U.MD.UI.editor.CreateEditor 创建HTML内容param1 parent(elemt)父元素*/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" + //onchange='U.UF.E.picture(this)'        "        </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" + //accept=\"image/*\"        "       </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 创建绑定事件param1 parent(elemt) 范围*/U.MD.UI.editor.EditorEventBind = function(parent) {    //绑定图片拉伸    //   U.UF.E.key($('.editor', 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('.upload', parent)[0].onchange = function () {    //        U.UF.E.picture(this);    ////        上传图片    //                var _this = this;    //                U.UF.UP.inputUpload([_this], 'http://disk.1473.cn/USUpfile.ashx?typename=UseStudioEditor&UserId=FA92AAC5-4134-449F-9659-0DC12F4F68E9', function (r) {    //                    var img = '<img style="max-width: 80%;" src="http://fs.1473.cn/' + r.value[0] + '">';    //                    U.UF.E.addRange(img);    //                    _this.value = '';    //                });    //    }    /*$('.editor', parent)[0].onpaste = function (e) {        //绑定粘贴        var _text = e.clipboardData.getData('text/html') || event.clipboardData.getData("text/plain");        var _div = $$("div", { innerHTML: _text, style: { display: "none"} }, document.body);        U.UF.E.unifiedFormat(_div);        document.body.removeChild(_div);    };*/    U.selectEl('.a', parent).bind('click', function() {        U.UF.E.addHref();    });    //添加a标签    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' });    });    //居右};/** * 下拉框 * @param choosecon 【object】必选 若需要value值使用集合({'11111111':'aaaaaaaa','2222222':'bbbbbbbb','33333333':'cccccccc'})键名为value值 * @param selattr 【object】必选 设置最外层div的属性值 * @param optionevent 【function】必选 给每个选择区域的点击后回调函数,参数一:value值或者文本值 * @param parentnode 【element】可选 添加到里面的元素 * @returns {*} 【element】 返回出创建好的下拉控件 * @constructor */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); //小三角    //_text = $$('div', { style: { cssText: "padding-left: 6px;  overflow: hidden; height:100%;cursor: pointer;"} }, _textarea), //创建显示文本内容div    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.border ? _selectEl.style.border = '1px solid #000' : '';    //    !selattr.style.background ? _selectEl.style.background = '#fff' : '';    //    !selattr.style.width ? _selectEl.style.width = "122px" : '';    //    !selattr.style.height ? _selectEl.style.height = '24px' : '';    (selattr.style && !selattr.style.position) ? _selectEl.style.position = 'relative': '';    (selattr.style && !selattr.style.textIndent) ? _textarea.style.textIndent = '6px': '';    //    !selattr.style.overflow ? _selectEl.style.overflow = 'hidden' : '';    _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; //返回创建元素};;///<jscompress sourcefile="Excel.js" />//excel控件Namespace.register("U.MD.UI.excel");;///<jscompress sourcefile="Reply.js" />Namespace.register("U.MD.R");/** * 评论控件全局变量 * PID // 项目id,请查看api文档说明,找到你所在项目的id。 * AID // 对应的文章id,获取url网址的主机,加上url网址的目录,形成的文章id。 * URL // 文章对应的url地址。 * PageIndex // 当前页数 * PageSize // 一页请求数 * AllCount // 此文章对应的有多少数据 * */U.MD.R.data = {    PID: "",    AID: "",    URL: "",    PageIndex: 1,    PageSize: 20,    AllCount: "",    CB: null}/** * 评论控件初始化函数,调用函数 * @param  {object} 参数。 * obj={ *      pid // 项目id,请查看api文档说明,找到你所在项目的id。 *      type //引用方式为弹窗还是嵌入式,true 为嵌入式方式,false 为窗体。 *      el // 评论控件追加的元素。注意:当控件为嵌入式时,才需要填写此参数,如果为弹窗时,不需要填写此参数。 * } */U.MD.R.reply = function(obj) {    //alert();    //定义变量,获取调用方式、控件追加的元素、以及项目id.    U.MD.R.login.cookieLogin(function() {        var _type = obj.type,            _el = obj.el,            _cb = obj.cb;        U.MD.R.data.PID = obj.pid; //项目id全局设置        U.MD.R.data.AID = U.MD.R.reply.getUrlHash(); //文章id全局设置        U.MD.R.data.URL = U.MD.R.reply.getUrl(); //文章url全局设置        U.MD.R.data.CB = _cb;        //调用类型判断        if (!_type) { //如果调用方式是窗体,那么先创建一个窗体,并且重新更新变量_el的值。            _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"        }); //动态添加css文件        U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/Basic/Picture.js" });    }); //cookie自动登录}/** * 评论控件初始化函数,调用函数 * @param  {element} 追加元素 */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); //创建基础html    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) : ""; //取数完成之后进行将页数全局赋值给id。        U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false); //打印数据        U.MD.R.initLoadMoreBtn(data[0]); //创建    });}/** * 获取url地址 */U.MD.R.reply.getUrl = function() {    return window.location.href;}/** * 获取url网址的主机,加上url网址的目录 */U.MD.R.reply.getUrlHash = function() {    return U.UF.EC.SparkMD5.hash(window.location.href);}/** * 获取评论数据 * @param  {number} 页码数 * @param  {number} 一页的请求量 * @param  {function} 回调函数 */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); //执行回调函数,并且返回数据。    });}/** * 初始化创建回复元素 * @param  {element} 追加元素 */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", { //创建头像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); //创建内容框架div    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]);            //$(this)[0].append($("#U_MD_UI_face")[0]);            //$(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); //上传    _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 {        // _btn.innerHTML = "还没有人评论";    }}/** * 打印一级评论 * @param  {object} 评论数据 * @param  {element} 追加元素 * @param  {number} 用于判断层级而显示指定内容 * @param  {boolean}元素插入类型 * @param  {boolean} 是否需要回复功能,默认为false * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型 */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, //评论id                rpid: _data[0][i].ReplyParentID, //评论父级id                deep: _data[0][i].ReplyDeep, //评论深度                topid: _data[0][i].ReplyID, //评论顶级id                uid: _data[0][i].UserID, //评论用户id                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 = '';    }}/** * 打印二级评论,用于区分用户点击回复或者查看更多。 * @param  {sring} 评论id * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型 */U.MD.R.viewComment = function(rid, type) {    if (US.userInfo.userid) {        var            _rid = rid, //父级id            _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) { //根据评论id,获取此评论,此评论点赞数,以及子目录下所有的评论还有点赞数            _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, //评论的用户id                                un: _data[2][j].un, //评论的用户名                                tx: _data[2][j].tx //评论的头像                            }                        }, false, true, true);                    }                }            }        });    } else {        U.Alert("请先登录");    }}/** * 打印评论数据内容 * @param  {object} 评论数据 * @param  {element} 追加元素 * @param  {object} 用于判断层级而显示指定内容 * object={ *  rid,//评论id *  rpid,//评论父级id *  deep,//评论深度 *  topid,//评论顶级id *  uid,//评论用户id *  un,//评论用户名 *  tx,//评论用户头像 *  time,//评论时间 *  content,//评论内容 *  likesnum,//评论点赞数 *  shownum,//评论子集(所有子集)的评论数 * } * @param  {boolean} 元素插入类型 * @param  {boolean} 是否需要回复功能,默认为false * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型 */U.MD.R.printCommentHtml = function(el, type, data, appendtype, isreply, readmore) {    var _data = data,        _el = el,        _type = type,        // _eltype = obj.eltype ? obj.eltype : false,        // _showmore = obj.showmore,        _rid = _data.rid, //评论id        _rpid = _data.rpid, //评论父级id        _deep = _data.deep, //评论顶级id        _topid = _data.topid, //评论顶级id        _uid = _data.uid, //评论用户id        _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 : "", //评论的用户id        _replyinfo_un = _data.replyinfo ? _data.replyinfo.un : "", //评论的用户名        _replyinfo_tx = _data.replyinfo ? _data.replyinfo.tx : "", //评论的头像        _appendtype = appendtype, //评论插入的方式,如果为true,那么就插入到所有评论的第一个(用于以及评论和二级评论),如果为false,那么就插入到最后一个        _isreply = isreply, //点击回复按钮,是否是弹出回复框,还是弹出查看更多,默认为false,        _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, //创建子集评论-评论操作区域-上传input        _button, //创建子集评论-评论操作区域-发布按钮        _img_warp, //创建子集评论-评论操作区域-图片显示区域        _childrenbox; //用于存放子集评论    _box = $$("div", { "className": "U_MD_R_content_box" }); //创建内容盒子    if (_appendtype) { //判断插入类型是否为true,如果为true,那么就插入到所有评论的第一个(用于以及评论和二级评论),如果为false,那么就插入到最后一个        U.selectEl(_el).append(_box, 0, U.selectEl(_el)[0].firstChild);    } else { //如果为false,那么就插入到最后一个        U.selectEl(_el).append(_box);    }    _info = $$("div", { "className": "U_MD_R_content_box_warp" }, _box); //创建信息div    U.selectEl(_info).attr({ //给评论内层设置评论id、评论父级id、评论深度、评论顶级id、评论用户id。用于回复时获取信息。        "data-rid": _rid, //评论id        "data-RPID": _rpid, //评论父级id        "data-RD": _deep, //评论深度        "data-RBID": _topid, //评论顶级id        "data-RPUID": _uid //评论用户id    });    _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); //创建右侧div    _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, this.src, this.src], 2);            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";                }            })            //_likesimg.src = "/img/reply/Fabulous.png";    }    _replywarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_replywarp" }, _content_bottom); //评论右侧内容-底部区域-回复最外层    if (_readmore) { //点击回复按钮,是否是弹出回复框,还是弹出查看更多,默认为false。如果为true,在元素下方显示出评论操作元素。        _replywarp.onclick = function() {            U.MD.R.subsetReply(this);        }    } else {        _replywarp.onclick = function() { //如果为false,弹出一个窗体。            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) { //如果类型为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)) { //如果是2级和3级以下,那么就创建操作区域。        _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        _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; //返回元素    }}/** * 图片上传函数 * @param  {element} input 元素 * @param  {element} 上传成功后,图片插入的位置。 */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", { //创建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); //创建img            $$("div", { "className": "closebtn", "onclick": "U.MD.R.uploadImages.close(this)" }, _imgwarp);            U.alert("上传成功");        } else { //否则提醒用户选择上传图片文件            U.alert("请上传图片文件");            return;        }    }, []);}/** * 图片关闭函数 * @param  {element} 事件源 */U.MD.R.uploadImages.close = function(el) {    U.selectEl(el).Parent().remove();}/** * 二级以下(包括二级、三级等等)评论点击回复后显示隐藏操作区域 * @param  {element} 事件源 */U.MD.R.subsetReply = function(el) {    // U.selectEl(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;                    // _val1 = _more1.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]);                            //$(_el).attr({"data-replyid": _data[1][i].ReplyID});                        }                        _type = 2;                    }                    if (_position == 4) {                        _el = U.selectEl($(_el).Parent()).Parent();                        _type = 3;                    }                    _more.innerText = ++_val;                    //_more1.innerText = ++_val1;                    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, //评论的用户id                        un: _data.un, //评论的用户名                        tx: _data.tx //评论的头像                    }                }, _appendtype, _isreply, _readmore);                // if (_position == 3) {                //     var _box1 = $$("div", {"className": "U_MD_R_content_warp_box"}, _box);                //     U.selectEl(_box1).attr({"data-replyid": _data[1][i].ReplyID});                // }                U.alert("评论成功");            });        } else {            U.alert("请输入评论内容");        }    } else {        U.Alert("请先登录");    }}/** * 点赞函数 * @param  {element} 事件源 * @param  {string} 评论id * @param  {string} 用户id */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("请先登录");    }}/** * 图片错误所执行的函数 * @param  {element} 事件源 */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();        });    }}/** * cookie登录,如果登录成功,则修改头像以及用户名 */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;};///<jscompress sourcefile="Table.js" />Namespace.register("U.MD.UI.table");/*    表格控件的基础函数    param1 datasource 数据源是一个object类型数组。    param2 titles 标题是一个json类型数据    param3 css 样式是一个json类型数据    param4 parent 父元素 */U.MD.UI.table = function(datasource, titles, css, parent) {        U.MD.UI.table.thead(datasource, titles, css, parent);        //创建表格    }    /*        表格控件的头部函数        param1 {json} datasource 数据源是一个object类型数组。        param2 {json} titles 标题是一个json类型数据        param3 {json} css 宽度是一个json类型数据        param4 {element} parent 父元素        param5 {number} index 默认页面        param6 {number} prows 页面    */U.MD.UI.table.thead = function(datasource, titles, css, parent, index, prows) {        if (!index) {            //index默认为一            index = 1;            //prwos默认为数据源的长度            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);        //创建table标签        _thead = $$("thead", {}, _table);        //创建thead标签        _tr = $$("tr", {}, _thead);        //创建tr标签        for (var num in titles) {            //遍历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);                //生成th            } else {                $$("th", {                    innerHTML: titles[num],                    style: {                        "cssText": css[num],                        "padding": "10px 0",                        "font-weight": "normal",                        "border": "1px solid #d5d5d5"                    },                    id: "th"                }, _tr);                //生成th             }        }        _tbody = $$("tbody", { style: { cssText: "width:100%;" }, id: "tbody" }, _table);        //生成tbody        U.MD.UI.table.tbody(_tbody, datasource, titles, css, index, prows);        //运行tbody函数        return _tbody;        //返回tbody    }    /*        表格控件的身体函数        param1 {element} parent 父元素,表格生成的地方        param2 {json} datasource 数据源是一个object类型数组。        param3 {json} titles 标题是一个json类型数据        param4 {json} css 宽度是一个json类型数据        param5 {number} index 默认页面        param6 {number} prows 页面行数    */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++) {            //建立一个循环,以(index - 1) * prows为初始值,index * prows为终点进行循环            if (num % 2 != 0) {                //判断table列表的行数是否是单数                _tr = $$("tr", { style: { cssText: "background-color: #FFF;" }, id: "tr" }, parent);                //行数是单的背景颜色是白色            } else {                _tr = $$("tr", { style: { cssText: "background-color: #dde4ee;" }, id: "tr" }, parent);                //行数是双的背景颜色是#dde4ee            }            for (var name in titles) {                //遍历titles                 _td = $$("td", { id: "td" }, _tr);                //生成td                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]);                        //生成div                        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) { //判断是否需要给td添加id                        _div.id = datasource[num][titles[name].id];                    }                }            }        }    }    /*        表格控件的分页表格函数        param1 {json} datasource   数据源 json        param2 {json} titles 标题是一个json类型数据        param3 {json} css 宽度是一个json类型数据        param4 {number} prows  页面行数 int        param5 {number} index  默认页面  int        param6 {element} parent 父元素     */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);        //生成一个大div放表格和分页        var _tdiv = $$("div", {}, _div);        //生成一个div 放表格        var _tbody = U.MD.UI.table.thead(datasource, titles, css, _tdiv, index, prows);        //生成表格,放_tdiv里        var _pdiv = $$("div", { "style": { "width": "650px", "margin": "20px auto 0 auto" } }, _div); //生成一个div 放分页按钮        new U.UF.P.page(_pdiv, datasource.length, prows, index, function(page) {            //生成分页控件,当点击其他页面是触发匿名波函数            U.MD.UI.table.delChild(_tbody);            //当点击下一页时,首先删除tbody 下全部子元            U.MD.UI.table.tbody(_tbody, datasource, titles, css, page, prows);            //生成tbody        });    }    /*        删除子元素函数         param {element}obj 删除子元素的函数    */U.MD.UI.table.delChild = function(obj) {        for (var num = obj.children.length - 1; num >= 0; num--) {            //得到元素底下的全部子元素            obj.removeChild(obj.children[num])                //删除子元素        }    }    /*        点击事件函数        param1 {element} obj 点击事件的触发对象        param2 {json} datasource 展示的数据    */U.MD.UI.table.onclick = function(obj, datasource, fun) {        obj.onclick = function() {            //绑定事件            fun(datasource);        }    }    /*        打印div        param2 {sting || element} content  生成内容(字符串或者元素)        param1 {element} parent 生成的父元素    */U.MD.UI.table.printDiv = function(parent, content) {    var _div;    //判断content类型是否是字符串    if (typeof content.name == "string") {        //是字符串的生成div,打印内容          _div = $$("div", { "innerHTML": content.name }, parent);    }    //如果content类型是object类型    if (typeof content.name == "object") {        //就克隆Contet        var _dd = content.name.cloneNode(true);        parent.appendChild(_dd);        _div = _dd;    }    return _div;};///<jscompress sourcefile="Tree.js" />Namespace.register("U.MD.UI.Tree");//json要求://里面需要包含id,name,deep(依赖),img_url(显示图片源),child(附属目录),为一个数值,每一个值为一个json,child的格式也是一样//案例// [{ id: "1", name: "文件夹", deep: 0, img_url: 'http://api.1473.cn/Uform/Image/tree/folder.png',//child: [{ id: "2", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png",//  child: [{ id: "5", name: "文件夹", deep: 2, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]// },//{ id: "3", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png" },//{ id: "4", name: "文件夹", deep: 1, img_url: "http://api.1473.cn/Uform/Image/tree/folder.png"}]//}]/*将二维数组转化为列表的方法arr {arr} 数据源json里面需要包含id,name,deep(依赖),img_url(显示图片源),child(附属目录),外部是数组tree {object} 要插入列表的地方bookfun {function} 每一行目录的点击事件leftfun {function} 右键事件*/U.MD.UI.Tree = function(arr, treeaction, bookfun, leftfun) {    json = []; //将外变量josn清空    var _json = arr; //定义局部变量_json,值为r    for (var _i = 0; _i < _json.length; _i++) { //定义循环,循环对象为        U.MD.UI.Tree.jsonAdd(json, _json[_i]); //运行函数,生成json    }    treeaction.innerHTML = ""; //清空tree的内容    U.MD.UI.Tree.treeCreate(json, treeaction, bookfun); //运行方法,在tree中生成树状图    treeaction.oncontextmenu = function(e) {        e.preventDefault(); //去掉默认的contextmenu事件,否则会和右键事件同时出现。    };    treeaction.onmousedown = function(e) { //设置树状图的右键点击事件        if (e.button == 2) {            leftfun(e, bookfun); //运行右键事件        }    }}/*将二维数组转化为列表的方法json {arr} 数据源json里面需要包含id,name,deep(依赖),img_url(显示图片源),child(附属目录),外部是数组tree {object} 要插入列表的地方bookfun {function} 没一行的点击事件*/U.MD.UI.Tree.treeCreate = function(json, tree, onclickfun) {    for (var _i = 0; _i < json.length; _i++) { //创建循环,解析json数组,得到每一个json        var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree); //创建var对象,在tree中创建ul        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对象,在ul中创建li,id为a+jsonid        var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li); //创建var对象,在li中创建img        var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li); //创建var对象,在li中创建span,内容为json的name        _ul.style.display = "none";        if (json[_i].deep == "1") { _ul.style.display = "block" } //进行判断,判断是否为一级目录,不是的先隐藏        _img.aa = false; //定义img的一个变量,用来控制列表的展开和关闭        var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0]; //定义一个let对象为获取到的对应的li对象        _ul.style.display = _liobj.style.display; //如果是展开状态,显示ul        _li.onclick = function() { //定义li的点击事件            onclickfun(this); //执行bookconlick函数,改变book对象的内容            _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);            if (_img.aa === true) { //如果img.aa等于true                _img.aa = false; //修改img.aa对象为false                for (var _ii = 0; _ii < _liobj.length; _ii++) { //定义循环,循环对象为获取到的li对象集合                    _liobj[_ii].style.display = "none"; //将集合隐藏                }            } else { //如果img.aa等于false                _img.aa = true; //修改img.aa等于true                for (var _ii = 0; _ii < _liobj.length; _ii++) { //定义循环,循环对象为获取到的li对象集合                    _liobj[_ii].style.display = "block"; //将集合显示                }            }        }        if (json[_i].child) {            U.MD.UI.Tree.treeCreate(json[_i].child, _ul, onclickfun); //重新调用函数,参数为child的对象数组,ul对象,20的边距值,隐藏,改变的book对象        }    }}/*在json中插入json的方法json {arr} 要被插入的json对象addjson {json} 要查入的json对象*/U.MD.UI.Tree.jsonAdd = function(json, addjson) {    var _addid = addjson.parentID; //定义要目的地id,等于插入json的parentID值    if (_addid == "0") { //进行判断,判断目的地id是否在第一层(0)        json[json.length] = addjson; //如果在,直接在json的第一层中加入要插入的json        return json; //结束方法,返回json对象    }    for (var _i = 0; _i < json.length; _i++) { //创建循环,解析json数组,得到每一个json        if (json[_i].id == _addid) { //进行判断,判断json的id是否等于获取到的目的地id,如果是            if (json[_i].child) { //进行判断,判断json的child有没有值                json[_i].child[json[_i].child.length] = addjson; //如果有,就在其中添加插入对象                return json; //结束方法,返回json对象            } else { //如果json中没有child                json[_i].child = [];                json[_i].child[json[_i].child.length] = addjson; //将json的child等于插入的对象                return json; //结束方法,返回json对象            }        }        if (json[_i].child) { //如果json的id不与目的地id相等且json中存在child            var _return = U.MD.UI.Tree.jsonAdd(json[_i].child, addjson); //定义函数,调用自己,变量为json的child,要插入的json            json[_i].child = _return; //json的child等于返回的json        }    }    return json; //返回json对象}/*rightButton {object} 要插入li的右键对象e {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); //在右键菜单中添加li        var _li1 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "重命名", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep) + 1 }, rightButton); //在右键菜单中添加li        var _li2 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "删除", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep + 1) }, rightButton); //在右键菜单中添加li        var _return = [];        _return[0] = _li;        _return[1] = _li1;        _return[2] = _li2;        return _return;    }    /*    搜索arr中最高的id方法    arr {arr} 要搜索的arr对象    */U.MD.UI.Tree.createID = function(arr) {    var _return = 0; //定义变量    for (var _i = 0; _i < arr.length; _i++) { //定义循环,循环对象为arr        if (parseInt(arr[_i].id) > _return) { //进行判断,如果arr的id比_return大            _return = parseInt(arr[_i].id); //修改_return的值        }    }    return _return; //返回变量};///<jscompress sourcefile="Txt.js" />//编辑器Namespace.register("U.MD.UI.txt");;///<jscompress sourcefile="Upload.js" />;
 |