NotFunction.js 167 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068
  1.  // if (UCE.hasOwnProperty(i)) {
  2. // _UGE = UCE; switch (i) { case "$or": _UGE = UCE[i]; _UTE.push(true); break; } //or使用 _UGE = _UGE["$or"];
  3. // _UFE: for (j in _UGE) {
  4. // _UTF = true;
  5. // if (_UGE.hasOwnProperty(j)) {
  6. // for (k in _UGE[j]) {
  7. // switch (j) {
  8. // case "$e": if (UDE[j] != _UGE[j]) { _UTF = false; }; break; //=
  9. // case "$ne": if (UDE[j] == _UGE[j]) { _UTF = false; }; break; //!=
  10. // case "$lt": if (UDE[j] >= _UGE[j]) { _UTF = false; }; break; //<
  11. // case "$lte": if (UDE[j] > _UGE[j]) { _UTF = false; }; break; //<=
  12. // case "$gt": if (UDE[j] <= _UGE[j]) { _UTF = false; }; break; //>
  13. // case "$gte": if (UDE[j] < _UGE[j]) { _UTF = false; }; break; //>=
  14. // case "$in": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] == UDE[j]) { _UTF = false; break; } } _UTF = !_UTF; break; //in
  15. // case "$nin": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] == UDE[j]) { _UTF = false; break; } } break; //not in
  16. // case "$all": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] != UDE[j]) { _UTF = false; break; } } break; //匹配所有
  17. // case "$exists": break; //存在文档
  18. // case "$mod": break; //取模函数
  19. // case "$not": break; //不匹配
  20. // }
  21. // if ((!_UTE[0] && !_UTF) || (_UTE[0] && _UTF)) { break _UFE; }
  22. // }
  23. // }
  24. // }
  25. // (_UTF) && (USE.push(UDE));
  26. // }
  27. // this.body = _UDE.parentEle ? U.selectEl(_UDE.parentEle).append(_UDTD) : new U.UF.UI.form(_USE).form;
  28. // if (!this.obj.head && this.obj.upload) { //启动上传功能
  29. // // $$("div", { "className": "UD_SYFDTZ U_Boom_Img_ys2017 UD_SYSXZBFCAHO", "style": { "width": "28px" }, "title": "添加文件",
  30. � // // "onclick": [[U.MD.DK.C.FileSwitch, ([US.EMPTYGUID, null, { "getData": U.UF.C.apply(this, [[this.createFile]]), "CB": U.UF.C.apply(this, [[this.createFile]])}])]]
  31. // // }, _UDSD);
  32. // }
  33. // <div class="UD_SYZCLTSI" title="上传头像">
  34. // <input type="file" name="UD_SYZCLTSI" id="UD_SYZCLTSI" multiple="true" accept="image/gif,image/jpeg,image/png" class="UD_uploadbg" onchange="U.MD.U.P.GLUI(this, [U.MD.U.P.DI, (['headimg', U.MD.U.P.DLKSCTX, U.selectEl(this).Parent()]), 'Userprofile'])">
  35. // </div>
  36. // _UDED = $$("input", { type: "file", multiple:"true",accept: "image/gif,image/jpeg,image/png" });
  37. // _UDED.onchange = U.UF.C.apply(_UDED, [[U.UF.UP.inputUpload, ([_UDED, U.UF.C.apply(this, [[this.createFile]]),null, "http://main.1473.cn/USUpfile.ashx?typename=UseStudioEditor"]) ]]);
  38. // U.UF.UP.inputUpload([UDOD], UDE[0], UDE[1], "http://main.1473.cn/USUpfile.ashx?typename=" + UDE[2]);
  39. // _UDKD = $$("div", { "className": "UD_SYFDTZ U_Boom_Img_ys2017 UD_SYSXZBFCAHO", "style": { "position": "relative" }, "title": "本地添加文件",
  40. // "onmousedown": [[U.MD.C.UP.SCXWPOP, (['this', { "width": "25px", "height": "22px", "GS": true, "getData": U.UF.C.apply(this, [[this.createFile]]), "URL": "http://main.1473.cn/USUpfile.ashx?typename=UseStudioEditor", "ID": Guid.newGuid() }, US.userInfo.UserId, true])]]
  41. // }, _UDSD);
  42. //#region 编辑器创建
  43. //动态创建编辑器选项
  44. U.UF.E.RichEditor = function (SO, W, H, ISC, cb) {//
  45. var _UDRE, _UDS, _UDOS, _UDA, _UDEM, _UDFD, _UDCD, _UDOD = SO[0] || SO, _UDTD = SO[1] || SO, _UOFD = $$("frag"), _UTFD = $$("frag"), _TF = U.UF.CI.isSupportFlash();
  46. //编辑器界面初始化
  47. _UDRE = $$("div", { "className": "UF_FW_ok UF_FW_centerwindow " }, _UOFD);
  48. $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_face", "title": "表情" }, _UDRE);
  49. $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_Fbold", "title": "粗体" }, _UDRE);
  50. $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_underline", "title": "下划线" }, _UDRE);
  51. $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_italic", "title": "斜体" }, _UDRE);
  52. _UDS = $$("select", { "className": "UF_FW_FontSize", "title": "字体大小" }, _UDRE);
  53. _UDOS = $$("select", { "className": "UF_FW_FontType", "title": "字体" }, _UDRE);
  54. _UDA = $$("div", { "className": "UE_Edit" }, _UDRE);
  55. _UDEM = $$("div", { "className": "UD_PiLt UE_EditOut UE_EditEnd", "title": "上传图片", "onclick": _TF ? [[U.UF.EV.stopBubble], [parent.U.MD.C.UP.FUW, [US.EMPTYGUID, US.userInfo.UserId, US.EMPTYGUID, { "GS": "UP", "getData": U.UF.C.apply(this, [[U.UF.E.UPAsynCB, [_UDTD, "QL", null]]], "URL": "http://main.1473.cn/USUpfile.ashx?typename=UseStudioEditor", "ID": "UDK_FUPB"}])]] : "" }, _UDA);
  56. if (!_TF) { $$("input", { "className": "UE_filePrew", "type": "file", "id": "UU_E_Input", "name": "usestudiouploadinput", "onchange": [[parent.U.UF.E.usestudioeditoruploadimg, [this, _UDTD, cb, "QL"]]] }, _UDEM); }
  57. if (ISC) { $$("div", { "unselectable": "on", "className": "UF_FW_right UD_PiLt UF_FW_messagenote", "id": "messagenote" }, _UDRE); }
  58. _UDFD = $$("div", { "style": { "height": H + "px" }, "className": "UF_FW_DECC" }, _UTFD);
  59. _UDCD = $$("div", { "spellcheck": "false", "contentEditable": "true", "className": "UF_FW_DEC", "style": { "float": "none", "cssFloat": "none", "styleFloat": "none"} }, _UDFD);
  60. _UDOD.appendChild(_UOFD); _UDTD.appendChild(_UTFD); //添加到文档里
  61. //编辑器里的功能初始化
  62. U.UF.E.editorWindow(_UDOD, _UDCD); U.UF.E.Setoptions(_UDCD, _UDOS, _UDS); return SO;
  63. }
  64. // UPAsynCB: function (UDOD, TF, fun, UDAT, UTE) { //Flash文件上传成功后异步处理
  65. // if (UDAT) {
  66. // var _TF = (UDOD.tagName), _UDID = U.UF.E.AddUPWJ(UTE), _UDPD = UDOD; (_TF) && (UDOD = U.selectEl("div@contentEditable=true", UDOD)[0]); (UDOD == null) && (UDOD = _UDPD)
  67. // if (UTE["type"] == "rar" || UTE["type"] == "zip") { U.UF.E.CreateImage(window, "&nbsp;" + _UDID.outerHTML + "&nbsp;", UDOD, TF); }
  68. // else {
  69. // var _UIID = _UDID.id; (_TF) ? U.UF.E.CreateImage(window, ("&nbsp;" + _UDID.outerHTML + "&nbsp;"), UDOD, TF) : UDOD.Replace(("&nbsp;" + _UDID.outerHTML + "&nbsp;")); (UDOD.Parent) && (UDOD = UDOD.Parent()); _UDID = U.selectEl("img#" + _UIID, UDOD)[0];
  70. // U.UF.E.AddUPWJ({ "URL": UDAT[0], "name": UTE["name"], "size": UTE["size"], "type": "." + UTE["type"] }, _UDID); (fun) && (fun(_UDID));
  71. // }
  72. // }
  73. // },
  74. //设置编辑器的工具栏初始化
  75. U.UF.E.editorWindow = function (UDRE, UDFD) {
  76. var _UDPD = U.selectEl("div", UDRE)[0], _UDOD = U.selectEl("div", _UDPD); ; //功能处理的元素
  77. ($("input", _UDPD)[0] || _UDOD[5]).onmousedown = _UDOD[0].onmousedown = U.UF.C.apply(this, [[U.UF.E.GetSelectionRange, [window, UDFD, { "TF": "QL"}])]]; //加入断点消失标记
  78. _UDOD[0].onclick = function(){U.UF.E.CreateSf("ChattingFaceDiv", null, this, window, UDFD, "QL");}; //添加表情图
  79. _UDOD[1].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "fontWeight": ["bold", "normal"]}])]]; //字体加粗
  80. _UDOD[2].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "textDecoration": ["underline", "none"]}])]]; //下划线
  81. _UDOD[3].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "fontStyle": ["italic", "normal"]}])]]; //斜体
  82. }
  83. //options onclick全兼容
  84. U.UF.E.SetSO = function (AF) {
  85. if (AF && AF != event) {
  86. if (this["on"] == 1) { U.UF.C.apply(this, [AF])(); this["on"] = 0; } //如果是option点击就执行
  87. else { this["on"]++; }
  88. }
  89. else { this["on"] = 0; }
  90. }
  91. //编辑器options赋值
  92. U.UF.E.Setoptions = function (ED, UDOS, UDS) {
  93. UDS["on"] = UDOS["on"] = UDOS.options.length = UDS.options.length = 0;
  94. var _FS = [12, 14, 16, 18, 20, 22, 24, 36, 48, 72], _FT = ["宋体", "黑体", "仿宋_GB2312", "楷体_GB2312", "隶书", "微软雅黑", "幼圆", "Arial", "Verdana"]; //字体的大小 //字体样式
  95. for (var i = 0; i < 9; i++) { UDOS.options.length += 1; UDOS.options[i].value = _FT[i]; UDOS.options[i].text = _FT[i]; } //select字体样式选择
  96. for (var j = 0; j < 10; j++) { UDS.options.length += 1; UDS.options[j].value = _FS[j] + "px"; UDS.options[j].text = _FS[j]; } //select字体大小选择
  97. UDOS.onclick = function(){U.UF.E.SetSO([U.UF.E.SelectO, [ED, "fontFamily", UDOS]]);}; //options onlick模拟事件
  98. UDS.onclick = function(){U.UF.E.SetSO([U.UF.E.SelectO, [ED, "fontSize", UDS]]);}; //options onlick模拟事件
  99. UDS.onblur = UDOS.onblur = U.UF.E.SetSO
  100. }
  101. //select onclick赋值
  102. U.UF.E.SelectO = function (ED, TF, UDE) {
  103. if (TF == "fontFamily") { U.UF.E.FontSizeType(ED, { "fontFamily": UDE.value }); }
  104. else { U.UF.E.FontSizeType(ED, { "fontSize": UDE.value }); }
  105. }
  106. //--------------------------------------------------------------------------有思文字编辑器模块--------------------------------------------------------------------
  107. //---------------------------------------------------------------编辑器上传文件-----------------------------------------------------------------
  108. //编辑器上传
  109. U.UF.E.usestudioeditoruploadimg = function (UEL, UED, cb, TF) {
  110. if (parent.US.userInfo.UserId) {
  111. var _UDID, _TF = U.UF.UP.SFT("UP"), _UDED = U.selectEl("div@contentEditable=true", UED.parentNode)[0], _UPEL = UEL.parentNode; //可上传文件类型
  112. if (parent.U.UF.UP.UploadFileType(UEL, _TF) == false) { U.Alert("只允许上传图片文件和压缩文件"); return; }
  113. UDID = U.UF.E.AddUPWJ({ "type": "jpg" }); U.UF.E.CreateImage(window, UDID.outerHTML, _UDED, TF); //插入图片
  114. U.UF.UP.inputUpload([UEL],"http://main.1473.cn/USUpfile.ashx?typename=UseStudioEditor", U.UF.E.uploadcallback, [_UDED, U.selectEl("img@TI=" + UDID.id, _UDED)[0]], true); //上传
  115. $$("input", { "className": "UE_filePrew", "title": "上传图片", "type": "file", "id": "UU_E_Input", "name": "usestudiouploadinput", "onchange": UEL.onchange, "onmousedown": function(){U.UF.E.GetSelectionRange(window, _UDED, { "TF": TF});} }, _UPEL)
  116. }
  117. else { parent.U.Alert("请登录后在上传"); }
  118. }
  119. //编辑器上传显示
  120. U.UF.E.uploadcallback = function (r) {
  121. var _UTF, _context = r.context, _UDOD = r.UpObj; r = r.value; //返回的值
  122. if (r != "") { _UTF = U.UF.UP.getFileNameAndExtension(_UDOD); U.UF.E.AddUPWJ({ "URL": r[0], "name": _UTF[0], "size": r[1], "type": "." + _UTF[1] }, _context[1]); }
  123. }
  124. //-----------------------------------------------------------------------------------表情框-----------------------------------------------------------------------
  125. //现在用户表情框的定位
  126. U.UF.E.init = function (UDOD, SO) {
  127. var _UE = U.UF.EL.getElementInfo(SO), _UR, _UL = _UE["BCRL"], _UT = _UE["BCRT"] + _UE["PXT"] - 220 + "px";
  128. if (_UL + 436 >= US.width) { _UR = true; _UL = 0; } else { _UL = _UL - 190; }
  129. U.selectEl(UDOD).addAttrArray({ "style": { "left": _UL + "px", "right": _UR ? _UL + "px" : "auto", "top": _UT} }); //定位
  130. }
  131. //创建表情框
  132. U.UF.E.CreateSf = function (ID, DFPE, SO, CW, OS, TF) {
  133. DFPE = DFPE || U.selectEl("#" + ID)[0];
  134. if (DFPE == null) {
  135. DFPE = $$("div", { "id": ID, "unselectable": "on", "className": "defaultFacePanel", "onclick": function(){U.UF.EV.stopBubble], [U.UF.E.CreateSf(ID, "retElement");}, "style": { "display": "block"} });
  136. for (var i = 0; i < 105; i++) { $$("div", { "title": "[face](" + i + ")", "unselectable": "on", "onclick": function(){U.UF.E.CreateImage(CW, "<img contentEditable='false' src='http://www.1473.cn/img/ChatingFaceGif/[face](" + i + ").gif' style='width:20px;height:20px;' />&nbsp;", OS, TF);} }, DFPE); } //
  137. document.onclick = function(){U.UF.E.CreateSf(ID, DFPE]], [document.onclick || function(){}, [);}; document.body.appendChild(DFPE);
  138. }
  139. else { if (DFPE.style.display == "block" || arguments.length == 2) { DFPE.style.display = "none"; return; } else { U.selectEl(DFPE).addAttrArray({ "style": { "display": "block"} }); } }
  140. U.UF.EV.stopBubble(); U.UF.F.topWindow(DFPE); U.UF.E.init(DFPE, SO); U.UF.E.CreateImage(CW, "", OS, TF); return DFPE; //定位表情框
  141. }
  142. //#endregion
  143. //#region
  144. ////-----------------------------------------------------------------窗体动画------------------------------------------------------------------------
  145. ////特效打开窗体,第一个参数为单击的按钮id str类型 第二个参数为弹出的窗体id str类型,ltwh是窗体的坐标和宽度,v是速度,按毫秒计算
  146. ////调用示例方法U.UF.ME.OpenWin("UCD_TOP_Lang", "UCD_L", document.body.clientWidth * 0.3 + "px", "130px", "600px", "380px");
  147. ////需要此效果的窗体css定义position:absolute; display:none; top:0px; left:0px; width:0px; height:0px;overflow:hidden;
  148. //U.UF.ME.OpenWin = function (b, d, l, t, w, h, v) {
  149. // var r = U.UF.EL.getElementInfo($("#" + b + "")[0]), o = U.selectEl("#" + d + "");
  150. // o[0].style.display = "block"; o[0].style.left = r.BCRL + "px"; o[0].style.top = r.BCRT + "px";
  151. // o.animate({ "left": l, "top": t, "width": w, "height": h }, v);
  152. //}
  153. ////特效关闭窗体,第一个参数为单击的按钮id str类型 第二个参数为弹出的窗体id str类型,v是速度,按照毫秒计算,cb是关闭窗体后执行的其他特效函数。
  154. //U.UF.ME.CloseWin = function (b, d, v, cb) {
  155. // var r = U.UF.EL.getElementInfo($("#" + b + "")[0]);
  156. // U.selectEl("#" + d + "").animate({ "left": r.BCRL + "px", "top": r.BCRT + "px", "width": "0px", "height": "0px" }, v, U.UF.C.apply(this, "$('#" + d + "').css('display', 'none')"));
  157. // if (cb) cb;
  158. //}
  159. ////按钮抖动效果,参数b为按钮id,str类型,v为速度,此函数调用方法//U.UF.ME.BShake(b,32);
  160. ////参考自:http://www.nowamagic.net/librarys/veda/detail/1063,绝对定位可行,相对定位有点问题
  161. //U.UF.ME.BShake = function (d, v) {
  162. // //k判断元素是相对定位还是决定定位,相对定位用marginTop,决定定位用Top。u是计时器,t,l是相对定位,决定定位的值,a b是计算变量
  163. // var o, t, l, a, b = 0, u, k = 1, s;
  164. // "string" == typeof (d) ? o = U.selectEl("#" + d + "") : o = U.selectEl(d);
  165. // //如果元素是相对定位,不是absolute或者relative,采用marginTop属性抖动s = U.UF.EL.getStyle(o[0]);不能批量获取
  166. // if (U.UF.EL.getStyle(o[0], "position") == "absolute" || U.UF.EL.getStyle(o[0], "position") == "relative") { k = 0 }
  167. // if (k) { t = U.UF.EL.getStyle(o[0], "marginTop"); l = U.UF.EL.getStyle(o[0], "marginLeft"); a = ['marginTop', 'marginLeft'] }
  168. // else { t = U.UF.EL.getStyle(o[0], "top"); l = U.UF.EL.getStyle(o[0], "left"); a = ['top', 'left'] }
  169. // u = setInterval(function () {
  170. // b++;
  171. // o[0].style[a[b % 2]] = b % 4 < 2 ? parseInt(U.UF.EL.getStyle(o[0], a[b % 2])) - 2 + "px" : parseInt(U.UF.EL.getStyle(o[0], a[b % 2])) + 2 + "px";
  172. // if (b > 15) { clearInterval(u); b = 0; if (k) { o[0].style.marginTop = t; o[0].style.marginLeft = l; } }
  173. // }, v)
  174. //}
  175. ////元素变色,参数b为按钮id,str类型,参数n为新的颜色
  176. //U.UF.ME.ChangeColor = function (b, n) {
  177. // var o = U.selectEl("#" + b + "")[0], c = o.style.backgroundColor;
  178. // o.style.backgroundColor = n;
  179. // setTimeout(function () { o.style.backgroundColor = c; }, 1000)
  180. //}
  181. ////#endregion
  182. // setTimeout((this.TIM[2] = function(){this.ADQJS("");}), 500); //设置记录值 //if (this.TIM[1]) { if (win.getSelection) { _UCE = this.CW.getSelection().getRangeAt(0); _UDE = this.OAT[_UTP]; _UDE[_UDE.l].R.setEnd(_UCE.startContainer, _UCE.startOffset); } }
  183. //获取QQ登录后得到的openId:用户身份的唯一标识。建议保存在本地,以便用户下次登录时可对应到其之前的身份信息,不需要重新授权。
  184. //accessToken:表示当前用户在此网站/应用的登录状态与授权信息,建议保存在本地。 有效期3个月
  185. CreateImage: function (EW, PH, SO, TF) {//编辑器里插入图片
  186. U.UF.E.SORange["OE"][TF].Replace(PH); //把设置后的文字顶替设置前的文字
  187. },
  188. // var i, _UTF; USE = USE || []; UDE = arguments.length > 4 ? UDE : this.Value; _UTF = this.IFOBJ(UDE);
  189. // if (_UTF === true) {//对象添加处理
  190. // if (this.IsTF(UCE, UDE)) { USE.push(UDE); } //确定本身是否为目标
  191. // if (UKE === true) { for (i in UDE) { if (USE.length == UT) { break; }; U.Json(UDE[i], this).select(UCE, UKE, UT, USE); } } //全盘搜索
  192. // else if (UKE) { if (USE.length != UT && UDE[UKE]) { U.Json(UDE[UKE], this).select(UCE, UKE, UT, USE); }; } //条件搜索
  193. // }
  194. // else if (_UTF == "Array") { for (i = 0; i < UDE.length; i++) { if (USE.length == UT) { break; } this.select(UCE, UKE, UT, USE, UDE[i]); } } //数组处理数据
  195. // return USE;
  196. //#endregion
  197. // else { this.EL.onmousedown = this.CB; this.SetHover(); U.UF.EV.simulateMouseClicks(this.EL, "mousedown"); };
  198. //this.EL.onmousedown(); this.EL.onmousedown = this.CB; U.UF.EV.simulateMouseClicks(this.EL, "mousedown");
  199. //释放 (this["SSO"] || _UDOD).onscroll = this.OS; U.UF.EV.simulateMouseClicks(_UDOD, "click");
  200. // return (U.MD.D.DestopStr = [{ "ApplicationID": "7aeaab56-485f-4150-b781-8ffd86d593ce", "UserDirectoryID": "", "ApplicationName": "网盘", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -304, "y": -20} },
  201. // { "ApplicationID": "93553847-e299-464c-a0e2-c15872efb6ae", "UserDirectoryID": "", "ApplicationName": "相册", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -88, "y": -92} },
  202. // {"ApplicationID": "8a2135ff-746a-43a8-97b8-552d228a00bb", "UserDirectoryID": "", "ApplicationName": "音乐", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -16, "y": -20} },
  203. // { "ApplicationID": "1e0742d8-737e-46e2-b03b-2f23ca8c1f17", "UserDirectoryID": "", "ApplicationName": "博客", "ApplicaitonUrl": "UseStudioBlogSystemDiv", "ApplicaitonImg": { "x": -88, "y": -20} },
  204. // { "ApplicationID": "8989bc55-6f36-44e8-8b1b-cc18486cf140", "UserDirectoryID": "", "ApplicationName": "论坛", "ApplicaitonUrl": "UseStudioStudyControlDiv", "ApplicaitonImg": { "x": -160, "y": -20} },
  205. // { "ApplicationID": "0085d7d9-a5aa-4785-b914-05136e3f4bf0", "UserDirectoryID": "", "ApplicationName": "应用", "ApplicaitonUrl": "US_Manage_App_Mark", "ApplicaitonImg": { "x": -160, "y": -92} },
  206. // { "ApplicationID": "0d0686f0-b3df-429b-a586-db5899118ec5", "UserDirectoryID": "", "ApplicationName": "便签", "ApplicaitonUrl": "mouseroverNote", "ApplicaitonImg": { "x": -232, "y": -92} },
  207. // { "ApplicationID": "", "UserDirectoryID": "", "ApplicationName": "文档编辑", "ApplicaitonUrl": "US_Word", "ApplicaitonImg": { "x": -232, "y": -20} },
  208. // { "ApplicationID": "", "UserDirectoryID": "", "ApplicationName": "工作表", "ApplicaitonUrl": "US_Excel", "ApplicaitonImg": { "x": -232, "y": -20} },
  209. // { "ApplicationID": "6DB2FD18-B8E0-075A-605F-F3FB928FE7AB", "UserDirectoryID": "", "ApplicationName": "购物", "ApplicaitonUrl": "UM_GW", "ApplicaitonImg": { "x": -232, "y": -20} },
  210. // { "ApplicationID": "5312340d-a802-a8c6-f80a-000000000000", "UserDirectoryID": "", "ApplicationName": "积分中心", "ApplicaitonUrl": "UD_DK_IC", "ApplicaitonImg": { "x": -232, "y": -20} },
  211. // { "ApplicationID": "6DB2FD18-B8E0-075A-605F-000000000000", "UserDirectoryID": "", "ApplicationName": "Use聊", "ApplicaitonUrl": "Chat", "ApplicaitonImg": { "x": -232, "y": -20} },
  212. // { "ApplicationID": "DA0EEA4E-AD61-4F2A-8DB1-3ADF0A506C86", "UserDirectoryID": "", "ApplicationName": "在线编程", "ApplicaitonUrl": "UD_PG", "ApplicaitonImg": { "x": -232, "y": -20} }
  213. // ]);
  214. // if (_UDE[_UL].C) { _UCE = _UDE[_UL]; } else if (_UDE[_UL + 1] && (_UDE[_UL + 1].C || _UL < _UDE.length - 2)) { _UCE = _UDE[(_UDE.l += 1)]; }
  215. // _UDE = this.OAT[_UTP]; _UL = _UDE.l; U.UF.EV.stopDefault();
  216. // if (_UDE[_UL].C) { _UCE = _UDE[_UL]; } else if (_UDE[_UL + 1] && (_UDE[_UL + 1].C || _UL < _UDE.length - 2)) { _UCE = _UDE[(_UDE.l += 1)]; }
  217. // if (_UCE) {
  218. // if (!win.getSelection) { //老ie处理
  219. // try { _UDE = _UDE[_UL] ? _UDE[_UL].OR.R : this.R; _UL = _UDE.boundingLeft + _UDE.boundingWidth; if (_UCE.P.boundingLeft || _UCE.P.boundingTop) { _UCE.OR.R.moveToPoint(_UCE.P.boundingLeft, _UCE.P.boundingTop); } }
  220. // catch (e) { try { if (_UCE.OR.R.boundingTop < _UCE.P.boundingTop) { _UCE.OR.R.moveToPoint(_UL, _UDE.boundingTop); } } catch (e) { } } _UCE.OR.Replace(_UCE.C); _UCE.C = "";
  221. // }
  222. // }
  223. ////------------------------------------------------------------------------桌面应用数据源的操作--------------------------------------------------------------
  224. //Namespace.register("U.MD.D.T"); //桌面数据源命名空间
  225. //U.MD.D.D.News; //学习系统帖子的全局
  226. //U.MD.D.DestopStr; //桌面图标的json
  227. //U.MD.D.icon_list; //桌面图标
  228. ////数据源操作的接口
  229. //U.MD.D.D.SF = function (name, term) {
  230. // switch (name) {
  231. // case "AddNews":
  232. // U.MD.D.D.AddNews(term);
  233. // break;
  234. // case "GetNews":
  235. // return U.MD.D.D.GetNews(term);
  236. // break;
  237. // case "GetIc":
  238. // return U.MD.D.D.GetDI(term);
  239. // break;
  240. // case "AddTG": //插入新闻
  241. // break;
  242. // default: break;
  243. // }
  244. //}
  245. ////---------------------------------------------------------------------------新闻的操作----------------------------------------------------------------
  246. ////添加学习系统的新闻
  247. //U.MD.D.D.AddNews = function (term) {
  248. // U.MD.D.D.News = term;
  249. //}
  250. ////获取学习系统的新闻
  251. //U.MD.D.D.GetNews = function (term) {
  252. // var _NL = [];
  253. // if (U.MD.D.D.News) {
  254. // for (var i = 0; i < U.MD.D.D.News.length; i++) {
  255. // if (U.MD.D.D.News[i].PublishedDirectoryID == term[0]) {
  256. // _NL.push(U.MD.D.D.News[i]);
  257. // }
  258. // }
  259. // return _NL;
  260. // }
  261. //}
  262. ////-----------------------------------------------------------------------通知通告操作--------------------------------------------------------------------
  263. ////----------------------------------------------------------------------------------桌面图标的操作-----------------------------------------------------------
  264. //U.MD.D.D.GetDI = function (term) {
  265. // var _UIC = US.userInfo["icon"] || U.MD.D.DestopStr;
  266. // for (var i = 0; i < _UIC.length; i++) {
  267. // if (_UIC[i].ApplicationID == term[0]) { return _UIC[i]; }
  268. // }
  269. //}
  270. ////用户互动的类
  271. //U.MD.D.D.CII = function (ET) {
  272. // this.newid = ET[0];
  273. // this.UserId = ET[1];
  274. // this.UserName = ET[2];
  275. // this.UserThumbnailImageHead = ET[3];
  276. // this.NEWTYPE = ET[4];
  277. // this.NEWT = ET[5];
  278. // this.NEWC = ET[6];
  279. // this.Time = ET[7];
  280. // this.ET = ET[8];
  281. //}
  282. //获取客户端各种信息
  283. U.UF.CI.GCInfo = function () {
  284. U.UF.CI.IEedition(); //获取可无端信息
  285. }
  286. //判断IE浏览器版本,是否下载最新IE,chrome,firefox
  287. U.UF.CI.IEedition = function () {
  288. var _UDE = U.UF.CI.getBrowser(), _UCE = U.UF.CI.getSystem();
  289. if ((_UDE.browser == "msie" && Number(_UDE.ver) < 7) || _UDE.browser == "firefox") { U.selectEl("#UD_CI_getBrowser")[0].style.display = "block"; } //提示浏览器升级
  290. else if ("iphone,ipad".indexOf(_UDE.browser) > -1) { U.UF.CI.Ipad(); } //苹果事件
  291. if (_UCE.indexOf("win") > -1) { U.UF.CI.Win(_UDE, _UCE); } //如果是win系列的升级
  292. }
  293. //如果是windows系列
  294. U.UF.CI.Win = function (UBE, UCE) {
  295. if (!browser.lb && UBE.browser == "msie" && UBE.ver != "10.0") {//提示用户安装
  296. _UHF = US.FILESYSTEMURL + "c181e980-d781-4fef-bb45-a3ccabdd911a.msi"; _UIH = "云端";
  297. U.UF.CI.WinDIs(_UHF, _UIH); //用户显示提示
  298. // if (UCE == "win7") { if (UBE.ver == "8.0" || UBE.ver == "7.0") { _UHF = "http://download.microsoft.com/download/4/C/A/4CA9248C-C09D-43D3-B627-76B0F6EBCD5E/IE9-Windows7-x86-chs.exe"; _UIH = "IE9"; } }
  299. // else if (UCE == "winxp") { if (UBE.ver == "6.0" || UBE.ver == "7.0") { _UHF = "http://download.microsoft.com/download/1/6/1/16174D37-73C1-4F76-A305-902E9D32BAC9/IE8-WindowsXP-x86-CHS.exe"; _UIH = "IE8" } }
  300. }
  301. }
  302. //用户显示提示
  303. U.UF.CI.WinDIs = function (UHF, UIH) {
  304. var _UDOD = $$("div", { "id": "UD_CI_BAlert", "className": "UD_CI_BAlert" });
  305. $$("div", { "className": "UD_CI_Warn" }, _UDOD);
  306. $$("div", { 'className': 'UD_CI_Text', "innerHTML": "您使用的浏览器版本过低建议您下载" }, _UDOD);
  307. $$("a", { "className": "UD_CI_DL", "href": UHF, "innerHTML": UIH }, _UDOD); //安装的链接
  308. $$("a", { "className": "UD_CI_Text_Click", "href": "javascript:void(0);", "onclick": U.UF.C.apply(_UDOD, "retElement.style.display = 'none';"), "innerHTML": "我知道了" }, _UDOD);
  309. U.selectEl("body").append(_UDOD); setTimeout(function(){U.UF.CI.SetUserD(_UDOD);}, 10000);
  310. }
  311. //提示用户安装浏览器的定位
  312. U.UF.CI.SetUserD = function (UDOD) {
  313. U.selectEl(UDOD).addAttrArray({ "style": { "display": "block"} }).animate({ "top": "80px", "left": US.width / 1.7 + "px" }, 400);
  314. }
  315. //浏览器下载接口
  316. U.UF.CI.XZWin = function (UFSN, UDN) {
  317. U.UF.UP.inputUpload([$$("input", { "type": "text", "value": UDN, "name": "filename" }), $$("input", { "type": "text", "value": UFSN, "name": "filepath" })],"http://main.1473.cn/USUpfile.ashx?typename=apk", null, null );
  318. }
  319. //如果是ipad,固定横屏,禁止放大的功能在html元素的css中。
  320. U.UF.CI.Ipad = function () {
  321. document.ontouchmove = U.UF.EV.stopDefault; //阻止浏览器默认变大变小动作
  322. }
  323. //下一个节点
  324. U.UF.C.nextSibling = function (obj) {
  325. while (obj.nextSibling.nodeType != 1) {
  326. obj = obj.nextSibling;
  327. }
  328. return obj.nextSibling;
  329. var i, _UDOD = parent.$("#US_ExcelContent").Parent(2), _UDSD = U.selectEl("span", _UDOD)[1], _UGE = U.MD.O.E.SY, _UAE = ["P", "Z", "Y", "ZT", "ZLJ", "ZU", "ZI", "F"];
  330. for (i = 0; i < _UAE.length; i++) { _UAE[i] = U.selectEl("#U_E_A" + _UAE[i])[0]; }
  331. if (_UGE["OL"]) { U.OU.Onload("Excel", _UAE.slice(0, 4), _UAE); _UGE["OL"] = false; U.MD.O.E.SetWH(); } //初始化工具
  332. U.MD.O.E.CNO(); _UDSD.onclick = function(){U.MD.O.E.CSave([parent.U.UF.F.closeWindow, [_UDOD,"remove"]]);}; //生成页面 //设置关闭保存
  333. document.body.focus(); document.onmousedown = document.onclick = U.MD.O.E.YCCD; //页面聚焦 //菜单屏蔽
  334. }
  335. // var _UDAD, TF = false, _AIMG = this.AIMG.length != null ? this.AIMG[this.I] : this.AIMG;
  336. // for (var i = 0; i < U.UF.IMG.IE.ET.length; i++) { if (U.UF.IMG.IE.ET[i]["AIMG"].indexOf(_AIMG["Thm"], "Thm") > -1) { TF = U.UF.IMG.IE.ET[i]; break; } }
  337. // if (TF) { TF["AIMG"] = this.AIMG.length ? this.AIMG : [this.AIMG]; TF.I = this.I; TF.Change(this.I, TF); U.UF.F.windowTopCenter(TF.UIOD); return true; } else { U.UF.IMG.IE.ET.push(this); } //
  338. // if (fun === true) { (!TF) && (_UDAD = this.AddE(_AIMG)); } else { _UDAD = fun(); } //图片显示缓冲
  339. // (!TF) && (U.UF.IMG.imgReady(_AIMG["Img"], function(){this.Ready(_UDAD[0], _UDAD[1], this]]]), function(){this.Load(_UDAD[0], _UDAD[1], this);}, U.UF.C.apply(this, [[this.Error, [_AIMG["Img"]);})); //图片加载处理
  340. // var i, k, j, _UDCD, _UDVD, _UDAD, _UKE = [], _UIF = US.userInfo, _UDE, _UDFD = U.selectEl("#UD_SYH")[0], _UDXD = U.selectEl("#UD_SYSXRT").Child(), _UCE = [null, _UDXD];
  341. // for (i = 0; i < UDE.length; i++) {
  342. // _UDVD = $$("frag"); _UDAD = U.selectEl("#" + UDE[i]).Child(); _UDE = function(){US.friend.friends.length, "正在追随", "您添加的好友", [[U.MD.F.W.viewFriend, [_UDFD]]]], [_UIF.UIF["DTC"], "动静..", "发表的动静", [[U.MD.U.V.ViewOtherUserInfo, [_UIF.UserId]]]], [_UIF.UIF["DDC"], "云分享", "云盘分享的文件", [[U.MD.D.I.openApplication, ["Disk", [_UIF.UserId, 1]]]]], [_UIF.UIF["PDC"], "版块爱好", "学习系统收藏", [[]]], [_UIF.UIF["FDC"], "追随者", "他人添加您", [[U.MD.F.W.viewFriend(_UDFD]]);}; ;
  343. // _UKE.length = 0; _UCE[0] = _UDAD; for (k = 0; k < i + 1; k++) { _UKE.push($("img", _UCE[k][0])[0] || $$("img", {}, _UCE[k][0])); }; //需要添加头像
  344. // _UDOD = U.selectEl(_UKE).addAttrArray({ "onerror": U.MD.C.imgError, "alt": (_UIF.UserNickName || _UIF.UserName), "title": "点击查看", "src": U.MD.C.getHeadImage(_UIF.UserThumbnailImageHead) })[0];
  345. // _UDCD = U.selectEl(_UDAD[1]).Child(); _UDCD[0].innerText = _UIF.UserIndividualitysignature || "暂时没有填写个人介绍..."; _UDXD[1].innerText = _UDCD[1].innerText = (_UIF.UserNickName || _UIF.UserName);
  346. // for (k = 0; k < i + 1; k++) { for (j = 0; j < _UDE.length; j++) { _UDOD = $$("div", { "className": "UD_SYSXKTBO", "style": !j ? { "marginLeft": "15px"} : {}, "onclick": _UDE[j][3] }, _UDVD); $$("div", { "className": "UD_SYSXKTBOL", "style": k ? { "fontSize": "17px", "verticalAlign": "sub"} : {}, "innerHTML": _UDE[j][0].formatMoney() }, _UDOD); $$("div", { "className": "UD_SYSXKTBOR", "innerHTML": _UDE[j][1], "style": k ? { "marginLeft": "8px", "verticalAlign": "baseline"} : {} }, _UDOD); }; (_UDCD = (k ? _UDXD[2] : _UDAD[2])); _UDCD.innerHTML = ""; _UDCD.appendChild(_UDVD); }
  347. // }
  348. ////初始化Word
  349. //U.MD.O.W.OnLoad = function (UDE) {
  350. // var i, _UDAD, UDOD = U.selectEl("#U_W_WordEdit")[0], _UDTD = U.selectEl("#U_E_ASRT")[0], _UDCD = U.selectEl(parent.$("#US_WordContent")[0]).Parent(2), _UDSD = U.selectEl("span", _UDCD)[1], _UAE = ["P", "Z", "Y", "ZT", "ZLJ", "ZU", "ZI"];
  351. // for (i = 0; i < _UAE.length; i++) { _UAE[i] = U.selectEl("#U_E_A" + _UAE[i])[0]; }; U.OU.TF["TF"] = "Word"; //初始化指定的值
  352. // (UDE) && (U.MD.O.W.WDJ()); UDOD.innerText = ""; //打印文档级联
  353. // if (!U.MD.O.W.TF["OL"]) { U.MD.O.W.WHO(); U.OU.Onload("Word", _UAE.slice(0, 4), _UAE); U.OU.SGN(); U.MD.O.W.TF["OL"] = true; } //初始化工具和需要隐藏的工具区域
  354. // if (UDE.UserFilesID != null) { U.OU.SCJD((UDE && UDE.UsOffice) ? $$("div", { "innerHTML": "&nbsp;" }, UDOD) : UDOD, (UDE && UDE.UsOffice) ? UDE.UsOffice : "", U.MD.O.W.TYHD); UDOD.contentEditable = true; } else { UDOD.contentEditable = false; } //添加text值
  355. // _UDSD.onclick = function(){U.MD.O.W.CSave([parent.U.MD.D.T.PopupWinClose, [_UDCD]]);}; //设置关闭
  356. // _UDTD.innerText = (UDE && UDE.UserallDirectoryName) ? UDE.UserallDirectoryName : "未命名文档"; //打开的文件名
  357. //}
  358. //动画特效
  359. //图片淡入淡出,滑进滑出效果。模仿jquery。主要是为抛弃jquery,mode为1表示slidedown,mode为0表示slideup
  360. U.UF.IMG.Animate = function (id) { return new U.UF.IMG.AnimateD(id); }
  361. U.UF.IMG.AnimateD = function (id) {
  362. this.itime = 0; //计时器时间
  363. this.mode = 1;
  364. this.maxHeight = 0;
  365. this.timer = null; //用于停止timeout
  366. this._BV = null; //获取浏览器版本
  367. this.obj = this.initial(id); ; //传入结点id
  368. }
  369. ////--------------------------------------有思工作室动态装载js-----------------------------------------------
  370. ////js文件放在head中,属于同步加载,head没加载完毕,不会执行...然而试验了很多次同步加载的方法。居然没有一种方法可行。哎。
  371. ////此函数相当于jquery的异步加载,但比jquery更好用,更符合传统编程。
  372. //
  373. ////异步加载js和css,url为需要加载的链接地址,T为类型,比如js,css等,CB为加载后执行的回调函数。
  374. //U.UF.DL.asynLoadJs = function (UURL, TF, cb, UTE, UIB) {
  375. // var i, _USD, _UASD, _UHD = U.selectEl("head", document)[0]; //获取head部
  376. // if (TF == "js") { _UASD = U.selectEl("script", document); _USD = $$("script", (UTE || { "src": UURL, "type": "text/javascript", "language": "javascript", "charset": "utf-8" })); } //js的异步创建
  377. // else if (TF == "link") { _UASD = U.selectEl("link", document); _USD = $$("link", { "href": UURL, "type": "text/css", "rel": "stylesheet" }); }
  378. // for (i = 0; i < _UASD.length; i++) { if (_UASD[i].src == UURL) { TF = false; if (!UIB) { _USD = _UASD[i]; } break; } } //如果已经加载完了
  379. // (TF || UIB) && (_UHD.insertBefore(_USD, _UHD.firstChild)); (cb) && (U.UF.DL.iframeLoad(_USD, cb)); //添加到头部 //异步处理
  380. // return true;
  381. //}
  382. ////备注:楚王辉 还差一个在Div中的innerhtml属性中加载外部js的方法。
  383. ////iframe加载完毕异步
  384. ////I参数可以试iframe 可以是需要加载的img js等等 AsynF是回调函数 AsynF=[[回调函数名,[回调参数]],[回调函数名,[回调参数]].........]
  385. //U.UF.DL.iframeLoad = function (UIF, cb) {
  386. // try { var _UCP = UIF.complete, _URS = UIF.readyState; } catch (e) { }
  387. // if (_UCP == "complete" && ((_URS == "complete" || _URS == "loaded") || _URS == null)) { function(){cb();}(); return; }
  388. // else {
  389. // (UIF.onreadystatechange) && (cb = U.UF.C.apply(UIF, [[UIF.onreadystatechange], [cb]]));
  390. // UIF.onreadystatechange = function(){U.UF.DL.AILD(UIF, cb);};
  391. // }
  392. // return UIF;
  393. //}
  394. U.UF.IMG.AnimateD.prototype = {
  395. initial: function (id) { //U.Json构造函数,目的是和jqery区别。
  396. this._BV = U.UF.CI.getBrowser().ver; //获取浏览器版本
  397. return "string" == typeof (id) ? document.getElementById(id) : id;
  398. },
  399. //横屏切换效果,元素s从左到右逐渐放大,元素d从左向右逐步缩小,并最终消失。
  400. LScreenSwitch: function (s, d, cb) {
  401. s.style.height = document.body.clientHeight + "px"; //把高度置为最高,宽度从0到最大。
  402. s.style.left = s.style.width = 0 + "px";
  403. d.style.width = document.body.clientWidth + "px";
  404. //s.style.display = "block";
  405. var that = this; //setInterval里面的变量必须用that取代。
  406. this.timer = setInterval(function () { that.sstimer(s, d, cb); }, 32);
  407. },
  408. sstimer: function (s, d, cb) {
  409. if (parseInt(s.style.width) < document.body.clientWidth) {
  410. d.style.left = s.style.width = parseInt(s.style.width) + 100 + "px";
  411. var w = parseInt(d.style.width) - 100;
  412. w > 0 ? d.style.width = w + "px" : d.style.width = "0px";
  413. }
  414. else {
  415. s.style.width = document.body.clientWidth + "px";
  416. d.style.width = "0px";
  417. d.style.left = "0px";
  418. clearInterval(this.timer);
  419. cb();
  420. }
  421. },
  422. //横屏切换效果,从右到左逐渐放大,上面一个函数的反向函数
  423. RScreenSwitch: function () {
  424. },
  425. slideDown: function () {
  426. if (parseInt(this.obj.style.height) > this.maxHeight) { this.mode = 0; return; };
  427. this.obj.style.height = parseInt(this.obj.style.height) + 2 + 'px';
  428. this.timer = setTimeout("U.UF.IMG.Animate()", this.itime);
  429. },
  430. slideUp: function () {
  431. if (parseInt(this.obj.style.height) < 2) { this.mode = 1; return; };
  432. this.obj.style.height = parseInt(this.obj.style.height) - 2 + 'px';
  433. var repeat = "U.UF.IMG.Animate()";
  434. this.timer = setTimeout(repeat, this.itime);
  435. },
  436. slide: function (objid, itime, mode) { //统一调用slide,自动区分down或者up
  437. clearTimeout(this.timer);
  438. this.obj = this.initial(objid);
  439. this.itime = itime;
  440. if (mode) {
  441. this.maxHeight = this.maxHeight ? this.maxHeight : parseInt(this.obj.style.height);
  442. this.obj.style.display = "block";
  443. this.obj.style.height = "0px";
  444. this.slideDown();
  445. }
  446. else this.slideUp();
  447. },
  448. fade: function (objid, itime, io, callback)//淡入淡出,io代表淡入或者淡出
  449. {
  450. this.obj = this.initial(objid);
  451. this.itime = itime;
  452. var that = this;
  453. this.maxHeight = parseInt(this.obj.style.height) | parseInt(this.obj.clientHeight); //此句可以不要?以后再优化。
  454. var i = io ? 100 : 0; //循环开始变量如果是淡入为100,淡出为0。
  455. var z = io ? 0 : 100; //循环结束变量,淡入为0,淡出为100。
  456. var v = (_BV == "7.0" || _BV == "8.0") ? 0.1 : 0.05; //浏览器判断,ie为chrome的20倍速。
  457. var b = io ? -100 * v : 100 * v; //步长,淡入为负数,淡出为正数。
  458. var timer = setInterval(function () {
  459. //清除计时器,如果有回调,执行回调函数
  460. if (i == z) { clearInterval(timer); if (typeof callback == "function") { callback(); } }
  461. i += b;
  462. that.obj.style.filter = "alpha(opacity=" + i + ")";
  463. that.obj.style.MozOpacity = i * v;
  464. that.obj.style.opacity = i * v;
  465. that.obj.style.height = that.maxHeight + "px";
  466. }, that.itime);
  467. },
  468. fadeIn: function (objid, itime, callback) { //淡入
  469. this.fade(objid, itime, true, callback);
  470. },
  471. fadeOut: function (objid, itime, callback) { //淡出
  472. this.fade(objid, itime, false, callback);
  473. }
  474. }
  475. //前一个节点
  476. U.UF.C.previousSibling = function (obj) {
  477. while (obj.previousSibling.nodeType != 1) {
  478. obj = obj.previousSibling;
  479. }
  480. return obj.previousSibling;
  481. }
  482. AddE: function (AIMG) {//创建默认的图片浏览器
  483. var _UIOD, _UIUD, _UICD, _UITD, _UIID, _useridA, _UIPA, _UICA, _UIYA, _UISA;
  484. //创建相框
  485. this.UIOD = _UIOD = $$("div", { "onmousewheel": function(){U.UF.EV.stopBubble], [this.Wheel(this);}, "className": "U_Img", "onclick": [this.XSI, ["retElement", this, true]], "onmousedown": U.UF.EV.stopBubble, "style": { "maxWidth": US.width + "px", "maxHeight": US.height + "px", "left": (Math.random() * 50) + "px", "top": (Math.random() * 50) + "px", "zIndex": US.ZINDEX ++} });
  486. $$("div", { "onmousedown": function(){U.UF.EV.stopBubble], [U.UF.F.DragMouseDown(_UIOD);}, "className": "U_Img_Move", "title": "移动相框" }, _UIOD);
  487. _UICD = $$("div", { "className": "U_Img_Operate UTransition", "onselectstart": function(){} }, _UIOD);
  488. _UITD = $$("div", { "className": "U_Img_Info", "onmousedown": function(){U.UF.EV.stopBubble], [this.MoveScroll("retElement", this);}, "style": { "maxHeight": (US.height - 80) + "px"} }, _UIOD);
  489. _UIUD = $$("div", { "style": { "overflow": "hidden", "margin": "auto", "width": "120px", "height": "120px"} }, _UITD);
  490. this.UIMG = _UIID = $$("img", { "NowRotate": "0", "src": AIMG["Thm"], "onerror": function(){U.MD.C.imgError(this, 1);} }, _UIUD);
  491. _useridA = $$("a", { "style": { "marginLeft": "20px" }, "onclick": function(){U.UF.EV.stopBubble], [this.Zoom("In", _UIOD, this);} }, _UICD);
  492. $$("i", { "className": "U_ImgPic zoomIn" }, _useridA);
  493. $$("div", { "innerHTML": "放大" }, _useridA);
  494. $$("a", { "title": "点击100%比例", "onclick": function(){U.UF.EV.stopBubble], [this.Zoom(100, _UIOD, this);}, "innerHTML": "100%" }, _UICD);
  495. _UIPA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Zoom("Out", _UIOD, this);} }, _UICD);
  496. $$("i", { "className": "U_ImgPic zoomOut" }, _UIPA);
  497. $$("div", { "innerHTML": "缩小" }, _UIPA);
  498. _UICA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Rotate(1, _UIOD, this);} }, _UICD);
  499. $$("i", { "className": "U_ImgPic Lrotate" }, _UICA);
  500. $$("div", { "innerHTML": "左转" }, _UICA);
  501. _UIYA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Rotate(-1, _UIOD, this);} }, _UICD);
  502. $$("i", { "className": "U_ImgPic Rrotate" }, _UIYA);
  503. $$("div", { "innerHTML": "右转" }, _UIYA);
  504. $$("div", { "className": "U_ImgPic U_Img_Close UTransition", "style": { "cssText": "float:right;" }, "onclick": [this.Close, [_UIOD, this, true]] }, _UICD);
  505. if (this.AIMG.length) {
  506. $$("div", { "className": "U_Img_Prev U_Img_Change U_Img_transition U_ImgPic", "onclick": function(){U.UF.EV.stopBubble], [this.Change(-1, this);} }, _UIOD);
  507. $$("div", { "className": "U_Img_Next U_Img_Change U_Img_transition U_ImgPic", "onclick": function(){U.UF.EV.stopBubble], [this.Change(1, this);} }, _UIOD);
  508. }
  509. U.selectEl(_UIID).addAttrArray({ "style": { "filter": "alpha(opacity=30)", "MozOpacity": "0.3", "Khtml-opacity": "0.3", "opacity": "0.3"} });
  510. document.body.appendChild(_UIOD); U.UF.F.windowTopCenter(_UIOD); return [_UIOD, _UIID]; //加入页面和居中弹框
  511. },
  512. // USE = USE || doc; UD = UD || doc; //设置选择初值
  513. // if (typeof USE === "string") {//如果选择符是字符串
  514. // var k, i, j, _UDE, _UDT, _UCA, _UNCA, _UME = USE.split(","), _UNC = /[~|#|.|&|:|>|@|*|=]/g, _UC = /[^(~|#|.|&|:|>|@|*|=)]+/g; //定义变量区域
  515. // for (k = 0; k < _UME.length; k++) {
  516. // USE = _UME[k]; _UNCA = (USE.match(_UNC) || []); _UCA = USE.match(_UC) || ["*"]; (_UCA.length > _UNCA.length) && (_UNCA.unshift(""));
  517. // for (i = 0; i < _UCA.length; i++) {
  518. // switch (_UNCA[i]) {
  519. // case "~": _UDE = UD.getElementsByName(_UCA[i]); break; //获取name属性获取
  520. // case "#": _UDE = _UDE == null ? doc.getElementById(_UCA[i]) : _UDE[_UCA[i]]; break; //根据id获取
  521. // case ".": //根据className获取
  522. // if (UD.getElementsByClassName) { _UDE = UD.getElementsByClassName(_UCA[i]); } //HTML5选择器
  523. // else if (document.querySelectorAll) { _UDE = UD.querySelectorAll("." + _UCA[i]); } //支持ie8选择器
  524. // else {//原始选择器
  525. // _UDE = UD.length != null ? UD : UD.getElementsByTagName("*"); var _UDT = [];
  526. // for (j = 0; j < _UDE.length; j++) { (_UDE[j].className == _UCA[i]) && (_UDT.push(_UDE[j])); };
  527. // _UDE = _UDT;
  528. // }
  529. // break;
  530. // case "": case "&": _UDE = (_UDE || UD).getElementsByTagName(_UCA[i]); break; //根据标签获取
  531. // case ":": //获取tr标签选择
  532. // _UDE = UD.getElementsByTagName("tr"); _UDT = [];
  533. // if (_UDE.length) {
  534. // for (j = 0; j < _UDE.length; j++) {
  535. // if (_UCA[i] == "even" && j % 2 == 0) { _UDT.push(_UDE[j]); }
  536. // else if (j % 2 != 1) { _UDT.push(_UDE[j]); }
  537. // }
  538. // _UDE = _UDT;
  539. // }
  540. // break;
  541. // case "@": //根据自定义属性选择
  542. // _UDE = _UDE || UD.getElementsByTagName('*'); _UDT = [];
  543. // for (j = 0; j < _UDE.length; j++) {//筛选出包含这属性的元素
  544. // if (_UNCA[i + 1] == "=") { if (_UDE[j].getAttribute(_UCA[i]) == _UCA[i + 1] || (_UDE[j][_UCA[i]] && _UDE[j][_UCA[i]].toString() == _UCA[i + 1])) { _UDT.push(_UDE[j]); } }
  545. // else { if (_UDE[j].getAttribute(_UCA[i]) != null) { _UDT.push(_UDE[j]); } }
  546. // }
  547. // _UDE = _UDT;
  548. // break;
  549. // case "*": //获取外加载控件
  550. // if (document.embeds && (_UDE = document.embeds[_UCA[i]])) { }
  551. // else if ((_UDE = window.document[_UCA[i]])) { }
  552. // else { _UDE = doc.getElementById(_UCA[i]); }
  553. // break;
  554. // default: break;
  555. // }
  556. // }
  557. // }
  558. // }
  559. // else { _UDE = USE; }
  560. // if (_UDE && !(_UDE instanceof Array && _UDE[0] == null)) {//选择器选择有值
  561. // if (_UDE.length == null || _UDE.id != null) { _UDE = [_UDE]; }
  562. // for (i = 0; i < _UDE.length; i++) { this[i] = _UDE[i]; (_UDE[i].id != "") && (this[_UDE[i].id] = _UDE[i]); } //添加选择器选择元素
  563. // this.context = UD; this.length = _UDE.length;
  564. // }
  565. // return this;
  566. //-----------------------------------------------------------------------加载音乐播放器--------------------------------------------------------------------------
  567. ////点击后加载播放器的flash
  568. //U.UF.MPlayer.Onload = function () {
  569. // try {
  570. // var _UDOD = U.selectEl("#U_MP_PFlash")[0];
  571. // if (_UDOD) {
  572. // if ($("#U_MP_MPFlash")[0] == null) { _UDOD.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="display:block" width="1" height="1" id="U_MP_MPFlash" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0"><param name="movie" value="http://www.1473.cn/img/mp3player.swf" /><param name="menu" value="false" /><param name="wmode" value="transparent" /> <param name="quality" value="high" /><param name="bgcolor" value="ffffff" /><param name="allowScriptAccess" value="always" /><embed src="http://www.1473.cn/img/mp3player.swf" quality="high" bgcolor="ffffff" width="1" height="1" name="U_MP_MPFlash" align="middle" play="true" wmode="transparent" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed></object>'; }
  573. // U.UF.MPlayer.UMPL = U.selectEl("#U_MPMCDPO")[0]; //进度显示的时间
  574. // U.UF.MPlayer.UMPP = U.selectEl("#U_MPMGDT")[0]; //进度条缓存的父亲元素
  575. // U.UF.MPlayer.UM = U.selectEl("*U_MP_MPFlash")[0]; //播放器
  576. // }
  577. // } catch (e) { }
  578. //}
  579. ////加载列表:传入列表Json
  580. ////Json规范{ "列表名": { "歌名": "歌曲URL","歌名": "歌曲URL"},"列表名": { "歌名": "歌曲URL","歌名": "歌曲URL"} }
  581. //U.UF.MPlayer.Open = function (J, D, OM) {//directories是目录文件夹
  582. // var _UDOD = U.selectEl("#UseStudioU_MP")[0], _UDTD = U.selectEl("#U_MPLB")[0], _UDSD = U.selectEl("#U_MPMCD")[0], _UDFD = U.selectEl("#U_MPFF")[0], _UDGD = U.selectEl("div#U_MPI", _UDOD)[0];
  583. // _UDFD.innerText = _UDTD.innerText = ""; _UDGD.style.display = "block"; U.UF.F.windowTopCenter(_UDOD);
  584. // U.selectEl("#U_MPLT")[0].onclick = function(){U.UF.MPlayer.MOM(US.disk.UserDisk[1][2]);};
  585. // U.selectEl("img", _UDSD).addAttrArray({ "onerror": [U.MD.C.imgError, ["retElement"]], "src": U.MD.C.getHeadImage(US.disk.UserDisk[1][0].UserThumbnailImageHead), "onclick": [U.MD.U.V.POUW, [US.disk.UserDisk[1][0].UserId]] }); //头像
  586. // U.selectEl("span", _UDSD)[0].innerHTML = US.disk.UserDisk[1][0].UserNickName; //名字
  587. // U.MD.DK.SetMDF((US.friend.friends || []), U.selectEl("#U_MPFF")[0]); //打印自己音乐好友
  588. // if (J[1].length == 0 && D.length == 0) { $$("div", { "className": "U_MPP U_MP_IMG" }, _UDTD); } //无音乐列表
  589. // else { U.UF.MPlayer.AddM(J, D, _UDTD, OM); } //添加音乐列表
  590. // U.MD.D.T.WindowRestore(_UDGD, "<div style='margin:11px 0 0 5px; width:61px; height:65px; background-position: -175px -75px;' class='UD_DI_iconimg UD_NUB'></div>", "音乐", U.UF.MPlayer.Close); //创建任务栏链接
  591. //}
  592. ////添加音乐文件文件
  593. //U.UF.MPlayer.AddM = function (J, D, ML, OM) {
  594. // var i, _UOOD, _UDPD, _UDTD, _UDSD, _UDFD = $$("frag");
  595. // if (J[0].UserDirectoryID != US.MUSICEFOLDERID) {
  596. // _UOOD = $$("div", { "className": "U_MPLB" });
  597. // _UDPD = $$("div", { "className": "U_MPLBT", "onclick": function(){U.UF.EV.stopBubble], [U.UF.MPlayer.ListShrink("this.parentNode");} }, _UOOD);
  598. // $$("div", { "className": "U_MPLBA U_MPLBAO U_MP_IMG" }, _UDPD);
  599. // $$("div", { "className": "U_MPLBM", "innerHTML": J[0].UserallDirectoryName + "(" + J[1].length + ")" }, _UDPD);
  600. // $$("div", { "className": "U_MPLBADD U_MP_IMG", "onclick": function(){U.UF.EV.stopBubble], [U.UF.MPlayer.OUPM(J[0].UserDirectoryID, US.disk.UserDisk[1][2]);} }, _UDPD);
  601. // _UDTD = $$("div", { "className": "U_MPLBT", "style": { "cssText": "width:100%;float:left;"} }, _UOOD);
  602. // ML.appendChild(_UOOD);
  603. // }
  604. // else { _UDTD = ML; }
  605. // for (i = 0; i < J[1].length; i++) {
  606. // _UDSD = $$("span", { "className": "U_MPLBN", "onclick": U.UF.EV.stopBubble, "ondblclick": [U.UF.MPlayer.loadAplay, ["retElement", J[1][i], US.disk.UserDisk[1][2]]] }, _UDFD);
  607. // $$("div", { "className": "U_MPLBNB U_MP_IMG", "innerHTML": (i + 1).prefixInteger() }, _UDSD);
  608. // $$("div", { "className": "U_MPLBNC", "innerHTML": J[1][i].UserallDirectoryName }, _UDSD);
  609. // $$("div", { "className": "U_MPLBNS", "innerHTML": "00:00" }, _UDSD);
  610. // if (J[1][i].UserDirectoryID == OM) { setTimeout(_UDSD.ondblclick, 1000); }
  611. // }
  612. // _UDTD.appendChild(_UDFD);
  613. // for (var j = 0; j < D.length; j++) { U.UF.MPlayer.AddM(D[j][0], D[j][1], _UDTD); } //循环打印音乐
  614. //}
  615. ////列表收缩或张开
  616. //U.UF.MPlayer.ListShrink = function (UDOD) {
  617. // var _UDAD = U.selectEl("div", UDOD);
  618. // var _TF = ["none", "U_MPLBA U_MPLBAC U_MP_IMG"];
  619. // if (_UDAD[4].style.display == "none") { _TF = ["block", "U_MPLBA U_MPLBAO U_MP_IMG"]; }
  620. // _UDAD[4].style.display = _TF[0];
  621. // _UDAD[1].className = _TF[1];
  622. //}
  623. ////加载音乐
  624. //U.UF.MPlayer.loadAplay = function (SO, UDK, userid) {
  625. // var _UFMS, _UFAD = U.selectEl("div", U.UF.MPlayer.UMPP), _UMPL = U.selectEl("#U_MPLB")[0], _TF = U.selectEl("*U_MP_MPFlash")[0].loadAplay(US.FILESYSTEMURL + UDK.UserFilesServerName);
  626. // _UFAD[1].style.width = _UFAD[0].style.width = _UFAD[2].style.left = "0px";
  627. // U.selectEl("#U_MPMCDD")[0].innerHTML = U.UF.MPlayer.UMPL.innerHTML = "00:00";
  628. // U.selectEl("div", U.UF.MPlayer.UMPP.parentNode)[0].innerHTML = UDK.UserallDirectoryName;
  629. // U.selectEl("#U_MPMCDP")[0].className = "U_MPMCDP U_MPMCDPC U_MP_IMG";
  630. // //停止所有的播放的样式
  631. // if ((U.UF.MPlayer.UMMP) && (_UFMS = U.UF.MPlayer.UMMP[0])) {
  632. // _UFMS.style.color = "#767676";
  633. // U.selectEl("div", _UFMS).addAttrArray({ "className": "U_MPLBNB U_MP_IMG", "innerHTML": U.UF.MPlayer.UMMP[1] }, 0);
  634. // }
  635. // else { U.UF.MPlayer.UMMP = []; }
  636. // //播放音乐的样式
  637. // U.UF.MPlayer.UMMP[0] = SO; //正在播放的元素
  638. // U.UF.MPlayer.UMMP[1] = U.selectEl("div", SO)[0].innerHTML; //播放的序号
  639. // SO.style.color = "#6da6e0";
  640. // U.selectEl("div", SO).addAttrArray({ "className": "U_MPLBNB U_MPLBNBI U_MP_IMG", "innerText": "" }, 0);
  641. // U.selectEl("#U_MPMXZL")[0].onclick = function(){U.UF.MPlayer.LMGM(userid, UDK, SO);}; //收藏音乐
  642. // U.selectEl("#U_MPMXZR")[0].onclick = function(){U.UF.MPlayer.DMGM(userid, UDK, SO);}; //删除音乐
  643. //}
  644. ////-----------------------------------------------------------------------------加载音乐的功能----------------------------------------------------------------------
  645. ////flash听完一首后直接下一首
  646. //U.UF.MPlayer.PNM = function (T) {
  647. // setTimeout($("#U_MPMCDA")[0].onclick, 1000); //flash需要延迟1秒执行下一首才有效
  648. //}
  649. ////上下一首
  650. //U.UF.MPlayer.PNMO = function (T) {
  651. // var _TF = U.UF.MPlayer.TF;
  652. // if (_TF == "L") { U.UF.MPlayer.PNMOM(T); } //列表播放模式
  653. // else if (_TF == "R") { U.UF.MPlayer.Shuffle(); } //随机播放模式
  654. // else { U.UF.MPlayer.REMOM(); } //单曲循环模式
  655. //}
  656. ////随机播放
  657. //U.UF.MPlayer.Shuffle = function () {
  658. // var _UFMP = U.selectEl("span", U.selectEl("#U_MPLB")[0]);
  659. // var _EP = U.UF.Math.getRandom(_UFMP.length);
  660. // _UFMP[_EP - 1].ondblclick();
  661. //}
  662. ////播放上下首
  663. //U.UF.MPlayer.PNMOM = function (T) {
  664. // var i, _UMMD, _UFM = U.selectEl("#U_MPLB")[0]; _UFMP = U.UF.MPlayer.UMMP[0], UFMPL = U.selectEl("span", _UFMP.parentNode);
  665. // for (i = 0; i < UFMPL.length; i++) {//循环判断找到正在播放的歌典
  666. // if (UFMPL[i] == _UFMP) {//找到当前播放的哪一首
  667. // _UMMD = _UFMP;
  668. // if ((i == UFMPL.length - 1) && T == 1) { _UMMD = UFMPL[0]; } //如果是最后一首就回到第一首歌
  669. // else if (UFMPL[i + T] != null) { _UMMD = UFMPL[i + T]; }
  670. // _UMMD.ondblclick();
  671. // return;
  672. // }
  673. // }
  674. //}
  675. ////单曲循环
  676. //U.UF.MPlayer.REMOM = function () {
  677. // U.UF.MPlayer.UMMP[0].ondblclick();
  678. //}
  679. ////播放或暂停
  680. //U.UF.MPlayer.pauseOstart = function () {
  681. // var _UMPP = U.selectEl("#U_MPMCDP")[0];
  682. // var _TF = U.UF.MPlayer.UM.pauseOstart(); //判断是否在播放音乐
  683. // if (_TF == false) { _UMPP.className = "U_MPMCDP U_MPMCDPO U_MP_IMG"; }
  684. // else { _UMPP.className = "U_MPMCDP U_MPMCDPC U_MP_IMG"; }
  685. //}
  686. ////---------------------------------------------------------进度条
  687. ////拉动进度条
  688. //U.UF.MPlayer.Posmove = function (SO) {
  689. // U.UF.MPlayer.IsUpPos = false;
  690. // var _UDMP = U.selectEl("div", SO.parentNode);
  691. // document.onmousemove = function () {
  692. // if (!U.UF.MPlayer.IsUpPos == true) {
  693. // SO.setCapture(); //聚焦
  694. // var _E = U.UF.C.GetMousep(); //获取鼠标的位置
  695. // var _PTX = U.UF.M.pageXY(SO.parentNode); //获取相对的位置
  696. // var _TL = _UDMP[1].clientWidth; //缓存长度
  697. // var _L = event.clientX - _PTX[1]; //移动的位置
  698. // if (_L < _TL && _L > 0) {
  699. // SO.style.left = _L + "px";
  700. // _UDMP[0].style.width = (_L + 2) + "px";
  701. // }
  702. // }
  703. // }
  704. // document.onmouseup = function () {
  705. // U.UF.MPlayer.SkipTo((parseInt(SO.style.left)) / 225); //跟换播放的进度
  706. // U.UF.MPlayer.IsUpPos = true; //允许播放更新
  707. // SO.releaseCapture(); //释放焦点
  708. // document.onmouseup = document.onmousemove = null; //取消
  709. // }
  710. //}
  711. ////进度条
  712. //U.UF.MPlayer.SkipTo = function (PNSO) {
  713. // U.UF.MPlayer.IsUpPos = false;
  714. // var _UPER, _UPOD = U.selectEl("div", U.UF.MPlayer.UMPP), _TL = _UPOD[1].clientWidth; //缓存长度
  715. // if (typeof PNSO == "number") { _UPER = PNSO; } //如果是数字直接更新时间
  716. // else {
  717. // _UPER = (event.clientX - parseInt(PNSO.getBoundingClientRect().left));
  718. // if (_TL > _UPER) {//判断是否更新到指定的进度位置
  719. // _UPOD[0].style.width = (_UPER + 2) + "px";
  720. // _UPOD[2].style.left = _UPER;
  721. // _UPER = _UPER / 225;
  722. // }
  723. // }
  724. // if (_TL > parseInt(_UPER * 225)) { U.UF.MPlayer.UM.SkipTo((parseInt(U.UF.MPlayer.Time) / 1000) * _UPER); }
  725. // U.UF.MPlayer.IsUpPos = true;
  726. //}
  727. ////音乐播放的总时间
  728. //U.UF.MPlayer.GD = function () {
  729. // U.UF.MPlayer.Time = U.UF.MPlayer.UM.getDuration();
  730. // var Duration = Math.round(U.UF.MPlayer.Time / 1000); //获取音乐播放的时间
  731. // U.selectEl("div", U.UF.MPlayer.UMMP[0])[2].innerHTML = U.selectEl("#U_MPMCDD")[0].innerHTML = (parseInt(Duration / 60)).prefixInteger() + ":" + (parseInt(Duration % 60)).prefixInteger(); //音乐播放时间显示
  732. //}
  733. ////-----------------------------------------------------------flash每秒的更新
  734. ////更新下载的进度
  735. //U.UF.MPlayer.ULD = function (LD) {
  736. // var _UDTD = U.selectEl("div", U.UF.MPlayer.UMPP)[1];
  737. // _UDTD.style.width = LD + "%";
  738. //}
  739. ////播放时间的更新和播放进度的更新
  740. //U.UF.MPlayer.UPT = function (P, PT, LD) {
  741. // U.UF.MPlayer.Time = PT;
  742. // var _UMPF = U.UF.MPlayer.UM, _L = Math.ceil(P / PT * 225);
  743. // if (U.UF.MPlayer.IsUpPos) {
  744. // if (_UMPF.getStatus() && U.UF.MPlayer.IsP) {
  745. // if ((LD * 2.25) >= _L) {
  746. // var _UDOD = U.selectEl("div", U.UF.MPlayer.UMPP);
  747. // _UDOD[0].style.width = _L + 2 + "px";
  748. // _UDOD[2].style.left = _L + "px";
  749. // U.UF.MPlayer.UMPL.innerText = (parseInt(P / 1000 / 60)).prefixInteger() + ":" + (parseInt(P / 1000 % 60)).prefixInteger();
  750. // }
  751. // else { _UMPF.pauseOstart(); U.UF.MPlayer.IsP = false; } //暂停缓冲
  752. // }
  753. // else {
  754. // if ((LD * 2.25 - 5) > _L && U.UF.MPlayer.IsP == false) {
  755. // _UMPF.pauseOstart(); //播放
  756. // U.UF.MPlayer.IsP = true;
  757. // }
  758. // }
  759. // }
  760. //}
  761. ////---------------------------------------------播放器声音调整
  762. ////调节音量大小
  763. //U.UF.MPlayer.setVol = function (Vol) {
  764. // U.UF.MPlayer.UM.setVol(Vol);
  765. //}
  766. ////调节声音大小的
  767. //U.UF.MPlayer.volumeMove = function (SO) {
  768. // var _UFMD = U.selectEl("div", SO.parentNode.parentNode);
  769. // document.onmousemove = function () {
  770. // SO.setCapture(); //聚焦
  771. // U.UF.MPlayer.OVM(SO, _UFMD[_UFMD.length - 2], _UFMD[_UFMD.length - 4]); //调节
  772. // }
  773. // document.onmouseup = function () {
  774. // SO.releaseCapture(); //释放焦点
  775. // document.onmouseup = document.onmousemove = null;
  776. // }
  777. //}
  778. ////点击调节音乐大小
  779. //U.UF.MPlayer.OVM = function (SO, TSO, MSO) {
  780. // var _L = event.clientX - SO.parentNode.getBoundingClientRect().left;
  781. // if (_L >= 0 && _L <= 48) {
  782. // SO.style.left = _L + "px";
  783. // TSO.style.width = (_L + 2) + "px";
  784. // _L = Math.round(_L * (100 / 48) * 2); //声音的大小
  785. // SO.title = _L; //声音大小显示
  786. // if (_L == 0) { U.UF.MPlayer.mute(MSO); } //静音
  787. // else { MSO.className = "U_MPMCDH U_MPMCDHH U_MP_IMG"; U.UF.MPlayer.setVol(_L); } //调整声音
  788. // }
  789. //}
  790. ////静音与非静音状态
  791. //U.UF.MPlayer.mute = function (SO) {
  792. // var _UFMD = U.selectEl("div", SO.parentNode);
  793. // var _UFC = SO.className;
  794. // var _UFPD = _UFMD[_UFMD.length - 1];
  795. // _L = _UFPD.offsetLeft;
  796. // if (_UFC.indexOf("U_MPMCDHH") > -1) {//静音
  797. // _L = 0;
  798. // SO.className = "U_MPMCDH U_MPMCDHM U_MP_IMG"; //静音的图标
  799. // }
  800. // else {
  801. // SO.className = "U_MPMCDH U_MPMCDHH U_MP_IMG"; //声音图标
  802. // if (_L == 0) { _L = 27; _UFMD[_UFMD.length - 1].style.left = _L + "px"; _UFMD[_UFMD.length - 2].style.width = (_L + 2) + "px" }
  803. // _L = Math.round(_L * (100 / 48) * 2)
  804. // }
  805. // U.UF.MPlayer.setVol(_L); //调节声音
  806. //}
  807. ////--------------------------------------------------功能处理
  808. ////点击我的音乐的时候
  809. //U.UF.MPlayer.MOM = function (userid) {
  810. // if (!U.MD.U.L.isLogin()) {
  811. // if (userid != US.userInfo.UserId) { U.UF.C.divdoubleClick("UseStudioU_MP", '', US.userInfo.UserId, null); } //回到自己的音乐
  812. // }
  813. //}
  814. ////切换播放音乐的模式
  815. //U.UF.MPlayer.SMTF = function (SO) {
  816. // var _TF = []; //模式对应的值
  817. // if (U.UF.MPlayer.TF == "L") { U.UF.MPlayer.TF = "R"; _TF[0] = "U_MPMXZM U_MPMXZMR U_MP_IMG"; _TF[1] = "随机播放"; }
  818. // else if (U.UF.MPlayer.TF == "R") { U.UF.MPlayer.TF = "RE"; _TF[0] = "U_MPMXZM U_MPMXZMRE U_MP_IMG"; _TF[1] = "单曲循环"; }
  819. // else { U.UF.MPlayer.TF = "L"; _TF[0] = "U_MPMXZM U_MPMXZMM U_MP_IMG"; _TF[1] = "列表播放"; }
  820. // SO.className = _TF[0]; SO.title = _TF[1];
  821. // U.Alert("切换到" + _TF[1] + "模式");
  822. //}
  823. ////添加他人的音乐到自己的默认文件夹
  824. //U.UF.MPlayer.LMGM = function (userid, UDK) {
  825. // if (!U.MD.U.L.isLogin()) {
  826. // if (userid != US.userInfo.UserId) {
  827. // U.MD.DK.LE.DBC(US.MUSICEFOLDERID, US.userInfo.UserId);
  828. // U.MD.DK.RE.CE = [UDK];
  829. // U.MD.DK.RE.UFStick(); //添加文件
  830. // U.MD.DK.RE.CE = [];
  831. // }
  832. // else { U.Alert("音乐已在自己的文件夹下"); }
  833. // }
  834. //}
  835. ////删除音乐
  836. //U.UF.MPlayer.DMGM = function (userid, UDK, SO) {
  837. // if (userid == US.userInfo.UserId && US.userInfo.UserId) { //只允许删除自己的音乐
  838. // U.MD.DK.RE.DMB(UDK, [U.UF.MPlayer.AsynDMGM, [SO]]); //删除音乐
  839. // }
  840. // else { U.Alert("无法删除它人的文件夹"); }
  841. //}
  842. ////异步删除音乐
  843. //U.UF.MPlayer.AsynDMGM = function (SO) {
  844. // U.UF.MPlayer.PNMO(1); //直接下一首
  845. // SO.parentNode.removeChild(SO); //删除音乐文件
  846. //}
  847. ////听音乐出错了
  848. //U.UF.MPlayer.Error = function (Error) {
  849. // U.Alert("音乐文件损坏或者暂时无法播放");
  850. // U.UF.MPlayer.PNMO(1);
  851. //}
  852. ////关闭音乐播放器
  853. //U.UF.MPlayer.Close = function () {
  854. // if (U.UF.MPlayer.UM.getStatus() == true) { U.UF.MPlayer.pauseOstart(); }
  855. // U.MD.D.T.PopupWinClose($("#U_MPI")[0]); //关闭任务栏
  856. //}
  857. ////隐藏音乐播放器
  858. //U.UF.MPlayer.YC = function (SO) {
  859. // SO.style.visibility = "hidden";
  860. //}
  861. ////打开上传音乐硬盘
  862. //U.UF.MPlayer.OUPM = function (DID, userid) {
  863. // if (US.userInfo.UserId != null && userid == US.userInfo.UserId) {
  864. // var _UDOD = U.MD.DK.NologinDiskDown(userid, DID, userid); //打开自己的网盘上传
  865. // U.selectEl("div#UDK_HP_UpFile", _UDOD)[0].onclick(); //上传文件显示
  866. // }
  867. // else { U.Alert("请上传到您的文件夹"); }
  868. //}
  869. // SetNodeStyle: function (N, UNV) {//设置样式变化
  870. // var _CN, j, PF, _UCH = N.childNodes;
  871. // if (_UCH.length > 0) {
  872. // for (var i = 0; i < _UCH.length; i++) {
  873. // _CN = N.childNodes[i];
  874. // if (_CN.innerHTML == undefined) {//假设innerhtml是undefined 说明这个标签是#text
  875. // if (PF != _CN.parentNode) { this.writeStyle(_CN.parentNode, UNV); PF = _CN.parentNode; } //设置字体大小或者是样式
  876. // }
  877. // else { this.SetNodeStyle(_CN, UNV); } //递归设置字体大小或者是样式
  878. // }
  879. // }
  880. // else { this.writeStyle(N, UNV); }
  881. // },
  882. //获取选择区的单元格
  883. U.MD.O.E.XZTH = function () {
  884. var k, t = [0, 0], _UI, _UJ, _UDED = [], i = ITF % U.MD.O.E.SY["CE"]["TF"][1], j = Math.ceil(ITF / U.MD.O.E.SY["CE"]["TF"][1]), _HW = 0, _OE = U.UF.EL.getElementInfo(SO), _I = U.MD.O.E.SY["SEO"][1], _UDAD = U.selectEl("div", U.selectEl("#U_E_TableArea")[0]), _UTD = (U.MD.O.E.SY["UAE"]["H"] || U.selectEl("#U_E_TitleBar")[0]), _ULD = (U.MD.O.E.SY["UAE"]["L"] || U.selectEl("#U_E_LeftLine")[0]), _UDEL = U.UF.EL.getChildrenNoText($("div", _UTD)[0].childNodes), _UDTD = U.UF.EL.getChildrenNoText($("div", _ULD)[0].childNodes); ;
  885. for (k = i; k < _UDEL.length; k++) { _HW += _UDEL[k].offsetWidth; if (_OE["OW"] == _HW) { _UI = k; break; } }
  886. _HW = 0;
  887. for (k = j; k < _UDTD.length; k++) { _HW += _UDTD[j].offsetHeight; if (_OE["OH"] == _HW) { _UJ = k; break; } }
  888. ITF += (_UJ - j) * U.MD.O.E.SY["CE"]["TF"][1] + (_UI - i);
  889. if (U.MD.O.E.SY["SEO"][1] % U.MD.O.E.SY["CE"]["TF"][1] < ITF % U.MD.O.E.SY["CE"]["TF"][1]) { t = [U.MD.O.E.SY["SEO"][1], ITF]; } else { t = [(Math.floor(U.MD.O.E.SY["SEO"][1] / U.MD.O.E.SY["CE"]["TF"][1]) * U.MD.O.E.SY["CE"]["TF"][1]) + (ITF % U.MD.O.E.SY["CE"]["TF"][1]), (Math.floor(ITF / U.MD.O.E.SY["CE"]["TF"][1]) * U.MD.O.E.SY["CE"]["TF"][1]) + (U.MD.O.E.SY["SEO"][1] % U.MD.O.E.SY["CE"]["TF"][1])]; }
  890. for (k = t[0]; k <= t[1]; k++) {
  891. if (U.MD.O.E.SY["SEO"][1] % U.MD.O.E.SY["CE"]["TF"][1] <= k % U.MD.O.E.SY["CE"]["TF"][1] && ITF % U.MD.O.E.SY["CE"]["TF"][1] >= k % U.MD.O.E.SY["CE"]["TF"][1]) { _UDED.push(_UDAD[k]); }
  892. else if (U.MD.O.E.SY["SEO"][1] % U.MD.O.E.SY["CE"]["TF"][1] >= k % U.MD.O.E.SY["CE"]["TF"][1] && ITF % U.MD.O.E.SY["CE"]["TF"][1] <= k % U.MD.O.E.SY["CE"]["TF"][1]) { _UDED.push(_UDAD[k]); }
  893. }
  894. }
  895. //自创建元素---------------------------------------------------------------------------------------------------------------
  896. //蛋疼的方法~~将生成的代码进行字符更换达到自创建元素的功能~~
  897. //使用方法~在载入的时候执行ElementReplace()便可windown.onload=function(){ElementReplace();}
  898. //终极目标:与asp.net中<asp:input>如此元素一般不止可以自定义元素~还可以进行元素属性的更改
  899. U.UF.ME.Element = new Array(
  900. '<dragdiv',
  901. '<div onselectstart="return false;" ', //禁止选取DIV框
  902. '</dragdiv>',
  903. '</div>'
  904. );
  905. //对生成的所有HTML代码进行替换
  906. U.UF.ME.ElementReplace = function () {
  907. var tmp = new String(document.body.innerHTML);
  908. for (i = 0; i < U.CE.Element.length; i += 2) tmp = tmp.replace(new RegExp(U.CE.Element[i], 'gi'), U.CE.Element[i + 1]); //'gi'是函数中表达搜索的代表
  909. document.body.innerHTML = tmp;
  910. }
  911. //(_UGE["D"] || U.selectEl("#U_E_RWRD")[0]).style.display = (_UGE["R"] || U.selectEl("#U_E_ContextMenu")[0]).style.display = "none";
  912. // (U.MD.O.E.SY["UAE"]["D"] || U.selectEl("#U_E_RWRD")[0]).style.display = (U.MD.O.E.SY["UAE"]["R"] || U.selectEl("#U_E_ContextMenu")[0]).style.display = "none";
  913. // var _UDPD = (event.srcElement);
  914. // (U.MD.O.E.SY["UAE"]["D"] || U.selectEl("#U_E_RWRD")[0]).style.display = (U.MD.O.E.SY["UAE"]["R"] || U.selectEl("#U_E_ContextMenu")[0]).style.display = "none"; U.OU.SDYC(); //隐藏右键菜单 //隐藏功能菜单
  915. // while (_UDPD && _UDPD.tagName.toLocaleLowerCase() != "body") {
  916. // if (_UDPD.id == "U_E_A") {
  917. // U.OU.TF["FTF"] = true;
  918. // _UDPD.onclick();
  919. // }
  920. // _UDPD = _UDPD.parentNode;
  921. // }
  922. //单元格编辑框与函数编辑框对应
  923. U.MD.O.E.EditTextEdit = function (UDOD, UDTD, UTF) {
  924. // if (UDCD.style.backgroundColor != "rgb(232, 243, 249)") { UDCD.style.backgroundColor = "rgb(232, 243, 249)"; }
  925. }
  926. ////显示颜色框
  927. //U.OU.DisplayColorFrame = function (DID, NID) {
  928. // U.selectEl("#" + DID)[0].style.display = "block"; U.selectEl("#" + NID)[0].style.display = "none";
  929. //}
  930. ////文件下拉菜单功能
  931. //U.OU.OpenFileMenu = function () {
  932. // var _UDEO = U.selectEl("#U_E_OC"); _UDEO.addAttrArray({ "style": { "display": (_UDEO[0].style.display == "block" ? "none" : "block")} }); U.UF.EV.stopBubble();
  933. //}
  934. //Error具有下面一些主要属性:
  935. //description: 错误描述 (仅IE可用).
  936. //fileName: 出错的文件名 (仅Mozilla可用).
  937. //lineNumber: 出错的行数 (仅Mozilla可用).
  938. //message: 错误信息 (在IE下同description)
  939. //name: 错误类型.
  940. //number: 错误代码 (仅IE可用).
  941. //stack: 像Java中的Stack Trace一样的错误堆栈信息 (仅Mozilla可用).
  942. //--------------------------------------统一try cache---------------------------------
  943. U.UF.MC.TC = {}; //保存前台错误的集合,暂时显示在前台,以后存入后台
  944. U.UF.MC.TCatch = function (f) {
  945. try { (typeof (f) == "string") ? eval(f) : f; }
  946. catch (e) { Add(U.UF.MC.TC, { "类型": e.name, "错误信息": e.message, "时间": U.UF.D.formatDateToArray(new Date()) }); }
  947. }
  948. //兼容SetCapture函数
  949. U.UF.C.SetCapture = function (obj) {
  950. return document.all ? obj.setCapture() : window.captureEvents(Event.MOUSEMOVE);
  951. }
  952. //兼容releaseCapture函数
  953. U.UF.C.releaseCapture = function (obj) {
  954. document.all ? obj.releaseCapture() : window.releaseEvents(Event.MOUSEUP);
  955. }
  956. //兼容加载事件与脚本 func为函数
  957. U.UF.C.LoadEvent = function (func) {
  958. var oldonload = window.onload;
  959. //判断对象是否为一个事件,是则直接执行
  960. if (typeof window.onload != 'function') {
  961. window.onload = func;
  962. }
  963. else {
  964. window.onload = function () {
  965. oldonload();
  966. func();
  967. }
  968. }
  969. }
  970. //函数功能:获取键盘码,兼容Onkeydown事件
  971. U.UF.C.getKeyCode = function (e) {
  972. e = e || window.event;
  973. keynum = e.keyCode ? e.keyCode : e.which;
  974. return keynum;
  975. }
  976. //事件代理机制,避免频繁添加事件操作。浪费代码,加大复杂度。
  977. U.UF.C.GetEventTarget = function (e) {//判断浏览器类型以兼容事件
  978. e = e || window.event;
  979. return e.target || e.srcElement;
  980. }
  981. //Click()事件调用兼容
  982. U.UF.C.invokeClick = function (element) {
  983. if (element.click) element.click(); //判断是否支持click() 事件
  984. else if (element.fireEvent) element.fireEvent('onclick'); //触发click() 事件
  985. else if (document.createEvent) {
  986. var evt = document.createEvent("MouseEvents"); //创建click() 事件
  987. evt.initEvent("click", true, true); //初始化click() 事件
  988. element.dispatchEvent(evt); //分发click() 事件
  989. }
  990. }
  991. //dblClick()事件调用兼容
  992. U.UF.C.dblClick = function (element) {
  993. if (element.ondblclick) element.ondblclick(); //判断是否支持dblClick() 事件
  994. else if (element.fireEvent) element.fireEvent('ondblclick'); //触发dblClick() 事件
  995. else if (document.createEvent) {
  996. var evt = document.createEvent("MouseEvents"); //创建ondblclick() 事件
  997. evt.initEvent("dblclick", true, true); //初始化ondblclick() 事件
  998. element.dispatchEvent(evt); //分发ondblclick() 事件
  999. }
  1000. }
  1001. //------------------------------------------------------------------监听事件注册和取消区域---------------------------------------------------------------
  1002. //注意:只有被addEventListener方法添加的事件才可以使用removeEventListener来注销.
  1003. //如果你直接使用onclick或onkeyup直接写在元素内的事件.将无法使用removeEventListener来删除.
  1004. U.UF.C.removeEvent = function (oTarget, sEventType, funName) {
  1005. if (oTarget.removeEventListener) {//for DOM;
  1006. oTarget.removeEventListener(sEventType, funName, false);
  1007. } else if (oTarget.detachEvent) {
  1008. oTarget.detachEvent("on" + sEventType, funName);
  1009. } else {
  1010. oTarget["on" + sEventType] = null;
  1011. }
  1012. }
  1013. //函数作用:为元素添加事件
  1014. //oTarget:元素对象;sEventType:事件类型,例如点击则为click;funName:事件触发的函数名;
  1015. U.UF.N.AddEvent = function (oTarget, sEventType, funName) {
  1016. if (oTarget.addEventListener) {//Dom浏览器触发
  1017. oTarget.addEventListener(sEventType, funName, false);
  1018. } else if (oTarget.attachEvent) { //IE
  1019. oTarget.attachEvent("on" + sEventType, funName);
  1020. } else {
  1021. oTarget["on" + sEventType] = funName;
  1022. }
  1023. }
  1024. //屏蔽错误
  1025. U.UF.C.killErrors = function (sMsg, sUrl, sLine) {
  1026. //onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。
  1027. // var oErrorLog = document.createElement("div");
  1028. // oErrorLog.innerHTML = "<b>An error was thrown and caught.</b><p>";
  1029. // oErrorLog.innerHTML += "Error: " + sMsg + "<br>";
  1030. // oErrorLog.innerHTML += "Line: " + sLine + "<br>";
  1031. // oErrorLog.innerHTML += "URL: " + sUrl + "<br>";
  1032. return true;
  1033. }
  1034. //屏蔽按键操作。
  1035. U.UF.C.forbiddenKey = function () {
  1036. if (event.keyCode == 116) { event.keyCode = 0; event.returnValue = false; } //屏蔽f5刷新
  1037. }
  1038. //屏蔽div右键
  1039. U.UF.C.ForbiddenDivRightMouseClick = function (obj) {
  1040. obj.oncontextmenu = function () { return false; }
  1041. }
  1042. //规范插入的图片大小--杨嘉城
  1043. U.UF.C.norm_img = function (SO) {
  1044. var _ISO = U.selectEl("img", SO);
  1045. for (var i = 0; i < _ISO.length; i++) {
  1046. if (_ISO[i].clientWidth >= 1024) { _ISO[i].width = "900px"; }
  1047. }
  1048. }
  1049. //设置字体
  1050. U.UF.C.setuserbackgroundfont = function (obj) {
  1051. if (obj != null) {
  1052. var allelments = parent.document.getElementsByTagName('*');
  1053. var i;
  1054. for (i = 0; i < allelments.length; i++) {
  1055. allelments[i].style.fontSize = obj + "px";
  1056. }
  1057. }
  1058. }
  1059. //去掉所有空格和标点符号
  1060. U.UF.S.dropSpaceAndDot = function (obj) {
  1061. str = obj.value;
  1062. var pattern = new RegExp("[`~!#$^&*()=|{}':;',\\[\\].<>/?~#……&*()&;—|{}‘;:”“'。,、]");
  1063. var newstr = "";
  1064. for (i = 0; i < str.length; i++) {
  1065. if (str.substr(i, 1) == " ") {
  1066. continue;
  1067. }
  1068. newstr += str.substr(i, 1).replace(pattern, "");
  1069. }
  1070. obj.innerText = newstr;
  1071. //U.UF.C.textCompatibleandStr(obj, newstr)
  1072. }
  1073. //判断字符串类型是是否带有' '这样的字符
  1074. U.UF.C.isBlank = function (szStr) {
  1075. for (i = 0; i < szStr.length; i++) {
  1076. if (szStr.substring(i, i + 1) == ' ') {
  1077. return false;
  1078. }
  1079. break;
  1080. }
  1081. return true;
  1082. }
  1083. // 检查序列号格式 目前的格式类似 GUID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
  1084. U.UF.S.Checkguid = function (object_value) {
  1085. if (object_value.length == 0)
  1086. return false;
  1087. if (object_value.length != 38)
  1088. return false;
  1089. if (object_value.charAt(0) != "{")
  1090. return false;
  1091. if (object_value.charAt(37) != "}")
  1092. return false;
  1093. var hex_format = "0123456789abcdefABCDEF";
  1094. var check_char;
  1095. for (var i = 1; i < 37; i++) {
  1096. if ((i == 9) || (i == 14) || (i == 19) || (i == 24)) {
  1097. if (object_value.charAt(i) != "-")
  1098. return false;
  1099. } else {
  1100. check_char = hex_format.indexOf(object_value.charAt(i));
  1101. if (check_char < 0)
  1102. return false;
  1103. }
  1104. }
  1105. return true;
  1106. }
  1107. //跟进时间判定早中午时间,此函数未被使用
  1108. U.UF.D.GetNowTime = function () {
  1109. var time = new Date();
  1110. var TimePart = document.getElementById("TimePart");
  1111. var DataTime = time.getHours();
  1112. if (DataTime >= 0 && DataTime < 12) {
  1113. TimePart.innerHTML = "早上好!";
  1114. }
  1115. else if (DataTime >= 12 && DataTime < 18) {
  1116. TimePart.innerHTML = "下午好!";
  1117. }
  1118. else {
  1119. TimePart.innerHTML = "晚上好!";
  1120. }
  1121. }
  1122. //使用U.UF.D.currenttime函数时转换UTC() 方法可根据世界时返回 1970 年 1 月 1 日 到指定日期的毫秒数。
  1123. //Date.UTC(year,month,day,hours,minutes,seconds,ms)
  1124. U.UF.D.DateUTC = function (STime) {
  1125. STime = STime.split(" ");
  1126. var MY = STime[0].split("/");
  1127. var MS = STime[STime.length - 1].split(":");
  1128. return "/Date(" + Date.UTC(MY[0], MY[1], MY[2], MS[0], MS[1], MS[2], 0) + ")/";
  1129. }
  1130. ////把json时间戳转为日期格式
  1131. U.UF.D.getLocalTime = function (nS) {
  1132. var _timeS = new Date(parseInt(nS.substring(6, nS.length - 2))).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
  1133. if (!parent.browser.msie) _timeS = _timeS.substring(10, 25);
  1134. return _timeS;
  1135. }
  1136. //js获取当前的时间
  1137. U.UF.D.currenttime = function () {
  1138. var _currenttime = new Date();
  1139. var _year = U.UF.D.getYear()//获取当前的年数
  1140. var _month = _currenttime.getMonth() + 1; //获取当前的月份
  1141. var _date = _currenttime.getDate(); //获取当前的日期
  1142. var _houst = _currenttime.getHours(); //获取当前的小时
  1143. var _Minutes = _currenttime.getMinutes(); //获取当前的分钟
  1144. var _Seconds = _currenttime.getSeconds(); //获取当前的秒数
  1145. return _year + '/' + _month + '/' + _date + ' ' + _houst + ':' + _Minutes + ':' + _Seconds; //返回用户现在的时间段 且样式复合项目的需求
  1146. }
  1147. U.UF.D.getDate = function (D) {
  1148. if (D == null) { D = new Date(); }
  1149. // if (date == null || date == "" || date == "undefined") date = new Date();
  1150. // var yyyy = date.getFullYear();
  1151. // var m = date.getMonth() + 1;
  1152. // var mm = (m < 10) ? '0' + m : m;
  1153. // var d = date.getDate();
  1154. // var dd = (d < 10) ? '0' + d : d;
  1155. // var h = date.getHours();
  1156. // var hh = (h < 10) ? '0' + h : h;
  1157. // var n = date.getMinutes();
  1158. // var nn = (n < 10) ? '0' + n : n;
  1159. // var s = date.getSeconds();
  1160. // var ss = (s < 10) ? '0' + s : s;
  1161. // return yyyy + "-" + mm + "-" + dd + " " + hh + ":" + nn + ":" + ss;
  1162. }
  1163. //返回月份的方法
  1164. U.UF.D.GetMonth = function (month) {
  1165. switch (month) {
  1166. case "Jan":
  1167. return "1";
  1168. break;
  1169. case "Feb":
  1170. return "2";
  1171. break;
  1172. case "Mar":
  1173. return "3";
  1174. break;
  1175. case "Apr":
  1176. return "4";
  1177. break;
  1178. case "May":
  1179. return "5";
  1180. break;
  1181. case "Jun":
  1182. return "6";
  1183. break;
  1184. case "Jul":
  1185. return "7";
  1186. break;
  1187. case "Aug":
  1188. return "8";
  1189. break;
  1190. case "Sep":
  1191. return "9";
  1192. break;
  1193. case "Oct":
  1194. return "10";
  1195. break;
  1196. case "Nov":
  1197. return "11";
  1198. break;
  1199. case "Dec":
  1200. return "12";
  1201. break;
  1202. }
  1203. }
  1204. //转化星期
  1205. U.UF.D.Getweek = function (week) {
  1206. switch (week) {
  1207. case "Mon":
  1208. return "一";
  1209. break;
  1210. case "Tue":
  1211. return "二";
  1212. break;
  1213. case "Wed":
  1214. return "三";
  1215. break;
  1216. case "Thu":
  1217. return "四";
  1218. break;
  1219. case "Fri":
  1220. return "五";
  1221. break;
  1222. case "Sat":
  1223. return "六";
  1224. break;
  1225. case "Sun":
  1226. return "七";
  1227. break;
  1228. }
  1229. }
  1230. //if (_UDD == 0) { _UDW = "小时"; _UDTS = _UND[3] - UGD[3]; (_UDTS == 0) && (_UDTS = _UND[4] - UGD[4], _UDW = "分钟"); _UDTS = _UDTS || 1; _UDTS += _UDW; } //(_UDTS == 0) && (_UDTS = _UND[5] - UGD[5], _UDW = "秒");
  1231. //else if (_UDD < 10) { _UDTS = _UDD + "天前"; }
  1232. U.UF.D.DataTime = function (time) {
  1233. time = eval('new ' + eval(time).source) + "";
  1234. var strtime;
  1235. _strtime = time.split(" ");
  1236. _strtime[1] = U.UF.D.GetMonth(_strtime[1]); // 转化月份
  1237. _strtime[0] = U.UF.D.Getweek(_strtime[0]); //转化星期
  1238. return _strtime;
  1239. }
  1240. //用于blog的时间转换...转入2013-2-2 10:28:00 ...返回2013 2 2 10:28:00
  1241. U.UF.D.DateAnalyze = function (TD) {
  1242. TD = TD.split(" ");
  1243. var MT = TD[0].split("/");
  1244. MT = MT[0].split("-")
  1245. MT[3] = TD[TD.length - 1];
  1246. return MT;
  1247. }
  1248. //转换普通时间为Unix时间戳,返回的是US.userInfo中相同的类型-曾冠悦
  1249. U.UF.D.getUnixTime = function (str_time) {
  1250. var new_str = str_time.replace(/:/g, '-'); //替换冒号
  1251. new_str = new_str.replace(/ /g, '-'); //替换空格
  1252. var arr = new_str.split("-"); //转换成数组
  1253. arr.length = 5;
  1254. for (var i = 0; i < 6; i++) {
  1255. if (arr[i] == undefined) {
  1256. arr[i] = 0;
  1257. }
  1258. }
  1259. return "/Date(" + Date.UTC(arr[0], arr[1] - 1, arr[2], arr[3] - 8, arr[4], arr[5]) + ")/";
  1260. }
  1261. //闰年
  1262. U.UF.D.IsLeapYear = function (Y) {
  1263. if ((Y % 400 == 0 && Y % 100 == 0) || (Y % 4 == 0 && Y % 100 != 0)) { return true; }
  1264. else { return false; }
  1265. }
  1266. //函数作用,获取年份
  1267. //在IE中得到的日期是"2011",在Firefox中看到的日期是"111",主要是因为在 Firefox 里面 getYear 返回的是 "当前年份-1900" 的值。
  1268. U.UF.D.getYear = function () {
  1269. var year = new Date().getYear();
  1270. year = (year < 1900 ? (1900 + year) : year);
  1271. return year;
  1272. }
  1273. //获取当前月份
  1274. U.UF.D.getNowMonth = function () {
  1275. var month = new Date().getMonth() + 1;
  1276. return month;
  1277. }
  1278. //获取日期
  1279. U.UF.D.getNowDate = function () {
  1280. var date = new Date().getDate();
  1281. return date;
  1282. }
  1283. //获取月份的天数,2月需要年参数
  1284. U.UF.D.getDayOfMonth = function (month, year) {
  1285. if (month == 4 || month == 6 || month == 9 || month == 11) {
  1286. return 30;
  1287. }
  1288. if (month == 2) {
  1289. if (U.UF.D.IsLeapYear(year)) {
  1290. return 29;
  1291. }
  1292. else return 28;
  1293. }
  1294. return 31;
  1295. }
  1296. U.UF.S.PY = { 0xB0A1: "a", 0xB0A3: "ai", 0xB0B0: "an", 0xB0B9: "ang", 0xB0BC: "ao", 0xB0C5: "ba", 0xB0D7: "bai", 0xB0DF: "ban", 0xB0EE: "bang", 0xB0FA: "bao", 0xB1AD: "bei", 0xB1BC: "ben", 0xB1C0: "beng", 0xB1C6: "bi", 0xB1DE: "bian", 0xB1EA: "biao", 0xB1EE: "bie", 0xB1F2: "bin", 0xB1F8: "bing", 0xB2A3: "bo", 0xB2B8: "bu", 0xB2C1: "ca", 0xB2C2: "cai", 0xB2CD: "can", 0xB2D4: "cang", 0xB2D9: "cao", 0xB2DE: "ce", 0xB2E3: "ceng", 0xB2E5: "cha", 0xB2F0: "chai", 0xB2F3: "chan", 0xB2FD: "chang", 0xB3AC: "chao", 0xB3B5: "che", 0xB3BB: "chen", 0xB3C5: "cheng", 0xB3D4: "chi", 0xB3E4: "chong", 0xB3E9: "chou", 0xB3F5: "chu", 0xB4A7: "chuai", 0xB4A8: "chuan", 0xB4AF: "chuang", 0xB4B5: "chui", 0xB4BA: "chun", 0xB4C1: "chuo", 0xB4C3: "ci", 0xB4CF: "cong", 0xB4D5: "cou", 0xB4D6: "cu", 0xB4DA: "cuan", 0xB4DD: "cui", 0xB4E5: "cun", 0xB4E8: "cuo", 0xB4EE: "da", 0xB4F4: "dai", 0xB5A2: "dan", 0xB5B1: "dang", 0xB5B6: "dao", 0xB5C2: "de", 0xB5C5: "deng", 0xB5CC: "di", 0xB5DF: "dian", 0xB5EF: "diao", 0xB5F8: "die", 0xB6A1: "ding", 0xB6AA: "diu", 0xB6AB: "dong", 0xB6B5: "dou", 0xB6BC: "du", 0xB6CB: "duan", 0xB6D1: "dui", 0xB6D5: "dun", 0xB6DE: "duo", 0xB6EA: "e", 0xB6F7: "en", 0xB6F8: "er", 0xB7A2: "fa", 0xB7AA: "fan", 0xB7BB: "fang", 0xB7C6: "fei", 0xB7D2: "fen", 0xB7E1: "feng", 0xB7F0: "fo", 0xB7F1: "fou", 0xB7F2: "fu", 0xB8C1: "ga", 0xB8C3: "gai", 0xB8C9: "gan", 0xB8D4: "gang", 0xB8DD: "gao", 0xB8E7: "ge", 0xB8F8: "gei", 0xB8F9: "gen", 0xB8FB: "geng", 0xB9A4: "gong", 0xB9B3: "gou", 0xB9BC: "gu", 0xB9CE: "gua", 0xB9D4: "guai", 0xB9D7: "guan", 0xB9E2: "guang", 0xB9E5: "gui", 0xB9F5: "gun", 0xB9F8: "guo", 0xB9FE: "ha", 0xBAA1: "hai", 0xBAA8: "han", 0xBABB: "hang", 0xBABE: "hao", 0xBAC7: "he", 0xBAD9: "hei", 0xBADB: "hen", 0xBADF: "heng", 0xBAE4: "hong", 0xBAED: "hou", 0xBAF4: "hu", 0xBBA8: "hua", 0xBBB1: "huai", 0xBBB6: "huan", 0xBBC4: "huang", 0xBBD2: "hui", 0xBBE7: "hun", 0xBBED: "huo", 0xBBF7: "ji", 0xBCCE: "jia", 0xBCDF: "jian", 0xBDA9: "jiang", 0xBDB6: "jiao", 0xBDD2: "jie", 0xBDED: "jin", 0xBEA3: "jing", 0xBEBC: "jiong", 0xBEBE: "jiu", 0xBECF: "ju", 0xBEE8: "juan", 0xBEEF: "jue", 0xBEF9: "jun", 0xBFA6: "ka", 0xBFAA: "kai", 0xBFAF: "kan", 0xBFB5: "kang", 0xBFBC: "kao", 0xBFC0: "ke", 0xBFCF: "ken", 0xBFD3: "keng", 0xBFD5: "kong", 0xBFD9: "kou", 0xBFDD: "ku", 0xBFE4: "kua", 0xBFE9: "kuai", 0xBFED: "kuan", 0xBFEF: "kuang", 0xBFF7: "kui", 0xC0A4: "kun", 0xC0A8: "kuo", 0xC0AC: "la", 0xC0B3: "lai", 0xC0B6: "lan", 0xC0C5: "lang", 0xC0CC: "lao", 0xC0D5: "le", 0xC0D7: "lei", 0xC0E2: "leng", 0xC0E5: "li", 0xC1A9: "lia", 0xC1AA: "lian", 0xC1B8: "liang", 0xC1C3: "liao", 0xC1D0: "lie", 0xC1D5: "lin", 0xC1E1: "ling", 0xC1EF: "liu", 0xC1FA: "long", 0xC2A5: "lou", 0xC2AB: "lu", 0xC2BF: "lv", 0xC2CD: "luan", 0xC2D3: "lue", 0xC2D5: "lun", 0xC2DC: "luo", 0xC2E8: "ma", 0xC2F1: "mai", 0xC2F7: "man", 0xC3A2: "mang", 0xC3A8: "mao", 0xC3B4: "me", 0xC3B5: "mei", 0xC3C5: "men", 0xC3C8: "meng", 0xC3D0: "mi", 0xC3DE: "mian", 0xC3E7: "miao", 0xC3EF: "mie", 0xC3F1: "min", 0xC3F7: "ming", 0xC3FD: "miu", 0xC3FE: "mo", 0xC4B1: "mou", 0xC4B4: "mu", 0xC4C3: "na", 0xC4CA: "nai", 0xC4CF: "nan", 0xC4D2: "nang", 0xC4D3: "nao", 0xC4D8: "ne", 0xC4D9: "nei", 0xC4DB: "nen", 0xC4DC: "neng", 0xC4DD: "ni", 0xC4E8: "nian", 0xC4EF: "niang", 0xC4F1: "niao", 0xC4F3: "nie", 0xC4FA: "nin", 0xC4FB: "ning", 0xC5A3: "niu", 0xC5A7: "nong", 0xC5AB: "nu", 0xC5AE: "nv", 0xC5AF: "nuan", 0xC5B0: "nue", 0xC5B2: "nuo", 0xC5B6: "o", 0xC5B7: "ou", 0xC5BE: "pa", 0xC5C4: "pai", 0xC5CA: "pan", 0xC5D2: "pang", 0xC5D7: "pao", 0xC5DE: "pei", 0xC5E7: "pen", 0xC5E9: "peng", 0xC5F7: "pi", 0xC6AA: "pian", 0xC6AE: "piao", 0xC6B2: "pie", 0xC6B4: "pin", 0xC6B9: "ping", 0xC6C2: "po", 0xC6CB: "pu", 0xC6DA: "qi", 0xC6FE: "qia", 0xC7A3: "qian", 0xC7B9: "qiang", 0xC7C1: "qiao", 0xC7D0: "qie", 0xC7D5: "qin", 0xC7E0: "qing", 0xC7ED: "qiong", 0xC7EF: "qiu", 0xC7F7: "qu", 0xC8A6: "quan", 0xC8B1: "que", 0xC8B9: "qun", 0xC8BB: "ran", 0xC8BF: "rang", 0xC8C4: "rao", 0xC8C7: "re", 0xC8C9: "ren", 0xC8D3: "reng", 0xC8D5: "ri", 0xC8D6: "rong", 0xC8E0: "rou", 0xC8E3: "ru", 0xC8ED: "ruan", 0xC8EF: "rui", 0xC8F2: "run", 0xC8F4: "ruo", 0xC8F6: "sa", 0xC8F9: "sai", 0xC8FD: "san", 0xC9A3: "sang", 0xC9A6: "sao", 0xC9AA: "se", 0xC9AD: "sen", 0xC9AE: "seng", 0xC9AF: "sha", 0xC9B8: "shai", 0xC9BA: "shan", 0xC9CA: "shang", 0xC9D2: "shao", 0xC9DD: "she", 0xC9E9: "shen", 0xC9F9: "sheng", 0xCAA6: "shi", 0xCAD5: "shou", 0xCADF: "shu", 0xCBA2: "shua", 0xCBA4: "shuai", 0xCBA8: "shuan", 0xCBAA: "shuang", 0xCBAD: "shui", 0xCBB1: "shun", 0xCBB5: "shuo", 0xCBB9: "si", 0xCBC9: "song", 0xCBD1: "sou", 0xCBD4: "su", 0xCBE1: "suan", 0xCBE4: "sui", 0xCBEF: "sun", 0xCBF2: "suo", 0xCBFA: "ta", 0xCCA5: "tai", 0xCCAE: "tan", 0xCCC0: "tang", 0xCCCD: "tao", 0xCCD8: "te", 0xCCD9: "teng", 0xCCDD: "ti", 0xCCEC: "tian", 0xCCF4: "tiao", 0xCCF9: "tie", 0xCCFC: "ting", 0xCDA8: "tong", 0xCDB5: "tou", 0xCDB9: "tu", 0xCDC4: "tuan", 0xCDC6: "tui", 0xCDCC: "tun", 0xCDCF: "tuo", 0xCDDA: "wa", 0xCDE1: "wai", 0xCDE3: "wan", 0xCDF4: "wang", 0xCDFE: "wei", 0xCEC1: "wen", 0xCECB: "weng", 0xCECE: "wo", 0xCED7: "wu", 0xCEF4: "xi", 0xCFB9: "xia", 0xCFC6: "xian", 0xCFE0: "xiang", 0xCFF4: "xiao", 0xD0A8: "xie", 0xD0BD: "xin", 0xD0C7: "xing", 0xD0D6: "xiong", 0xD0DD: "xiu", 0xD0E6: "xu", 0xD0F9: "xuan", 0xD1A5: "xue", 0xD1AB: "xun", 0xD1B9: "ya", 0xD1C9: "yan", 0xD1EA: "yang", 0xD1FB: "yao", 0xD2AC: "ye", 0xD2BB: "yi", 0xD2F0: "yin", 0xD3A2: "ying", 0xD3B4: "yo", 0xD3B5: "yong", 0xD3C4: "you", 0xD3D9: "yu", 0xD4A7: "yuan", 0xD4BB: "yue", 0xD4C5: "yun", 0xD4D1: "za", 0xD4D4: "zai", 0xD4DB: "zan", 0xD4DF: "zang", 0xD4E2: "zao", 0xD4F0: "ze", 0xD4F4: "zei", 0xD4F5: "zen", 0xD4F6: "zeng", 0xD4FA: "zha", 0xD5AA: "zhai", 0xD5B0: "zhan", 0xD5C1: "zhang", 0xD5D0: "zhao", 0xD5DA: "zhe", 0xD5E4: "zhen", 0xD5F4: "zheng", 0xD6A5: "zhi", 0xD6D0: "zhong", 0xD6DB: "zhou", 0xD6E9: "zhu", 0xD7A5: "zhua", 0xD7A7: "zhuai", 0xD7A8: "zhuan", 0xD7AE: "zhuang", 0xD7B5: "zhui", 0xD7BB: "zhun", 0xD7BD: "zhuo", 0xD7C8: "zi", 0xD7D7: "zong", 0xD7DE: "zou", 0xD7E2: "zu", 0xD7EA: "zuan", 0xD7EC: "zui", 0xD7F0: "zun", 0xD7F2: "zuo" }
  1297. //获取中文拼音
  1298. U.UF.S.PYS = function (UST) {//U.UF.S.PY
  1299. var i, _UCT = UST.charCodeAt(0); //拼音编码
  1300. if (_UCT && (_UCT > 0xB0A0 && _UCT < 0xD7FC)) { for (i = _UCT; (!(_UCT = U.UF.S.PY[i]) && i > 0xB0A1); ) { i--; } } //如果为拼音
  1301. return _UCT;
  1302. }
  1303. U.UF.S.PYS("你");
  1304. Namespace.register("U.UF.IMGes"); //久的图片浏览器
  1305. USPhotoImgJson = null;
  1306. //图片预加载(摘自:http://www.planeart.cn/demo/imgReady/ )=========================================================================================================================
  1307. //使用方法ImgReady(图片URL,加载头文件成功执行函数(即获得图片长宽),加载图片成功执行函数,加载图片失败执行函数);
  1308. //imgReady('images/logo_cn.png', function () {alert('size ready: width=' + this.width + '; height=' + this.height);},function(){alert("加载成功")},function(){alert("加载失败")});
  1309. U.UF.IMGes.ImgReady = (function () {
  1310. var list = [], intervalId = null,
  1311. // 用来执行队列
  1312. tick = function () {
  1313. var i = 0;
  1314. for (; i < list.length; i++) {
  1315. list[i].end ? list.splice(i--, 1) : list[i]();
  1316. };
  1317. !list.length && stop();
  1318. },
  1319. //停止所有定时器队列
  1320. stop = function () {
  1321. clearInterval(intervalId);
  1322. intervalId = null;
  1323. };
  1324. return function (url, ready, load, error) {
  1325. var onready, width, height, newWidth, newHeight,
  1326. img = new Image();
  1327. img.src = url;
  1328. // 如果图片被缓存,则直接返回缓存数据
  1329. if (img.complete) {
  1330. ready.call(img);
  1331. load && load.call(img);
  1332. return;
  1333. };
  1334. width = img.width;
  1335. height = img.height;
  1336. // 加载错误后的事件
  1337. img.onerror = function () {
  1338. error && error.call(img);
  1339. //onready.end = true;
  1340. img = img.onload = img.onerror = null;
  1341. };
  1342. // 图片尺寸就绪
  1343. img.onreadystatechange = function () {
  1344. if (document.readyState == "complete") {
  1345. newWidth = img.width;
  1346. newHeight = img.height;
  1347. // 如果图片已经在其他地方加载可使用面积检测
  1348. if (newWidth !== width || newHeight !== height || newWidth * newHeight > 1024) {
  1349. ready.call(img);
  1350. //onready.end = true;
  1351. };
  1352. };
  1353. };
  1354. // onready = function () {
  1355. // newWidth = img.width;
  1356. // newHeight = img.height;
  1357. // // 如果图片已经在其他地方加载可使用面积检测
  1358. // if (newWidth !== width || newHeight !== height || newWidth * newHeight > 1024) {
  1359. // ready.call(img);
  1360. // onready.end = true;
  1361. // };
  1362. // };
  1363. // onready();
  1364. // 完全加载完毕的事件
  1365. img.onload = function () {
  1366. // onload在定时器时间差范围内可能比onready快
  1367. // 这里进行检查并保证onready优先执行
  1368. //!onready.end && onready();
  1369. load && load.call(img);
  1370. // IE gif动画会循环执行onload,置空onload即可
  1371. img = img.onload = img.onerror = null;
  1372. };
  1373. // 加入队列中定期执行
  1374. // if (!onready.end) {
  1375. // list.push(onready);
  1376. // // 无论何时只允许出现一个定时器,减少浏览器性能损耗
  1377. // if (intervalId === null) intervalId = setInterval(tick, 40);
  1378. // };
  1379. };
  1380. })();
  1381. //图片预加载(摘自:http://www.planeart.cn/demo/imgReady/ )=========================================================================================================================
  1382. //图片居中旋转(编写:郭仁)========================================================================================================================================================
  1383. //传入图片对象,与旋转方向(值:'left' or 'right')
  1384. //使用方法imgRoll(document.getElementById("ImgObj"),"left");
  1385. U.UF.IMGes.imgRoll = function (imgObj, SX, ArcSizeInt) {
  1386. var ArcSize = imgObj.alt == null ? 0 : parseInt(imgObj.alt); //通过图片对象中的alt属性进行储存现行角度(1=90度;2=180度;3=270度;4=360度=0度)
  1387. //判断SX进行角度增减
  1388. if (SX == "left") {
  1389. ArcSize += 1;
  1390. ArcSize = ArcSize > 4 ? 0 : ArcSize;
  1391. } else if (SX == "right") {
  1392. ArcSize -= 1;
  1393. ArcSize = ArcSize < 0 ? 3 : ArcSize;
  1394. } else if (SX == "int") {
  1395. ArcSize = ArcSizeInt;
  1396. }
  1397. //因为CSS旋转滤镜的实现方式不同~~需要进行不同的浏览判断给予定位
  1398. imgObj.parentNode.style.width = ArcSize % 2 == 0 ? imgObj.width + (2 * 7) + "px" : imgObj.height + (2 * 7) + "px";
  1399. imgObj.parentNode.style.height = ArcSize % 2 == 0 ? imgObj.height + (2 * 7) + "px" : imgObj.width + (2 * 7) + "px";
  1400. if (!browser.msie) {
  1401. if (ArcSize % 2 != 0) {
  1402. imgObj.style.left = Math.ceil((parseInt(imgObj.parentNode.style.width) - parseInt(imgObj.parentNode.style.height)) / 2) + "px";
  1403. imgObj.style.top = Math.ceil((parseInt(imgObj.parentNode.style.height) - parseInt(imgObj.parentNode.style.width)) / 2) + "px";
  1404. imgObj.parentNode.style.left = parseInt(imgObj.parentNode.style.left) - parseInt(imgObj.style.left) + "px";
  1405. imgObj.parentNode.style.top = parseInt(imgObj.parentNode.style.top) - parseInt(imgObj.style.top) + "px";
  1406. } else {
  1407. imgObj.parentNode.style.left = parseInt(imgObj.parentNode.style.left) + parseInt(imgObj.style.left) + "px";
  1408. imgObj.parentNode.style.top = parseInt(imgObj.parentNode.style.top) + parseInt(imgObj.style.top) + "px";
  1409. imgObj.style.left = "0px";
  1410. imgObj.style.top = "0px";
  1411. }
  1412. }
  1413. // else {
  1414. // imgObj.parentNode.style.left = parseInt(imgObj.parentNode.getBoundingClientRect().left) - Math.ceil((parseInt(imgObj.parentNode.style.width) - parseInt(imgObj.parentNode.style.height)) / 2) + "px";
  1415. // imgObj.parentNode.style.top = parseInt(imgObj.parentNode.getBoundingClientRect().top) - Math.ceil((parseInt(imgObj.parentNode.style.height) - parseInt(imgObj.parentNode.style.width)) / 2) + "px";
  1416. // }
  1417. imgObj.alt = ArcSize; //将角度值置于图片对象alt属性中
  1418. //css旋转滤镜兼容
  1419. imgObj.style.filter = 'Progid:DXImageTransform.Microsoft.BasicImage(Rotation=' + ArcSize + ')';
  1420. imgObj.style.WebkitTransform = 'rotate(' + ArcSize * 90 + 'deg)';
  1421. imgObj.style.MozTransform = 'rotate(' + ArcSize * 90 + 'deg)';
  1422. imgObj.style.OTransform = 'rotate(' + ArcSize * 90 + 'deg)';
  1423. }
  1424. //图片居中旋转(编写:郭仁)========================================================================================================================================================
  1425. //放大缩小【不影响于旋转后放大缩小的BUG~~】(编写:郭仁)============================================================================================================================
  1426. //传入(图片对象,原始宽,原始高)~~
  1427. U.UF.IMGes.Scale = function (ImgObj, nwidth, nheight) {
  1428. var event = arguments.callee.caller.arguments[0] || window.event; //消除浏览器差异
  1429. //滑动条位置
  1430. var x = event.clientX - 80;
  1431. var y = event.clientY - 20;
  1432. //缩放比例~~
  1433. var Scale = nwidth / nheight;
  1434. //现行角度
  1435. var ArcSize = ImgObj.alt == null ? 0 : parseInt(ImgObj.alt);
  1436. if (document.getElementById("SlideCase_" + ImgObj.id) == null) {//判断滑动条是否已存在
  1437. //创建滑动条
  1438. var SlideCase = new U.UF.IMGes.SliderContorl(ImgObj.id, 200, 50, x, y, function (percentage) {
  1439. ImgObj.style.width = nwidth * (percentage / 100) + "px";
  1440. ImgObj.style.height = parseInt(ImgObj.style.width) / Scale + "px";
  1441. if (ArcSize % 2 != 0) {
  1442. ImgObj.parentNode.style.width = parseInt(ImgObj.style.height) + (2 * 7) + "px";
  1443. ImgObj.parentNode.style.height = parseInt(ImgObj.style.width) + (2 * 7) + "px";
  1444. if (browser.chrome || browser.firefox) {
  1445. ImgObj.style.left = Math.ceil((parseInt(ImgObj.parentNode.style.width) - parseInt(ImgObj.parentNode.style.height)) / 2) + "px";
  1446. ImgObj.style.top = Math.ceil((parseInt(ImgObj.parentNode.style.height) - parseInt(ImgObj.parentNode.style.width)) / 2) + "px";
  1447. }
  1448. } else {
  1449. ImgObj.parentNode.style.width = parseInt(ImgObj.style.width) + (2 * 7) + "px";
  1450. ImgObj.parentNode.style.height = parseInt(ImgObj.style.height) + (2 * 7) + "px";
  1451. }
  1452. });
  1453. document.body.appendChild(SlideCase);
  1454. }
  1455. }
  1456. //放大缩小【不影响于旋转后放大缩小的BUG~~】(编写:郭仁)============================================================================================================================
  1457. //stackBlurImage(ImgStr, CanvasStr, percentage, false);
  1458. //滑动条创建(编写:郭仁)==========================================================================================================================================================
  1459. //通过传入[ID(为了避免多次创建同样功能滑动条);最大值;最小值;x;y;滑动块left改变后执行函数]
  1460. //使用方法
  1461. // if(document.getElementById("SlideCase_20")==null){
  1462. // var DemoSlider = SliderContorl("20",200, 50, x, y, function (percentage) {
  1463. // alert(percentage);
  1464. // });
  1465. // document.body.appendChild(DemoSlider);
  1466. // }
  1467. U.UF.IMGes.SliderContorl = function (id, max, min, left, top, callback) {
  1468. var fadeOut = null; //淡出计时器Interval
  1469. var removealertBar = null; //移除提示框计时器Timeout
  1470. var percentage = 0; //滑动所在百分比
  1471. //动态创建滑动框=====================================================================
  1472. var SlideCase = document.createElement("div");
  1473. SlideCase.id = "SlideCase_" + id; //每个滑动条都有自己的ID
  1474. SlideCase.className = "ImgViewer SlideCase";
  1475. SlideCase.style.left = left + "px";
  1476. SlideCase.style.top = top + "px";
  1477. //禁止选取
  1478. SlideCase.onmousedown = function () { return false; } //IE;
  1479. SlideCase.onselectstart = function () { return false; } //FireFox;Chorme
  1480. //滑动条--------------------------------------------------
  1481. var SlideBar = document.createElement("div");
  1482. SlideBar.id = "SlideBar"
  1483. SlideBar.className = "SlideBar";
  1484. //滑动块--------------------------------------------------
  1485. var SlidhingShoe = document.createElement("a");
  1486. SlidhingShoe.id = "SlidhingShoe";
  1487. SlidhingShoe.className = "ImgViewer SlidhingShoe";
  1488. //移除按钮------------------------------------------------
  1489. var CloseSlideButton = document.createElement("div");
  1490. CloseSlideButton.id = "Slidhing_CloseSlideButton"
  1491. CloseSlideButton.className = "Slidhing_CloseSlideButton";
  1492. CloseSlideButton.onclick = function () { SlideCase.parentNode.removeChild(SlideCase); }
  1493. //提示框--------------------------------------------------
  1494. var alertBar = document.createElement("div");
  1495. alertBar.id = "Slidhing_alertBar";
  1496. alertBar.style.display = "none";
  1497. alertBar.className = "ImgViewer Slidhing_alertBar";
  1498. //添加到各各节点-------------------------------------------
  1499. SlideBar.appendChild(SlidhingShoe);
  1500. SlideCase.appendChild(SlideBar);
  1501. SlideCase.appendChild(CloseSlideButton);
  1502. SlideCase.appendChild(alertBar);
  1503. //两个主要事件=====================================================================
  1504. //提示框淡出消失函数
  1505. var AlertFadeIn = function () {
  1506. //提示框样式重置
  1507. alertBar.style.filter = "alpha(opacity=100)";
  1508. alertBar.style.MozOpacity = "1";
  1509. alertBar.style.opacity = "1";
  1510. alertBar.style.display = "inline-block";
  1511. //再次清扫计时器防止内存溢出
  1512. clearInterval(fadeOut);
  1513. clearTimeout(removealertBar);
  1514. //特效开始
  1515. removealertBar = setTimeout(function () {
  1516. i = 100;
  1517. fadeOut = setInterval(function () {
  1518. alertBar.style.filter = "alpha(opacity=" + i + ")";
  1519. alertBar.style.MozOpacity = i * 0.01;
  1520. alertBar.style.opacity = i * 0.01;
  1521. i -= 2;
  1522. if (i == 0) {
  1523. alertBar.style.display = "none";
  1524. //清扫计时器防止内存溢出
  1525. clearInterval(fadeOut);
  1526. clearTimeout(removealertBar);
  1527. }
  1528. }, 1);
  1529. }, 800);
  1530. }
  1531. //滑动块移动或滑动条被点击后执行函数
  1532. var mouse_down_or_move = function () {
  1533. var pole = event.clientX - parseInt(SlideCase.style.left) - 25; //计算滑动块left
  1534. //限制最小left与最大left
  1535. pole = pole < 0 ? 0 : pole;
  1536. pole = pole > 120 ? 120 : pole;
  1537. SlidhingShoe.style.left = pole + "px";
  1538. //给提示框赋予left值;使提示框跟着滑动块移动
  1539. alertBar.style.left = pole - 20 + "px";
  1540. percentage = pole * ((max - min) / 120) + min; //计算滑动条现行百分比
  1541. alertBar.innerHTML = Math.round(percentage) + "%";
  1542. callback(percentage); //回调传入函数
  1543. }
  1544. //给滑动条与滑动块进行事件处理==========================================
  1545. SlideBar.onmousedown = function () {
  1546. mouse_down_or_move();
  1547. alertBar.style.display = "inline-block";
  1548. }
  1549. SlideBar.onmouseup = function () {
  1550. if (!browser.msie) {
  1551. AlertFadeIn();
  1552. } else {
  1553. clearTimeout(removealertBar);
  1554. removealertBar = setTimeout(function () {
  1555. alertBar.style.display = "none";
  1556. clearTimeout(removealertBar);
  1557. }, 800);
  1558. }
  1559. }
  1560. SlidhingShoe.onmousedown = function () {
  1561. var ismoveSlide = true;
  1562. document.body.onmousemove = function () {
  1563. if (ismoveSlide == true) {
  1564. mouse_down_or_move();
  1565. alertBar.style.display = "inline-block";
  1566. if (!browser.msie) {
  1567. alertBar.style.filter = "alpha(opacity=" + i + ")";
  1568. alertBar.style.MozOpacity = i * 0.01;
  1569. alertBar.style.opacity = i * 0.01;
  1570. }
  1571. }
  1572. }
  1573. document.body.onmouseup = function () {
  1574. if (document.all != undefined) SlidhingShoe.releaseCapture(); //鼠标事件制焦
  1575. ismoveSlide = false;
  1576. if (!browser.msie) {
  1577. AlertFadeIn();
  1578. } else {
  1579. clearTimeout(removealertBar);
  1580. removealertBar = setTimeout(function () {
  1581. alertBar.style.display = "none";
  1582. clearTimeout(removealertBar);
  1583. }, 800);
  1584. }
  1585. document.body.onmouseup = function () { return false; }
  1586. }
  1587. }
  1588. return SlideCase; //返回滑动条
  1589. }
  1590. //滑动条创建(编写:郭仁)==========================================================================================================================================================
  1591. //恢复1:1实际比例===================================================================================================================================================================
  1592. //传入图片对象,原宽,原高
  1593. U.UF.IMGes.ActuleScale = function (ImgObj, width, height) {
  1594. ImgObj.style.width = width + "px";
  1595. ImgObj.style.height = height + "px";
  1596. ImgObj.parentNode.style.width = parseInt(ImgObj.style.width) + (2 * 7) + "px";
  1597. ImgObj.parentNode.style.height = parseInt(ImgObj.style.height) + (2 * 7) + "px";
  1598. }
  1599. //创建图片框========================================================================================================================================================================
  1600. //传入图片ID(防止同时出现多个同ID导致网页出错),图片地址,JSON【KEY】(你懂的~~可为空~~)
  1601. U.UF.IMGes.CreatePhotoCase = function (imgid, url, key) {
  1602. var nwidth = 0; //原宽
  1603. var nheight = 0; //原高
  1604. // if (window.parent.document.getElementById("ImgViewer_Div" + imgid) != null) {//如果已创建此相框则返回此相框
  1605. // return window.parent.document.getElementById("ImgViewer_Div" + imgid);
  1606. // }
  1607. //var IV_Div = window.parent.document.getElementById("ImgViewer_Div");
  1608. var IV_Div = window.parent.$('#ImgViewer_Div')[0];
  1609. if (IV_Div != null) {//如果已创建过相框则只在更改图片及管理框 ——简炜杰
  1610. var img = U.selectEl("Img", IV_Div)[0];
  1611. //更换图片ID
  1612. img.id = "ImgViewer_Img" + imgid;
  1613. //图片大小处理以及重新加载管理框
  1614. var _ready = function () {
  1615. return function () {
  1616. var nImg = new Image();
  1617. nImg.src = url;
  1618. var nwidth = nImg.width;
  1619. var nheight = nImg.height;
  1620. if (nImg.width > 800 || nImg.height > 600) {
  1621. if (nImg.width > nImg.height) {
  1622. nwidth = 800;
  1623. nheight = nwidth / (nImg.width / nImg.height);
  1624. } else {
  1625. nheight = 600;
  1626. nwidth = nheight * (nImg.width / nImg.height);
  1627. }
  1628. } else if (nImg.height < 200) {
  1629. nheight = 200;
  1630. nwidth = nheight * (nImg.width / nImg.height);
  1631. } else {
  1632. nwidth = nImg.width;
  1633. nheight = nImg.height;
  1634. }
  1635. img.style.height = nheight + "px";
  1636. img.style.width = nwidth + "px";
  1637. IV_Div.style.height = nheight + 14 + "px";
  1638. IV_Div.style.width = nwidth + 14 + "px";
  1639. var strCode = '<a class="samllRadius ImgViewer ImgViewer_CloseIcon" href="javascript:void(0)" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode); if (parent.document.getElementById(\'SlideCase_' + img.id + '\')!=null){ parent.document.getElementById(\'SlideCase_' + img.id + '\').parentNode.removeChild(parent.document.getElementById(\'SlideCase_' + img.id + '\'));}"></a>';
  1640. strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollLeftIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + imgid + '\'),\'left\')" ></a>';
  1641. strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollRightIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + imgid + '\'),\'right\')"></a>';
  1642. strCode += '<a class="samllRadius ImgViewer ImgViewer_ScaleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.Scale(document.getElementById(\'ImgViewer_Img' + imgid + '\'),' + nwidth + ',' + nheight + ')"></a>';
  1643. strCode += '<a class="samllRadius ImgViewer ImgViewer_ActuleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.ActuleScale(document.getElementById(\'ImgViewer_Img' + imgid + '\'),' + nwidth + ',' + nheight + ')"></a>';
  1644. strCode += '<a class="samllRadius ImgViewer ImgViewer_ThumbnailsIcon" href="javascript:void(0)" onclick="if(USPhotoImgJson!=null) document.getElementById(\'ImgViewer_ThumbnailsCase\').style.display=\'inline-block\';"></a>';
  1645. U.selectEl('#ImgViewer_manager')[0].innerHTML = strCode;
  1646. U.UF.IMGes.ActuleScale(img, nwidth, nheight);
  1647. }
  1648. }
  1649. _ready = _ready();
  1650. //加载图片
  1651. U.UF.IMGes.ImgReady(url, _ready, function () { img.src = url; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
  1652. return;
  1653. }
  1654. //创建相框==============================================================
  1655. var ImgDiv = document.createElement("div");
  1656. //ImgDiv.id = "ImgViewer_Div" + imgid;
  1657. //相框只生成一次,ID改为唯一 ——简炜杰
  1658. ImgDiv.id = "ImgViewer_Div";
  1659. ImgDiv.className = "ImgViewer_Div ImgViewer_shadow";
  1660. //禁止选取
  1661. ImgDiv.onmousedown = function () { return false; } //IE;
  1662. ImgDiv.onselectstart = function () { return false; } //FireFox;Chorme
  1663. //创建管理框============================================================
  1664. var managerBar = document.createElement("div");
  1665. managerBar.id = "ImgViewer_managerBar";
  1666. managerBar.className = "ImgViewer ImgViewer_managerBar";
  1667. //创建管理对齐DIV=======================================================
  1668. var manager = document.createElement("div");
  1669. manager.id = "ImgViewer_manager";
  1670. manager.className = "ImgViewer_manager";
  1671. //创建图片元素==========================================================
  1672. var USPhotoImg = document.createElement("img");
  1673. USPhotoImg.id = "ImgViewer_Img" + imgid;
  1674. USPhotoImg.className = "ImgViewer_Img";
  1675. USPhotoImg.alt = "0";
  1676. USPhotoImg.src = "img/loading.png";
  1677. USPhotoImg.onmousedown = function () { U.UF.F.DragMouseDown(ImgDiv, "ImgViewer"); }
  1678. if (key != null && key != "") {//如果KEY值为空则不显示上一张与下一张
  1679. //创建对齐框==========================================================
  1680. var gobackdiv = document.createElement("div");
  1681. gobackdiv.id = "ImgViewer_gobackdiv";
  1682. gobackdiv.className = "ImgViewer_gobackdiv";
  1683. //创建上一张按钮======================================================
  1684. var go = document.createElement("i");
  1685. go.id = "ImgViewer_go";
  1686. go.className = "ImgViewer ImgViewer_go";
  1687. go.onclick = function () {
  1688. goorback("g");
  1689. }
  1690. go.onmouseover = function () {
  1691. gobackdiv.style.display = "inline-block";
  1692. }
  1693. go.onmouseout = function () {
  1694. gobackdiv.style.display = "none";
  1695. }
  1696. //创建下一张按钮======================================================
  1697. var back = document.createElement("i");
  1698. back.id = "ImgViewer_back";
  1699. back.className = "ImgViewer ImgViewer_back";
  1700. back.onclick = function () {
  1701. goorback("b");
  1702. }
  1703. back.onmouseover = function () {
  1704. gobackdiv.style.display = "inline-block";
  1705. }
  1706. back.onmouseout = function () {
  1707. gobackdiv.style.display = "none";
  1708. }
  1709. USPhotoImg.onmouseover = function () {
  1710. gobackdiv.style.display = "inline-block";
  1711. }
  1712. USPhotoImg.onmouseout = function () {
  1713. gobackdiv.style.display = "none";
  1714. }
  1715. gobackdiv.appendChild(go);
  1716. gobackdiv.appendChild(back);
  1717. ImgDiv.appendChild(gobackdiv);
  1718. var goorback = function (gb) {
  1719. //如果滑动条存在为以防出错而将原图滑动条隐藏
  1720. if (document.getElementById("SlideCase_" + USPhotoImg.id) != null) document.getElementById("SlideCase_" + USPhotoImg.id).parentNode.removeChild(document.getElementById("SlideCase_" + USPhotoImg.id));
  1721. U.UF.IMGes.imgRoll(USPhotoImg, "int", 0); //恢复旋转角度
  1722. if (gb == "g") {
  1723. key--;
  1724. } else if (gb == "b") {
  1725. key++;
  1726. }
  1727. key = key < 0 ? USPhotoImgJson.length - 1 : key;
  1728. key = key > USPhotoImgJson.length - 1 ? 0 : key;
  1729. var Img = USPhotoImgJson[key]; //选择JSON
  1730. //更换ID
  1731. //相框只生成一次,ID改为唯一,无需更换 ——简炜杰
  1732. //ImgDiv.id = "ImgViewer_Div" + Img.imgid;
  1733. USPhotoImg.id = "ImgViewer_Img" + Img.imgid;
  1734. //执行图片预加载~~
  1735. var _e = function () {
  1736. return function () {
  1737. var nwidth = this.width;
  1738. var nheight = this.height;
  1739. if (this.width > 800 || this.height > 600) {
  1740. if (this.width > this.height) {
  1741. nwidth = 800;
  1742. nheight = nwidth / (this.width / this.height);
  1743. } else {
  1744. nheight = 600;
  1745. nwidth = nheight * (this.width / this.height);
  1746. }
  1747. } else if (this.height < 200) {
  1748. nheight = 200;
  1749. nwidth = nheight * (this.width / this.height);
  1750. } else {
  1751. nwidth = this.width;
  1752. nheight = this.height;
  1753. }
  1754. ImageReady(Img.imgid, nwidth, nheight);
  1755. gobackdiv.style.bottom = (nheight + (2 * 7)) / 2 - 15 + "px";
  1756. }
  1757. }
  1758. _e = _e();
  1759. U.UF.IMGes.ImgReady(Img.imgurl, _e, function () { USPhotoImg.src = this.src; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
  1760. }
  1761. }
  1762. managerBar.appendChild(manager);
  1763. ImgDiv.appendChild(USPhotoImg);
  1764. ImgDiv.appendChild(managerBar);
  1765. //图片加载成功后执行事件
  1766. var ImageReady = function (Imgid, width, height) {
  1767. var strCode = '<a class="samllRadius ImgViewer ImgViewer_CloseIcon" href="javascript:void(0)" onclick="this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode); if (parent.document.getElementById(\'SlideCase_' + USPhotoImg.id + '\')!=null){ parent.document.getElementById(\'SlideCase_' + USPhotoImg.id + '\').parentNode.removeChild(parent.document.getElementById(\'SlideCase_' + USPhotoImg.id + '\'));}"></a>';
  1768. strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollLeftIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),\'left\')" ></a>';
  1769. strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollRightIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),\'right\')"></a>';
  1770. strCode += '<a class="samllRadius ImgViewer ImgViewer_ScaleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.Scale(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),' + width + ',' + height + ')"></a>';
  1771. strCode += '<a class="samllRadius ImgViewer ImgViewer_ActuleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.ActuleScale(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),' + width + ',' + height + ')"></a>';
  1772. strCode += '<a class="samllRadius ImgViewer ImgViewer_ThumbnailsIcon" href="javascript:void(0)" onclick="if(USPhotoImgJson!=null) document.getElementById(\'ImgViewer_ThumbnailsCase\').style.display=\'inline-block\';"></a>';
  1773. manager.innerHTML = strCode;
  1774. U.UF.IMGes.ActuleScale(USPhotoImg, width, height);
  1775. }
  1776. var _e = function () {
  1777. return function () {
  1778. var nwidth = this.width;
  1779. var nheight = this.height;
  1780. if (this.width > 800 || this.height > 600) {
  1781. if (this.width > this.height) {
  1782. nwidth = 800;
  1783. nheight = nwidth / (this.width / this.height);
  1784. } else {
  1785. nheight = 600;
  1786. nwidth = nheight * (this.width / this.height);
  1787. }
  1788. } else if (this.height < 200) {
  1789. nheight = 200;
  1790. nwidth = nheight * (this.width / this.height);
  1791. } else {
  1792. nwidth = this.width;
  1793. nheight = this.height;
  1794. }
  1795. ImageReady(imgid, nwidth, nheight);
  1796. if (key != null & key != "") gobackdiv.style.bottom = (nheight + (2 * 7)) / 2 - 15 + "px";
  1797. }
  1798. }
  1799. _e = _e();
  1800. U.UF.IMGes.ImgReady(url, _e, function () { USPhotoImg.src = this.src; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
  1801. document.body.appendChild(ImgDiv);
  1802. }
  1803. U.UF.IMGes.ThumbnailsCase = function (ImgJson) {
  1804. var fadeOut = null; //淡出计时器Interval
  1805. var removealertBar = null; //移除提示框计时器Timeout
  1806. var ThumbnailsArray = document.getElementById("ImgViewer_ThumbnailsArray");
  1807. var ThumbnailsSlideShoe = document.getElementById("ImgViewer_ThumbnailsSlideShoe");
  1808. var ThumbnailsSlideBar = document.getElementById("ImgViewer_ThumbnailsSlideBar");
  1809. var ThumbnailsAlertBar = document.getElementById("ImgViewer_ThumbnailsAlertBar");
  1810. var strCode = "";
  1811. var Json = eval('(' + ImgJson + ')');
  1812. USPhotoImgJson = Json;
  1813. for (var i in Json) {
  1814. var Img = Json[i]
  1815. strCode += '<img onclick="U.UF.IMGes.CreatePhotoCase(\'' + Img.imgid + '\',\'' + Img.imgurl + '\',\'' + i + '\')" class="ImgViewer_ThumbnailsImg" src="' + Img.imgThumbnails + '"/>';
  1816. }
  1817. ThumbnailsArray.innerHTML = strCode;
  1818. ThumbnailsArray.style.width = (Json.length / 2) * 68 + "px";
  1819. ThumbnailsArray.parentNode.parentNode.style.display = "inline-block";
  1820. var mousemoveOrdown = function () {
  1821. pole = event.clientX - parseInt(ThumbnailsSlideShoe.parentNode.parentNode.getBoundingClientRect().left) - 35;
  1822. pole = pole < 0 ? 0 : pole;
  1823. pole = pole > 235 ? 235 : pole;
  1824. ThumbnailsSlideShoe.style.left = pole + "px";
  1825. ThumbnailsAlertBar.style.left = pole - 10 + "px";
  1826. var ThumbnailsArrayleft = Math.ceil(pole) * ((parseInt(ThumbnailsArray.style.width) - 278) / 235);
  1827. if (ThumbnailsArrayleft > 0) {
  1828. ThumbnailsAlertBar.innerHTML = Math.round(ThumbnailsArrayleft) + 35 + "%";
  1829. ThumbnailsArray.style.marginLeft = "-" + ThumbnailsArrayleft + "px";
  1830. } else {
  1831. ThumbnailsAlertBar.innerHTML = "小于范围值~~";
  1832. ThumbnailsArray.style.marginLeft = "0px";
  1833. }
  1834. }
  1835. var AlertFadeIn = function () {
  1836. //提示框样式重置
  1837. ThumbnailsAlertBar.style.filter = "alpha(opacity=100)";
  1838. ThumbnailsAlertBar.style.MozOpacity = "1";
  1839. ThumbnailsAlertBar.style.opacity = "1";
  1840. ThumbnailsAlertBar.style.display = "inline-block";
  1841. //再次清扫计时器防止内存溢出
  1842. clearInterval(fadeOut);
  1843. clearTimeout(removealertBar);
  1844. //特效开始
  1845. removealertBar = setTimeout(function () {
  1846. i = 100;
  1847. fadeOut = setInterval(function () {
  1848. ThumbnailsAlertBar.style.filter = "alpha(opacity=" + i + ")";
  1849. ThumbnailsAlertBar.style.MozOpacity = i * 0.01;
  1850. ThumbnailsAlertBar.style.opacity = i * 0.01;
  1851. i -= 2;
  1852. if (i == 0) {
  1853. ThumbnailsAlertBar.style.display = "none";
  1854. //清扫计时器防止内存溢出
  1855. clearInterval(fadeOut);
  1856. clearTimeout(removealertBar);
  1857. }
  1858. }, 1);
  1859. }, 800);
  1860. }
  1861. //事件控制
  1862. ThumbnailsSlideBar.onmousedown = function () {
  1863. mousemoveOrdown();
  1864. ThumbnailsAlertBar.style.display = "inline-block";
  1865. }
  1866. ThumbnailsSlideBar.onmouseup = function () {
  1867. if (!browser.msie) {
  1868. AlertFadeIn();
  1869. } else {
  1870. clearTimeout(removealertBar);
  1871. removealertBar = setTimeout(function () {
  1872. ThumbnailsAlertBar.style.display = "none";
  1873. clearTimeout(removealertBar);
  1874. }, 800);
  1875. }
  1876. }
  1877. ThumbnailsSlideShoe.onmousedown = function () {
  1878. var ismoveSlide = true;
  1879. document.body.onmousemove = function () {
  1880. if (ismoveSlide == true) {
  1881. mousemoveOrdown();
  1882. ThumbnailsAlertBar.style.display = "inline-block";
  1883. if (!browser.msie) {
  1884. ThumbnailsAlertBar.style.filter = "alpha(opacity=" + i + ")";
  1885. ThumbnailsAlertBar.style.MozOpacity = i * 0.01;
  1886. ThumbnailsAlertBar.style.opacity = i * 0.01;
  1887. }
  1888. }
  1889. }
  1890. document.body.onmouseup = function () {
  1891. if (document.all != undefined) ThumbnailsSlideShoe.releaseCapture();
  1892. ismoveSlide = false;
  1893. if (!browser.msie) {
  1894. AlertFadeIn();
  1895. } else {
  1896. clearTimeout(removealertBar);
  1897. removealertBar = setTimeout(function () {
  1898. ThumbnailsAlertBar.style.display = "none";
  1899. clearTimeout(removealertBar);
  1900. }, 800);
  1901. }
  1902. document.body.onmouseup = function () { return false; }
  1903. }
  1904. }
  1905. }
  1906. //设置换行
  1907. U.UF.C.SEKP = function (IF, CB, TF) {
  1908. IF.onkeypress = function () { if (event.keyCode == 10 || event.keyCode == 13) { if (TF) { U.UF.EV.stopDefault(); } if (CB) { CB(); } } }
  1909. }
  1910. //由于需要大Div,小Div的loading,而现有的Loading函数有些复杂。需要逻辑再清晰,所以先独立,最后合并到一个loading中。
  1911. //加载Gif动画效果,小加载,区别于博客,论坛的大加载。
  1912. //此处需要异步装载,先装载文章(需要有加载动画),文章加载完毕再异步加载评论(需要有加载动画),否则会很慢。
  1913. //参数load为true,则为显示图片,参数load为false,则为卸载。因为每个项目都要用所以放在了主项目中。
  1914. U.UF.DL.SMGif = function (_div, _load) {
  1915. if (_load == false) _div.removeChild(U.UF.C.GetCById(_div, "U_SMLD"));
  1916. else $$("img", { "id": "U_SMLD", "className": "U_SMLDGif", "src": "http://www.1473.cn/img/us_smlding.gif" }, _div); //追加loading
  1917. }
  1918. //U.OU.TF = { "TF": "Excel" }
  1919. //U.OU.DivisionExcelWord = function (Judge) { U.OU.JudgeEW = Judge; } //判断是Excel还是Wrod
  1920. ////----------------------------------------------菜单功能----------------------------------------------------------//
  1921. ////文件下拉菜单功能
  1922. //U.OU.OpenFileMenu = function () {
  1923. // U.UF.EV.stopBubble(); //阻止冒泡
  1924. // var FileMenu = document.getElementById("U_E_OC");
  1925. // FileMenu.style.display = FileMenu.style.display == "none" ? "block" : "none";
  1926. //}
  1927. ////切换菜单选项
  1928. //U.OU.SwitchOption = function (Option, Judge) {
  1929. // var OptionList = document.getElementById("U_E_MenuBar").getElementsByTagName("li");
  1930. // for (var i = 1; i < OptionList.length; i++) { OptionList[i].className = ""; }
  1931. // Option.className = "U_E_MenuButton";
  1932. // document.getElementById(Judge).style.display = "block";
  1933. // document.getElementById(Judge == "U_E_Tool" ? "U_OU_Nav" : "U_E_Tool").style.display = "none";
  1934. //}
  1935. ////-----------------------------------------------工具-----------------------------------------------------------//
  1936. ////显示或隐藏颜色框
  1937. //U.OU.DisplayColorFrame = function (FrameID) {
  1938. // var ColorFrame = document.getElementById(FrameID);
  1939. // ColorFrame.style.display = ColorFrame.style.display == "none" ? "block" : "none";
  1940. // var OtherID = FrameID == "U_E_TColorFrame" ? "U_E_BColorFrame" : "U_E_TColorFrame"; //隐藏另一个颜色框
  1941. // document.getElementById(OtherID).style.display = "none";
  1942. //}
  1943. ////点击颜色Li
  1944. //U.OU.ColorLiOnClick = function (Li) {
  1945. // var Color = Li.style.backgroundColor; var Father = Li.parentNode;
  1946. // var BorderID = Father.id == "U_E_BColorFrame" ? "U_E_BColorBorder" : "U_E_TColorBorder";
  1947. // var StyleName = Father.id == "U_E_BColorFrame" ? "BackColor" : "ForeColor";
  1948. // document.getElementById(BorderID).style.backgroundColor = Color;
  1949. // U.OU.ChangeStyle(StyleName, Color);
  1950. // Father.style.display = "none"; //隐藏颜色框
  1951. //}
  1952. ////-----------------------------------------------插入-----------------------------------------------------------//
  1953. //U.OU.InsertNowTime = function () {
  1954. // var NowTime = US.Admin.TimeNow["年", "月", "日"];
  1955. // if (U.OU.JudgeEW == "Word" || U.MD.O.E.KeepEditblur()) { U.UF.E.GetSelectionRange(window, $$("span")).Replace(NowTime); }
  1956. // else {
  1957. // var Compare = U.MD.O.E.ComparePickOn(); var Small = Compare[0]; var Big = Compare[1];
  1958. // for (var i = Small[0]; i <= Big[0]; i++) {
  1959. // for (var j = Small[1]; j <= Big[1]; j++) { U.MD.O.E.Cell[i][j].innerHTML = NowTime; }
  1960. // }
  1961. // }
  1962. //}
  1963. ////-----------------------------------------------文本编辑器-----------------------------------------------------------//
  1964. //U.OU.ChangeStyle = function (SN, V, TF) {
  1965. // if (U.OU.TF["TF"] == "Excel") {
  1966. // var _UDFD = U.selectEl("#U_E_EditFrame")[0], _UDED = U.selectEl("div", _UDFD)[0];
  1967. // if (_UDFD.ondblclick == null) { U.UF.E.FontSizeType(_UDED, SN, [V, V]); } //修改文字样式
  1968. // else {
  1969. // U.UF.E.GetSelectionRange(window, U.MD.O.E.SY["SEO"][0]).SetYPS(SN, V);
  1970. // U.MD.O.E.SY["CE"]["Cell"][U.MD.O.E.SY["SEO"][1]].style[SN] = V;
  1971. // }
  1972. // }
  1973. //}
  1974. //////改变单元格或选中文本的样式(Style)
  1975. ////U.OU.ChangeStyle = function (StyleName, Param) {
  1976. //// var EJudge = U.OU.JudgeEW == "Word" || (U.MD.O.E.KeepEditblur() && StyleName != "BackColor" && StyleName != "JustifyLeft" && StyleName != "JustifyCenter" && StyleName != "JustifyRight");
  1977. //// if (EJudge) {//判断是否处于编辑状态中,或者是否是Word
  1978. //// if (Param == null) { document.execCommand(StyleName) }
  1979. //// else { document.execCommand(StyleName, false, Param); }
  1980. //// }
  1981. //// else {
  1982. //// // var StyleList = { "Bold": "fontWeight", "Italic": "fontStyle", "Underline": "textDecoration", "StrikeThrough": "textDecoration", "": "backgroundColor", "": "", "": "", "": "", "": "", "": "", "": "", "": "", "": "", "": "" };
  1983. //// switch (StyleName) {
  1984. //// case "Bold": StyleName = "fontWeight"; Param = ['bold', 'normal']; break;
  1985. //// case "Italic": StyleName = "fontStyle"; Param = ['italic', 'normal']; break;
  1986. //// case "Underline": StyleName = "textDecoration"; Param = ['underline', 'none']; break;
  1987. //// case "StrikeThrough": StyleName = "textDecoration"; Param = ['line-through', 'none']; break;
  1988. //// case "BackColor": StyleName = "backgroundColor"; break;
  1989. //// case "ForeColor": StyleName = "color"; break;
  1990. //// case "JustifyLeft": StyleName = "textAlign"; Param = "left"; break;
  1991. //// case "JustifyCenter": StyleName = "textAlign"; Param = "center"; break;
  1992. //// case "JustifyRight": StyleName = "textAlign"; Param = "right"; break;
  1993. //// case "FontSize": StyleName = "fontSize"; Param = Param + "px"; break;
  1994. //// case "FontName": StyleName = "fontFamily"; break;
  1995. //// }
  1996. //// var TempParam = Param.concat();
  1997. //// var Compare = U.MD.O.E.ComparePickOn(); var Small = Compare[0]; var Big = Compare[1]; var Cell;
  1998. //// for (var i = Small[0]; i <= Big[0]; i++) {
  1999. //// for (var j = Small[1]; j <= Big[1]; j++) {
  2000. //// Cell = U.MD.O.E.Cell[i][j];
  2001. //// if (StyleName == "textDecoration") {//让删除线和下划线共存
  2002. //// var Decoration = Param[0] == "underline" ? "line-through" : "underline";
  2003. //// if (Cell.style[StyleName].indexOf(Decoration) > -1) { Param[0] = "underline line-through"; Param[1] = Decoration; }
  2004. //// }
  2005. //// if ((typeof (Param) == "string")) { Cell.style[StyleName] = Param; }
  2006. //// else { Cell.style[StyleName] = Cell.style[StyleName] == Param[0] ? Param[1] : Param[0]; }
  2007. //// if (StyleName == "textDecoration") { Param = TempParam.concat(); }
  2008. //// }
  2009. //// }
  2010. //// }
  2011. //// if (U.OU.JudgeEW == "Excel") { U.MD.O.E.EditTextEdit("Cell"); }
  2012. ////}
  2013. ////获取选中文本在整篇文章内的位置
  2014. //U.OU.SelectedLocation = function () {
  2015. // //Chorme
  2016. // // var range = window.getSelection().getRangeAt(0);
  2017. // // var startRangeOffset = range.startOffset;
  2018. // // range.collapse(true);
  2019. // // range.setStart(range.startContainer, startRangeOffset - 1);
  2020. // // range.setEnd(range.startContainer, startRangeOffset - 1 + plenght);
  2021. // //IE
  2022. // // var EditFrame = document.getElementById("U_E_EditFrame");
  2023. // // var EditContent = EditFrame.getElementsByTagName("div")[0];
  2024. // var EditContent = document.getElementById("U_W_WordEdit");
  2025. // var range = document.selection.createRange();
  2026. // var stored_range = range.duplicate();
  2027. // stored_range.moveToElementText(EditContent);
  2028. // stored_range.setEndPoint('EndToEnd', range);
  2029. // EditContent.selectionStart = stored_range.text.length - range.text.length;
  2030. // EditContent.selectionEnd = EditContent.selectionStart + range.text.length;
  2031. // //U.MD.O.E.setSelectText(EditContent, EditContent.selectionStart, EditContent.selectionEnd);
  2032. //}
  2033. ////将InnerHTML拆分成数组
  2034. //U.OU.SpiltInnerHTML = function (InnerHTML) {
  2035. // var InnerFrame = $$("span", { "innerHTML": InnerHTML });
  2036. // InnerHTML = InnerFrame.innerHTML;
  2037. // var ElementList = U.UF.EL.getChildrenNoText(InnerFrame.childNodes); var SubStr = "";
  2038. // var NewArray = []; var Local; var ElementInner;
  2039. // for (var i = 0; i < ElementList.length; i++) {
  2040. // ElementInner = U.OU.OuterHTML(ElementList[i]);
  2041. // Local = InnerHTML.toLowerCase().indexOf(ElementInner.toLowerCase());
  2042. // SubStr = InnerHTML.substring(0, Local);
  2043. // if (SubStr.replace(/(^\s*)|(\s*$)/g, "") != "") { NewArray.push(SubStr); } //如果为空就不加入到数组中
  2044. // NewArray.push(ElementList[i]);
  2045. // InnerHTML = InnerHTML.substring(Local + ElementInner.length, InnerHTML.length);
  2046. // }
  2047. // if (InnerHTML.replace(/(^\s*)|(\s*$)/g, "") != "") { NewArray.push(InnerHTML); }
  2048. // return NewArray;
  2049. //}
  2050. //U.OU.OuterHTML = function (Element) {
  2051. // var HTMLFrame = $$("span", {}); HTMLFrame.appendChild(Element);
  2052. // return HTMLFrame.innerHTML;
  2053. //}
  2054. ////文本编辑器(兼容IE,Chroem)Firefox未测试
  2055. //U.OU.Editplus = function (StyleName, Param) {
  2056. // var BrowserJudge = !(document.selection); //判断是哪个浏览器
  2057. // var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
  2058. // var TextFather = BrowserJudge ? range.commonAncestorContainer.parentNode : range.parentElement(); //获取文本的父窗口
  2059. // var InnerHTML = BrowserJudge ? document.createElement('span') : range.htmlText; //返回选中的InnerHTML
  2060. // if (BrowserJudge) { SpanFrame.appendChild(range.cloneContents()).innerHTML; }
  2061. // var ElementList = U.OU.SpiltInnerHTML(InnerHTML); //将InnerHTML分割成数组(根据标签进行分割)
  2062. // var NewStyle = TextFather.style[StyleName] == Param[0] ? Param[1] : Param[0]; var NextSpan;
  2063. // if (ElementList[0].nodeName) {//如果开头是标签就取标签相反的,如果是文本就取第一种样式
  2064. // for (var i = 0; i < ElementList.length; i++) {
  2065. // NewStyle = ElementList[i].style[StyleName]; NextSpan = ElementList[i + 1];
  2066. // if (NextSpan == null || NextSpan.nodeName == null || NextSpan.style[StyleName] == NewStyle) { NewStyle = NewStyle == Param[0] ? Param[1] : Param[0]; break; }
  2067. // }
  2068. // }
  2069. // var HTMLFrameB = $$("span", {}); var HTMLFrameS = $$("span", {}, HTMLFrameB);
  2070. // var str = ChildList = ""; HTMLFrameS.style[StyleName] = NewStyle; var ElementName = "";
  2071. // for (var i = 0; i < ElementList.length; i++) {
  2072. // ElementName = ElementList[i].nodeName;
  2073. // if (ElementName) {
  2074. // if (ElementList[i].innerHTML == "" && ElementName == "SPAN") { continue; }
  2075. // ChildList = ElementList[i].getElementsByTagName("*");
  2076. // for (var j = 0; j < ChildList.length; j++) { if (ChildList[j].nodeName != "BR") { ChildList[j].style[StyleName] = NewStyle; } }
  2077. // if (ElementName != "BR") {
  2078. // if (ElementName == "P" && (i == 0 || i == ElementList.length - 1)) {
  2079. // // if (i == ElementList.length - 1) { str += "<p>"; }
  2080. // HTMLFrameS.innerHTML = ElementList[i].innerHTML;
  2081. // str += HTMLFrameB.innerHTML;
  2082. // if (i == 0) { str += "<br />"; }
  2083. // continue;
  2084. // }
  2085. // ElementList[i].style[StyleName] = NewStyle;
  2086. // }
  2087. // str += U.OU.OuterHTML(ElementList[i]);
  2088. // }
  2089. // else { HTMLFrameS.innerHTML = ElementList[i]; str += HTMLFrameB.innerHTML; }
  2090. // }
  2091. // if (BrowserJudge) { var NewFrame = $$("span", { "innerHTML": str }); range.deleteContents(); range.insertNode(HTMLFrameS); }
  2092. // else { range.pasteHTML(str); }
  2093. //}
  2094. ////文本编辑器(兼容IE,Chroem)Firefox未测试
  2095. ////U.OU.Editplus = function (StyleName, Param) {
  2096. //// var BrowserJudge = !(document.selection); //判断是哪个浏览器
  2097. //// var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
  2098. //// var TextFather = BrowserJudge ? range.commonAncestorContainer.parentNode : range.parentElement(); //获取文本的父窗口
  2099. //// var SpanFrame = BrowserJudge ? document.createElement('span') : $$("span", { "innerHTML": range.htmlText }); //返回innerHTML为选中内容的span
  2100. //// if (BrowserJudge) { SpanFrame.appendChild(range.cloneContents()); } var SpanList = SpanFrame.getElementsByTagName("*");
  2101. //// var NewStyle = Param[0]; var NextSpan;
  2102. //// //如果开头是标签就取标签相反的,如果是文本就取第一种样式
  2103. //// if (!(SpanFrame.firstChild.nodeValue)) {
  2104. //// for (var i = 0; i < SpanList.length; i++) {
  2105. //// NewStyle = SpanList[i].style[StyleName]; NextSpan = SpanList[i + 1];
  2106. //// if (NextSpan == null || NextSpan.style[StyleName] == NewStyle) { NewStyle = NewStyle == Param[0] ? Param[1] : Param[0]; break; }
  2107. //// }
  2108. //// }
  2109. //// else { NewStyle = TextFather.style[StyleName] == Param[0] ? Param[1] : Param[0]; }
  2110. //// for (var i = 0; i < SpanList.length; i++) { SpanList[i].style[StyleName] = NewStyle }; //让内部所有标签都为该css
  2111. //// SpanFrame.style[StyleName] = NewStyle;
  2112. //// if (BrowserJudge) { range.deleteContents(); range.insertNode(SpanFrame); return; }
  2113. //// if (TextFather.contentEditable == "true" || U.OU.DivisionEW == "Word") { range.pasteHTML(SpanFrame.outerHTML); }
  2114. //// else {
  2115. //// TextFather.style[StyleName] = NewStyle; SpanList = TextFather.getElementsByTagName("*");
  2116. //// for (var i = 0; i < SpanList.length; i++) { SpanList[i].style[StyleName] = NewStyle };
  2117. //// }
  2118. ////}
  2119. ////让回车生成的<p></p>变成<br />
  2120. //U.OU.EditOnkey = function () {
  2121. // var BrowserJudge = !(document.selection); //判断是哪个浏览器
  2122. // var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
  2123. // if (event.keyCode == 13 || event.keyCode == 108) {
  2124. // U.UF.EV.stopDefault(); //阻止系统事件
  2125. // var dd = document.createElement("br");
  2126. // if (BrowserJudge) { range.deleteContents(); range.insertNode(dd); }
  2127. // else { range.pasteHTML("<br />"); }
  2128. // }
  2129. // U.UF.EV.stopBubble(); //阻止冒泡
  2130. //}
  2131. // freeze: Object.freeze || function (UDE) { //冻结对象
  2132. // if (Object.defineProperty) {
  2133. // if (!U.UF.Ut.isForObj(UDE)) { throw new Error("Object.defineProperties requires more than 0 arguments"); } //error
  2134. // else {
  2135. // var i, _UCE = Object.create(null);
  2136. // for (i in UDE) {
  2137. // if (UDE.hasOwnProperty(i)) {
  2138. // if (U.UF.C.isObject(UDE[i])) { Object.freeze(UDE[i]); }
  2139. // else { Object.defineProperty(_UCE, i, { value: UDE[i], configurable: false, writable: false }); }
  2140. // }
  2141. // }
  2142. // return UDE;
  2143. // }
  2144. // }
  2145. // else { throw new Error("Browser version is too low"); }
  2146. // },
  2147. // isFrozen: Object.isFrozen || function (UDE) {//判断元素是否冻结 configurable and writable is false
  2148. // if (Object.getOwnPropertyDescriptor) {
  2149. // if (U.UF.Ut.isForObj(UDE)) {
  2150. // for (var i in UDE) {
  2151. // if (U.UF.C.isObject(UDE[i])) { if (!Object.isFrozen(UDE[i])) { return false; } }
  2152. // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (!_UCE.configurable && !_UCE.writable) { return false; } } //不可读写的为密封
  2153. // }
  2154. // return true;
  2155. // }
  2156. // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
  2157. // }
  2158. // else { throw new Error("Browser version is too low"); }
  2159. // },
  2160. // preventExtensions: Object.preventExtensions || function () { //设置属性不可扩展
  2161. // if (Object.defineProperty) {
  2162. // if (U.UF.Ut.isForObj(UDE)) {
  2163. // for (var i in UDE) {
  2164. // if (U.UF.C.isObject(UDE[i])) { Object.preventExtensions(UDE[i]); }
  2165. // else { Object.defineProperty(UDE, i, { value: UDE[i], configurable: false }); }
  2166. // }
  2167. // return UDE;
  2168. // }
  2169. // else { throw new Error(UDE + " is not an object"); }
  2170. // }
  2171. // else { throw new Error("Browser version is too low"); }
  2172. // },
  2173. // isExtensible: Object.isExtensible || function () {//是否可扩展
  2174. // if (Object.getOwnPropertyDescriptor) {
  2175. // if (U.UF.Ut.isForObj(UDE)) {
  2176. // var i, _UCE;
  2177. // for (i in UDE) {
  2178. // if (U.UF.C.isObject(UDE[i])) { if (Object.isExtensible(UDE[i])) { return true; } } //不可扩展
  2179. // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (_UCE.configurable) { return true; } } //判断是否可扩展
  2180. // }
  2181. // return false;
  2182. // }
  2183. // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
  2184. // }
  2185. // else { throw new Error("Browser version is too low"); }
  2186. // },
  2187. // seal: Object.seal || function (UDE) {//密封对象
  2188. // return Object.preventExtensions(UDE);
  2189. // },
  2190. // isSealed: Object.isSealed || function () { //判断对象是否密封对象
  2191. // if (Object.getOwnPropertyDescriptor) {
  2192. // if (U.UF.Ut.isForObj(UDE)) {
  2193. // var i, _UCE;
  2194. // for (i in UDE) {
  2195. // if (U.UF.C.isObject(UDE[i])) { if (!Object.isSealed(UDE[i])) { return false; } }
  2196. // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (_UCE.configurable && _UCE.writable) { return false; } } //可读可写不为密封对象
  2197. // }
  2198. // return true;
  2199. // }
  2200. // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
  2201. // }
  2202. // else { throw new Error("Browser version is too low"); }
  2203. // },
  2204. // var i, _UL, _UEL, _UPB, _UKE, _UBT, _UDE = US.forum.news[0], _UDOD = U.selectEl("#UD_SYSXZLRSR")[0], _UDTD = U.selectEl("#UD_SYSXZLRSRO")[0], _UDPD = _UDTD.parentNode, _UDSD = U.selectEl("span", _UDPD), _UDXD = U.selectEl("#UD_SYXTXO")[0], _UDZD = U.selectEl(_UDXD.parentNode), _UDCD = _UDZD.Child();
  2205. // if ((_UEL = _UDE.length)) {
  2206. // U.MD.D.Blog.N.PNWB(_UDE); _UBT = U.Json.select(_UDE,{ "NF": null }); _UPB = U.Json.select(_UDE,{ "NF": US.FORUMROOTID }); _UKE = U.Json.select(_UDE,{ "NF": US.EMPTYGUID }); //获取PB和Blog的值
  2207. // if (_UEL = _UBT.length) { U.MD.D.Blog.N.PNSXX(_UBT.slice(0, 3), _UDOD); (_UEL > 3) && (_UDPD.style.display = "block", U.MD.D.Blog.N.PNXXX(_UDTD, _UBT.slice(3, 10)), _UDSD[_UDSD.length - 2].innerText = _UEL); U.selectEl("div", _UDPD)[0].onclick = function(){U.UF.EV.stopBubble], [U.MD.D.Blog.N.SNXX(null, _UBT, _UDTD)}; } else { i = 0; _UL = 2; }; //blog值查看
  2208. // if (_UPB.length || _UKE.length) { U.MD.D.Blog.N.BNXX(_UPB, _UDXD); U.MD.D.Blog.N.SQBNXX(_UKE, _UDXD); _UDCD[2].innerHTML = "有" + (_UEL = (_UDE.length - _UBT.length)) + "条新讨论消息"; _UDZD.addAttrArray({ "style": { "display": "block", "top": -(_UEL > 2 ? 70 : 0) + "px"} })[0]; _UDCD[0].onclick = function(){U.UF.EV.stopBubble], [U.MD.D.Blog.N.SNXX(null, _UPB, _UDXD)}; } else { i = i == null ? 2 : i; _UL = 3; } //pb值查看
  2209. // }
  2210. // else { i = 0; _UL = 3; }; i = i || 0; _UL = (_UL == null ? 0 : _UL || 3); _UDE = [_UDTD, _UDOD, _UDXD]; for (; i < _UL; i++) { _UDE[i].innerText = ""; (i - 1 > 0) && ($(_UDE[i]).parentElement(i - 1).css("display", "none")); }
  2211. //搜索云好友赋事件
  2212. //U.MD.D.H.SSHY = function () {
  2213. // var i, UDOD, _UDE = ["UD_SYSSZSJ"];
  2214. // for (i = 0; i < _UDE.length; i++) { (UDOD = U.selectEl("#" + _UDE[i])[0]).onscroll = U.UF.EV.scrollLoad({ "AF": U.UF.C.apply(null, [[U.MD.F.S.GDJZ, [$("input", UDOD.parentNode)[0]])]] }).SCH(); }
  2215. //}
  2216. /*
  2217. U.MD.O.OLWord = function (UIF, UDE, UDOD, UDFD, USID) {
  2218. var _UTH;
  2219. var _UW = UDFD.contentWindow; //获取window操作层
  2220. var _UDPD = U.selectEl(UDOD).Parent(); //获取父亲层
  2221. var _UDAD = U.selectEl(_UW.document.body).childs(0, 0).Child(); //获取Ifrmae下的第一个元素的子级
  2222. var _UDMD = _UDAD[1]; //推荐分享区
  2223. var _UAE = U.MD.DK.M.GDBFM("uw"); //获取最近打开的uw文件
  2224. U.UF.DL.uploading(UDOD); //设置loading
  2225. U.MD.O.E.T.WETZ(_UDPD, (_UW.U.OU.TF["TF"] = "Word")); _UDMD.contentEditable = true; if (!UDE) { (!USID) && (_UTH = _UDMD.innerHTML); } else { _UTH = UDE["UsOffice"]; } _UDMD.innerHTML = ""; //创建独立的div作为换行
  2226. (!_UTH) && (_UDMD = $$("div", {}, _UDMD), _UTH = ""); _UW.U.OU.SCJD(_UDMD, _UTH, U.MD.O.OLWordUP); _UDMD.focus(); _UW.U.MD.O.W.AsynGetTemp(); (_UAE) && (U.MD.O.PWord(_UAE.slice(0, 6), U.selectEl(_UDAD[0]).Child()[1], UIF)); //打印值//打印最近推荐
  2227. }
  2228. */
  2229. //暂时先屏蔽 网上很少使用
  2230. //outerText 最初是由 IE4.0 浏览器实现的私有属性,只有 Firefox 不支持该属性
  2231. //兼容outerText
  2232. // if (!!document.getBoxObjectFor || window.mozInnerScreenX != null) {//判断是否为firefox
  2233. // HTMLElement.prototype.__defineSetter__("outerText", function (str) {
  2234. // var parsedText = document.createTextNode(str); //创建文本节点
  2235. // this.parentNode.replaceChild(parsedText, this); //用创建的文本节点代替this
  2236. // return parsedText;
  2237. // });
  2238. // HTMLElement.prototype.__defineGetter__("outerText", function () {
  2239. // var r = this.ownerDocument.createRange(); //在这个元素的根元素创建一个(Range 对象)
  2240. // r.selectNodeContents(this); //设置该范围的边界点,使它包含指定节点的子孙节点,但不包含指定的节点本身;参数->其子节点将成为当前范围的内容的节点
  2241. // return r.toString(); //把一个逻辑值转换成字符串,并返回结果
  2242. // });
  2243. // }
  2244. //暂时先屏蔽
  2245. // if (!("componentFromPoint" in HTMLElement.prototype)) {//通过特定事件返回对象在指定坐标下的位置
  2246. // U.UF.EV.boundProperties(HTMLElement.prototype, "componentFromPoint", function () {//componentFromPoint("指定x的客户端窗口的坐标","指定y的客户端窗口的坐标")
  2247. // return function () {
  2248. // var _UE = U.UF.C.GetMousep();
  2249. // var _UDE = U.UF.EL.getElementInfo(this);
  2250. // if ((_UE["X"] > _UDE["CW"] + _UDE["TX"]) || (_UE["Y"] > _UDE["CH"] + _UDE["TY"])) {
  2251. // return "outside";
  2252. // }
  2253. // return "";
  2254. // }
  2255. // },
  2256. // function () { });
  2257. // }
  2258. //IE的script元素支持onreadystatechange事件,不支持onload事件.
  2259. //FF的script元素不支持onreadystatechange事件,只支持onload事件.
  2260. // if (!("onreadystatechange" in HTMLElement.prototype)) {//判断是否是firefox
  2261. // U.UF.EV.boundProperties(HTMLElement.prototype, "onreadystatechange", function () {
  2262. // return this.onload;
  2263. // },
  2264. // function (cb) {
  2265. // this.onload = cb;
  2266. // });
  2267. // }
  2268. // function loadJS(url, success) {
  2269. // var domScript = document.createElement('script');
  2270. // domScript.src = url;
  2271. // success = success || function () { };
  2272. // domScript.onload = domScript.onreadystatechange = function () {
  2273. // if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
  2274. // success();
  2275. // this.onload = this.onreadystatechange = null;
  2276. // this.parentNode.removeChild(this);
  2277. // }
  2278. // }
  2279. // document.getElementsByTagName('head')[0].appendChild(domScript);
  2280. // }
  2281. // if (!("setCapture" in HTMLElement.prototype)) {//判断是否是firefox
  2282. // U.UF.EV.boundProperties(HTMLElement.prototype, "setCapture", function () {
  2283. // return function () { window.captureEvents(Event.MOUSEMOVE); } //firefox对于鼠标事件的捕捉
  2284. // },
  2285. // function () { }); }
  2286. //
  2287. // if (!("releaseCapture" in HTMLElement.prototype)) {//判断是否是firefox
  2288. // U.UF.EV.boundProperties(HTMLElement.prototype, "releaseCapture", function () {
  2289. // return function () {
  2290. // window.releaseEvents(Event.MOUSEMOVE);
  2291. // }
  2292. // },
  2293. // function () { });
  2294. // }
  2295. //setCapture和window.captureEvents(Event.MOUSEMOVE)的兼容
  2296. // if (!("event" in window.constructor.prototype)) {/*检测浏览器是否支持鼠标键盘事件*/
  2297. // U.UF.EV.boundProperties(window.constructor.prototype, "event", function () {
  2298. // var _UDE = arguments.callee; //arguments.callee ->指向参数arguments对象的函数
  2299. // while (_UDE.caller) {//一直往上寻找直到 寻找到顶层作用域 返回null 再往下执行
  2300. // _UDE = _UDE.caller;
  2301. // }
  2302. // return _UDE.arguments ? _UDE.arguments[0] : null; //arguments 是一个对应于传递给函数的参数的类数组对象。
  2303. // }, function () { });
  2304. // }
  2305. // if (!("srcElement" in window.Event.prototype)) {
  2306. // U.UF.EV.boundProperties(window.Event.prototype, "srcElement", function () {
  2307. // return event.target;
  2308. // },
  2309. // function () { });
  2310. // }
  2311. //srcElement 和 target 的兼容
  2312. // var theEvent = window.event || arguments.callee.caller.arguments[0]; //arguments.callee.caller.arguments[0]相当于firefox的获取event
  2313. // var srcElement = theEvent.srcElement; //捕获当前事件作用的对象
  2314. // if (!srcElement) {//Firefox不兼容srcElement
  2315. // srcElement = theEvent.target; //Firefox兼容target
  2316. // }
  2317. // if (!("keyCode" in window.Event.prototype)) {
  2318. // U.UF.EV.boundProperties(window.Event.prototype, "keyCode", function () {
  2319. // return event.which;
  2320. // },
  2321. // function () { });
  2322. // }
  2323. //keyCode - 兼容chrom和Firefox
  2324. // HTMLElement.prototype.__defineGetter__("onmousewheel", function () {
  2325. // return this.onwheel;
  2326. // });
  2327. // HTMLElement.prototype.__defineSetter__("onmousewheel", function (cb) {
  2328. // this.onwheel = cb;
  2329. // });
  2330. // if (!("onmousewheel" in HTMLElement)) {
  2331. // if ("onwheel" in HTMLElement.prototype) {
  2332. // U.UF.EV.boundProperties(HTMLElement.prototype, "onmousewheel", function () {
  2333. // return this.onwheel;
  2334. // },
  2335. // function (cb) {
  2336. // this.onwheel = cb;
  2337. // });
  2338. // }
  2339. // else {
  2340. // //firefox支持onmousewheel
  2341. // if (browser.firefox) {
  2342. // (function () {
  2343. // window.addEventListener("DOMMouseScroll", function (UE) {
  2344. // //监控Scroll事件
  2345. // var _UOE = null
  2346. // , _UDOD = UE.srcElement;
  2347. // do {
  2348. // _UOE = U.selectEl(_UDOD).attr("onmousewheel") || _UDOD.onmousewheel;
  2349. // _UDOD = U.selectEl(_UDOD).Parent();
  2350. // } while (!(_UOE || !_UDOD)); //冒泡的顶部获取
  2351. // if (_UOE) {
  2352. // (typeof _UOE == "string") && (_UDOD.onmousewheel = new Function(_UOE));
  2353. // U.M.StopDefault();
  2354. // //阻止页面固定事件
  2355. // setTimeout(function () {
  2356. // _UOE.call(this, UE);
  2357. // }
  2358. // , 0);
  2359. // //异步执行 解决锁定的bug
  2360. // }
  2361. // }
  2362. // , false);
  2363. // }
  2364. // )();
  2365. // }
  2366. // }
  2367. // }
  2368. //------------------------------------------------------------------------------------------
  2369. // if (!("innerText" in HTMLElement.prototype)) {/*检测浏览器是否支持innerText这个方法*/
  2370. // U.UF.EV.boundProperties(HTMLElement.prototype, "innerText",
  2371. // function () {
  2372. // return this.textContent;
  2373. // },
  2374. // function (UDE) {
  2375. // this.textContent = UDE;
  2376. // }
  2377. // );
  2378. // }
  2379. //------------------------------------------------------------------------------------------
  2380. // if (!("outerHTML" in HTMLElement.prototype)) {/*检测浏览器是否支持outerHTML这个方法*/
  2381. // U.UF.EV.boundProperties(HTMLElement.prototype, "outerHTML",
  2382. // function () {
  2383. // var _UDOD = this.cloneNode(true),
  2384. // _UDTD = $$("div", {});
  2385. // _UDTD.appendChild(_UDOD);
  2386. // return _UDTD.innerHTML; /*如果不支持就使用innerhtml插入*/
  2387. // },
  2388. // function (UTH) {
  2389. // var i, _UDOD = U.selectEl(this), _UDPD = _UDOD.Parent(), _UDCD = $$("div", {
  2390. // "innerHTML": UTH
  2391. // }).childNodes, _UDTD = document.createDocumentFragment;
  2392. // for (i = 0; i < _UDCD.length; i++) {
  2393. // _UDTD.appendChild(_UDCD[i]);
  2394. // }
  2395. // ; _UDTD.insertBefore(_UDTD, this);
  2396. // _UDOD.remove();
  2397. // }
  2398. // );
  2399. // }
  2400. //------------------------------------------------------------------------------------------
  2401. // if (!("outerText" in HTMLElement.prototype)) {/*检测浏览器是否支持outerText这个方法*/
  2402. // U.UF.EV.boundProperties(HTMLElement.prototype, "outerText",
  2403. // function () {
  2404. // var _UDOD = this.cloneNode(true)
  2405. // , _UDTD = $$("div", {});
  2406. // _UDTD.appendChld(_UDOD);
  2407. // return _UDTD.innerText; /*如果不支持就使用innerText插入*/
  2408. // },
  2409. // function (UTH) {
  2410. // var i, _UDOD = U.selectEl(this), _UDPD = _UDOD.Parent(), _UDCD = $$("div", {
  2411. // "innerText": UTH
  2412. // }).childNodes, _UDTD = document.createDocumentFragment;
  2413. // for (i = 0; i < _UDCD.length; i++) {
  2414. // _UDTD.appendChild(_UDCD[i]);
  2415. // }
  2416. // _UDTD.insertBefore(_UDTD, this);
  2417. // _UDOD.remove();
  2418. // });
  2419. // }
  2420. //------------------------------------------------------------------------------------------
  2421. // if (!("currentStyle" in HTMLElement.prototype)) {
  2422. // U.UF.EV.boundProperties(HTMLElement.prototype, "currentStyle", function () {
  2423. // return getComputedStyle(this, false);
  2424. // },
  2425. // function () { });
  2426. // }
  2427. //------------------------------------------------------------------------------------------
  2428. // if (!("onresize" in HTMLElement.prototype) || !browser.msie) {//HTMLElement.prototype内没有onresize 则执行这个函数
  2429. // U.UF.CP.onresize = function (UDOD, UDTD, cb) {
  2430. // Size事件设置
  2431. // if (cb) {
  2432. // UDOD.contentDocument.defaultView.onresize = function () { U.UF.C.apply(UDTD, [[cb]])(); } //
  2433. // }
  2434. // else {
  2435. // try {
  2436. // delete this.__SizeElement__;
  2437. // } catch (e) { }
  2438. // }
  2439. // }
  2440. // U.UF.EV.boundProperties(HTMLElement.prototype, "onresize", function () {
  2441. // try {
  2442. // this.__SizeElement__.contentDocument.defaultView.onresize;
  2443. // } catch (e) {
  2444. // return null;
  2445. // }
  2446. // },
  2447. // function (cb) {
  2448. // if (this.tagName) {
  2449. // 设置Set事件
  2450. // var _UDOD = this.__SizeElement__;
  2451. // (U.UF.EL.getStyle(this, "position") == "static") && (this.style.position = "relative");
  2452. // if (!_UDOD || U.selectEl(_UDOD).Parent() != this && cb) {
  2453. // _UDOD = this.__SizeElement__ = $$("object", {
  2454. // "onload": function(){U.UF.CP.onresize(this, this, cb);},
  2455. // "type": "text/html",
  2456. // "data": "about:blank",
  2457. // "style": {
  2458. // "cssText": "display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1;visibility:hidden;margin:0;padding:0;"
  2459. // }
  2460. // }, this)[0];
  2461. // }
  2462. // else {
  2463. // U.UF.CP.onresize(_UDOD, this, cb);
  2464. // }
  2465. // }
  2466. // });
  2467. // }
  2468. // if (!("componentFromPoint" in HTMLElement.prototype)) { // --------- 上面有重复代码
  2469. // U.UF.EV.boundProperties(HTMLElement.prototype, "componentFromPoint", function () {
  2470. // return function () {
  2471. // var _UE = U.UF.EL.getMousePosition();
  2472. // var _UDE = U.UF.EL.getElementInfo(this);
  2473. // if ((_UE["X"] > _UDE["CW"] + _UDE["TX"]) || (_UE["Y"] > _UDE["CH"] + _UDE["TY"])) {
  2474. // return "outside";
  2475. // }
  2476. // return "";
  2477. // }
  2478. // },
  2479. // function () { });
  2480. // }
  2481. ////发送消息到桌面提示
  2482. //U.MD.F.N.ZMTS = function (UDE) {
  2483. // var i, j, k, _UKE, _USE,
  2484. // _UET = window.external,
  2485. // _UTF = [], _UCE = [[], []];
  2486. // for (i = 0; i < UDE.length; i++) {
  2487. // if (i) {
  2488. // _USE = UDE[i][3];
  2489. // for (j = 0; j < _USE.length; j++) {
  2490. // _UTF[0] = true;
  2491. // _UKE = _USE[j];
  2492. // _UCE[1].push({
  2493. // "UsImag": _UKE.UserThumbnailImageHead !== undefined ? U.MD.C.getHeadImage(_UKE.UserThumbnailImageHead) : US.DOMAIN + "img/getface.jpg",
  2494. // "UsSYSUN": "",
  2495. // "UsSYScontent": _UKE["NEWC"] || _UKE["ET"],
  2496. // "UsName": _UKE.UserName,
  2497. // "UsType": _UKE["NEWTYPE"]
  2498. // });
  2499. // }
  2500. // }
  2501. // else { //属于闪烁消息
  2502. // for (j = 0; j < UDE[i].length; j++) {
  2503. // _USE = UDE[i][j];
  2504. // if (_USE && _USE.length) {
  2505. // for (k = 0; k < _USE.length; k++) {
  2506. // _UTF[1] = true;
  2507. // _UKE = _USE[k];
  2508. // _UCE[0].push({
  2509. // "UsImag": _UKE.UserThumbnailImageHead != null ? U.MD.C.getHeadImage(_UKE.UserThumbnailImageHead) : US.DOMAIN + "img/getface.jpg",
  2510. // "UsSYSUN": "",
  2511. // "UsSYScontent": _UKE,
  2512. // "UsName": _UKE.FriendsDescript || _UKE.UserNickName || _UKE.GroupManageName,
  2513. // "UsType": _UKE.MessageIsVerify || 0
  2514. // });
  2515. // }
  2516. // }
  2517. // }
  2518. // }
  2519. // }
  2520. // try { //云端浏览器
  2521. // if (_UET) {
  2522. // if (_UTF[0]) { _UET.news(U.UF.C.jsonToStr(_UCE[1])); }
  2523. // if (_UTF[1]) { _UET.ftpshow(U.UF.C.jsonToStr(_UCE[0])); } else { _UET.QXftpshow(); } //属于普通消息 //闪烁消息
  2524. // _UCE[0] = _UCE[1] = null; CollectGarbage(); return null;
  2525. // }
  2526. // } catch (e) { } //html5消息查看
  2527. //}
  2528. //#region 带虚拟框的拖动
  2529. /*
  2530. * 拖动函数处理
  2531. *
  2532. * @param {element} 需要拖动的元素
  2533. * @param {function} 拖动回调函数
  2534. * @param {object} 拖动参数
  2535. ----------参数为getElementInfo 返回值
  2536. * @return {object} 拖动对象
  2537. */
  2538. U.UF.F.DragMouseDown = function (UDOD, cb, UDE) {
  2539. if (event.button < 2) { //判断左键使用
  2540. var _UTE = new U.UF.F.DragMouseDown.init(UDOD, cb, UDE),
  2541. _UKE = {//拖动事件处理
  2542. "mousemove": U.UF.C.apply(_UTE, _UTE.Drag), //move事件处理
  2543. "mouseup": U.UF.C.apply(_UTE, _UTE.DragUp) //up事件处理
  2544. };
  2545. //绑定事件
  2546. U.UF.C.AddObj(_UTE, _UKE); //给拖动方法添加新的事件。
  2547. _UTE.create(); //创建拖动参数
  2548. U.selectEl(document).bind(_UKE); //绑定拖动事件
  2549. //返回对象
  2550. return (U.UF.F.DragMouseDown.ST = _UTE);
  2551. }
  2552. }
  2553. /*
  2554. * 初始化拖动等待拖动
  2555. *
  2556. * @param {element} 需要拖动的元素
  2557. * @param {function} 拉伸回调函数
  2558. * @param {object} 拖动参数
  2559. * @param {object} 拉伸回调函数
  2560. ----------参数为getElementInfo 返回值
  2561. */
  2562. U.UF.F.DragMouseDown.init = function (UDOD, cb, UDE, UCE) {
  2563. if (UCE && UCE.start) { UCE.start() }; //初始化回调
  2564. this.set(UCE);
  2565. //参数设置和说明
  2566. this.set({
  2567. max: (UDE && UDE.MaxLeft) ? UDE : null, //最大的拖动范围
  2568. SO: UDOD, //拖动的元素
  2569. AF: cb, //回调函数
  2570. ESO: event.srcElement //当前选中的元素
  2571. });
  2572. return this;
  2573. }
  2574. U.UF.F.DragMouseDown.init.prototype = {
  2575. /*
  2576. * 设置拖动参数 上述有参数说明
  2577. *
  2578. * @param {object} 需要拖动的元素
  2579. */
  2580. set: function (UDE) {
  2581. if (UDE) { U.UF.C.AddObj(this, UDE) };
  2582. },
  2583. /*
  2584. * 创建虚拟框
  2585. *
  2586. */
  2587. create: function () {
  2588. var _UDOD = this.SO, //拖动元素
  2589. _UHE = U.UF.EL.getElementInfo(_UDOD); //拖动元素的位置
  2590. //参数设置
  2591. U.UF.C.AddObj(this, {
  2592. IsD: false, //是否为有效拖动
  2593. XY: U.UF.EL.getMousePosition(), //当前鼠标位置
  2594. E: _UHE, //拖动元素大小等
  2595. MaxTop: _UHE["PXT"] + US.height - 10, //最大拖动top
  2596. MaxLeft: _UHE["PXL"] + US.width, //最大拖动left
  2597. MinLeft: -_UHE["OW"] + 10, //最小拖动left
  2598. MinTop: 0 //最小拖动top
  2599. });
  2600. //判断是否有最大范围设置
  2601. if (this.max) { this.IsMinAndMax() };
  2602. },
  2603. /*
  2604. * 限制拖动范围
  2605. *
  2606. * @param {object} 需要拖动的元素
  2607. */
  2608. IsMinAndMax: function (UDE) {
  2609. U.UF.C.AddObj(this,
  2610. { "MaxLeft": this.E["PXL"] + UDE["MaxLeft"] || this.MaxLeft, //最大拖动left
  2611. "MinLeft": UDE["MinLeft"] || this.MinLeft, //最小拖动left
  2612. "MinTop": UDE["MinTop"] || this.MinTop, //最小拖动top
  2613. "MaxTop": this.E["PXT"] + UDE["MaxTop"] || this.MaxTop //最大拖动top
  2614. }); //设置拉伸的范围限制
  2615. },
  2616. //拖动时触发的函数
  2617. Drag: function () {
  2618. var i, _UHE, _UDTD, _UDMD,
  2619. _UDOD = this.SO, //拖动元素
  2620. _UDE = [["X", "Left", "L"], ["Y", "Top", "T"]], //设置参数
  2621. _UME = this.E, //拖动元素原大小位置
  2622. _UCE = this.XY,
  2623. _UE = U.UF.EL.getMousePosition(); //鼠标的位置
  2624. if (this.move) { this.move(this) }; //回调函数
  2625. //循环判断设置 top left
  2626. for (i = 0; i < _UDE.length; i++) {
  2627. _UDE[i] = Math.min(Math.max(_UE[(_UHE = _UDE[i])[0]] - _UCE[_UHE[0]] + _UME["O" + _UHE[2]], this["Min" + _UHE[1]]), this["Max" + _UHE[1]]);
  2628. }
  2629. //第一次拖动的参数
  2630. if (!this.IsD) {
  2631. this.IsD = true; //设置正在拖动
  2632. U.UF.C.AddObj(this, {
  2633. VDB: U.UF.F.foundVirtualBox(_UDOD), //添加虚拟框
  2634. UMD: U.UF.F.maskFrame() //添加遮层
  2635. });
  2636. //绑定事件
  2637. U.selectEl(this.UMD).bind({
  2638. mousemove: this.mousemove, //移动事件绑定
  2639. mouseup: this.mouseup //释放事件
  2640. });
  2641. //遮罩置顶
  2642. U.UF.F.topWindow(this.UMD);
  2643. U.UF.F.topWindow(this.VDB);
  2644. //鼠标聚焦处理
  2645. this.VDB.setCapture();
  2646. }
  2647. //鼠标处理
  2648. U.selectEl(this.VDB).addAttrArray({ "style":
  2649. {
  2650. "cssText": "left:" + _UDE[0] + "px;top:" + _UDE[1] + "px;"
  2651. }
  2652. });
  2653. },
  2654. //拖动结束
  2655. DragUp: function () {
  2656. //事件释放
  2657. $[document, this.UMD].unbind(
  2658. {
  2659. "mousemove": this.mousemove, //拖动变化使用
  2660. "mouseup": this.mouseup //拖动结束
  2661. });
  2662. this.IsD = false; //设置结束
  2663. //释放元素 同时元素定位
  2664. if (this.VDB) {
  2665. var _UDMD = this.UMD, //遮罩框
  2666. _UDTD = this.VDB, //虚拟框
  2667. _UDE = U.UF.EL.getElementInfo(_UDTD); //拖动结束的位置
  2668. _UDTD.releaseCapture();
  2669. U.UF.F.DragMouseDown.chche = U.UF.F.DragMouseDown.ST = null;
  2670. $[_UDMD, this.VDB].remove(); //元素移除 //事件结束
  2671. U.selectEl(this.SO).addAttrArray({ "style":
  2672. {
  2673. "cssText": "top:" + (_UDE["OT"] + 2) + "px;left:" + (_UDE["OL"] + 2) + "px;"
  2674. }
  2675. });
  2676. U.UF.F.withf(this.cb); //执行回调
  2677. }
  2678. }
  2679. }
  2680. //#endregion
  2681. //#region
  2682. /*
  2683. * 直接拖动元素不带虚拟框 一般常用于图标移动
  2684. *
  2685. * @param {element} 需要拖动的元素
  2686. * @param {object} 拖动参数
  2687. ----------[ST] 初始化回调函数
  2688. * @return {object} 拖动对象
  2689. */
  2690. U.UF.F.iconmove = function (UDOD, UDE) {
  2691. if (event.button != 2) { //只有右键允许拖动
  2692. var _UTE = new U.UF.F.iconmove.init(UDOD, UDE);
  2693. return _UTE;
  2694. }
  2695. }
  2696. U.UF.F.iconmove.init = function (UDOD, UDE) { //拖动开始
  2697. if (UDOD) {
  2698. var i, _UE = U.UF.EL.getElementInfo($(UDOD)[0]), //拖动元素的位置
  2699. _UKE = U.UF.EL.getMousePosition(), //鼠标位置
  2700. _UCE = this.UCE = {
  2701. "mousemove": U.UF.C.apply(this, function () { this.move(); }), //移动函数处理
  2702. "mouseup": U.UF.C.apply(this, function () { this.up(); }) //释放函数处理
  2703. };
  2704. if (UDE && UDE["ST"]) { UDE["ST"].call(this, UDOD) }; //初始化回调
  2705. //初始化参数
  2706. U.UF.C.AddObj(this, {
  2707. IsD: false, //设置未拖动状态
  2708. UMD: U.UF.F.maskFrame(), //虚拟框
  2709. E: _UKE, //鼠标位置
  2710. SO: UDOD, //拖动元素
  2711. UE: _UE, //元素的位置
  2712. UCF: UDE, //拖动传参
  2713. MT: _UE["PXT"] + US.height - 10, //拖动最大top
  2714. ML: _UE["PXL"] + US.width, MIL: -_UE["OW"] + 10, //拖动最大left
  2715. MIT: 0 //最小拖动范围
  2716. });
  2717. //绑定设置
  2718. UDOD.setCapture(); //事件聚焦
  2719. U.selectEl(document).bind(_UCE); //事件绑定
  2720. U.UF.F.topWindow(this.UMD, true); //置顶
  2721. U.selectEl(UDOD).css("z-index", 9999); //当前拖动元素置顶
  2722. return this;
  2723. }
  2724. }
  2725. U.UF.F.iconmove.init.prototype = {
  2726. //移动效果
  2727. move: function () {
  2728. var i, _UTL,
  2729. _UDOD = this.SO; //当前拖动元素处理
  2730. _UE = U.UF.EL.getMousePosition(), //当前拖动鼠标位置
  2731. _UKE = this.E, //初始鼠标位置
  2732. _UME = this.UE, //元素位置
  2733. _UAE = [["x", "L"], ["y", "T"]]; //变化top left对应参数
  2734. U.UF.EV.stopBubble(); //阻止冒泡
  2735. if (!this.UMD) {
  2736. this.UMD = U.UF.F.maskFrame();
  2737. U.selectEl(this.UMD).bind(this.UCE); //事件绑定
  2738. }
  2739. //计算获取位置
  2740. for (i = 0; i < _UAE.length; i++) {
  2741. _UTL = _UE[_UAE[i][0]] - _UKE[_UAE[i][0]];
  2742. if (Math.abs(_UTL) > 2) { this.IsD = true };
  2743. _UAE[i] = Math.min(Math.max(_UTL + _UME["O" + _UAE[i][1]], this["MI" + _UAE[i][1]]), this["M" + _UAE[i][1]]);
  2744. }
  2745. //设置值
  2746. U.selectEl(_UDOD).addAttrArray({ "style": { "cssText": "left:" + _UAE[0] + "px;top:" + _UAE[1] + "px"} }); //?
  2747. if (this.UCF && this.UCF["Move"]) { this.UCF["Move"].apply(this, [_UDOD, _UAE, _UKE, _UE]) }; //回调
  2748. this.ism = true;
  2749. },
  2750. //移动结束
  2751. up: function () {
  2752. var _UDOD = this.SO, //拖动元素
  2753. _UFE = this.UCF; //回调函数
  2754. U.UF.EV.stopBubble(); //阻止冒泡
  2755. _UDOD.setCapture(); //事件聚焦
  2756. //释放
  2757. this.ism = null;
  2758. U.selectEl(this.UMD).remove(); //虚拟框移除
  2759. U.selectEl(document).unbind(this.UCE); //移除绑定
  2760. U.selectEl(_UDOD).css("z-index", ""); //去除置顶
  2761. // //回调
  2762. if (_UFE && _UFE["UP"]) { _UFE["UP"].apply(this, [_UDOD]) }; //回调函数处理
  2763. setTimeout(function () {
  2764. _UDOD.releaseCapture();
  2765. }, 0); ; //鼠标聚焦移除
  2766. }
  2767. }
  2768. //#endregion
  2769. /*
  2770. * 分页获取数据!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!放这里是什么意思?????
  2771. *
  2772. * @param {array} 帖子信息
  2773. * @param {number} 位置
  2774. * @param {number} 数量
  2775. * @returns {array}
  2776. */
  2777. U.MD.D.D.FYGBL = function (UDE, UP, UHP) {
  2778. UHP = UHP || [10, 300];
  2779. var _UDV, _UNP = UHP[1] / UHP[0],
  2780. _UTP = Math.ceil(UP / _UNP),
  2781. _UCP = UP % _UNP;
  2782. UP = !_UCP ? _UNP : _UCP; //分页的页码
  2783. if (UDE && (UDE = UDE[_UTP])) {
  2784. _UDV = UDE.slice((UP - 1) * UHP[0], (UP * UHP[0]));
  2785. }
  2786. return [_UDV, _UTP]; //分页的数据
  2787. }
  2788. //未登录图标的集合
  2789. //U.MD.D.D.Desktop = function (UTF) {
  2790. // // return UTF === 1 ? U.MD.D.D.Class : U.MD.D.D.DesktopOr(UTF);
  2791. // // if ((!U.MD.D.D.Class && UTF == 1) || UTF == 2) {
  2792. // // var i, j, _UDE = U.MD.D.D.Class = [], _UKE = U.MD.D.D.GetDesk();
  2793. // // for (i = 0; i < _UKE.length; i++) { if (!(i % 7)) { _UDE[(j = _UDE.length)] = []; } _UDE[j].push(new U.MD.D.T(_UKE[i])); }
  2794. // // return _UDE;
  2795. // // } else { return UTF === 1 ? U.MD.D.D.Class : U.MD.D.D.DesktopOr(UTF); }
  2796. //}