12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068 |
- // if (UCE.hasOwnProperty(i)) {
- // _UGE = UCE; switch (i) { case "$or": _UGE = UCE[i]; _UTE.push(true); break; } //or使用 _UGE = _UGE["$or"];
- // _UFE: for (j in _UGE) {
- // _UTF = true;
- // if (_UGE.hasOwnProperty(j)) {
- // for (k in _UGE[j]) {
- // switch (j) {
- // case "$e": if (UDE[j] != _UGE[j]) { _UTF = false; }; break; //=
- // case "$ne": if (UDE[j] == _UGE[j]) { _UTF = false; }; break; //!=
- // case "$lt": if (UDE[j] >= _UGE[j]) { _UTF = false; }; break; //<
- // case "$lte": if (UDE[j] > _UGE[j]) { _UTF = false; }; break; //<=
- // case "$gt": if (UDE[j] <= _UGE[j]) { _UTF = false; }; break; //>
- // case "$gte": if (UDE[j] < _UGE[j]) { _UTF = false; }; break; //>=
- // case "$in": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] == UDE[j]) { _UTF = false; break; } } _UTF = !_UTF; break; //in
- // case "$nin": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] == UDE[j]) { _UTF = false; break; } } break; //not in
- // case "$all": for (k = 0; k < _UGE[j]; k++) { if (_UGE[j][k] != UDE[j]) { _UTF = false; break; } } break; //匹配所有
- // case "$exists": break; //存在文档
- // case "$mod": break; //取模函数
- // case "$not": break; //不匹配
- // }
- // if ((!_UTE[0] && !_UTF) || (_UTE[0] && _UTF)) { break _UFE; }
- // }
- // }
- // }
- // (_UTF) && (USE.push(UDE));
- // }
-
- // this.body = _UDE.parentEle ? U.selectEl(_UDE.parentEle).append(_UDTD) : new U.UF.UI.form(_USE).form;
- // if (!this.obj.head && this.obj.upload) { //启动上传功能
- // // $$("div", { "className": "UD_SYFDTZ U_Boom_Img_ys2017 UD_SYSXZBFCAHO", "style": { "width": "28px" }, "title": "添加文件",
- � // // "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]])}])]]
- // // }, _UDSD);
- // }
- // <div class="UD_SYZCLTSI" title="上传头像">
- // <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'])">
- // </div>
- // _UDED = $$("input", { type: "file", multiple:"true",accept: "image/gif,image/jpeg,image/png" });
- // _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"]) ]]);
- // U.UF.UP.inputUpload([UDOD], UDE[0], UDE[1], "http://main.1473.cn/USUpfile.ashx?typename=" + UDE[2]);
- // _UDKD = $$("div", { "className": "UD_SYFDTZ U_Boom_Img_ys2017 UD_SYSXZBFCAHO", "style": { "position": "relative" }, "title": "本地添加文件",
- // "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])]]
- // }, _UDSD);
- //#region 编辑器创建
- //动态创建编辑器选项
- U.UF.E.RichEditor = function (SO, W, H, ISC, cb) {//
- 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();
- //编辑器界面初始化
- _UDRE = $$("div", { "className": "UF_FW_ok UF_FW_centerwindow " }, _UOFD);
- $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_face", "title": "表情" }, _UDRE);
- $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_Fbold", "title": "粗体" }, _UDRE);
- $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_underline", "title": "下划线" }, _UDRE);
- $$("div", { "unselectable": "on", "className": "UD_PiLt UF_FW_italic", "title": "斜体" }, _UDRE);
- _UDS = $$("select", { "className": "UF_FW_FontSize", "title": "字体大小" }, _UDRE);
- _UDOS = $$("select", { "className": "UF_FW_FontType", "title": "字体" }, _UDRE);
- _UDA = $$("div", { "className": "UE_Edit" }, _UDRE);
- _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);
- 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); }
- if (ISC) { $$("div", { "unselectable": "on", "className": "UF_FW_right UD_PiLt UF_FW_messagenote", "id": "messagenote" }, _UDRE); }
- _UDFD = $$("div", { "style": { "height": H + "px" }, "className": "UF_FW_DECC" }, _UTFD);
- _UDCD = $$("div", { "spellcheck": "false", "contentEditable": "true", "className": "UF_FW_DEC", "style": { "float": "none", "cssFloat": "none", "styleFloat": "none"} }, _UDFD);
- _UDOD.appendChild(_UOFD); _UDTD.appendChild(_UTFD); //添加到文档里
- //编辑器里的功能初始化
- U.UF.E.editorWindow(_UDOD, _UDCD); U.UF.E.Setoptions(_UDCD, _UDOS, _UDS); return SO;
- }
- // UPAsynCB: function (UDOD, TF, fun, UDAT, UTE) { //Flash文件上传成功后异步处理
- // if (UDAT) {
- // 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)
- // if (UTE["type"] == "rar" || UTE["type"] == "zip") { U.UF.E.CreateImage(window, " " + _UDID.outerHTML + " ", UDOD, TF); }
- // else {
- // var _UIID = _UDID.id; (_TF) ? U.UF.E.CreateImage(window, (" " + _UDID.outerHTML + " "), UDOD, TF) : UDOD.Replace((" " + _UDID.outerHTML + " ")); (UDOD.Parent) && (UDOD = UDOD.Parent()); _UDID = U.selectEl("img#" + _UIID, UDOD)[0];
- // U.UF.E.AddUPWJ({ "URL": UDAT[0], "name": UTE["name"], "size": UTE["size"], "type": "." + UTE["type"] }, _UDID); (fun) && (fun(_UDID));
- // }
- // }
- // },
- //设置编辑器的工具栏初始化
- U.UF.E.editorWindow = function (UDRE, UDFD) {
- var _UDPD = U.selectEl("div", UDRE)[0], _UDOD = U.selectEl("div", _UDPD); ; //功能处理的元素
- ($("input", _UDPD)[0] || _UDOD[5]).onmousedown = _UDOD[0].onmousedown = U.UF.C.apply(this, [[U.UF.E.GetSelectionRange, [window, UDFD, { "TF": "QL"}])]]; //加入断点消失标记
- _UDOD[0].onclick = function(){U.UF.E.CreateSf("ChattingFaceDiv", null, this, window, UDFD, "QL");}; //添加表情图
- _UDOD[1].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "fontWeight": ["bold", "normal"]}])]]; //字体加粗
- _UDOD[2].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "textDecoration": ["underline", "none"]}])]]; //下划线
- _UDOD[3].onmousedown = U.UF.C.apply(this, [[U.UF.E.FontSizeType, [UDFD, { "fontStyle": ["italic", "normal"]}])]]; //斜体
- }
- //options onclick全兼容
- U.UF.E.SetSO = function (AF) {
- if (AF && AF != event) {
- if (this["on"] == 1) { U.UF.C.apply(this, [AF])(); this["on"] = 0; } //如果是option点击就执行
- else { this["on"]++; }
- }
- else { this["on"] = 0; }
- }
- //编辑器options赋值
- U.UF.E.Setoptions = function (ED, UDOS, UDS) {
- UDS["on"] = UDOS["on"] = UDOS.options.length = UDS.options.length = 0;
- var _FS = [12, 14, 16, 18, 20, 22, 24, 36, 48, 72], _FT = ["宋体", "黑体", "仿宋_GB2312", "楷体_GB2312", "隶书", "微软雅黑", "幼圆", "Arial", "Verdana"]; //字体的大小 //字体样式
- for (var i = 0; i < 9; i++) { UDOS.options.length += 1; UDOS.options[i].value = _FT[i]; UDOS.options[i].text = _FT[i]; } //select字体样式选择
- 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字体大小选择
- UDOS.onclick = function(){U.UF.E.SetSO([U.UF.E.SelectO, [ED, "fontFamily", UDOS]]);}; //options onlick模拟事件
- UDS.onclick = function(){U.UF.E.SetSO([U.UF.E.SelectO, [ED, "fontSize", UDS]]);}; //options onlick模拟事件
- UDS.onblur = UDOS.onblur = U.UF.E.SetSO
- }
- //select onclick赋值
- U.UF.E.SelectO = function (ED, TF, UDE) {
- if (TF == "fontFamily") { U.UF.E.FontSizeType(ED, { "fontFamily": UDE.value }); }
- else { U.UF.E.FontSizeType(ED, { "fontSize": UDE.value }); }
- }
- //--------------------------------------------------------------------------有思文字编辑器模块--------------------------------------------------------------------
- //---------------------------------------------------------------编辑器上传文件-----------------------------------------------------------------
- //编辑器上传
- U.UF.E.usestudioeditoruploadimg = function (UEL, UED, cb, TF) {
- if (parent.US.userInfo.UserId) {
- var _UDID, _TF = U.UF.UP.SFT("UP"), _UDED = U.selectEl("div@contentEditable=true", UED.parentNode)[0], _UPEL = UEL.parentNode; //可上传文件类型
- if (parent.U.UF.UP.UploadFileType(UEL, _TF) == false) { U.Alert("只允许上传图片文件和压缩文件"); return; }
- UDID = U.UF.E.AddUPWJ({ "type": "jpg" }); U.UF.E.CreateImage(window, UDID.outerHTML, _UDED, TF); //插入图片
- 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); //上传
- $$("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)
- }
- else { parent.U.Alert("请登录后在上传"); }
- }
- //编辑器上传显示
- U.UF.E.uploadcallback = function (r) {
- var _UTF, _context = r.context, _UDOD = r.UpObj; r = r.value; //返回的值
- 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]); }
- }
- //-----------------------------------------------------------------------------------表情框-----------------------------------------------------------------------
- //现在用户表情框的定位
- U.UF.E.init = function (UDOD, SO) {
- var _UE = U.UF.EL.getElementInfo(SO), _UR, _UL = _UE["BCRL"], _UT = _UE["BCRT"] + _UE["PXT"] - 220 + "px";
- if (_UL + 436 >= US.width) { _UR = true; _UL = 0; } else { _UL = _UL - 190; }
- U.selectEl(UDOD).addAttrArray({ "style": { "left": _UL + "px", "right": _UR ? _UL + "px" : "auto", "top": _UT} }); //定位
- }
- //创建表情框
- U.UF.E.CreateSf = function (ID, DFPE, SO, CW, OS, TF) {
- DFPE = DFPE || U.selectEl("#" + ID)[0];
- if (DFPE == null) {
- DFPE = $$("div", { "id": ID, "unselectable": "on", "className": "defaultFacePanel", "onclick": function(){U.UF.EV.stopBubble], [U.UF.E.CreateSf(ID, "retElement");}, "style": { "display": "block"} });
- 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;' /> ", OS, TF);} }, DFPE); } //
- document.onclick = function(){U.UF.E.CreateSf(ID, DFPE]], [document.onclick || function(){}, [);}; document.body.appendChild(DFPE);
- }
- else { if (DFPE.style.display == "block" || arguments.length == 2) { DFPE.style.display = "none"; return; } else { U.selectEl(DFPE).addAttrArray({ "style": { "display": "block"} }); } }
- U.UF.EV.stopBubble(); U.UF.F.topWindow(DFPE); U.UF.E.init(DFPE, SO); U.UF.E.CreateImage(CW, "", OS, TF); return DFPE; //定位表情框
- }
- //#endregion
- //#region
- ////-----------------------------------------------------------------窗体动画------------------------------------------------------------------------
- ////特效打开窗体,第一个参数为单击的按钮id str类型 第二个参数为弹出的窗体id str类型,ltwh是窗体的坐标和宽度,v是速度,按毫秒计算
- ////调用示例方法U.UF.ME.OpenWin("UCD_TOP_Lang", "UCD_L", document.body.clientWidth * 0.3 + "px", "130px", "600px", "380px");
- ////需要此效果的窗体css定义position:absolute; display:none; top:0px; left:0px; width:0px; height:0px;overflow:hidden;
- //U.UF.ME.OpenWin = function (b, d, l, t, w, h, v) {
- // var r = U.UF.EL.getElementInfo($("#" + b + "")[0]), o = U.selectEl("#" + d + "");
- // o[0].style.display = "block"; o[0].style.left = r.BCRL + "px"; o[0].style.top = r.BCRT + "px";
- // o.animate({ "left": l, "top": t, "width": w, "height": h }, v);
- //}
- ////特效关闭窗体,第一个参数为单击的按钮id str类型 第二个参数为弹出的窗体id str类型,v是速度,按照毫秒计算,cb是关闭窗体后执行的其他特效函数。
- //U.UF.ME.CloseWin = function (b, d, v, cb) {
- // var r = U.UF.EL.getElementInfo($("#" + b + "")[0]);
- // 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')"));
- // if (cb) cb;
- //}
- ////按钮抖动效果,参数b为按钮id,str类型,v为速度,此函数调用方法//U.UF.ME.BShake(b,32);
- ////参考自:http://www.nowamagic.net/librarys/veda/detail/1063,绝对定位可行,相对定位有点问题
- //U.UF.ME.BShake = function (d, v) {
- // //k判断元素是相对定位还是决定定位,相对定位用marginTop,决定定位用Top。u是计时器,t,l是相对定位,决定定位的值,a b是计算变量
- // var o, t, l, a, b = 0, u, k = 1, s;
- // "string" == typeof (d) ? o = U.selectEl("#" + d + "") : o = U.selectEl(d);
- // //如果元素是相对定位,不是absolute或者relative,采用marginTop属性抖动s = U.UF.EL.getStyle(o[0]);不能批量获取
- // if (U.UF.EL.getStyle(o[0], "position") == "absolute" || U.UF.EL.getStyle(o[0], "position") == "relative") { k = 0 }
- // if (k) { t = U.UF.EL.getStyle(o[0], "marginTop"); l = U.UF.EL.getStyle(o[0], "marginLeft"); a = ['marginTop', 'marginLeft'] }
- // else { t = U.UF.EL.getStyle(o[0], "top"); l = U.UF.EL.getStyle(o[0], "left"); a = ['top', 'left'] }
- // u = setInterval(function () {
- // b++;
- // 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";
- // if (b > 15) { clearInterval(u); b = 0; if (k) { o[0].style.marginTop = t; o[0].style.marginLeft = l; } }
- // }, v)
- //}
- ////元素变色,参数b为按钮id,str类型,参数n为新的颜色
- //U.UF.ME.ChangeColor = function (b, n) {
- // var o = U.selectEl("#" + b + "")[0], c = o.style.backgroundColor;
- // o.style.backgroundColor = n;
- // setTimeout(function () { o.style.backgroundColor = c; }, 1000)
- //}
- ////#endregion
- // 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); } }
- //获取QQ登录后得到的openId:用户身份的唯一标识。建议保存在本地,以便用户下次登录时可对应到其之前的身份信息,不需要重新授权。
- //accessToken:表示当前用户在此网站/应用的登录状态与授权信息,建议保存在本地。 有效期3个月
- CreateImage: function (EW, PH, SO, TF) {//编辑器里插入图片
- U.UF.E.SORange["OE"][TF].Replace(PH); //把设置后的文字顶替设置前的文字
- },
- // var i, _UTF; USE = USE || []; UDE = arguments.length > 4 ? UDE : this.Value; _UTF = this.IFOBJ(UDE);
- // if (_UTF === true) {//对象添加处理
- // if (this.IsTF(UCE, UDE)) { USE.push(UDE); } //确定本身是否为目标
- // if (UKE === true) { for (i in UDE) { if (USE.length == UT) { break; }; U.Json(UDE[i], this).select(UCE, UKE, UT, USE); } } //全盘搜索
- // else if (UKE) { if (USE.length != UT && UDE[UKE]) { U.Json(UDE[UKE], this).select(UCE, UKE, UT, USE); }; } //条件搜索
- // }
- // else if (_UTF == "Array") { for (i = 0; i < UDE.length; i++) { if (USE.length == UT) { break; } this.select(UCE, UKE, UT, USE, UDE[i]); } } //数组处理数据
- // return USE;
- //#endregion
- // else { this.EL.onmousedown = this.CB; this.SetHover(); U.UF.EV.simulateMouseClicks(this.EL, "mousedown"); };
- //this.EL.onmousedown(); this.EL.onmousedown = this.CB; U.UF.EV.simulateMouseClicks(this.EL, "mousedown");
- //释放 (this["SSO"] || _UDOD).onscroll = this.OS; U.UF.EV.simulateMouseClicks(_UDOD, "click");
- // return (U.MD.D.DestopStr = [{ "ApplicationID": "7aeaab56-485f-4150-b781-8ffd86d593ce", "UserDirectoryID": "", "ApplicationName": "网盘", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -304, "y": -20} },
- // { "ApplicationID": "93553847-e299-464c-a0e2-c15872efb6ae", "UserDirectoryID": "", "ApplicationName": "相册", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -88, "y": -92} },
- // {"ApplicationID": "8a2135ff-746a-43a8-97b8-552d228a00bb", "UserDirectoryID": "", "ApplicationName": "音乐", "ApplicaitonUrl": "UseStudioUserDiskDiv", "ApplicaitonImg": { "x": -16, "y": -20} },
- // { "ApplicationID": "1e0742d8-737e-46e2-b03b-2f23ca8c1f17", "UserDirectoryID": "", "ApplicationName": "博客", "ApplicaitonUrl": "UseStudioBlogSystemDiv", "ApplicaitonImg": { "x": -88, "y": -20} },
- // { "ApplicationID": "8989bc55-6f36-44e8-8b1b-cc18486cf140", "UserDirectoryID": "", "ApplicationName": "论坛", "ApplicaitonUrl": "UseStudioStudyControlDiv", "ApplicaitonImg": { "x": -160, "y": -20} },
- // { "ApplicationID": "0085d7d9-a5aa-4785-b914-05136e3f4bf0", "UserDirectoryID": "", "ApplicationName": "应用", "ApplicaitonUrl": "US_Manage_App_Mark", "ApplicaitonImg": { "x": -160, "y": -92} },
- // { "ApplicationID": "0d0686f0-b3df-429b-a586-db5899118ec5", "UserDirectoryID": "", "ApplicationName": "便签", "ApplicaitonUrl": "mouseroverNote", "ApplicaitonImg": { "x": -232, "y": -92} },
- // { "ApplicationID": "", "UserDirectoryID": "", "ApplicationName": "文档编辑", "ApplicaitonUrl": "US_Word", "ApplicaitonImg": { "x": -232, "y": -20} },
- // { "ApplicationID": "", "UserDirectoryID": "", "ApplicationName": "工作表", "ApplicaitonUrl": "US_Excel", "ApplicaitonImg": { "x": -232, "y": -20} },
- // { "ApplicationID": "6DB2FD18-B8E0-075A-605F-F3FB928FE7AB", "UserDirectoryID": "", "ApplicationName": "购物", "ApplicaitonUrl": "UM_GW", "ApplicaitonImg": { "x": -232, "y": -20} },
- // { "ApplicationID": "5312340d-a802-a8c6-f80a-000000000000", "UserDirectoryID": "", "ApplicationName": "积分中心", "ApplicaitonUrl": "UD_DK_IC", "ApplicaitonImg": { "x": -232, "y": -20} },
- // { "ApplicationID": "6DB2FD18-B8E0-075A-605F-000000000000", "UserDirectoryID": "", "ApplicationName": "Use聊", "ApplicaitonUrl": "Chat", "ApplicaitonImg": { "x": -232, "y": -20} },
- // { "ApplicationID": "DA0EEA4E-AD61-4F2A-8DB1-3ADF0A506C86", "UserDirectoryID": "", "ApplicationName": "在线编程", "ApplicaitonUrl": "UD_PG", "ApplicaitonImg": { "x": -232, "y": -20} }
- // ]);
-
- // 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)]; }
- // _UDE = this.OAT[_UTP]; _UL = _UDE.l; U.UF.EV.stopDefault();
- // 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)]; }
- // if (_UCE) {
- // if (!win.getSelection) { //老ie处理
- // 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); } }
- // 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 = "";
- // }
- // }
- ////------------------------------------------------------------------------桌面应用数据源的操作--------------------------------------------------------------
- //Namespace.register("U.MD.D.T"); //桌面数据源命名空间
- //U.MD.D.D.News; //学习系统帖子的全局
- //U.MD.D.DestopStr; //桌面图标的json
- //U.MD.D.icon_list; //桌面图标
- ////数据源操作的接口
- //U.MD.D.D.SF = function (name, term) {
- // switch (name) {
- // case "AddNews":
- // U.MD.D.D.AddNews(term);
- // break;
- // case "GetNews":
- // return U.MD.D.D.GetNews(term);
- // break;
- // case "GetIc":
- // return U.MD.D.D.GetDI(term);
- // break;
- // case "AddTG": //插入新闻
- // break;
- // default: break;
- // }
- //}
- ////---------------------------------------------------------------------------新闻的操作----------------------------------------------------------------
- ////添加学习系统的新闻
- //U.MD.D.D.AddNews = function (term) {
- // U.MD.D.D.News = term;
- //}
- ////获取学习系统的新闻
- //U.MD.D.D.GetNews = function (term) {
- // var _NL = [];
- // if (U.MD.D.D.News) {
- // for (var i = 0; i < U.MD.D.D.News.length; i++) {
- // if (U.MD.D.D.News[i].PublishedDirectoryID == term[0]) {
- // _NL.push(U.MD.D.D.News[i]);
- // }
- // }
- // return _NL;
- // }
- //}
- ////-----------------------------------------------------------------------通知通告操作--------------------------------------------------------------------
- ////----------------------------------------------------------------------------------桌面图标的操作-----------------------------------------------------------
- //U.MD.D.D.GetDI = function (term) {
- // var _UIC = US.userInfo["icon"] || U.MD.D.DestopStr;
- // for (var i = 0; i < _UIC.length; i++) {
- // if (_UIC[i].ApplicationID == term[0]) { return _UIC[i]; }
- // }
- //}
- ////用户互动的类
- //U.MD.D.D.CII = function (ET) {
- // this.newid = ET[0];
- // this.UserId = ET[1];
- // this.UserName = ET[2];
- // this.UserThumbnailImageHead = ET[3];
- // this.NEWTYPE = ET[4];
- // this.NEWT = ET[5];
- // this.NEWC = ET[6];
- // this.Time = ET[7];
- // this.ET = ET[8];
- //}
- //获取客户端各种信息
- U.UF.CI.GCInfo = function () {
- U.UF.CI.IEedition(); //获取可无端信息
- }
- //判断IE浏览器版本,是否下载最新IE,chrome,firefox
- U.UF.CI.IEedition = function () {
- var _UDE = U.UF.CI.getBrowser(), _UCE = U.UF.CI.getSystem();
- if ((_UDE.browser == "msie" && Number(_UDE.ver) < 7) || _UDE.browser == "firefox") { U.selectEl("#UD_CI_getBrowser")[0].style.display = "block"; } //提示浏览器升级
- else if ("iphone,ipad".indexOf(_UDE.browser) > -1) { U.UF.CI.Ipad(); } //苹果事件
- if (_UCE.indexOf("win") > -1) { U.UF.CI.Win(_UDE, _UCE); } //如果是win系列的升级
- }
- //如果是windows系列
- U.UF.CI.Win = function (UBE, UCE) {
- if (!browser.lb && UBE.browser == "msie" && UBE.ver != "10.0") {//提示用户安装
- _UHF = US.FILESYSTEMURL + "c181e980-d781-4fef-bb45-a3ccabdd911a.msi"; _UIH = "云端";
- U.UF.CI.WinDIs(_UHF, _UIH); //用户显示提示
- // 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"; } }
- // 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" } }
- }
- }
- //用户显示提示
- U.UF.CI.WinDIs = function (UHF, UIH) {
- var _UDOD = $$("div", { "id": "UD_CI_BAlert", "className": "UD_CI_BAlert" });
- $$("div", { "className": "UD_CI_Warn" }, _UDOD);
- $$("div", { 'className': 'UD_CI_Text', "innerHTML": "您使用的浏览器版本过低建议您下载" }, _UDOD);
- $$("a", { "className": "UD_CI_DL", "href": UHF, "innerHTML": UIH }, _UDOD); //安装的链接
- $$("a", { "className": "UD_CI_Text_Click", "href": "javascript:void(0);", "onclick": U.UF.C.apply(_UDOD, "retElement.style.display = 'none';"), "innerHTML": "我知道了" }, _UDOD);
- U.selectEl("body").append(_UDOD); setTimeout(function(){U.UF.CI.SetUserD(_UDOD);}, 10000);
- }
- //提示用户安装浏览器的定位
- U.UF.CI.SetUserD = function (UDOD) {
- U.selectEl(UDOD).addAttrArray({ "style": { "display": "block"} }).animate({ "top": "80px", "left": US.width / 1.7 + "px" }, 400);
- }
- //浏览器下载接口
- U.UF.CI.XZWin = function (UFSN, UDN) {
- 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 );
- }
- //如果是ipad,固定横屏,禁止放大的功能在html元素的css中。
- U.UF.CI.Ipad = function () {
- document.ontouchmove = U.UF.EV.stopDefault; //阻止浏览器默认变大变小动作
- }
- //下一个节点
- U.UF.C.nextSibling = function (obj) {
- while (obj.nextSibling.nodeType != 1) {
- obj = obj.nextSibling;
- }
- return obj.nextSibling;
- 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"];
- for (i = 0; i < _UAE.length; i++) { _UAE[i] = U.selectEl("#U_E_A" + _UAE[i])[0]; }
- if (_UGE["OL"]) { U.OU.Onload("Excel", _UAE.slice(0, 4), _UAE); _UGE["OL"] = false; U.MD.O.E.SetWH(); } //初始化工具
- U.MD.O.E.CNO(); _UDSD.onclick = function(){U.MD.O.E.CSave([parent.U.UF.F.closeWindow, [_UDOD,"remove"]]);}; //生成页面 //设置关闭保存
- document.body.focus(); document.onmousedown = document.onclick = U.MD.O.E.YCCD; //页面聚焦 //菜单屏蔽
- }
- // var _UDAD, TF = false, _AIMG = this.AIMG.length != null ? this.AIMG[this.I] : this.AIMG;
- // 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; } }
- // 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); } //
- // if (fun === true) { (!TF) && (_UDAD = this.AddE(_AIMG)); } else { _UDAD = fun(); } //图片显示缓冲
- // (!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"]);})); //图片加载处理
- // 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];
- // for (i = 0; i < UDE.length; i++) {
- // _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]]);}; ;
- // _UKE.length = 0; _UCE[0] = _UDAD; for (k = 0; k < i + 1; k++) { _UKE.push($("img", _UCE[k][0])[0] || $$("img", {}, _UCE[k][0])); }; //需要添加头像
- // _UDOD = U.selectEl(_UKE).addAttrArray({ "onerror": U.MD.C.imgError, "alt": (_UIF.UserNickName || _UIF.UserName), "title": "点击查看", "src": U.MD.C.getHeadImage(_UIF.UserThumbnailImageHead) })[0];
- // _UDCD = U.selectEl(_UDAD[1]).Child(); _UDCD[0].innerText = _UIF.UserIndividualitysignature || "暂时没有填写个人介绍..."; _UDXD[1].innerText = _UDCD[1].innerText = (_UIF.UserNickName || _UIF.UserName);
- // 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); }
- // }
- ////初始化Word
- //U.MD.O.W.OnLoad = function (UDE) {
- // 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"];
- // for (i = 0; i < _UAE.length; i++) { _UAE[i] = U.selectEl("#U_E_A" + _UAE[i])[0]; }; U.OU.TF["TF"] = "Word"; //初始化指定的值
- // (UDE) && (U.MD.O.W.WDJ()); UDOD.innerText = ""; //打印文档级联
- // 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; } //初始化工具和需要隐藏的工具区域
- // if (UDE.UserFilesID != null) { U.OU.SCJD((UDE && UDE.UsOffice) ? $$("div", { "innerHTML": " " }, UDOD) : UDOD, (UDE && UDE.UsOffice) ? UDE.UsOffice : "", U.MD.O.W.TYHD); UDOD.contentEditable = true; } else { UDOD.contentEditable = false; } //添加text值
- // _UDSD.onclick = function(){U.MD.O.W.CSave([parent.U.MD.D.T.PopupWinClose, [_UDCD]]);}; //设置关闭
- // _UDTD.innerText = (UDE && UDE.UserallDirectoryName) ? UDE.UserallDirectoryName : "未命名文档"; //打开的文件名
- //}
- //动画特效
- //图片淡入淡出,滑进滑出效果。模仿jquery。主要是为抛弃jquery,mode为1表示slidedown,mode为0表示slideup
- U.UF.IMG.Animate = function (id) { return new U.UF.IMG.AnimateD(id); }
- U.UF.IMG.AnimateD = function (id) {
- this.itime = 0; //计时器时间
- this.mode = 1;
- this.maxHeight = 0;
- this.timer = null; //用于停止timeout
- this._BV = null; //获取浏览器版本
- this.obj = this.initial(id); ; //传入结点id
- }
- ////--------------------------------------有思工作室动态装载js-----------------------------------------------
- ////js文件放在head中,属于同步加载,head没加载完毕,不会执行...然而试验了很多次同步加载的方法。居然没有一种方法可行。哎。
- ////此函数相当于jquery的异步加载,但比jquery更好用,更符合传统编程。
- //
- ////异步加载js和css,url为需要加载的链接地址,T为类型,比如js,css等,CB为加载后执行的回调函数。
- //U.UF.DL.asynLoadJs = function (UURL, TF, cb, UTE, UIB) {
- // var i, _USD, _UASD, _UHD = U.selectEl("head", document)[0]; //获取head部
- // if (TF == "js") { _UASD = U.selectEl("script", document); _USD = $$("script", (UTE || { "src": UURL, "type": "text/javascript", "language": "javascript", "charset": "utf-8" })); } //js的异步创建
- // else if (TF == "link") { _UASD = U.selectEl("link", document); _USD = $$("link", { "href": UURL, "type": "text/css", "rel": "stylesheet" }); }
- // for (i = 0; i < _UASD.length; i++) { if (_UASD[i].src == UURL) { TF = false; if (!UIB) { _USD = _UASD[i]; } break; } } //如果已经加载完了
- // (TF || UIB) && (_UHD.insertBefore(_USD, _UHD.firstChild)); (cb) && (U.UF.DL.iframeLoad(_USD, cb)); //添加到头部 //异步处理
- // return true;
- //}
- ////备注:楚王辉 还差一个在Div中的innerhtml属性中加载外部js的方法。
- ////iframe加载完毕异步
- ////I参数可以试iframe 可以是需要加载的img js等等 AsynF是回调函数 AsynF=[[回调函数名,[回调参数]],[回调函数名,[回调参数]].........]
- //U.UF.DL.iframeLoad = function (UIF, cb) {
- // try { var _UCP = UIF.complete, _URS = UIF.readyState; } catch (e) { }
- // if (_UCP == "complete" && ((_URS == "complete" || _URS == "loaded") || _URS == null)) { function(){cb();}(); return; }
- // else {
- // (UIF.onreadystatechange) && (cb = U.UF.C.apply(UIF, [[UIF.onreadystatechange], [cb]]));
- // UIF.onreadystatechange = function(){U.UF.DL.AILD(UIF, cb);};
- // }
- // return UIF;
- //}
- U.UF.IMG.AnimateD.prototype = {
- initial: function (id) { //U.Json构造函数,目的是和jqery区别。
- this._BV = U.UF.CI.getBrowser().ver; //获取浏览器版本
- return "string" == typeof (id) ? document.getElementById(id) : id;
- },
- //横屏切换效果,元素s从左到右逐渐放大,元素d从左向右逐步缩小,并最终消失。
- LScreenSwitch: function (s, d, cb) {
- s.style.height = document.body.clientHeight + "px"; //把高度置为最高,宽度从0到最大。
- s.style.left = s.style.width = 0 + "px";
- d.style.width = document.body.clientWidth + "px";
- //s.style.display = "block";
- var that = this; //setInterval里面的变量必须用that取代。
- this.timer = setInterval(function () { that.sstimer(s, d, cb); }, 32);
- },
- sstimer: function (s, d, cb) {
- if (parseInt(s.style.width) < document.body.clientWidth) {
- d.style.left = s.style.width = parseInt(s.style.width) + 100 + "px";
- var w = parseInt(d.style.width) - 100;
- w > 0 ? d.style.width = w + "px" : d.style.width = "0px";
- }
- else {
- s.style.width = document.body.clientWidth + "px";
- d.style.width = "0px";
- d.style.left = "0px";
- clearInterval(this.timer);
- cb();
- }
- },
- //横屏切换效果,从右到左逐渐放大,上面一个函数的反向函数
- RScreenSwitch: function () {
- },
- slideDown: function () {
- if (parseInt(this.obj.style.height) > this.maxHeight) { this.mode = 0; return; };
- this.obj.style.height = parseInt(this.obj.style.height) + 2 + 'px';
- this.timer = setTimeout("U.UF.IMG.Animate()", this.itime);
- },
- slideUp: function () {
- if (parseInt(this.obj.style.height) < 2) { this.mode = 1; return; };
- this.obj.style.height = parseInt(this.obj.style.height) - 2 + 'px';
- var repeat = "U.UF.IMG.Animate()";
- this.timer = setTimeout(repeat, this.itime);
- },
- slide: function (objid, itime, mode) { //统一调用slide,自动区分down或者up
- clearTimeout(this.timer);
- this.obj = this.initial(objid);
- this.itime = itime;
- if (mode) {
- this.maxHeight = this.maxHeight ? this.maxHeight : parseInt(this.obj.style.height);
- this.obj.style.display = "block";
- this.obj.style.height = "0px";
- this.slideDown();
- }
- else this.slideUp();
- },
- fade: function (objid, itime, io, callback)//淡入淡出,io代表淡入或者淡出
- {
- this.obj = this.initial(objid);
- this.itime = itime;
- var that = this;
- this.maxHeight = parseInt(this.obj.style.height) | parseInt(this.obj.clientHeight); //此句可以不要?以后再优化。
- var i = io ? 100 : 0; //循环开始变量如果是淡入为100,淡出为0。
- var z = io ? 0 : 100; //循环结束变量,淡入为0,淡出为100。
- var v = (_BV == "7.0" || _BV == "8.0") ? 0.1 : 0.05; //浏览器判断,ie为chrome的20倍速。
- var b = io ? -100 * v : 100 * v; //步长,淡入为负数,淡出为正数。
- var timer = setInterval(function () {
- //清除计时器,如果有回调,执行回调函数
- if (i == z) { clearInterval(timer); if (typeof callback == "function") { callback(); } }
- i += b;
- that.obj.style.filter = "alpha(opacity=" + i + ")";
- that.obj.style.MozOpacity = i * v;
- that.obj.style.opacity = i * v;
- that.obj.style.height = that.maxHeight + "px";
- }, that.itime);
- },
- fadeIn: function (objid, itime, callback) { //淡入
- this.fade(objid, itime, true, callback);
- },
- fadeOut: function (objid, itime, callback) { //淡出
- this.fade(objid, itime, false, callback);
- }
- }
- //前一个节点
- U.UF.C.previousSibling = function (obj) {
- while (obj.previousSibling.nodeType != 1) {
- obj = obj.previousSibling;
- }
- return obj.previousSibling;
- }
- AddE: function (AIMG) {//创建默认的图片浏览器
- var _UIOD, _UIUD, _UICD, _UITD, _UIID, _useridA, _UIPA, _UICA, _UIYA, _UISA;
- //创建相框
- 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 ++} });
- $$("div", { "onmousedown": function(){U.UF.EV.stopBubble], [U.UF.F.DragMouseDown(_UIOD);}, "className": "U_Img_Move", "title": "移动相框" }, _UIOD);
- _UICD = $$("div", { "className": "U_Img_Operate UTransition", "onselectstart": function(){} }, _UIOD);
- _UITD = $$("div", { "className": "U_Img_Info", "onmousedown": function(){U.UF.EV.stopBubble], [this.MoveScroll("retElement", this);}, "style": { "maxHeight": (US.height - 80) + "px"} }, _UIOD);
- _UIUD = $$("div", { "style": { "overflow": "hidden", "margin": "auto", "width": "120px", "height": "120px"} }, _UITD);
- this.UIMG = _UIID = $$("img", { "NowRotate": "0", "src": AIMG["Thm"], "onerror": function(){U.MD.C.imgError(this, 1);} }, _UIUD);
- _useridA = $$("a", { "style": { "marginLeft": "20px" }, "onclick": function(){U.UF.EV.stopBubble], [this.Zoom("In", _UIOD, this);} }, _UICD);
- $$("i", { "className": "U_ImgPic zoomIn" }, _useridA);
- $$("div", { "innerHTML": "放大" }, _useridA);
- $$("a", { "title": "点击100%比例", "onclick": function(){U.UF.EV.stopBubble], [this.Zoom(100, _UIOD, this);}, "innerHTML": "100%" }, _UICD);
- _UIPA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Zoom("Out", _UIOD, this);} }, _UICD);
- $$("i", { "className": "U_ImgPic zoomOut" }, _UIPA);
- $$("div", { "innerHTML": "缩小" }, _UIPA);
- _UICA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Rotate(1, _UIOD, this);} }, _UICD);
- $$("i", { "className": "U_ImgPic Lrotate" }, _UICA);
- $$("div", { "innerHTML": "左转" }, _UICA);
- _UIYA = $$("a", { "onclick": function(){U.UF.EV.stopBubble], [this.Rotate(-1, _UIOD, this);} }, _UICD);
- $$("i", { "className": "U_ImgPic Rrotate" }, _UIYA);
- $$("div", { "innerHTML": "右转" }, _UIYA);
- $$("div", { "className": "U_ImgPic U_Img_Close UTransition", "style": { "cssText": "float:right;" }, "onclick": [this.Close, [_UIOD, this, true]] }, _UICD);
- if (this.AIMG.length) {
- $$("div", { "className": "U_Img_Prev U_Img_Change U_Img_transition U_ImgPic", "onclick": function(){U.UF.EV.stopBubble], [this.Change(-1, this);} }, _UIOD);
- $$("div", { "className": "U_Img_Next U_Img_Change U_Img_transition U_ImgPic", "onclick": function(){U.UF.EV.stopBubble], [this.Change(1, this);} }, _UIOD);
- }
- U.selectEl(_UIID).addAttrArray({ "style": { "filter": "alpha(opacity=30)", "MozOpacity": "0.3", "Khtml-opacity": "0.3", "opacity": "0.3"} });
- document.body.appendChild(_UIOD); U.UF.F.windowTopCenter(_UIOD); return [_UIOD, _UIID]; //加入页面和居中弹框
- },
- // USE = USE || doc; UD = UD || doc; //设置选择初值
- // if (typeof USE === "string") {//如果选择符是字符串
- // var k, i, j, _UDE, _UDT, _UCA, _UNCA, _UME = USE.split(","), _UNC = /[~|#|.|&|:|>|@|*|=]/g, _UC = /[^(~|#|.|&|:|>|@|*|=)]+/g; //定义变量区域
- // for (k = 0; k < _UME.length; k++) {
- // USE = _UME[k]; _UNCA = (USE.match(_UNC) || []); _UCA = USE.match(_UC) || ["*"]; (_UCA.length > _UNCA.length) && (_UNCA.unshift(""));
- // for (i = 0; i < _UCA.length; i++) {
- // switch (_UNCA[i]) {
- // case "~": _UDE = UD.getElementsByName(_UCA[i]); break; //获取name属性获取
- // case "#": _UDE = _UDE == null ? doc.getElementById(_UCA[i]) : _UDE[_UCA[i]]; break; //根据id获取
- // case ".": //根据className获取
- // if (UD.getElementsByClassName) { _UDE = UD.getElementsByClassName(_UCA[i]); } //HTML5选择器
- // else if (document.querySelectorAll) { _UDE = UD.querySelectorAll("." + _UCA[i]); } //支持ie8选择器
- // else {//原始选择器
- // _UDE = UD.length != null ? UD : UD.getElementsByTagName("*"); var _UDT = [];
- // for (j = 0; j < _UDE.length; j++) { (_UDE[j].className == _UCA[i]) && (_UDT.push(_UDE[j])); };
- // _UDE = _UDT;
- // }
- // break;
- // case "": case "&": _UDE = (_UDE || UD).getElementsByTagName(_UCA[i]); break; //根据标签获取
- // case ":": //获取tr标签选择
- // _UDE = UD.getElementsByTagName("tr"); _UDT = [];
- // if (_UDE.length) {
- // for (j = 0; j < _UDE.length; j++) {
- // if (_UCA[i] == "even" && j % 2 == 0) { _UDT.push(_UDE[j]); }
- // else if (j % 2 != 1) { _UDT.push(_UDE[j]); }
- // }
- // _UDE = _UDT;
- // }
- // break;
- // case "@": //根据自定义属性选择
- // _UDE = _UDE || UD.getElementsByTagName('*'); _UDT = [];
- // for (j = 0; j < _UDE.length; j++) {//筛选出包含这属性的元素
- // 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]); } }
- // else { if (_UDE[j].getAttribute(_UCA[i]) != null) { _UDT.push(_UDE[j]); } }
- // }
- // _UDE = _UDT;
- // break;
- // case "*": //获取外加载控件
- // if (document.embeds && (_UDE = document.embeds[_UCA[i]])) { }
- // else if ((_UDE = window.document[_UCA[i]])) { }
- // else { _UDE = doc.getElementById(_UCA[i]); }
- // break;
- // default: break;
- // }
- // }
- // }
- // }
- // else { _UDE = USE; }
- // if (_UDE && !(_UDE instanceof Array && _UDE[0] == null)) {//选择器选择有值
- // if (_UDE.length == null || _UDE.id != null) { _UDE = [_UDE]; }
- // for (i = 0; i < _UDE.length; i++) { this[i] = _UDE[i]; (_UDE[i].id != "") && (this[_UDE[i].id] = _UDE[i]); } //添加选择器选择元素
- // this.context = UD; this.length = _UDE.length;
- // }
- // return this;
- //-----------------------------------------------------------------------加载音乐播放器--------------------------------------------------------------------------
- ////点击后加载播放器的flash
- //U.UF.MPlayer.Onload = function () {
- // try {
- // var _UDOD = U.selectEl("#U_MP_PFlash")[0];
- // if (_UDOD) {
- // 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>'; }
- // U.UF.MPlayer.UMPL = U.selectEl("#U_MPMCDPO")[0]; //进度显示的时间
- // U.UF.MPlayer.UMPP = U.selectEl("#U_MPMGDT")[0]; //进度条缓存的父亲元素
- // U.UF.MPlayer.UM = U.selectEl("*U_MP_MPFlash")[0]; //播放器
- // }
- // } catch (e) { }
- //}
- ////加载列表:传入列表Json
- ////Json规范{ "列表名": { "歌名": "歌曲URL","歌名": "歌曲URL"},"列表名": { "歌名": "歌曲URL","歌名": "歌曲URL"} }
- //U.UF.MPlayer.Open = function (J, D, OM) {//directories是目录文件夹
- // 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];
- // _UDFD.innerText = _UDTD.innerText = ""; _UDGD.style.display = "block"; U.UF.F.windowTopCenter(_UDOD);
- // U.selectEl("#U_MPLT")[0].onclick = function(){U.UF.MPlayer.MOM(US.disk.UserDisk[1][2]);};
- // 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]] }); //头像
- // U.selectEl("span", _UDSD)[0].innerHTML = US.disk.UserDisk[1][0].UserNickName; //名字
- // U.MD.DK.SetMDF((US.friend.friends || []), U.selectEl("#U_MPFF")[0]); //打印自己音乐好友
- // if (J[1].length == 0 && D.length == 0) { $$("div", { "className": "U_MPP U_MP_IMG" }, _UDTD); } //无音乐列表
- // else { U.UF.MPlayer.AddM(J, D, _UDTD, OM); } //添加音乐列表
- // 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); //创建任务栏链接
- //}
- ////添加音乐文件文件
- //U.UF.MPlayer.AddM = function (J, D, ML, OM) {
- // var i, _UOOD, _UDPD, _UDTD, _UDSD, _UDFD = $$("frag");
- // if (J[0].UserDirectoryID != US.MUSICEFOLDERID) {
- // _UOOD = $$("div", { "className": "U_MPLB" });
- // _UDPD = $$("div", { "className": "U_MPLBT", "onclick": function(){U.UF.EV.stopBubble], [U.UF.MPlayer.ListShrink("this.parentNode");} }, _UOOD);
- // $$("div", { "className": "U_MPLBA U_MPLBAO U_MP_IMG" }, _UDPD);
- // $$("div", { "className": "U_MPLBM", "innerHTML": J[0].UserallDirectoryName + "(" + J[1].length + ")" }, _UDPD);
- // $$("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);
- // _UDTD = $$("div", { "className": "U_MPLBT", "style": { "cssText": "width:100%;float:left;"} }, _UOOD);
- // ML.appendChild(_UOOD);
- // }
- // else { _UDTD = ML; }
- // for (i = 0; i < J[1].length; i++) {
- // _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);
- // $$("div", { "className": "U_MPLBNB U_MP_IMG", "innerHTML": (i + 1).prefixInteger() }, _UDSD);
- // $$("div", { "className": "U_MPLBNC", "innerHTML": J[1][i].UserallDirectoryName }, _UDSD);
- // $$("div", { "className": "U_MPLBNS", "innerHTML": "00:00" }, _UDSD);
- // if (J[1][i].UserDirectoryID == OM) { setTimeout(_UDSD.ondblclick, 1000); }
- // }
- // _UDTD.appendChild(_UDFD);
- // for (var j = 0; j < D.length; j++) { U.UF.MPlayer.AddM(D[j][0], D[j][1], _UDTD); } //循环打印音乐
- //}
- ////列表收缩或张开
- //U.UF.MPlayer.ListShrink = function (UDOD) {
- // var _UDAD = U.selectEl("div", UDOD);
- // var _TF = ["none", "U_MPLBA U_MPLBAC U_MP_IMG"];
- // if (_UDAD[4].style.display == "none") { _TF = ["block", "U_MPLBA U_MPLBAO U_MP_IMG"]; }
- // _UDAD[4].style.display = _TF[0];
- // _UDAD[1].className = _TF[1];
- //}
- ////加载音乐
- //U.UF.MPlayer.loadAplay = function (SO, UDK, userid) {
- // 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);
- // _UFAD[1].style.width = _UFAD[0].style.width = _UFAD[2].style.left = "0px";
- // U.selectEl("#U_MPMCDD")[0].innerHTML = U.UF.MPlayer.UMPL.innerHTML = "00:00";
- // U.selectEl("div", U.UF.MPlayer.UMPP.parentNode)[0].innerHTML = UDK.UserallDirectoryName;
- // U.selectEl("#U_MPMCDP")[0].className = "U_MPMCDP U_MPMCDPC U_MP_IMG";
- // //停止所有的播放的样式
- // if ((U.UF.MPlayer.UMMP) && (_UFMS = U.UF.MPlayer.UMMP[0])) {
- // _UFMS.style.color = "#767676";
- // U.selectEl("div", _UFMS).addAttrArray({ "className": "U_MPLBNB U_MP_IMG", "innerHTML": U.UF.MPlayer.UMMP[1] }, 0);
- // }
- // else { U.UF.MPlayer.UMMP = []; }
- // //播放音乐的样式
- // U.UF.MPlayer.UMMP[0] = SO; //正在播放的元素
- // U.UF.MPlayer.UMMP[1] = U.selectEl("div", SO)[0].innerHTML; //播放的序号
- // SO.style.color = "#6da6e0";
- // U.selectEl("div", SO).addAttrArray({ "className": "U_MPLBNB U_MPLBNBI U_MP_IMG", "innerText": "" }, 0);
- // U.selectEl("#U_MPMXZL")[0].onclick = function(){U.UF.MPlayer.LMGM(userid, UDK, SO);}; //收藏音乐
- // U.selectEl("#U_MPMXZR")[0].onclick = function(){U.UF.MPlayer.DMGM(userid, UDK, SO);}; //删除音乐
- //}
- ////-----------------------------------------------------------------------------加载音乐的功能----------------------------------------------------------------------
- ////flash听完一首后直接下一首
- //U.UF.MPlayer.PNM = function (T) {
- // setTimeout($("#U_MPMCDA")[0].onclick, 1000); //flash需要延迟1秒执行下一首才有效
- //}
- ////上下一首
- //U.UF.MPlayer.PNMO = function (T) {
- // var _TF = U.UF.MPlayer.TF;
- // if (_TF == "L") { U.UF.MPlayer.PNMOM(T); } //列表播放模式
- // else if (_TF == "R") { U.UF.MPlayer.Shuffle(); } //随机播放模式
- // else { U.UF.MPlayer.REMOM(); } //单曲循环模式
- //}
- ////随机播放
- //U.UF.MPlayer.Shuffle = function () {
- // var _UFMP = U.selectEl("span", U.selectEl("#U_MPLB")[0]);
- // var _EP = U.UF.Math.getRandom(_UFMP.length);
- // _UFMP[_EP - 1].ondblclick();
- //}
- ////播放上下首
- //U.UF.MPlayer.PNMOM = function (T) {
- // var i, _UMMD, _UFM = U.selectEl("#U_MPLB")[0]; _UFMP = U.UF.MPlayer.UMMP[0], UFMPL = U.selectEl("span", _UFMP.parentNode);
- // for (i = 0; i < UFMPL.length; i++) {//循环判断找到正在播放的歌典
- // if (UFMPL[i] == _UFMP) {//找到当前播放的哪一首
- // _UMMD = _UFMP;
- // if ((i == UFMPL.length - 1) && T == 1) { _UMMD = UFMPL[0]; } //如果是最后一首就回到第一首歌
- // else if (UFMPL[i + T] != null) { _UMMD = UFMPL[i + T]; }
- // _UMMD.ondblclick();
- // return;
- // }
- // }
- //}
- ////单曲循环
- //U.UF.MPlayer.REMOM = function () {
- // U.UF.MPlayer.UMMP[0].ondblclick();
- //}
- ////播放或暂停
- //U.UF.MPlayer.pauseOstart = function () {
- // var _UMPP = U.selectEl("#U_MPMCDP")[0];
- // var _TF = U.UF.MPlayer.UM.pauseOstart(); //判断是否在播放音乐
- // if (_TF == false) { _UMPP.className = "U_MPMCDP U_MPMCDPO U_MP_IMG"; }
- // else { _UMPP.className = "U_MPMCDP U_MPMCDPC U_MP_IMG"; }
- //}
- ////---------------------------------------------------------进度条
- ////拉动进度条
- //U.UF.MPlayer.Posmove = function (SO) {
- // U.UF.MPlayer.IsUpPos = false;
- // var _UDMP = U.selectEl("div", SO.parentNode);
- // document.onmousemove = function () {
- // if (!U.UF.MPlayer.IsUpPos == true) {
- // SO.setCapture(); //聚焦
- // var _E = U.UF.C.GetMousep(); //获取鼠标的位置
- // var _PTX = U.UF.M.pageXY(SO.parentNode); //获取相对的位置
- // var _TL = _UDMP[1].clientWidth; //缓存长度
- // var _L = event.clientX - _PTX[1]; //移动的位置
- // if (_L < _TL && _L > 0) {
- // SO.style.left = _L + "px";
- // _UDMP[0].style.width = (_L + 2) + "px";
- // }
- // }
- // }
- // document.onmouseup = function () {
- // U.UF.MPlayer.SkipTo((parseInt(SO.style.left)) / 225); //跟换播放的进度
- // U.UF.MPlayer.IsUpPos = true; //允许播放更新
- // SO.releaseCapture(); //释放焦点
- // document.onmouseup = document.onmousemove = null; //取消
- // }
- //}
- ////进度条
- //U.UF.MPlayer.SkipTo = function (PNSO) {
- // U.UF.MPlayer.IsUpPos = false;
- // var _UPER, _UPOD = U.selectEl("div", U.UF.MPlayer.UMPP), _TL = _UPOD[1].clientWidth; //缓存长度
- // if (typeof PNSO == "number") { _UPER = PNSO; } //如果是数字直接更新时间
- // else {
- // _UPER = (event.clientX - parseInt(PNSO.getBoundingClientRect().left));
- // if (_TL > _UPER) {//判断是否更新到指定的进度位置
- // _UPOD[0].style.width = (_UPER + 2) + "px";
- // _UPOD[2].style.left = _UPER;
- // _UPER = _UPER / 225;
- // }
- // }
- // if (_TL > parseInt(_UPER * 225)) { U.UF.MPlayer.UM.SkipTo((parseInt(U.UF.MPlayer.Time) / 1000) * _UPER); }
- // U.UF.MPlayer.IsUpPos = true;
- //}
- ////音乐播放的总时间
- //U.UF.MPlayer.GD = function () {
- // U.UF.MPlayer.Time = U.UF.MPlayer.UM.getDuration();
- // var Duration = Math.round(U.UF.MPlayer.Time / 1000); //获取音乐播放的时间
- // U.selectEl("div", U.UF.MPlayer.UMMP[0])[2].innerHTML = U.selectEl("#U_MPMCDD")[0].innerHTML = (parseInt(Duration / 60)).prefixInteger() + ":" + (parseInt(Duration % 60)).prefixInteger(); //音乐播放时间显示
- //}
- ////-----------------------------------------------------------flash每秒的更新
- ////更新下载的进度
- //U.UF.MPlayer.ULD = function (LD) {
- // var _UDTD = U.selectEl("div", U.UF.MPlayer.UMPP)[1];
- // _UDTD.style.width = LD + "%";
- //}
- ////播放时间的更新和播放进度的更新
- //U.UF.MPlayer.UPT = function (P, PT, LD) {
- // U.UF.MPlayer.Time = PT;
- // var _UMPF = U.UF.MPlayer.UM, _L = Math.ceil(P / PT * 225);
- // if (U.UF.MPlayer.IsUpPos) {
- // if (_UMPF.getStatus() && U.UF.MPlayer.IsP) {
- // if ((LD * 2.25) >= _L) {
- // var _UDOD = U.selectEl("div", U.UF.MPlayer.UMPP);
- // _UDOD[0].style.width = _L + 2 + "px";
- // _UDOD[2].style.left = _L + "px";
- // U.UF.MPlayer.UMPL.innerText = (parseInt(P / 1000 / 60)).prefixInteger() + ":" + (parseInt(P / 1000 % 60)).prefixInteger();
- // }
- // else { _UMPF.pauseOstart(); U.UF.MPlayer.IsP = false; } //暂停缓冲
- // }
- // else {
- // if ((LD * 2.25 - 5) > _L && U.UF.MPlayer.IsP == false) {
- // _UMPF.pauseOstart(); //播放
- // U.UF.MPlayer.IsP = true;
- // }
- // }
- // }
- //}
- ////---------------------------------------------播放器声音调整
- ////调节音量大小
- //U.UF.MPlayer.setVol = function (Vol) {
- // U.UF.MPlayer.UM.setVol(Vol);
- //}
- ////调节声音大小的
- //U.UF.MPlayer.volumeMove = function (SO) {
- // var _UFMD = U.selectEl("div", SO.parentNode.parentNode);
- // document.onmousemove = function () {
- // SO.setCapture(); //聚焦
- // U.UF.MPlayer.OVM(SO, _UFMD[_UFMD.length - 2], _UFMD[_UFMD.length - 4]); //调节
- // }
- // document.onmouseup = function () {
- // SO.releaseCapture(); //释放焦点
- // document.onmouseup = document.onmousemove = null;
- // }
- //}
- ////点击调节音乐大小
- //U.UF.MPlayer.OVM = function (SO, TSO, MSO) {
- // var _L = event.clientX - SO.parentNode.getBoundingClientRect().left;
- // if (_L >= 0 && _L <= 48) {
- // SO.style.left = _L + "px";
- // TSO.style.width = (_L + 2) + "px";
- // _L = Math.round(_L * (100 / 48) * 2); //声音的大小
- // SO.title = _L; //声音大小显示
- // if (_L == 0) { U.UF.MPlayer.mute(MSO); } //静音
- // else { MSO.className = "U_MPMCDH U_MPMCDHH U_MP_IMG"; U.UF.MPlayer.setVol(_L); } //调整声音
- // }
- //}
- ////静音与非静音状态
- //U.UF.MPlayer.mute = function (SO) {
- // var _UFMD = U.selectEl("div", SO.parentNode);
- // var _UFC = SO.className;
- // var _UFPD = _UFMD[_UFMD.length - 1];
- // _L = _UFPD.offsetLeft;
- // if (_UFC.indexOf("U_MPMCDHH") > -1) {//静音
- // _L = 0;
- // SO.className = "U_MPMCDH U_MPMCDHM U_MP_IMG"; //静音的图标
- // }
- // else {
- // SO.className = "U_MPMCDH U_MPMCDHH U_MP_IMG"; //声音图标
- // if (_L == 0) { _L = 27; _UFMD[_UFMD.length - 1].style.left = _L + "px"; _UFMD[_UFMD.length - 2].style.width = (_L + 2) + "px" }
- // _L = Math.round(_L * (100 / 48) * 2)
- // }
- // U.UF.MPlayer.setVol(_L); //调节声音
- //}
- ////--------------------------------------------------功能处理
- ////点击我的音乐的时候
- //U.UF.MPlayer.MOM = function (userid) {
- // if (!U.MD.U.L.isLogin()) {
- // if (userid != US.userInfo.UserId) { U.UF.C.divdoubleClick("UseStudioU_MP", '', US.userInfo.UserId, null); } //回到自己的音乐
- // }
- //}
- ////切换播放音乐的模式
- //U.UF.MPlayer.SMTF = function (SO) {
- // var _TF = []; //模式对应的值
- // if (U.UF.MPlayer.TF == "L") { U.UF.MPlayer.TF = "R"; _TF[0] = "U_MPMXZM U_MPMXZMR U_MP_IMG"; _TF[1] = "随机播放"; }
- // else if (U.UF.MPlayer.TF == "R") { U.UF.MPlayer.TF = "RE"; _TF[0] = "U_MPMXZM U_MPMXZMRE U_MP_IMG"; _TF[1] = "单曲循环"; }
- // else { U.UF.MPlayer.TF = "L"; _TF[0] = "U_MPMXZM U_MPMXZMM U_MP_IMG"; _TF[1] = "列表播放"; }
- // SO.className = _TF[0]; SO.title = _TF[1];
- // U.Alert("切换到" + _TF[1] + "模式");
- //}
- ////添加他人的音乐到自己的默认文件夹
- //U.UF.MPlayer.LMGM = function (userid, UDK) {
- // if (!U.MD.U.L.isLogin()) {
- // if (userid != US.userInfo.UserId) {
- // U.MD.DK.LE.DBC(US.MUSICEFOLDERID, US.userInfo.UserId);
- // U.MD.DK.RE.CE = [UDK];
- // U.MD.DK.RE.UFStick(); //添加文件
- // U.MD.DK.RE.CE = [];
- // }
- // else { U.Alert("音乐已在自己的文件夹下"); }
- // }
- //}
- ////删除音乐
- //U.UF.MPlayer.DMGM = function (userid, UDK, SO) {
- // if (userid == US.userInfo.UserId && US.userInfo.UserId) { //只允许删除自己的音乐
- // U.MD.DK.RE.DMB(UDK, [U.UF.MPlayer.AsynDMGM, [SO]]); //删除音乐
- // }
- // else { U.Alert("无法删除它人的文件夹"); }
- //}
- ////异步删除音乐
- //U.UF.MPlayer.AsynDMGM = function (SO) {
- // U.UF.MPlayer.PNMO(1); //直接下一首
- // SO.parentNode.removeChild(SO); //删除音乐文件
- //}
- ////听音乐出错了
- //U.UF.MPlayer.Error = function (Error) {
- // U.Alert("音乐文件损坏或者暂时无法播放");
- // U.UF.MPlayer.PNMO(1);
- //}
- ////关闭音乐播放器
- //U.UF.MPlayer.Close = function () {
- // if (U.UF.MPlayer.UM.getStatus() == true) { U.UF.MPlayer.pauseOstart(); }
- // U.MD.D.T.PopupWinClose($("#U_MPI")[0]); //关闭任务栏
- //}
- ////隐藏音乐播放器
- //U.UF.MPlayer.YC = function (SO) {
- // SO.style.visibility = "hidden";
- //}
- ////打开上传音乐硬盘
- //U.UF.MPlayer.OUPM = function (DID, userid) {
- // if (US.userInfo.UserId != null && userid == US.userInfo.UserId) {
- // var _UDOD = U.MD.DK.NologinDiskDown(userid, DID, userid); //打开自己的网盘上传
- // U.selectEl("div#UDK_HP_UpFile", _UDOD)[0].onclick(); //上传文件显示
- // }
- // else { U.Alert("请上传到您的文件夹"); }
- //}
- // SetNodeStyle: function (N, UNV) {//设置样式变化
- // var _CN, j, PF, _UCH = N.childNodes;
- // if (_UCH.length > 0) {
- // for (var i = 0; i < _UCH.length; i++) {
- // _CN = N.childNodes[i];
- // if (_CN.innerHTML == undefined) {//假设innerhtml是undefined 说明这个标签是#text
- // if (PF != _CN.parentNode) { this.writeStyle(_CN.parentNode, UNV); PF = _CN.parentNode; } //设置字体大小或者是样式
- // }
- // else { this.SetNodeStyle(_CN, UNV); } //递归设置字体大小或者是样式
- // }
- // }
- // else { this.writeStyle(N, UNV); }
- // },
- //获取选择区的单元格
- U.MD.O.E.XZTH = function () {
- 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); ;
- for (k = i; k < _UDEL.length; k++) { _HW += _UDEL[k].offsetWidth; if (_OE["OW"] == _HW) { _UI = k; break; } }
- _HW = 0;
- for (k = j; k < _UDTD.length; k++) { _HW += _UDTD[j].offsetHeight; if (_OE["OH"] == _HW) { _UJ = k; break; } }
- ITF += (_UJ - j) * U.MD.O.E.SY["CE"]["TF"][1] + (_UI - i);
- 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])]; }
- for (k = t[0]; k <= t[1]; k++) {
- 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]); }
- 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]); }
- }
- }
- //自创建元素---------------------------------------------------------------------------------------------------------------
- //蛋疼的方法~~将生成的代码进行字符更换达到自创建元素的功能~~
- //使用方法~在载入的时候执行ElementReplace()便可windown.onload=function(){ElementReplace();}
- //终极目标:与asp.net中<asp:input>如此元素一般不止可以自定义元素~还可以进行元素属性的更改
- U.UF.ME.Element = new Array(
- '<dragdiv',
- '<div onselectstart="return false;" ', //禁止选取DIV框
- '</dragdiv>',
- '</div>'
- );
- //对生成的所有HTML代码进行替换
- U.UF.ME.ElementReplace = function () {
- var tmp = new String(document.body.innerHTML);
- 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'是函数中表达搜索的代表
- document.body.innerHTML = tmp;
- }
- //(_UGE["D"] || U.selectEl("#U_E_RWRD")[0]).style.display = (_UGE["R"] || U.selectEl("#U_E_ContextMenu")[0]).style.display = "none";
- // (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";
- // var _UDPD = (event.srcElement);
- // (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(); //隐藏右键菜单 //隐藏功能菜单
- // while (_UDPD && _UDPD.tagName.toLocaleLowerCase() != "body") {
- // if (_UDPD.id == "U_E_A") {
- // U.OU.TF["FTF"] = true;
- // _UDPD.onclick();
- // }
- // _UDPD = _UDPD.parentNode;
- // }
- //单元格编辑框与函数编辑框对应
- U.MD.O.E.EditTextEdit = function (UDOD, UDTD, UTF) {
- // if (UDCD.style.backgroundColor != "rgb(232, 243, 249)") { UDCD.style.backgroundColor = "rgb(232, 243, 249)"; }
- }
- ////显示颜色框
- //U.OU.DisplayColorFrame = function (DID, NID) {
- // U.selectEl("#" + DID)[0].style.display = "block"; U.selectEl("#" + NID)[0].style.display = "none";
- //}
- ////文件下拉菜单功能
- //U.OU.OpenFileMenu = function () {
- // var _UDEO = U.selectEl("#U_E_OC"); _UDEO.addAttrArray({ "style": { "display": (_UDEO[0].style.display == "block" ? "none" : "block")} }); U.UF.EV.stopBubble();
- //}
- //Error具有下面一些主要属性:
- //description: 错误描述 (仅IE可用).
- //fileName: 出错的文件名 (仅Mozilla可用).
- //lineNumber: 出错的行数 (仅Mozilla可用).
- //message: 错误信息 (在IE下同description)
- //name: 错误类型.
- //number: 错误代码 (仅IE可用).
- //stack: 像Java中的Stack Trace一样的错误堆栈信息 (仅Mozilla可用).
- //--------------------------------------统一try cache---------------------------------
- U.UF.MC.TC = {}; //保存前台错误的集合,暂时显示在前台,以后存入后台
- U.UF.MC.TCatch = function (f) {
- try { (typeof (f) == "string") ? eval(f) : f; }
- catch (e) { Add(U.UF.MC.TC, { "类型": e.name, "错误信息": e.message, "时间": U.UF.D.formatDateToArray(new Date()) }); }
- }
- //兼容SetCapture函数
- U.UF.C.SetCapture = function (obj) {
- return document.all ? obj.setCapture() : window.captureEvents(Event.MOUSEMOVE);
- }
- //兼容releaseCapture函数
- U.UF.C.releaseCapture = function (obj) {
- document.all ? obj.releaseCapture() : window.releaseEvents(Event.MOUSEUP);
- }
- //兼容加载事件与脚本 func为函数
- U.UF.C.LoadEvent = function (func) {
- var oldonload = window.onload;
- //判断对象是否为一个事件,是则直接执行
- if (typeof window.onload != 'function') {
- window.onload = func;
- }
- else {
- window.onload = function () {
- oldonload();
- func();
- }
- }
- }
- //函数功能:获取键盘码,兼容Onkeydown事件
- U.UF.C.getKeyCode = function (e) {
- e = e || window.event;
- keynum = e.keyCode ? e.keyCode : e.which;
- return keynum;
- }
- //事件代理机制,避免频繁添加事件操作。浪费代码,加大复杂度。
- U.UF.C.GetEventTarget = function (e) {//判断浏览器类型以兼容事件
- e = e || window.event;
- return e.target || e.srcElement;
- }
- //Click()事件调用兼容
- U.UF.C.invokeClick = function (element) {
- if (element.click) element.click(); //判断是否支持click() 事件
- else if (element.fireEvent) element.fireEvent('onclick'); //触发click() 事件
- else if (document.createEvent) {
- var evt = document.createEvent("MouseEvents"); //创建click() 事件
- evt.initEvent("click", true, true); //初始化click() 事件
- element.dispatchEvent(evt); //分发click() 事件
- }
- }
- //dblClick()事件调用兼容
- U.UF.C.dblClick = function (element) {
- if (element.ondblclick) element.ondblclick(); //判断是否支持dblClick() 事件
- else if (element.fireEvent) element.fireEvent('ondblclick'); //触发dblClick() 事件
- else if (document.createEvent) {
- var evt = document.createEvent("MouseEvents"); //创建ondblclick() 事件
- evt.initEvent("dblclick", true, true); //初始化ondblclick() 事件
- element.dispatchEvent(evt); //分发ondblclick() 事件
- }
- }
- //------------------------------------------------------------------监听事件注册和取消区域---------------------------------------------------------------
- //注意:只有被addEventListener方法添加的事件才可以使用removeEventListener来注销.
- //如果你直接使用onclick或onkeyup直接写在元素内的事件.将无法使用removeEventListener来删除.
- U.UF.C.removeEvent = function (oTarget, sEventType, funName) {
- if (oTarget.removeEventListener) {//for DOM;
- oTarget.removeEventListener(sEventType, funName, false);
- } else if (oTarget.detachEvent) {
- oTarget.detachEvent("on" + sEventType, funName);
- } else {
- oTarget["on" + sEventType] = null;
- }
- }
- //函数作用:为元素添加事件
- //oTarget:元素对象;sEventType:事件类型,例如点击则为click;funName:事件触发的函数名;
- U.UF.N.AddEvent = function (oTarget, sEventType, funName) {
- if (oTarget.addEventListener) {//Dom浏览器触发
- oTarget.addEventListener(sEventType, funName, false);
- } else if (oTarget.attachEvent) { //IE
- oTarget.attachEvent("on" + sEventType, funName);
- } else {
- oTarget["on" + sEventType] = funName;
- }
- }
- //屏蔽错误
- U.UF.C.killErrors = function (sMsg, sUrl, sLine) {
- //onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。
- // var oErrorLog = document.createElement("div");
- // oErrorLog.innerHTML = "<b>An error was thrown and caught.</b><p>";
- // oErrorLog.innerHTML += "Error: " + sMsg + "<br>";
- // oErrorLog.innerHTML += "Line: " + sLine + "<br>";
- // oErrorLog.innerHTML += "URL: " + sUrl + "<br>";
- return true;
- }
- //屏蔽按键操作。
- U.UF.C.forbiddenKey = function () {
- if (event.keyCode == 116) { event.keyCode = 0; event.returnValue = false; } //屏蔽f5刷新
- }
- //屏蔽div右键
- U.UF.C.ForbiddenDivRightMouseClick = function (obj) {
- obj.oncontextmenu = function () { return false; }
- }
- //规范插入的图片大小--杨嘉城
- U.UF.C.norm_img = function (SO) {
- var _ISO = U.selectEl("img", SO);
- for (var i = 0; i < _ISO.length; i++) {
- if (_ISO[i].clientWidth >= 1024) { _ISO[i].width = "900px"; }
- }
- }
- //设置字体
- U.UF.C.setuserbackgroundfont = function (obj) {
- if (obj != null) {
- var allelments = parent.document.getElementsByTagName('*');
- var i;
- for (i = 0; i < allelments.length; i++) {
- allelments[i].style.fontSize = obj + "px";
- }
- }
- }
- //去掉所有空格和标点符号
- U.UF.S.dropSpaceAndDot = function (obj) {
- str = obj.value;
- var pattern = new RegExp("[`~!#$^&*()=|{}':;',\\[\\].<>/?~#……&*()&;—|{}‘;:”“'。,、]");
- var newstr = "";
- for (i = 0; i < str.length; i++) {
- if (str.substr(i, 1) == " ") {
- continue;
- }
- newstr += str.substr(i, 1).replace(pattern, "");
- }
- obj.innerText = newstr;
- //U.UF.C.textCompatibleandStr(obj, newstr)
- }
- //判断字符串类型是是否带有' '这样的字符
- U.UF.C.isBlank = function (szStr) {
- for (i = 0; i < szStr.length; i++) {
- if (szStr.substring(i, i + 1) == ' ') {
- return false;
- }
- break;
- }
- return true;
- }
- // 检查序列号格式 目前的格式类似 GUID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
- U.UF.S.Checkguid = function (object_value) {
- if (object_value.length == 0)
- return false;
- if (object_value.length != 38)
- return false;
- if (object_value.charAt(0) != "{")
- return false;
- if (object_value.charAt(37) != "}")
- return false;
- var hex_format = "0123456789abcdefABCDEF";
- var check_char;
- for (var i = 1; i < 37; i++) {
- if ((i == 9) || (i == 14) || (i == 19) || (i == 24)) {
- if (object_value.charAt(i) != "-")
- return false;
- } else {
- check_char = hex_format.indexOf(object_value.charAt(i));
- if (check_char < 0)
- return false;
- }
- }
- return true;
- }
- //跟进时间判定早中午时间,此函数未被使用
- U.UF.D.GetNowTime = function () {
- var time = new Date();
- var TimePart = document.getElementById("TimePart");
- var DataTime = time.getHours();
- if (DataTime >= 0 && DataTime < 12) {
- TimePart.innerHTML = "早上好!";
- }
- else if (DataTime >= 12 && DataTime < 18) {
- TimePart.innerHTML = "下午好!";
- }
- else {
- TimePart.innerHTML = "晚上好!";
- }
- }
- //使用U.UF.D.currenttime函数时转换UTC() 方法可根据世界时返回 1970 年 1 月 1 日 到指定日期的毫秒数。
- //Date.UTC(year,month,day,hours,minutes,seconds,ms)
- U.UF.D.DateUTC = function (STime) {
- STime = STime.split(" ");
- var MY = STime[0].split("/");
- var MS = STime[STime.length - 1].split(":");
- return "/Date(" + Date.UTC(MY[0], MY[1], MY[2], MS[0], MS[1], MS[2], 0) + ")/";
- }
- ////把json时间戳转为日期格式
- U.UF.D.getLocalTime = function (nS) {
- var _timeS = new Date(parseInt(nS.substring(6, nS.length - 2))).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
- if (!parent.browser.msie) _timeS = _timeS.substring(10, 25);
- return _timeS;
- }
- //js获取当前的时间
- U.UF.D.currenttime = function () {
- var _currenttime = new Date();
- var _year = U.UF.D.getYear()//获取当前的年数
- var _month = _currenttime.getMonth() + 1; //获取当前的月份
- var _date = _currenttime.getDate(); //获取当前的日期
- var _houst = _currenttime.getHours(); //获取当前的小时
- var _Minutes = _currenttime.getMinutes(); //获取当前的分钟
- var _Seconds = _currenttime.getSeconds(); //获取当前的秒数
- return _year + '/' + _month + '/' + _date + ' ' + _houst + ':' + _Minutes + ':' + _Seconds; //返回用户现在的时间段 且样式复合项目的需求
- }
- U.UF.D.getDate = function (D) {
- if (D == null) { D = new Date(); }
- // if (date == null || date == "" || date == "undefined") date = new Date();
- // var yyyy = date.getFullYear();
- // var m = date.getMonth() + 1;
- // var mm = (m < 10) ? '0' + m : m;
- // var d = date.getDate();
- // var dd = (d < 10) ? '0' + d : d;
- // var h = date.getHours();
- // var hh = (h < 10) ? '0' + h : h;
- // var n = date.getMinutes();
- // var nn = (n < 10) ? '0' + n : n;
- // var s = date.getSeconds();
- // var ss = (s < 10) ? '0' + s : s;
- // return yyyy + "-" + mm + "-" + dd + " " + hh + ":" + nn + ":" + ss;
- }
- //返回月份的方法
- U.UF.D.GetMonth = function (month) {
- switch (month) {
- case "Jan":
- return "1";
- break;
- case "Feb":
- return "2";
- break;
- case "Mar":
- return "3";
- break;
- case "Apr":
- return "4";
- break;
- case "May":
- return "5";
- break;
- case "Jun":
- return "6";
- break;
- case "Jul":
- return "7";
- break;
- case "Aug":
- return "8";
- break;
- case "Sep":
- return "9";
- break;
- case "Oct":
- return "10";
- break;
- case "Nov":
- return "11";
- break;
- case "Dec":
- return "12";
- break;
- }
- }
- //转化星期
- U.UF.D.Getweek = function (week) {
- switch (week) {
- case "Mon":
- return "一";
- break;
- case "Tue":
- return "二";
- break;
- case "Wed":
- return "三";
- break;
- case "Thu":
- return "四";
- break;
- case "Fri":
- return "五";
- break;
- case "Sat":
- return "六";
- break;
- case "Sun":
- return "七";
- break;
- }
- }
- //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 = "秒");
- //else if (_UDD < 10) { _UDTS = _UDD + "天前"; }
- U.UF.D.DataTime = function (time) {
- time = eval('new ' + eval(time).source) + "";
- var strtime;
- _strtime = time.split(" ");
- _strtime[1] = U.UF.D.GetMonth(_strtime[1]); // 转化月份
- _strtime[0] = U.UF.D.Getweek(_strtime[0]); //转化星期
- return _strtime;
- }
- //用于blog的时间转换...转入2013-2-2 10:28:00 ...返回2013 2 2 10:28:00
- U.UF.D.DateAnalyze = function (TD) {
- TD = TD.split(" ");
- var MT = TD[0].split("/");
- MT = MT[0].split("-")
- MT[3] = TD[TD.length - 1];
- return MT;
- }
- //转换普通时间为Unix时间戳,返回的是US.userInfo中相同的类型-曾冠悦
- U.UF.D.getUnixTime = function (str_time) {
- var new_str = str_time.replace(/:/g, '-'); //替换冒号
- new_str = new_str.replace(/ /g, '-'); //替换空格
- var arr = new_str.split("-"); //转换成数组
- arr.length = 5;
- for (var i = 0; i < 6; i++) {
- if (arr[i] == undefined) {
- arr[i] = 0;
- }
- }
- return "/Date(" + Date.UTC(arr[0], arr[1] - 1, arr[2], arr[3] - 8, arr[4], arr[5]) + ")/";
- }
- //闰年
- U.UF.D.IsLeapYear = function (Y) {
- if ((Y % 400 == 0 && Y % 100 == 0) || (Y % 4 == 0 && Y % 100 != 0)) { return true; }
- else { return false; }
- }
- //函数作用,获取年份
- //在IE中得到的日期是"2011",在Firefox中看到的日期是"111",主要是因为在 Firefox 里面 getYear 返回的是 "当前年份-1900" 的值。
- U.UF.D.getYear = function () {
- var year = new Date().getYear();
- year = (year < 1900 ? (1900 + year) : year);
- return year;
- }
- //获取当前月份
- U.UF.D.getNowMonth = function () {
- var month = new Date().getMonth() + 1;
- return month;
- }
- //获取日期
- U.UF.D.getNowDate = function () {
- var date = new Date().getDate();
- return date;
- }
- //获取月份的天数,2月需要年参数
- U.UF.D.getDayOfMonth = function (month, year) {
- if (month == 4 || month == 6 || month == 9 || month == 11) {
- return 30;
- }
- if (month == 2) {
- if (U.UF.D.IsLeapYear(year)) {
- return 29;
- }
- else return 28;
- }
- return 31;
- }
- 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" }
- //获取中文拼音
- U.UF.S.PYS = function (UST) {//U.UF.S.PY
- var i, _UCT = UST.charCodeAt(0); //拼音编码
- if (_UCT && (_UCT > 0xB0A0 && _UCT < 0xD7FC)) { for (i = _UCT; (!(_UCT = U.UF.S.PY[i]) && i > 0xB0A1); ) { i--; } } //如果为拼音
- return _UCT;
- }
- U.UF.S.PYS("你");
- Namespace.register("U.UF.IMGes"); //久的图片浏览器
- USPhotoImgJson = null;
- //图片预加载(摘自:http://www.planeart.cn/demo/imgReady/ )=========================================================================================================================
- //使用方法ImgReady(图片URL,加载头文件成功执行函数(即获得图片长宽),加载图片成功执行函数,加载图片失败执行函数);
- //imgReady('images/logo_cn.png', function () {alert('size ready: width=' + this.width + '; height=' + this.height);},function(){alert("加载成功")},function(){alert("加载失败")});
- U.UF.IMGes.ImgReady = (function () {
- var list = [], intervalId = null,
- // 用来执行队列
- tick = function () {
- var i = 0;
- for (; i < list.length; i++) {
- list[i].end ? list.splice(i--, 1) : list[i]();
- };
- !list.length && stop();
- },
- //停止所有定时器队列
- stop = function () {
- clearInterval(intervalId);
- intervalId = null;
- };
- return function (url, ready, load, error) {
- var onready, width, height, newWidth, newHeight,
- img = new Image();
- img.src = url;
- // 如果图片被缓存,则直接返回缓存数据
- if (img.complete) {
- ready.call(img);
- load && load.call(img);
- return;
- };
- width = img.width;
- height = img.height;
- // 加载错误后的事件
- img.onerror = function () {
- error && error.call(img);
- //onready.end = true;
- img = img.onload = img.onerror = null;
- };
- // 图片尺寸就绪
- img.onreadystatechange = function () {
- if (document.readyState == "complete") {
- newWidth = img.width;
- newHeight = img.height;
- // 如果图片已经在其他地方加载可使用面积检测
- if (newWidth !== width || newHeight !== height || newWidth * newHeight > 1024) {
- ready.call(img);
- //onready.end = true;
- };
- };
- };
- // onready = function () {
- // newWidth = img.width;
- // newHeight = img.height;
- // // 如果图片已经在其他地方加载可使用面积检测
- // if (newWidth !== width || newHeight !== height || newWidth * newHeight > 1024) {
- // ready.call(img);
- // onready.end = true;
- // };
- // };
- // onready();
- // 完全加载完毕的事件
- img.onload = function () {
- // onload在定时器时间差范围内可能比onready快
- // 这里进行检查并保证onready优先执行
- //!onready.end && onready();
- load && load.call(img);
- // IE gif动画会循环执行onload,置空onload即可
- img = img.onload = img.onerror = null;
- };
- // 加入队列中定期执行
- // if (!onready.end) {
- // list.push(onready);
- // // 无论何时只允许出现一个定时器,减少浏览器性能损耗
- // if (intervalId === null) intervalId = setInterval(tick, 40);
- // };
- };
- })();
- //图片预加载(摘自:http://www.planeart.cn/demo/imgReady/ )=========================================================================================================================
- //图片居中旋转(编写:郭仁)========================================================================================================================================================
- //传入图片对象,与旋转方向(值:'left' or 'right')
- //使用方法imgRoll(document.getElementById("ImgObj"),"left");
- U.UF.IMGes.imgRoll = function (imgObj, SX, ArcSizeInt) {
- var ArcSize = imgObj.alt == null ? 0 : parseInt(imgObj.alt); //通过图片对象中的alt属性进行储存现行角度(1=90度;2=180度;3=270度;4=360度=0度)
- //判断SX进行角度增减
- if (SX == "left") {
- ArcSize += 1;
- ArcSize = ArcSize > 4 ? 0 : ArcSize;
- } else if (SX == "right") {
- ArcSize -= 1;
- ArcSize = ArcSize < 0 ? 3 : ArcSize;
- } else if (SX == "int") {
- ArcSize = ArcSizeInt;
- }
- //因为CSS旋转滤镜的实现方式不同~~需要进行不同的浏览判断给予定位
- imgObj.parentNode.style.width = ArcSize % 2 == 0 ? imgObj.width + (2 * 7) + "px" : imgObj.height + (2 * 7) + "px";
- imgObj.parentNode.style.height = ArcSize % 2 == 0 ? imgObj.height + (2 * 7) + "px" : imgObj.width + (2 * 7) + "px";
- if (!browser.msie) {
- if (ArcSize % 2 != 0) {
- imgObj.style.left = Math.ceil((parseInt(imgObj.parentNode.style.width) - parseInt(imgObj.parentNode.style.height)) / 2) + "px";
- imgObj.style.top = Math.ceil((parseInt(imgObj.parentNode.style.height) - parseInt(imgObj.parentNode.style.width)) / 2) + "px";
- imgObj.parentNode.style.left = parseInt(imgObj.parentNode.style.left) - parseInt(imgObj.style.left) + "px";
- imgObj.parentNode.style.top = parseInt(imgObj.parentNode.style.top) - parseInt(imgObj.style.top) + "px";
- } else {
- imgObj.parentNode.style.left = parseInt(imgObj.parentNode.style.left) + parseInt(imgObj.style.left) + "px";
- imgObj.parentNode.style.top = parseInt(imgObj.parentNode.style.top) + parseInt(imgObj.style.top) + "px";
- imgObj.style.left = "0px";
- imgObj.style.top = "0px";
- }
- }
- // else {
- // imgObj.parentNode.style.left = parseInt(imgObj.parentNode.getBoundingClientRect().left) - Math.ceil((parseInt(imgObj.parentNode.style.width) - parseInt(imgObj.parentNode.style.height)) / 2) + "px";
- // imgObj.parentNode.style.top = parseInt(imgObj.parentNode.getBoundingClientRect().top) - Math.ceil((parseInt(imgObj.parentNode.style.height) - parseInt(imgObj.parentNode.style.width)) / 2) + "px";
- // }
- imgObj.alt = ArcSize; //将角度值置于图片对象alt属性中
- //css旋转滤镜兼容
- imgObj.style.filter = 'Progid:DXImageTransform.Microsoft.BasicImage(Rotation=' + ArcSize + ')';
- imgObj.style.WebkitTransform = 'rotate(' + ArcSize * 90 + 'deg)';
- imgObj.style.MozTransform = 'rotate(' + ArcSize * 90 + 'deg)';
- imgObj.style.OTransform = 'rotate(' + ArcSize * 90 + 'deg)';
- }
- //图片居中旋转(编写:郭仁)========================================================================================================================================================
- //放大缩小【不影响于旋转后放大缩小的BUG~~】(编写:郭仁)============================================================================================================================
- //传入(图片对象,原始宽,原始高)~~
- U.UF.IMGes.Scale = function (ImgObj, nwidth, nheight) {
- var event = arguments.callee.caller.arguments[0] || window.event; //消除浏览器差异
- //滑动条位置
- var x = event.clientX - 80;
- var y = event.clientY - 20;
- //缩放比例~~
- var Scale = nwidth / nheight;
- //现行角度
- var ArcSize = ImgObj.alt == null ? 0 : parseInt(ImgObj.alt);
- if (document.getElementById("SlideCase_" + ImgObj.id) == null) {//判断滑动条是否已存在
- //创建滑动条
- var SlideCase = new U.UF.IMGes.SliderContorl(ImgObj.id, 200, 50, x, y, function (percentage) {
- ImgObj.style.width = nwidth * (percentage / 100) + "px";
- ImgObj.style.height = parseInt(ImgObj.style.width) / Scale + "px";
- if (ArcSize % 2 != 0) {
- ImgObj.parentNode.style.width = parseInt(ImgObj.style.height) + (2 * 7) + "px";
- ImgObj.parentNode.style.height = parseInt(ImgObj.style.width) + (2 * 7) + "px";
- if (browser.chrome || browser.firefox) {
- ImgObj.style.left = Math.ceil((parseInt(ImgObj.parentNode.style.width) - parseInt(ImgObj.parentNode.style.height)) / 2) + "px";
- ImgObj.style.top = Math.ceil((parseInt(ImgObj.parentNode.style.height) - parseInt(ImgObj.parentNode.style.width)) / 2) + "px";
- }
- } else {
- ImgObj.parentNode.style.width = parseInt(ImgObj.style.width) + (2 * 7) + "px";
- ImgObj.parentNode.style.height = parseInt(ImgObj.style.height) + (2 * 7) + "px";
- }
- });
- document.body.appendChild(SlideCase);
- }
- }
- //放大缩小【不影响于旋转后放大缩小的BUG~~】(编写:郭仁)============================================================================================================================
- //stackBlurImage(ImgStr, CanvasStr, percentage, false);
- //滑动条创建(编写:郭仁)==========================================================================================================================================================
- //通过传入[ID(为了避免多次创建同样功能滑动条);最大值;最小值;x;y;滑动块left改变后执行函数]
- //使用方法
- // if(document.getElementById("SlideCase_20")==null){
- // var DemoSlider = SliderContorl("20",200, 50, x, y, function (percentage) {
- // alert(percentage);
- // });
- // document.body.appendChild(DemoSlider);
- // }
- U.UF.IMGes.SliderContorl = function (id, max, min, left, top, callback) {
- var fadeOut = null; //淡出计时器Interval
- var removealertBar = null; //移除提示框计时器Timeout
- var percentage = 0; //滑动所在百分比
- //动态创建滑动框=====================================================================
- var SlideCase = document.createElement("div");
- SlideCase.id = "SlideCase_" + id; //每个滑动条都有自己的ID
- SlideCase.className = "ImgViewer SlideCase";
- SlideCase.style.left = left + "px";
- SlideCase.style.top = top + "px";
- //禁止选取
- SlideCase.onmousedown = function () { return false; } //IE;
- SlideCase.onselectstart = function () { return false; } //FireFox;Chorme
- //滑动条--------------------------------------------------
- var SlideBar = document.createElement("div");
- SlideBar.id = "SlideBar"
- SlideBar.className = "SlideBar";
- //滑动块--------------------------------------------------
- var SlidhingShoe = document.createElement("a");
- SlidhingShoe.id = "SlidhingShoe";
- SlidhingShoe.className = "ImgViewer SlidhingShoe";
- //移除按钮------------------------------------------------
- var CloseSlideButton = document.createElement("div");
- CloseSlideButton.id = "Slidhing_CloseSlideButton"
- CloseSlideButton.className = "Slidhing_CloseSlideButton";
- CloseSlideButton.onclick = function () { SlideCase.parentNode.removeChild(SlideCase); }
- //提示框--------------------------------------------------
- var alertBar = document.createElement("div");
- alertBar.id = "Slidhing_alertBar";
- alertBar.style.display = "none";
- alertBar.className = "ImgViewer Slidhing_alertBar";
- //添加到各各节点-------------------------------------------
- SlideBar.appendChild(SlidhingShoe);
- SlideCase.appendChild(SlideBar);
- SlideCase.appendChild(CloseSlideButton);
- SlideCase.appendChild(alertBar);
- //两个主要事件=====================================================================
- //提示框淡出消失函数
- var AlertFadeIn = function () {
- //提示框样式重置
- alertBar.style.filter = "alpha(opacity=100)";
- alertBar.style.MozOpacity = "1";
- alertBar.style.opacity = "1";
- alertBar.style.display = "inline-block";
- //再次清扫计时器防止内存溢出
- clearInterval(fadeOut);
- clearTimeout(removealertBar);
- //特效开始
- removealertBar = setTimeout(function () {
- i = 100;
- fadeOut = setInterval(function () {
- alertBar.style.filter = "alpha(opacity=" + i + ")";
- alertBar.style.MozOpacity = i * 0.01;
- alertBar.style.opacity = i * 0.01;
- i -= 2;
- if (i == 0) {
- alertBar.style.display = "none";
- //清扫计时器防止内存溢出
- clearInterval(fadeOut);
- clearTimeout(removealertBar);
- }
- }, 1);
- }, 800);
- }
- //滑动块移动或滑动条被点击后执行函数
- var mouse_down_or_move = function () {
- var pole = event.clientX - parseInt(SlideCase.style.left) - 25; //计算滑动块left
- //限制最小left与最大left
- pole = pole < 0 ? 0 : pole;
- pole = pole > 120 ? 120 : pole;
- SlidhingShoe.style.left = pole + "px";
- //给提示框赋予left值;使提示框跟着滑动块移动
- alertBar.style.left = pole - 20 + "px";
- percentage = pole * ((max - min) / 120) + min; //计算滑动条现行百分比
- alertBar.innerHTML = Math.round(percentage) + "%";
- callback(percentage); //回调传入函数
- }
- //给滑动条与滑动块进行事件处理==========================================
- SlideBar.onmousedown = function () {
- mouse_down_or_move();
- alertBar.style.display = "inline-block";
- }
- SlideBar.onmouseup = function () {
- if (!browser.msie) {
- AlertFadeIn();
- } else {
- clearTimeout(removealertBar);
- removealertBar = setTimeout(function () {
- alertBar.style.display = "none";
- clearTimeout(removealertBar);
- }, 800);
- }
- }
- SlidhingShoe.onmousedown = function () {
- var ismoveSlide = true;
- document.body.onmousemove = function () {
- if (ismoveSlide == true) {
- mouse_down_or_move();
- alertBar.style.display = "inline-block";
- if (!browser.msie) {
- alertBar.style.filter = "alpha(opacity=" + i + ")";
- alertBar.style.MozOpacity = i * 0.01;
- alertBar.style.opacity = i * 0.01;
- }
- }
- }
- document.body.onmouseup = function () {
- if (document.all != undefined) SlidhingShoe.releaseCapture(); //鼠标事件制焦
- ismoveSlide = false;
- if (!browser.msie) {
- AlertFadeIn();
- } else {
- clearTimeout(removealertBar);
- removealertBar = setTimeout(function () {
- alertBar.style.display = "none";
- clearTimeout(removealertBar);
- }, 800);
- }
- document.body.onmouseup = function () { return false; }
- }
- }
- return SlideCase; //返回滑动条
- }
- //滑动条创建(编写:郭仁)==========================================================================================================================================================
- //恢复1:1实际比例===================================================================================================================================================================
- //传入图片对象,原宽,原高
- U.UF.IMGes.ActuleScale = function (ImgObj, width, height) {
- ImgObj.style.width = width + "px";
- ImgObj.style.height = height + "px";
- ImgObj.parentNode.style.width = parseInt(ImgObj.style.width) + (2 * 7) + "px";
- ImgObj.parentNode.style.height = parseInt(ImgObj.style.height) + (2 * 7) + "px";
- }
- //创建图片框========================================================================================================================================================================
- //传入图片ID(防止同时出现多个同ID导致网页出错),图片地址,JSON【KEY】(你懂的~~可为空~~)
- U.UF.IMGes.CreatePhotoCase = function (imgid, url, key) {
- var nwidth = 0; //原宽
- var nheight = 0; //原高
- // if (window.parent.document.getElementById("ImgViewer_Div" + imgid) != null) {//如果已创建此相框则返回此相框
- // return window.parent.document.getElementById("ImgViewer_Div" + imgid);
- // }
- //var IV_Div = window.parent.document.getElementById("ImgViewer_Div");
- var IV_Div = window.parent.$('#ImgViewer_Div')[0];
- if (IV_Div != null) {//如果已创建过相框则只在更改图片及管理框 ——简炜杰
- var img = U.selectEl("Img", IV_Div)[0];
- //更换图片ID
- img.id = "ImgViewer_Img" + imgid;
- //图片大小处理以及重新加载管理框
- var _ready = function () {
- return function () {
- var nImg = new Image();
- nImg.src = url;
- var nwidth = nImg.width;
- var nheight = nImg.height;
- if (nImg.width > 800 || nImg.height > 600) {
- if (nImg.width > nImg.height) {
- nwidth = 800;
- nheight = nwidth / (nImg.width / nImg.height);
- } else {
- nheight = 600;
- nwidth = nheight * (nImg.width / nImg.height);
- }
- } else if (nImg.height < 200) {
- nheight = 200;
- nwidth = nheight * (nImg.width / nImg.height);
- } else {
- nwidth = nImg.width;
- nheight = nImg.height;
- }
- img.style.height = nheight + "px";
- img.style.width = nwidth + "px";
- IV_Div.style.height = nheight + 14 + "px";
- IV_Div.style.width = nwidth + 14 + "px";
- 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>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollLeftIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + imgid + '\'),\'left\')" ></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollRightIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + imgid + '\'),\'right\')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ScaleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.Scale(document.getElementById(\'ImgViewer_Img' + imgid + '\'),' + nwidth + ',' + nheight + ')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ActuleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.ActuleScale(document.getElementById(\'ImgViewer_Img' + imgid + '\'),' + nwidth + ',' + nheight + ')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ThumbnailsIcon" href="javascript:void(0)" onclick="if(USPhotoImgJson!=null) document.getElementById(\'ImgViewer_ThumbnailsCase\').style.display=\'inline-block\';"></a>';
- U.selectEl('#ImgViewer_manager')[0].innerHTML = strCode;
- U.UF.IMGes.ActuleScale(img, nwidth, nheight);
- }
- }
- _ready = _ready();
- //加载图片
- U.UF.IMGes.ImgReady(url, _ready, function () { img.src = url; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
- return;
- }
- //创建相框==============================================================
- var ImgDiv = document.createElement("div");
- //ImgDiv.id = "ImgViewer_Div" + imgid;
- //相框只生成一次,ID改为唯一 ——简炜杰
- ImgDiv.id = "ImgViewer_Div";
- ImgDiv.className = "ImgViewer_Div ImgViewer_shadow";
- //禁止选取
- ImgDiv.onmousedown = function () { return false; } //IE;
- ImgDiv.onselectstart = function () { return false; } //FireFox;Chorme
- //创建管理框============================================================
- var managerBar = document.createElement("div");
- managerBar.id = "ImgViewer_managerBar";
- managerBar.className = "ImgViewer ImgViewer_managerBar";
- //创建管理对齐DIV=======================================================
- var manager = document.createElement("div");
- manager.id = "ImgViewer_manager";
- manager.className = "ImgViewer_manager";
- //创建图片元素==========================================================
- var USPhotoImg = document.createElement("img");
- USPhotoImg.id = "ImgViewer_Img" + imgid;
- USPhotoImg.className = "ImgViewer_Img";
- USPhotoImg.alt = "0";
- USPhotoImg.src = "img/loading.png";
- USPhotoImg.onmousedown = function () { U.UF.F.DragMouseDown(ImgDiv, "ImgViewer"); }
- if (key != null && key != "") {//如果KEY值为空则不显示上一张与下一张
- //创建对齐框==========================================================
- var gobackdiv = document.createElement("div");
- gobackdiv.id = "ImgViewer_gobackdiv";
- gobackdiv.className = "ImgViewer_gobackdiv";
- //创建上一张按钮======================================================
- var go = document.createElement("i");
- go.id = "ImgViewer_go";
- go.className = "ImgViewer ImgViewer_go";
- go.onclick = function () {
- goorback("g");
- }
- go.onmouseover = function () {
- gobackdiv.style.display = "inline-block";
- }
- go.onmouseout = function () {
- gobackdiv.style.display = "none";
- }
- //创建下一张按钮======================================================
- var back = document.createElement("i");
- back.id = "ImgViewer_back";
- back.className = "ImgViewer ImgViewer_back";
- back.onclick = function () {
- goorback("b");
- }
- back.onmouseover = function () {
- gobackdiv.style.display = "inline-block";
- }
- back.onmouseout = function () {
- gobackdiv.style.display = "none";
- }
- USPhotoImg.onmouseover = function () {
- gobackdiv.style.display = "inline-block";
- }
- USPhotoImg.onmouseout = function () {
- gobackdiv.style.display = "none";
- }
- gobackdiv.appendChild(go);
- gobackdiv.appendChild(back);
- ImgDiv.appendChild(gobackdiv);
- var goorback = function (gb) {
- //如果滑动条存在为以防出错而将原图滑动条隐藏
- if (document.getElementById("SlideCase_" + USPhotoImg.id) != null) document.getElementById("SlideCase_" + USPhotoImg.id).parentNode.removeChild(document.getElementById("SlideCase_" + USPhotoImg.id));
- U.UF.IMGes.imgRoll(USPhotoImg, "int", 0); //恢复旋转角度
- if (gb == "g") {
- key--;
- } else if (gb == "b") {
- key++;
- }
- key = key < 0 ? USPhotoImgJson.length - 1 : key;
- key = key > USPhotoImgJson.length - 1 ? 0 : key;
- var Img = USPhotoImgJson[key]; //选择JSON
- //更换ID
- //相框只生成一次,ID改为唯一,无需更换 ——简炜杰
- //ImgDiv.id = "ImgViewer_Div" + Img.imgid;
- USPhotoImg.id = "ImgViewer_Img" + Img.imgid;
- //执行图片预加载~~
- var _e = function () {
- return function () {
- var nwidth = this.width;
- var nheight = this.height;
- if (this.width > 800 || this.height > 600) {
- if (this.width > this.height) {
- nwidth = 800;
- nheight = nwidth / (this.width / this.height);
- } else {
- nheight = 600;
- nwidth = nheight * (this.width / this.height);
- }
- } else if (this.height < 200) {
- nheight = 200;
- nwidth = nheight * (this.width / this.height);
- } else {
- nwidth = this.width;
- nheight = this.height;
- }
- ImageReady(Img.imgid, nwidth, nheight);
- gobackdiv.style.bottom = (nheight + (2 * 7)) / 2 - 15 + "px";
- }
- }
- _e = _e();
- U.UF.IMGes.ImgReady(Img.imgurl, _e, function () { USPhotoImg.src = this.src; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
- }
- }
- managerBar.appendChild(manager);
- ImgDiv.appendChild(USPhotoImg);
- ImgDiv.appendChild(managerBar);
- //图片加载成功后执行事件
- var ImageReady = function (Imgid, width, height) {
- 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>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollLeftIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),\'left\')" ></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ImgRollRightIcon" href="javascript:void(0)" onclick="U.UF.IMGes.imgRoll(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),\'right\')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ScaleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.Scale(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),' + width + ',' + height + ')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ActuleIcon" href="javascript:void(0)" onclick="U.UF.IMGes.ActuleScale(document.getElementById(\'ImgViewer_Img' + Imgid + '\'),' + width + ',' + height + ')"></a>';
- strCode += '<a class="samllRadius ImgViewer ImgViewer_ThumbnailsIcon" href="javascript:void(0)" onclick="if(USPhotoImgJson!=null) document.getElementById(\'ImgViewer_ThumbnailsCase\').style.display=\'inline-block\';"></a>';
- manager.innerHTML = strCode;
- U.UF.IMGes.ActuleScale(USPhotoImg, width, height);
- }
- var _e = function () {
- return function () {
- var nwidth = this.width;
- var nheight = this.height;
- if (this.width > 800 || this.height > 600) {
- if (this.width > this.height) {
- nwidth = 800;
- nheight = nwidth / (this.width / this.height);
- } else {
- nheight = 600;
- nwidth = nheight * (this.width / this.height);
- }
- } else if (this.height < 200) {
- nheight = 200;
- nwidth = nheight * (this.width / this.height);
- } else {
- nwidth = this.width;
- nheight = this.height;
- }
- ImageReady(imgid, nwidth, nheight);
- if (key != null & key != "") gobackdiv.style.bottom = (nheight + (2 * 7)) / 2 - 15 + "px";
- }
- }
- _e = _e();
- U.UF.IMGes.ImgReady(url, _e, function () { USPhotoImg.src = this.src; }, function () { alert("加载失败"); ImgDiv.parentNode.removeChild(ImgDiv); });
- document.body.appendChild(ImgDiv);
- }
- U.UF.IMGes.ThumbnailsCase = function (ImgJson) {
- var fadeOut = null; //淡出计时器Interval
- var removealertBar = null; //移除提示框计时器Timeout
- var ThumbnailsArray = document.getElementById("ImgViewer_ThumbnailsArray");
- var ThumbnailsSlideShoe = document.getElementById("ImgViewer_ThumbnailsSlideShoe");
- var ThumbnailsSlideBar = document.getElementById("ImgViewer_ThumbnailsSlideBar");
- var ThumbnailsAlertBar = document.getElementById("ImgViewer_ThumbnailsAlertBar");
- var strCode = "";
- var Json = eval('(' + ImgJson + ')');
- USPhotoImgJson = Json;
- for (var i in Json) {
- var Img = Json[i]
- strCode += '<img onclick="U.UF.IMGes.CreatePhotoCase(\'' + Img.imgid + '\',\'' + Img.imgurl + '\',\'' + i + '\')" class="ImgViewer_ThumbnailsImg" src="' + Img.imgThumbnails + '"/>';
- }
- ThumbnailsArray.innerHTML = strCode;
- ThumbnailsArray.style.width = (Json.length / 2) * 68 + "px";
- ThumbnailsArray.parentNode.parentNode.style.display = "inline-block";
- var mousemoveOrdown = function () {
- pole = event.clientX - parseInt(ThumbnailsSlideShoe.parentNode.parentNode.getBoundingClientRect().left) - 35;
- pole = pole < 0 ? 0 : pole;
- pole = pole > 235 ? 235 : pole;
- ThumbnailsSlideShoe.style.left = pole + "px";
- ThumbnailsAlertBar.style.left = pole - 10 + "px";
- var ThumbnailsArrayleft = Math.ceil(pole) * ((parseInt(ThumbnailsArray.style.width) - 278) / 235);
- if (ThumbnailsArrayleft > 0) {
- ThumbnailsAlertBar.innerHTML = Math.round(ThumbnailsArrayleft) + 35 + "%";
- ThumbnailsArray.style.marginLeft = "-" + ThumbnailsArrayleft + "px";
- } else {
- ThumbnailsAlertBar.innerHTML = "小于范围值~~";
- ThumbnailsArray.style.marginLeft = "0px";
- }
- }
- var AlertFadeIn = function () {
- //提示框样式重置
- ThumbnailsAlertBar.style.filter = "alpha(opacity=100)";
- ThumbnailsAlertBar.style.MozOpacity = "1";
- ThumbnailsAlertBar.style.opacity = "1";
- ThumbnailsAlertBar.style.display = "inline-block";
- //再次清扫计时器防止内存溢出
- clearInterval(fadeOut);
- clearTimeout(removealertBar);
- //特效开始
- removealertBar = setTimeout(function () {
- i = 100;
- fadeOut = setInterval(function () {
- ThumbnailsAlertBar.style.filter = "alpha(opacity=" + i + ")";
- ThumbnailsAlertBar.style.MozOpacity = i * 0.01;
- ThumbnailsAlertBar.style.opacity = i * 0.01;
- i -= 2;
- if (i == 0) {
- ThumbnailsAlertBar.style.display = "none";
- //清扫计时器防止内存溢出
- clearInterval(fadeOut);
- clearTimeout(removealertBar);
- }
- }, 1);
- }, 800);
- }
- //事件控制
- ThumbnailsSlideBar.onmousedown = function () {
- mousemoveOrdown();
- ThumbnailsAlertBar.style.display = "inline-block";
- }
- ThumbnailsSlideBar.onmouseup = function () {
- if (!browser.msie) {
- AlertFadeIn();
- } else {
- clearTimeout(removealertBar);
- removealertBar = setTimeout(function () {
- ThumbnailsAlertBar.style.display = "none";
- clearTimeout(removealertBar);
- }, 800);
- }
- }
- ThumbnailsSlideShoe.onmousedown = function () {
- var ismoveSlide = true;
- document.body.onmousemove = function () {
- if (ismoveSlide == true) {
- mousemoveOrdown();
- ThumbnailsAlertBar.style.display = "inline-block";
- if (!browser.msie) {
- ThumbnailsAlertBar.style.filter = "alpha(opacity=" + i + ")";
- ThumbnailsAlertBar.style.MozOpacity = i * 0.01;
- ThumbnailsAlertBar.style.opacity = i * 0.01;
- }
- }
- }
- document.body.onmouseup = function () {
- if (document.all != undefined) ThumbnailsSlideShoe.releaseCapture();
- ismoveSlide = false;
- if (!browser.msie) {
- AlertFadeIn();
- } else {
- clearTimeout(removealertBar);
- removealertBar = setTimeout(function () {
- ThumbnailsAlertBar.style.display = "none";
- clearTimeout(removealertBar);
- }, 800);
- }
- document.body.onmouseup = function () { return false; }
- }
- }
- }
- //设置换行
- U.UF.C.SEKP = function (IF, CB, TF) {
- IF.onkeypress = function () { if (event.keyCode == 10 || event.keyCode == 13) { if (TF) { U.UF.EV.stopDefault(); } if (CB) { CB(); } } }
- }
- //由于需要大Div,小Div的loading,而现有的Loading函数有些复杂。需要逻辑再清晰,所以先独立,最后合并到一个loading中。
- //加载Gif动画效果,小加载,区别于博客,论坛的大加载。
- //此处需要异步装载,先装载文章(需要有加载动画),文章加载完毕再异步加载评论(需要有加载动画),否则会很慢。
- //参数load为true,则为显示图片,参数load为false,则为卸载。因为每个项目都要用所以放在了主项目中。
- U.UF.DL.SMGif = function (_div, _load) {
- if (_load == false) _div.removeChild(U.UF.C.GetCById(_div, "U_SMLD"));
- else $$("img", { "id": "U_SMLD", "className": "U_SMLDGif", "src": "http://www.1473.cn/img/us_smlding.gif" }, _div); //追加loading
- }
- //U.OU.TF = { "TF": "Excel" }
- //U.OU.DivisionExcelWord = function (Judge) { U.OU.JudgeEW = Judge; } //判断是Excel还是Wrod
- ////----------------------------------------------菜单功能----------------------------------------------------------//
- ////文件下拉菜单功能
- //U.OU.OpenFileMenu = function () {
- // U.UF.EV.stopBubble(); //阻止冒泡
- // var FileMenu = document.getElementById("U_E_OC");
- // FileMenu.style.display = FileMenu.style.display == "none" ? "block" : "none";
- //}
- ////切换菜单选项
- //U.OU.SwitchOption = function (Option, Judge) {
- // var OptionList = document.getElementById("U_E_MenuBar").getElementsByTagName("li");
- // for (var i = 1; i < OptionList.length; i++) { OptionList[i].className = ""; }
- // Option.className = "U_E_MenuButton";
- // document.getElementById(Judge).style.display = "block";
- // document.getElementById(Judge == "U_E_Tool" ? "U_OU_Nav" : "U_E_Tool").style.display = "none";
- //}
- ////-----------------------------------------------工具-----------------------------------------------------------//
- ////显示或隐藏颜色框
- //U.OU.DisplayColorFrame = function (FrameID) {
- // var ColorFrame = document.getElementById(FrameID);
- // ColorFrame.style.display = ColorFrame.style.display == "none" ? "block" : "none";
- // var OtherID = FrameID == "U_E_TColorFrame" ? "U_E_BColorFrame" : "U_E_TColorFrame"; //隐藏另一个颜色框
- // document.getElementById(OtherID).style.display = "none";
- //}
- ////点击颜色Li
- //U.OU.ColorLiOnClick = function (Li) {
- // var Color = Li.style.backgroundColor; var Father = Li.parentNode;
- // var BorderID = Father.id == "U_E_BColorFrame" ? "U_E_BColorBorder" : "U_E_TColorBorder";
- // var StyleName = Father.id == "U_E_BColorFrame" ? "BackColor" : "ForeColor";
- // document.getElementById(BorderID).style.backgroundColor = Color;
- // U.OU.ChangeStyle(StyleName, Color);
- // Father.style.display = "none"; //隐藏颜色框
- //}
- ////-----------------------------------------------插入-----------------------------------------------------------//
- //U.OU.InsertNowTime = function () {
- // var NowTime = US.Admin.TimeNow["年", "月", "日"];
- // if (U.OU.JudgeEW == "Word" || U.MD.O.E.KeepEditblur()) { U.UF.E.GetSelectionRange(window, $$("span")).Replace(NowTime); }
- // else {
- // var Compare = U.MD.O.E.ComparePickOn(); var Small = Compare[0]; var Big = Compare[1];
- // for (var i = Small[0]; i <= Big[0]; i++) {
- // for (var j = Small[1]; j <= Big[1]; j++) { U.MD.O.E.Cell[i][j].innerHTML = NowTime; }
- // }
- // }
- //}
- ////-----------------------------------------------文本编辑器-----------------------------------------------------------//
- //U.OU.ChangeStyle = function (SN, V, TF) {
- // if (U.OU.TF["TF"] == "Excel") {
- // var _UDFD = U.selectEl("#U_E_EditFrame")[0], _UDED = U.selectEl("div", _UDFD)[0];
- // if (_UDFD.ondblclick == null) { U.UF.E.FontSizeType(_UDED, SN, [V, V]); } //修改文字样式
- // else {
- // U.UF.E.GetSelectionRange(window, U.MD.O.E.SY["SEO"][0]).SetYPS(SN, V);
- // U.MD.O.E.SY["CE"]["Cell"][U.MD.O.E.SY["SEO"][1]].style[SN] = V;
- // }
- // }
- //}
- //////改变单元格或选中文本的样式(Style)
- ////U.OU.ChangeStyle = function (StyleName, Param) {
- //// var EJudge = U.OU.JudgeEW == "Word" || (U.MD.O.E.KeepEditblur() && StyleName != "BackColor" && StyleName != "JustifyLeft" && StyleName != "JustifyCenter" && StyleName != "JustifyRight");
- //// if (EJudge) {//判断是否处于编辑状态中,或者是否是Word
- //// if (Param == null) { document.execCommand(StyleName) }
- //// else { document.execCommand(StyleName, false, Param); }
- //// }
- //// else {
- //// // var StyleList = { "Bold": "fontWeight", "Italic": "fontStyle", "Underline": "textDecoration", "StrikeThrough": "textDecoration", "": "backgroundColor", "": "", "": "", "": "", "": "", "": "", "": "", "": "", "": "", "": "" };
- //// switch (StyleName) {
- //// case "Bold": StyleName = "fontWeight"; Param = ['bold', 'normal']; break;
- //// case "Italic": StyleName = "fontStyle"; Param = ['italic', 'normal']; break;
- //// case "Underline": StyleName = "textDecoration"; Param = ['underline', 'none']; break;
- //// case "StrikeThrough": StyleName = "textDecoration"; Param = ['line-through', 'none']; break;
- //// case "BackColor": StyleName = "backgroundColor"; break;
- //// case "ForeColor": StyleName = "color"; break;
- //// case "JustifyLeft": StyleName = "textAlign"; Param = "left"; break;
- //// case "JustifyCenter": StyleName = "textAlign"; Param = "center"; break;
- //// case "JustifyRight": StyleName = "textAlign"; Param = "right"; break;
- //// case "FontSize": StyleName = "fontSize"; Param = Param + "px"; break;
- //// case "FontName": StyleName = "fontFamily"; break;
- //// }
- //// var TempParam = Param.concat();
- //// var Compare = U.MD.O.E.ComparePickOn(); var Small = Compare[0]; var Big = Compare[1]; var Cell;
- //// for (var i = Small[0]; i <= Big[0]; i++) {
- //// for (var j = Small[1]; j <= Big[1]; j++) {
- //// Cell = U.MD.O.E.Cell[i][j];
- //// if (StyleName == "textDecoration") {//让删除线和下划线共存
- //// var Decoration = Param[0] == "underline" ? "line-through" : "underline";
- //// if (Cell.style[StyleName].indexOf(Decoration) > -1) { Param[0] = "underline line-through"; Param[1] = Decoration; }
- //// }
- //// if ((typeof (Param) == "string")) { Cell.style[StyleName] = Param; }
- //// else { Cell.style[StyleName] = Cell.style[StyleName] == Param[0] ? Param[1] : Param[0]; }
- //// if (StyleName == "textDecoration") { Param = TempParam.concat(); }
- //// }
- //// }
- //// }
- //// if (U.OU.JudgeEW == "Excel") { U.MD.O.E.EditTextEdit("Cell"); }
- ////}
- ////获取选中文本在整篇文章内的位置
- //U.OU.SelectedLocation = function () {
- // //Chorme
- // // var range = window.getSelection().getRangeAt(0);
- // // var startRangeOffset = range.startOffset;
- // // range.collapse(true);
- // // range.setStart(range.startContainer, startRangeOffset - 1);
- // // range.setEnd(range.startContainer, startRangeOffset - 1 + plenght);
- // //IE
- // // var EditFrame = document.getElementById("U_E_EditFrame");
- // // var EditContent = EditFrame.getElementsByTagName("div")[0];
- // var EditContent = document.getElementById("U_W_WordEdit");
- // var range = document.selection.createRange();
- // var stored_range = range.duplicate();
- // stored_range.moveToElementText(EditContent);
- // stored_range.setEndPoint('EndToEnd', range);
- // EditContent.selectionStart = stored_range.text.length - range.text.length;
- // EditContent.selectionEnd = EditContent.selectionStart + range.text.length;
- // //U.MD.O.E.setSelectText(EditContent, EditContent.selectionStart, EditContent.selectionEnd);
- //}
- ////将InnerHTML拆分成数组
- //U.OU.SpiltInnerHTML = function (InnerHTML) {
- // var InnerFrame = $$("span", { "innerHTML": InnerHTML });
- // InnerHTML = InnerFrame.innerHTML;
- // var ElementList = U.UF.EL.getChildrenNoText(InnerFrame.childNodes); var SubStr = "";
- // var NewArray = []; var Local; var ElementInner;
- // for (var i = 0; i < ElementList.length; i++) {
- // ElementInner = U.OU.OuterHTML(ElementList[i]);
- // Local = InnerHTML.toLowerCase().indexOf(ElementInner.toLowerCase());
- // SubStr = InnerHTML.substring(0, Local);
- // if (SubStr.replace(/(^\s*)|(\s*$)/g, "") != "") { NewArray.push(SubStr); } //如果为空就不加入到数组中
- // NewArray.push(ElementList[i]);
- // InnerHTML = InnerHTML.substring(Local + ElementInner.length, InnerHTML.length);
- // }
- // if (InnerHTML.replace(/(^\s*)|(\s*$)/g, "") != "") { NewArray.push(InnerHTML); }
- // return NewArray;
- //}
- //U.OU.OuterHTML = function (Element) {
- // var HTMLFrame = $$("span", {}); HTMLFrame.appendChild(Element);
- // return HTMLFrame.innerHTML;
- //}
- ////文本编辑器(兼容IE,Chroem)Firefox未测试
- //U.OU.Editplus = function (StyleName, Param) {
- // var BrowserJudge = !(document.selection); //判断是哪个浏览器
- // var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
- // var TextFather = BrowserJudge ? range.commonAncestorContainer.parentNode : range.parentElement(); //获取文本的父窗口
- // var InnerHTML = BrowserJudge ? document.createElement('span') : range.htmlText; //返回选中的InnerHTML
- // if (BrowserJudge) { SpanFrame.appendChild(range.cloneContents()).innerHTML; }
- // var ElementList = U.OU.SpiltInnerHTML(InnerHTML); //将InnerHTML分割成数组(根据标签进行分割)
- // var NewStyle = TextFather.style[StyleName] == Param[0] ? Param[1] : Param[0]; var NextSpan;
- // if (ElementList[0].nodeName) {//如果开头是标签就取标签相反的,如果是文本就取第一种样式
- // for (var i = 0; i < ElementList.length; i++) {
- // NewStyle = ElementList[i].style[StyleName]; NextSpan = ElementList[i + 1];
- // if (NextSpan == null || NextSpan.nodeName == null || NextSpan.style[StyleName] == NewStyle) { NewStyle = NewStyle == Param[0] ? Param[1] : Param[0]; break; }
- // }
- // }
- // var HTMLFrameB = $$("span", {}); var HTMLFrameS = $$("span", {}, HTMLFrameB);
- // var str = ChildList = ""; HTMLFrameS.style[StyleName] = NewStyle; var ElementName = "";
- // for (var i = 0; i < ElementList.length; i++) {
- // ElementName = ElementList[i].nodeName;
- // if (ElementName) {
- // if (ElementList[i].innerHTML == "" && ElementName == "SPAN") { continue; }
- // ChildList = ElementList[i].getElementsByTagName("*");
- // for (var j = 0; j < ChildList.length; j++) { if (ChildList[j].nodeName != "BR") { ChildList[j].style[StyleName] = NewStyle; } }
- // if (ElementName != "BR") {
- // if (ElementName == "P" && (i == 0 || i == ElementList.length - 1)) {
- // // if (i == ElementList.length - 1) { str += "<p>"; }
- // HTMLFrameS.innerHTML = ElementList[i].innerHTML;
- // str += HTMLFrameB.innerHTML;
- // if (i == 0) { str += "<br />"; }
- // continue;
- // }
- // ElementList[i].style[StyleName] = NewStyle;
- // }
- // str += U.OU.OuterHTML(ElementList[i]);
- // }
- // else { HTMLFrameS.innerHTML = ElementList[i]; str += HTMLFrameB.innerHTML; }
- // }
- // if (BrowserJudge) { var NewFrame = $$("span", { "innerHTML": str }); range.deleteContents(); range.insertNode(HTMLFrameS); }
- // else { range.pasteHTML(str); }
- //}
- ////文本编辑器(兼容IE,Chroem)Firefox未测试
- ////U.OU.Editplus = function (StyleName, Param) {
- //// var BrowserJudge = !(document.selection); //判断是哪个浏览器
- //// var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
- //// var TextFather = BrowserJudge ? range.commonAncestorContainer.parentNode : range.parentElement(); //获取文本的父窗口
- //// var SpanFrame = BrowserJudge ? document.createElement('span') : $$("span", { "innerHTML": range.htmlText }); //返回innerHTML为选中内容的span
- //// if (BrowserJudge) { SpanFrame.appendChild(range.cloneContents()); } var SpanList = SpanFrame.getElementsByTagName("*");
- //// var NewStyle = Param[0]; var NextSpan;
- //// //如果开头是标签就取标签相反的,如果是文本就取第一种样式
- //// if (!(SpanFrame.firstChild.nodeValue)) {
- //// for (var i = 0; i < SpanList.length; i++) {
- //// NewStyle = SpanList[i].style[StyleName]; NextSpan = SpanList[i + 1];
- //// if (NextSpan == null || NextSpan.style[StyleName] == NewStyle) { NewStyle = NewStyle == Param[0] ? Param[1] : Param[0]; break; }
- //// }
- //// }
- //// else { NewStyle = TextFather.style[StyleName] == Param[0] ? Param[1] : Param[0]; }
- //// for (var i = 0; i < SpanList.length; i++) { SpanList[i].style[StyleName] = NewStyle }; //让内部所有标签都为该css
- //// SpanFrame.style[StyleName] = NewStyle;
- //// if (BrowserJudge) { range.deleteContents(); range.insertNode(SpanFrame); return; }
- //// if (TextFather.contentEditable == "true" || U.OU.DivisionEW == "Word") { range.pasteHTML(SpanFrame.outerHTML); }
- //// else {
- //// TextFather.style[StyleName] = NewStyle; SpanList = TextFather.getElementsByTagName("*");
- //// for (var i = 0; i < SpanList.length; i++) { SpanList[i].style[StyleName] = NewStyle };
- //// }
- ////}
- ////让回车生成的<p></p>变成<br />
- //U.OU.EditOnkey = function () {
- // var BrowserJudge = !(document.selection); //判断是哪个浏览器
- // var range = BrowserJudge ? window.getSelection().getRangeAt(0) : document.selection.createRange();
- // if (event.keyCode == 13 || event.keyCode == 108) {
- // U.UF.EV.stopDefault(); //阻止系统事件
- // var dd = document.createElement("br");
- // if (BrowserJudge) { range.deleteContents(); range.insertNode(dd); }
- // else { range.pasteHTML("<br />"); }
- // }
- // U.UF.EV.stopBubble(); //阻止冒泡
- //}
- // freeze: Object.freeze || function (UDE) { //冻结对象
- // if (Object.defineProperty) {
- // if (!U.UF.Ut.isForObj(UDE)) { throw new Error("Object.defineProperties requires more than 0 arguments"); } //error
- // else {
- // var i, _UCE = Object.create(null);
- // for (i in UDE) {
- // if (UDE.hasOwnProperty(i)) {
- // if (U.UF.C.isObject(UDE[i])) { Object.freeze(UDE[i]); }
- // else { Object.defineProperty(_UCE, i, { value: UDE[i], configurable: false, writable: false }); }
- // }
- // }
- // return UDE;
- // }
- // }
- // else { throw new Error("Browser version is too low"); }
- // },
- // isFrozen: Object.isFrozen || function (UDE) {//判断元素是否冻结 configurable and writable is false
- // if (Object.getOwnPropertyDescriptor) {
- // if (U.UF.Ut.isForObj(UDE)) {
- // for (var i in UDE) {
- // if (U.UF.C.isObject(UDE[i])) { if (!Object.isFrozen(UDE[i])) { return false; } }
- // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (!_UCE.configurable && !_UCE.writable) { return false; } } //不可读写的为密封
- // }
- // return true;
- // }
- // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
- // }
- // else { throw new Error("Browser version is too low"); }
- // },
- // preventExtensions: Object.preventExtensions || function () { //设置属性不可扩展
- // if (Object.defineProperty) {
- // if (U.UF.Ut.isForObj(UDE)) {
- // for (var i in UDE) {
- // if (U.UF.C.isObject(UDE[i])) { Object.preventExtensions(UDE[i]); }
- // else { Object.defineProperty(UDE, i, { value: UDE[i], configurable: false }); }
- // }
- // return UDE;
- // }
- // else { throw new Error(UDE + " is not an object"); }
- // }
- // else { throw new Error("Browser version is too low"); }
- // },
- // isExtensible: Object.isExtensible || function () {//是否可扩展
- // if (Object.getOwnPropertyDescriptor) {
- // if (U.UF.Ut.isForObj(UDE)) {
- // var i, _UCE;
- // for (i in UDE) {
- // if (U.UF.C.isObject(UDE[i])) { if (Object.isExtensible(UDE[i])) { return true; } } //不可扩展
- // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (_UCE.configurable) { return true; } } //判断是否可扩展
- // }
- // return false;
- // }
- // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
- // }
- // else { throw new Error("Browser version is too low"); }
- // },
- // seal: Object.seal || function (UDE) {//密封对象
- // return Object.preventExtensions(UDE);
- // },
- // isSealed: Object.isSealed || function () { //判断对象是否密封对象
- // if (Object.getOwnPropertyDescriptor) {
- // if (U.UF.Ut.isForObj(UDE)) {
- // var i, _UCE;
- // for (i in UDE) {
- // if (U.UF.C.isObject(UDE[i])) { if (!Object.isSealed(UDE[i])) { return false; } }
- // else { _UCE = Object.getOwnPropertyDescriptor(UDE, i); if (_UCE.configurable && _UCE.writable) { return false; } } //可读可写不为密封对象
- // }
- // return true;
- // }
- // else { throw new Error(arguments.length ? UDE + " is not an object" : "Object.preventExtensions requires more than 0 arguments"); }
- // }
- // else { throw new Error("Browser version is too low"); }
- // },
-
- // 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();
- // if ((_UEL = _UDE.length)) {
- // 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的值
- // 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值查看
- // 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值查看
- // }
- // 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")); }
- //搜索云好友赋事件
- //U.MD.D.H.SSHY = function () {
- // var i, UDOD, _UDE = ["UD_SYSSZSJ"];
- // 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(); }
- //}
- /*
- U.MD.O.OLWord = function (UIF, UDE, UDOD, UDFD, USID) {
- var _UTH;
- var _UW = UDFD.contentWindow; //获取window操作层
- var _UDPD = U.selectEl(UDOD).Parent(); //获取父亲层
- var _UDAD = U.selectEl(_UW.document.body).childs(0, 0).Child(); //获取Ifrmae下的第一个元素的子级
- var _UDMD = _UDAD[1]; //推荐分享区
- var _UAE = U.MD.DK.M.GDBFM("uw"); //获取最近打开的uw文件
- U.UF.DL.uploading(UDOD); //设置loading
- 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作为换行
- (!_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)); //打印值//打印最近推荐
- }
- */
- //暂时先屏蔽 网上很少使用
- //outerText 最初是由 IE4.0 浏览器实现的私有属性,只有 Firefox 不支持该属性
- //兼容outerText
- // if (!!document.getBoxObjectFor || window.mozInnerScreenX != null) {//判断是否为firefox
- // HTMLElement.prototype.__defineSetter__("outerText", function (str) {
- // var parsedText = document.createTextNode(str); //创建文本节点
- // this.parentNode.replaceChild(parsedText, this); //用创建的文本节点代替this
- // return parsedText;
- // });
- // HTMLElement.prototype.__defineGetter__("outerText", function () {
- // var r = this.ownerDocument.createRange(); //在这个元素的根元素创建一个(Range 对象)
- // r.selectNodeContents(this); //设置该范围的边界点,使它包含指定节点的子孙节点,但不包含指定的节点本身;参数->其子节点将成为当前范围的内容的节点
- // return r.toString(); //把一个逻辑值转换成字符串,并返回结果
- // });
- // }
- //暂时先屏蔽
- // if (!("componentFromPoint" in HTMLElement.prototype)) {//通过特定事件返回对象在指定坐标下的位置
- // U.UF.EV.boundProperties(HTMLElement.prototype, "componentFromPoint", function () {//componentFromPoint("指定x的客户端窗口的坐标","指定y的客户端窗口的坐标")
- // return function () {
- // var _UE = U.UF.C.GetMousep();
- // var _UDE = U.UF.EL.getElementInfo(this);
- // if ((_UE["X"] > _UDE["CW"] + _UDE["TX"]) || (_UE["Y"] > _UDE["CH"] + _UDE["TY"])) {
- // return "outside";
- // }
- // return "";
- // }
- // },
- // function () { });
- // }
- //IE的script元素支持onreadystatechange事件,不支持onload事件.
- //FF的script元素不支持onreadystatechange事件,只支持onload事件.
- // if (!("onreadystatechange" in HTMLElement.prototype)) {//判断是否是firefox
- // U.UF.EV.boundProperties(HTMLElement.prototype, "onreadystatechange", function () {
- // return this.onload;
- // },
- // function (cb) {
- // this.onload = cb;
- // });
- // }
- // function loadJS(url, success) {
- // var domScript = document.createElement('script');
- // domScript.src = url;
- // success = success || function () { };
- // domScript.onload = domScript.onreadystatechange = function () {
- // if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
- // success();
- // this.onload = this.onreadystatechange = null;
- // this.parentNode.removeChild(this);
- // }
- // }
- // document.getElementsByTagName('head')[0].appendChild(domScript);
- // }
- // if (!("setCapture" in HTMLElement.prototype)) {//判断是否是firefox
- // U.UF.EV.boundProperties(HTMLElement.prototype, "setCapture", function () {
- // return function () { window.captureEvents(Event.MOUSEMOVE); } //firefox对于鼠标事件的捕捉
- // },
- // function () { }); }
- //
- // if (!("releaseCapture" in HTMLElement.prototype)) {//判断是否是firefox
- // U.UF.EV.boundProperties(HTMLElement.prototype, "releaseCapture", function () {
- // return function () {
- // window.releaseEvents(Event.MOUSEMOVE);
- // }
- // },
- // function () { });
- // }
- //setCapture和window.captureEvents(Event.MOUSEMOVE)的兼容
- // if (!("event" in window.constructor.prototype)) {/*检测浏览器是否支持鼠标键盘事件*/
- // U.UF.EV.boundProperties(window.constructor.prototype, "event", function () {
- // var _UDE = arguments.callee; //arguments.callee ->指向参数arguments对象的函数
- // while (_UDE.caller) {//一直往上寻找直到 寻找到顶层作用域 返回null 再往下执行
- // _UDE = _UDE.caller;
- // }
- // return _UDE.arguments ? _UDE.arguments[0] : null; //arguments 是一个对应于传递给函数的参数的类数组对象。
- // }, function () { });
- // }
- // if (!("srcElement" in window.Event.prototype)) {
- // U.UF.EV.boundProperties(window.Event.prototype, "srcElement", function () {
- // return event.target;
- // },
- // function () { });
- // }
- //srcElement 和 target 的兼容
- // var theEvent = window.event || arguments.callee.caller.arguments[0]; //arguments.callee.caller.arguments[0]相当于firefox的获取event
- // var srcElement = theEvent.srcElement; //捕获当前事件作用的对象
- // if (!srcElement) {//Firefox不兼容srcElement
- // srcElement = theEvent.target; //Firefox兼容target
- // }
- // if (!("keyCode" in window.Event.prototype)) {
- // U.UF.EV.boundProperties(window.Event.prototype, "keyCode", function () {
- // return event.which;
- // },
- // function () { });
- // }
- //keyCode - 兼容chrom和Firefox
- // HTMLElement.prototype.__defineGetter__("onmousewheel", function () {
- // return this.onwheel;
- // });
- // HTMLElement.prototype.__defineSetter__("onmousewheel", function (cb) {
- // this.onwheel = cb;
- // });
- // if (!("onmousewheel" in HTMLElement)) {
- // if ("onwheel" in HTMLElement.prototype) {
- // U.UF.EV.boundProperties(HTMLElement.prototype, "onmousewheel", function () {
- // return this.onwheel;
- // },
- // function (cb) {
- // this.onwheel = cb;
- // });
- // }
- // else {
- // //firefox支持onmousewheel
- // if (browser.firefox) {
- // (function () {
- // window.addEventListener("DOMMouseScroll", function (UE) {
- // //监控Scroll事件
- // var _UOE = null
- // , _UDOD = UE.srcElement;
- // do {
- // _UOE = U.selectEl(_UDOD).attr("onmousewheel") || _UDOD.onmousewheel;
- // _UDOD = U.selectEl(_UDOD).Parent();
- // } while (!(_UOE || !_UDOD)); //冒泡的顶部获取
- // if (_UOE) {
- // (typeof _UOE == "string") && (_UDOD.onmousewheel = new Function(_UOE));
- // U.M.StopDefault();
- // //阻止页面固定事件
- // setTimeout(function () {
- // _UOE.call(this, UE);
- // }
- // , 0);
- // //异步执行 解决锁定的bug
- // }
- // }
- // , false);
- // }
- // )();
- // }
- // }
- // }
- //------------------------------------------------------------------------------------------
- // if (!("innerText" in HTMLElement.prototype)) {/*检测浏览器是否支持innerText这个方法*/
- // U.UF.EV.boundProperties(HTMLElement.prototype, "innerText",
- // function () {
- // return this.textContent;
- // },
- // function (UDE) {
- // this.textContent = UDE;
- // }
- // );
- // }
- //------------------------------------------------------------------------------------------
- // if (!("outerHTML" in HTMLElement.prototype)) {/*检测浏览器是否支持outerHTML这个方法*/
- // U.UF.EV.boundProperties(HTMLElement.prototype, "outerHTML",
- // function () {
- // var _UDOD = this.cloneNode(true),
- // _UDTD = $$("div", {});
- // _UDTD.appendChild(_UDOD);
- // return _UDTD.innerHTML; /*如果不支持就使用innerhtml插入*/
- // },
- // function (UTH) {
- // var i, _UDOD = U.selectEl(this), _UDPD = _UDOD.Parent(), _UDCD = $$("div", {
- // "innerHTML": UTH
- // }).childNodes, _UDTD = document.createDocumentFragment;
- // for (i = 0; i < _UDCD.length; i++) {
- // _UDTD.appendChild(_UDCD[i]);
- // }
- // ; _UDTD.insertBefore(_UDTD, this);
- // _UDOD.remove();
- // }
- // );
- // }
- //------------------------------------------------------------------------------------------
- // if (!("outerText" in HTMLElement.prototype)) {/*检测浏览器是否支持outerText这个方法*/
- // U.UF.EV.boundProperties(HTMLElement.prototype, "outerText",
- // function () {
- // var _UDOD = this.cloneNode(true)
- // , _UDTD = $$("div", {});
- // _UDTD.appendChld(_UDOD);
- // return _UDTD.innerText; /*如果不支持就使用innerText插入*/
- // },
- // function (UTH) {
- // var i, _UDOD = U.selectEl(this), _UDPD = _UDOD.Parent(), _UDCD = $$("div", {
- // "innerText": UTH
- // }).childNodes, _UDTD = document.createDocumentFragment;
- // for (i = 0; i < _UDCD.length; i++) {
- // _UDTD.appendChild(_UDCD[i]);
- // }
- // _UDTD.insertBefore(_UDTD, this);
- // _UDOD.remove();
- // });
- // }
- //------------------------------------------------------------------------------------------
- // if (!("currentStyle" in HTMLElement.prototype)) {
- // U.UF.EV.boundProperties(HTMLElement.prototype, "currentStyle", function () {
- // return getComputedStyle(this, false);
- // },
- // function () { });
- // }
- //------------------------------------------------------------------------------------------
- // if (!("onresize" in HTMLElement.prototype) || !browser.msie) {//HTMLElement.prototype内没有onresize 则执行这个函数
- // U.UF.CP.onresize = function (UDOD, UDTD, cb) {
- // Size事件设置
- // if (cb) {
- // UDOD.contentDocument.defaultView.onresize = function () { U.UF.C.apply(UDTD, [[cb]])(); } //
- // }
- // else {
- // try {
- // delete this.__SizeElement__;
- // } catch (e) { }
- // }
- // }
- // U.UF.EV.boundProperties(HTMLElement.prototype, "onresize", function () {
- // try {
- // this.__SizeElement__.contentDocument.defaultView.onresize;
- // } catch (e) {
- // return null;
- // }
- // },
- // function (cb) {
- // if (this.tagName) {
- // 设置Set事件
- // var _UDOD = this.__SizeElement__;
- // (U.UF.EL.getStyle(this, "position") == "static") && (this.style.position = "relative");
- // if (!_UDOD || U.selectEl(_UDOD).Parent() != this && cb) {
- // _UDOD = this.__SizeElement__ = $$("object", {
- // "onload": function(){U.UF.CP.onresize(this, this, cb);},
- // "type": "text/html",
- // "data": "about:blank",
- // "style": {
- // "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;"
- // }
- // }, this)[0];
- // }
- // else {
- // U.UF.CP.onresize(_UDOD, this, cb);
- // }
- // }
- // });
- // }
- // if (!("componentFromPoint" in HTMLElement.prototype)) { // --------- 上面有重复代码
- // U.UF.EV.boundProperties(HTMLElement.prototype, "componentFromPoint", function () {
- // return function () {
- // var _UE = U.UF.EL.getMousePosition();
- // var _UDE = U.UF.EL.getElementInfo(this);
- // if ((_UE["X"] > _UDE["CW"] + _UDE["TX"]) || (_UE["Y"] > _UDE["CH"] + _UDE["TY"])) {
- // return "outside";
- // }
- // return "";
- // }
- // },
- // function () { });
- // }
- ////发送消息到桌面提示
- //U.MD.F.N.ZMTS = function (UDE) {
- // var i, j, k, _UKE, _USE,
- // _UET = window.external,
- // _UTF = [], _UCE = [[], []];
- // for (i = 0; i < UDE.length; i++) {
- // if (i) {
- // _USE = UDE[i][3];
- // for (j = 0; j < _USE.length; j++) {
- // _UTF[0] = true;
- // _UKE = _USE[j];
- // _UCE[1].push({
- // "UsImag": _UKE.UserThumbnailImageHead !== undefined ? U.MD.C.getHeadImage(_UKE.UserThumbnailImageHead) : US.DOMAIN + "img/getface.jpg",
- // "UsSYSUN": "",
- // "UsSYScontent": _UKE["NEWC"] || _UKE["ET"],
- // "UsName": _UKE.UserName,
- // "UsType": _UKE["NEWTYPE"]
- // });
- // }
- // }
- // else { //属于闪烁消息
- // for (j = 0; j < UDE[i].length; j++) {
- // _USE = UDE[i][j];
- // if (_USE && _USE.length) {
- // for (k = 0; k < _USE.length; k++) {
- // _UTF[1] = true;
- // _UKE = _USE[k];
- // _UCE[0].push({
- // "UsImag": _UKE.UserThumbnailImageHead != null ? U.MD.C.getHeadImage(_UKE.UserThumbnailImageHead) : US.DOMAIN + "img/getface.jpg",
- // "UsSYSUN": "",
- // "UsSYScontent": _UKE,
- // "UsName": _UKE.FriendsDescript || _UKE.UserNickName || _UKE.GroupManageName,
- // "UsType": _UKE.MessageIsVerify || 0
- // });
- // }
- // }
- // }
- // }
- // }
- // try { //云端浏览器
- // if (_UET) {
- // if (_UTF[0]) { _UET.news(U.UF.C.jsonToStr(_UCE[1])); }
- // if (_UTF[1]) { _UET.ftpshow(U.UF.C.jsonToStr(_UCE[0])); } else { _UET.QXftpshow(); } //属于普通消息 //闪烁消息
- // _UCE[0] = _UCE[1] = null; CollectGarbage(); return null;
- // }
- // } catch (e) { } //html5消息查看
- //}
- //#region 带虚拟框的拖动
- /*
- * 拖动函数处理
- *
- * @param {element} 需要拖动的元素
- * @param {function} 拖动回调函数
- * @param {object} 拖动参数
- ----------参数为getElementInfo 返回值
- * @return {object} 拖动对象
- */
- U.UF.F.DragMouseDown = function (UDOD, cb, UDE) {
- if (event.button < 2) { //判断左键使用
- var _UTE = new U.UF.F.DragMouseDown.init(UDOD, cb, UDE),
- _UKE = {//拖动事件处理
- "mousemove": U.UF.C.apply(_UTE, _UTE.Drag), //move事件处理
- "mouseup": U.UF.C.apply(_UTE, _UTE.DragUp) //up事件处理
- };
- //绑定事件
- U.UF.C.AddObj(_UTE, _UKE); //给拖动方法添加新的事件。
- _UTE.create(); //创建拖动参数
- U.selectEl(document).bind(_UKE); //绑定拖动事件
- //返回对象
- return (U.UF.F.DragMouseDown.ST = _UTE);
- }
- }
- /*
- * 初始化拖动等待拖动
- *
- * @param {element} 需要拖动的元素
- * @param {function} 拉伸回调函数
- * @param {object} 拖动参数
- * @param {object} 拉伸回调函数
- ----------参数为getElementInfo 返回值
- */
- U.UF.F.DragMouseDown.init = function (UDOD, cb, UDE, UCE) {
- if (UCE && UCE.start) { UCE.start() }; //初始化回调
- this.set(UCE);
- //参数设置和说明
- this.set({
- max: (UDE && UDE.MaxLeft) ? UDE : null, //最大的拖动范围
- SO: UDOD, //拖动的元素
- AF: cb, //回调函数
- ESO: event.srcElement //当前选中的元素
- });
- return this;
- }
- U.UF.F.DragMouseDown.init.prototype = {
- /*
- * 设置拖动参数 上述有参数说明
- *
- * @param {object} 需要拖动的元素
- */
- set: function (UDE) {
- if (UDE) { U.UF.C.AddObj(this, UDE) };
- },
- /*
- * 创建虚拟框
- *
- */
- create: function () {
- var _UDOD = this.SO, //拖动元素
- _UHE = U.UF.EL.getElementInfo(_UDOD); //拖动元素的位置
- //参数设置
- U.UF.C.AddObj(this, {
- IsD: false, //是否为有效拖动
- XY: U.UF.EL.getMousePosition(), //当前鼠标位置
- E: _UHE, //拖动元素大小等
- MaxTop: _UHE["PXT"] + US.height - 10, //最大拖动top
- MaxLeft: _UHE["PXL"] + US.width, //最大拖动left
- MinLeft: -_UHE["OW"] + 10, //最小拖动left
- MinTop: 0 //最小拖动top
- });
- //判断是否有最大范围设置
- if (this.max) { this.IsMinAndMax() };
- },
- /*
- * 限制拖动范围
- *
- * @param {object} 需要拖动的元素
- */
- IsMinAndMax: function (UDE) {
- U.UF.C.AddObj(this,
- { "MaxLeft": this.E["PXL"] + UDE["MaxLeft"] || this.MaxLeft, //最大拖动left
- "MinLeft": UDE["MinLeft"] || this.MinLeft, //最小拖动left
- "MinTop": UDE["MinTop"] || this.MinTop, //最小拖动top
- "MaxTop": this.E["PXT"] + UDE["MaxTop"] || this.MaxTop //最大拖动top
- }); //设置拉伸的范围限制
- },
- //拖动时触发的函数
- Drag: function () {
- var i, _UHE, _UDTD, _UDMD,
- _UDOD = this.SO, //拖动元素
- _UDE = [["X", "Left", "L"], ["Y", "Top", "T"]], //设置参数
- _UME = this.E, //拖动元素原大小位置
- _UCE = this.XY,
- _UE = U.UF.EL.getMousePosition(); //鼠标的位置
- if (this.move) { this.move(this) }; //回调函数
- //循环判断设置 top left
- for (i = 0; i < _UDE.length; i++) {
- _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]]);
- }
- //第一次拖动的参数
- if (!this.IsD) {
- this.IsD = true; //设置正在拖动
- U.UF.C.AddObj(this, {
- VDB: U.UF.F.foundVirtualBox(_UDOD), //添加虚拟框
- UMD: U.UF.F.maskFrame() //添加遮层
- });
- //绑定事件
- U.selectEl(this.UMD).bind({
- mousemove: this.mousemove, //移动事件绑定
- mouseup: this.mouseup //释放事件
- });
- //遮罩置顶
- U.UF.F.topWindow(this.UMD);
- U.UF.F.topWindow(this.VDB);
- //鼠标聚焦处理
- this.VDB.setCapture();
- }
- //鼠标处理
- U.selectEl(this.VDB).addAttrArray({ "style":
- {
- "cssText": "left:" + _UDE[0] + "px;top:" + _UDE[1] + "px;"
- }
- });
- },
- //拖动结束
- DragUp: function () {
- //事件释放
- $[document, this.UMD].unbind(
- {
- "mousemove": this.mousemove, //拖动变化使用
- "mouseup": this.mouseup //拖动结束
- });
- this.IsD = false; //设置结束
- //释放元素 同时元素定位
- if (this.VDB) {
- var _UDMD = this.UMD, //遮罩框
- _UDTD = this.VDB, //虚拟框
- _UDE = U.UF.EL.getElementInfo(_UDTD); //拖动结束的位置
- _UDTD.releaseCapture();
- U.UF.F.DragMouseDown.chche = U.UF.F.DragMouseDown.ST = null;
- $[_UDMD, this.VDB].remove(); //元素移除 //事件结束
- U.selectEl(this.SO).addAttrArray({ "style":
- {
- "cssText": "top:" + (_UDE["OT"] + 2) + "px;left:" + (_UDE["OL"] + 2) + "px;"
- }
- });
- U.UF.F.withf(this.cb); //执行回调
- }
- }
- }
- //#endregion
- //#region
- /*
- * 直接拖动元素不带虚拟框 一般常用于图标移动
- *
- * @param {element} 需要拖动的元素
- * @param {object} 拖动参数
- ----------[ST] 初始化回调函数
- * @return {object} 拖动对象
- */
- U.UF.F.iconmove = function (UDOD, UDE) {
- if (event.button != 2) { //只有右键允许拖动
- var _UTE = new U.UF.F.iconmove.init(UDOD, UDE);
- return _UTE;
- }
- }
- U.UF.F.iconmove.init = function (UDOD, UDE) { //拖动开始
- if (UDOD) {
- var i, _UE = U.UF.EL.getElementInfo($(UDOD)[0]), //拖动元素的位置
- _UKE = U.UF.EL.getMousePosition(), //鼠标位置
- _UCE = this.UCE = {
- "mousemove": U.UF.C.apply(this, function () { this.move(); }), //移动函数处理
- "mouseup": U.UF.C.apply(this, function () { this.up(); }) //释放函数处理
- };
- if (UDE && UDE["ST"]) { UDE["ST"].call(this, UDOD) }; //初始化回调
- //初始化参数
- U.UF.C.AddObj(this, {
- IsD: false, //设置未拖动状态
- UMD: U.UF.F.maskFrame(), //虚拟框
- E: _UKE, //鼠标位置
- SO: UDOD, //拖动元素
- UE: _UE, //元素的位置
- UCF: UDE, //拖动传参
- MT: _UE["PXT"] + US.height - 10, //拖动最大top
- ML: _UE["PXL"] + US.width, MIL: -_UE["OW"] + 10, //拖动最大left
- MIT: 0 //最小拖动范围
- });
- //绑定设置
- UDOD.setCapture(); //事件聚焦
- U.selectEl(document).bind(_UCE); //事件绑定
- U.UF.F.topWindow(this.UMD, true); //置顶
- U.selectEl(UDOD).css("z-index", 9999); //当前拖动元素置顶
- return this;
- }
- }
- U.UF.F.iconmove.init.prototype = {
- //移动效果
- move: function () {
- var i, _UTL,
- _UDOD = this.SO; //当前拖动元素处理
- _UE = U.UF.EL.getMousePosition(), //当前拖动鼠标位置
- _UKE = this.E, //初始鼠标位置
- _UME = this.UE, //元素位置
- _UAE = [["x", "L"], ["y", "T"]]; //变化top left对应参数
- U.UF.EV.stopBubble(); //阻止冒泡
- if (!this.UMD) {
- this.UMD = U.UF.F.maskFrame();
- U.selectEl(this.UMD).bind(this.UCE); //事件绑定
- }
- //计算获取位置
- for (i = 0; i < _UAE.length; i++) {
- _UTL = _UE[_UAE[i][0]] - _UKE[_UAE[i][0]];
- if (Math.abs(_UTL) > 2) { this.IsD = true };
- _UAE[i] = Math.min(Math.max(_UTL + _UME["O" + _UAE[i][1]], this["MI" + _UAE[i][1]]), this["M" + _UAE[i][1]]);
- }
- //设置值
- U.selectEl(_UDOD).addAttrArray({ "style": { "cssText": "left:" + _UAE[0] + "px;top:" + _UAE[1] + "px"} }); //?
- if (this.UCF && this.UCF["Move"]) { this.UCF["Move"].apply(this, [_UDOD, _UAE, _UKE, _UE]) }; //回调
- this.ism = true;
- },
- //移动结束
- up: function () {
- var _UDOD = this.SO, //拖动元素
- _UFE = this.UCF; //回调函数
- U.UF.EV.stopBubble(); //阻止冒泡
- _UDOD.setCapture(); //事件聚焦
- //释放
- this.ism = null;
- U.selectEl(this.UMD).remove(); //虚拟框移除
- U.selectEl(document).unbind(this.UCE); //移除绑定
- U.selectEl(_UDOD).css("z-index", ""); //去除置顶
- // //回调
- if (_UFE && _UFE["UP"]) { _UFE["UP"].apply(this, [_UDOD]) }; //回调函数处理
- setTimeout(function () {
- _UDOD.releaseCapture();
- }, 0); ; //鼠标聚焦移除
- }
- }
- //#endregion
- /*
- * 分页获取数据!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!放这里是什么意思?????
- *
- * @param {array} 帖子信息
- * @param {number} 位置
- * @param {number} 数量
- * @returns {array}
- */
- U.MD.D.D.FYGBL = function (UDE, UP, UHP) {
- UHP = UHP || [10, 300];
- var _UDV, _UNP = UHP[1] / UHP[0],
- _UTP = Math.ceil(UP / _UNP),
- _UCP = UP % _UNP;
- UP = !_UCP ? _UNP : _UCP; //分页的页码
- if (UDE && (UDE = UDE[_UTP])) {
- _UDV = UDE.slice((UP - 1) * UHP[0], (UP * UHP[0]));
- }
- return [_UDV, _UTP]; //分页的数据
- }
- //未登录图标的集合
- //U.MD.D.D.Desktop = function (UTF) {
- // // return UTF === 1 ? U.MD.D.D.Class : U.MD.D.D.DesktopOr(UTF);
- // // if ((!U.MD.D.D.Class && UTF == 1) || UTF == 2) {
- // // var i, j, _UDE = U.MD.D.D.Class = [], _UKE = U.MD.D.D.GetDesk();
- // // for (i = 0; i < _UKE.length; i++) { if (!(i % 7)) { _UDE[(j = _UDE.length)] = []; } _UDE[j].push(new U.MD.D.T(_UKE[i])); }
- // // return _UDE;
- // // } else { return UTF === 1 ? U.MD.D.D.Class : U.MD.D.D.DesktopOr(UTF); }
- //}
|