12 |
- Namespace.register("U.MD.UI.BTree"),U.MD.UI.BTree=function(e,t,n,o,i,r,l,a,s,c,d){U.MD.UI.BTree.jsonStartLeft(e,r[0],t),U.MD.UI.BTree.jsonStartRight(r[1],t,n,o,i,l,a,s,c,d)},U.MD.UI.BTree.treeCreate=function(e,t,n){for(var o=0;o<e.length;o++){var i=$$("ul",{className:"U_MD_UI_Tree_a "+e[o].parentID},t),r=$$("li",{id:e[o].id,parentid:e[o].parentid,className:"U_MD_UI_Tree_listyle",parentid:e[o].id,deep:e[o].deep},i),l=$$("img",{onerror:U.MD.C.imgError,src:e[o].img_url,className:"U_MD_UI_Tree_imgstyle"},r);$$("span",{innerHTML:e[o].name,className:"spanstyle"},r);i.style.display="none","1"==e[o].deep&&(i.style.display="block"),l.aa=!1;var a=document.getElementsByClassName("U_MD_UI_Tree_a "+e[o].parentID)[0];i.style.display=a.style.display,r.onclick=function(){if(n(this),a=document.getElementsByClassName("U_MD_UI_Tree_a "+this.parentid),!0===l.aa){l.aa=!1;for(var e=0;e<a.length;e++)a[e].style.display="none"}else{l.aa=!0;for(e=0;e<a.length;e++)a[e].style.display="block"}},e[o].child&&U.MD.UI.BTree.treeCreate(e[o].child,i,n)}},U.MD.UI.BTree.JsonSelect=function(e,t){for(var n=[],o=0;o<e.length;o++){if(0==t)return e;if(e[o].id==t)return n=e[o].child,n;if(e[o].child)var i=U.MD.UI.BTree.JsonSelect(e[o].child,t)}return i},U.MD.UI.BTree.DirectoryCreate=function(e,t,n,o,i,r,l,a,s,c,d){0==c?(n[1].style.display="none",n[2].style.display="none"):(n[2].style.display="none",n[c].style.display="block");var p="修改",_="删除";if(a&&s&&(p="",_=""),t[c].innerHTML="",n[c].parentID=o,n[c].deep=c+1,d&&(t[d].innerHTML=""),e)for(var u=0;u<e.length;u++){var g=$$("ul",{className:"U_MD_UI_Tree_styleul",parentid:e[u].parentID,deep:e[u].deep},t[c]),D=$$("li",{className:"U_MD_UI_Tree_styleli",innerHTML:e[u].name,parentid:e[u].id},g),m=$$("input",{type:"button",pid:e[u].id,parentid:e[u].parentID,innerHTML:p,className:"U_MD_UI_Tree_button"},g),h=$$("input",{type:"button",pid:e[u].id,parentid:e[u].parentID,innerHTML:_,className:"U_MD_UI_Tree_button1"},g);m.onclick=function(){r(this,t,n,o,i,r,l,a,s,c)},h.onclick=function(){i(this,t,n,o,i,r,l,a,s,c)},D.onclick=function(){d?U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(e,this.parentid),t,n,this.parentid,i,r,l,a,s,d):2==c||U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(e,this.parentid),t,n,this.parentid,i,r,l,a,s,1,2)}}var M=U.selectEl(".U_MD_UI_Tree_add");M[c]&&n[c].removeChild(M[c]);var f=$$("div",{className:"U_MD_UI_Tree_add",innerHTML:"添加新分类"},n[c]);f.onclick=function(){l(this,t,n,o,i,r,l,a,s,c)}},U.MD.UI.BTree.jsonAdd=function(e,t){var n=t.parentID;if("0"==n)return e[e.length]=t,e;for(var o=0;o<e.length;o++){if(e[o].id==n)return e[o].child?(e[o].child[e[o].child.length]=t,e):(e[o].child=[],e[o].child[e[o].child.length]=t,e);if(e[o].child){var i=U.MD.UI.BTree.jsonAdd(e[o].child,t);e[o].child=i}}return e},U.MD.UI.BTree.jsonStartA=function(e,t,n,o,i,r,l,a,s,c,d){json=[];for(var p=e,_=0;_<p.length;_++)U.MD.UI.BTree.jsonAdd(json,p[_]);r.innerHTML="",U.MD.UI.BTree.jsonStartRight(r,t,n,o,i,l,a,s,c,d)},U.MD.UI.BTree.jsonStartRight=function(e,t,n,o,i,r,l,a,s,c){var d=$$("ul",{className:"U_MD_UI_Tree_a "},e),p=$$("li",{className:"U_MD_UI_Tree_listyle",yid:"1"},d);$$("img",{onerror:U.MD.C.imgError,src:a,className:"U_MD_UI_Tree_imgstyle"},p),$$("span",{innerHTML:"目录管理",className:"U_MD_UI_Tree_spanstyle"},p);p.onclick=function(){t(this),U.MD.UI.BTree.DirectoryCreate(json,r,l,0,function(e,t,o,i,r,l,a,s,c,d){var p=n(e.pid);if(p){json=U.MD.UI.BTree.jsonDelete(json,e.pid);var _=U.selectEl("#"+e.pid)[0];_&&_.parentNode.remove(),1==d&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,e.parentid),t,o,i,r,l,a,s,c,1,2),2==d&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,e.parentid),t,o,i,r,l,a,s,c,2),0==d&&U.MD.UI.BTree.DirectoryCreate(json,t,o,i,r,l,a,s,c,0)}},function(e,t,n,i,r,l,a,s,c,d){var p=o(U.MD.UI.BTree.jsonSelectA(json,e.pid));json=U.MD.UI.BTree.jsonUpdate(json,p);var _=U.selectEl("#"+e.pid)[0];_&&(_.childNodes[0].src=p.img_url,_.childNodes[1].innerHTML=p.name),1==d&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,e.parentid),t,n,i,r,l,a,s,c,1,2),2==d&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,e.parentid),t,n,i,r,l,a,s,c,2),0==d&&U.MD.UI.BTree.DirectoryCreate(json,t,n,i,r,l,a,s,c,0)},function(e,n,o,r,l,a,s,c,d,p){var _={};_.parentID=e.parentNode.parentID,_.deep=e.parentNode.deep;var u,g=i(_);g&&(u=U.selectEl(".U_MD_UI_Tree_a")[1],u&&(u=0==g.parentID?U.selectEl(".U_MD_UI_Tree_a")[0].parentNode:U.selectEl("#"+g.parentID)[0].parentNode,_js=[],_js[0]=g,U.MD.UI.BTree.treeCreate(_js,u,t)),json=U.MD.UI.BTree.jsonAdd(json,g),1==p&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,_.parentID),n,o,r,l,a,s,c,d,1,2),2==p&&U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json,_.parentID),n,o,r,l,a,s,c,d,2),0==p&&U.MD.UI.BTree.DirectoryCreate(json,n,o,r,l,a,s,c,d,0))},s,c,0)}},U.MD.UI.BTree.jsonStartLeft=function(e,t,n){json=[];for(var o=e,i=0;i<o.length;i++)U.MD.UI.BTree.jsonAdd(json,o[i]);t.innerHTML="",U.MD.UI.BTree.treeCreate(json,t,n)},U.MD.UI.BTree.jsonDelete=function(e,t){for(var n=0;n<e.length;n++){if(e[n].id==t)return e.splice(n,1),e;e[n].child&&(e[n].child=U.MD.UI.BTree.jsonDelete(e[n].child,t))}return e},U.MD.UI.BTree.jsonSelectA=function(e,t){for(var n=0;n<e.length;n++){if(e[n].id==t)return e[n];if(e[n].child){var o=U.MD.UI.BTree.jsonSelectA(e[n].child,t);if(o)return o}}return!1},U.MD.UI.BTree.jsonUpdate=function(e,t){for(var n=0;n<e.length;n++){if(e[n].id==t.id)return e[n]=t,e;if(e[n].child){var o=U.MD.UI.BTree.jsonUpdate(e[n].child,t);if(o)return e[n].child=o,e}}return!1},U.MD.UI.BTree.createID=function(e){for(var t=0,n=0;n<e.length;n++)parseInt(e[n].id)>t&&(t=parseInt(e[n].id));return t},Namespace.register("U.MD.UI.editor"),U.MD.UI.Editor=U.MD.UI.editor=function(e,t){return U.UF.DL.asynLoadCss({rel:"stylesheet",type:"text/css",href:"/css/Controls/Complex/Editor.css"}),U.MD.UI.editor.createEditor(e),U.UF.E.initEditor($(".editor",e)[0],t),U.MD.UI.editor.EditorEventBind(e),U.MD.UI.editor.operateJson.editor=U.selectEl(".editor",e)[0],U.MD.UI.editor.operateJson},U.MD.UI.editor.operateJson={loadContent:function(e){this.editor.focus(),U.UF.E.onpaste(null,this.editor,e)},getContent:function(){return this.editor.innerHTML}},U.MD.UI.editor.createEditor=function(e){e.innerHTML='<div class=\'toolbar\' style="width: 788px;background-color: #f5f5f5;border: 1px solid #c7d3e1;line-height: 0;padding: 6px;height: 25px;">\n <button class="last" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/left.png\') no-repeat center;">\n </button>\n <button class="future" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/right.png\') no-repeat center;">\n </button>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n<div class=\'setFont\' style=\'float: left;margin: 0 3px;position: relative;padding:0px\'></div> <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n<div class=\'setSize\' style=\'float: left;margin: 0 3px;position: relative;padding:0px\'></div> <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n <label style="float: left;margin: 0 3px;position: relative;">\n <button class="pic" style="outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/pic.png\') no-repeat center;">\n </button>\n <input multiple accept=\'image/*\' type=\'file\' class=\'picUpload\' style=\'display: none;\' onchange=\'U.UF.E.picture(this,this.parentNode.parentNode.nextSibling)\' />\n </label>\n <label style="float: left;margin: 0 3px;position: relative;">\n <button class="attachment" style="outline: none;cursor: pointer;border: 1px solid transparent;width: 25px;height: 25px;background: url(/img/YS2017.png) no-repeat;background-position: -1054px -593.5px;"></button>\n <input multiple="" type="file" class="attachmentUpload" style="display: none;" onchange=\'U.UF.E.attachment(this,this.parentNode.parentNode.nextSibling)\' >\n </label>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n <div style="float: left;margin: 0 3px;position: relative;padding:0px">\n <button class="fontColor" style="outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/fontColor.png\') no-repeat center;">\n </button>\n <div class=\'fontColorBar colorBar\' style=\'display:none;position: absolute;\'>\n </div>\n </div>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n <div style="float: left;margin: 0 3px;position: relative;padding:0px">\n <button class="backgroundColor" style="outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/blockColor.png\') no-repeat center;">\n </button>\n <div class=\'backgroundColorBar colorBar\' style=\'display:none;position: absolute;\'>\n </div>\n </div>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n <button class="bIcon" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/strong.png\') no-repeat center;">\n </button>\n <button class="iIcon" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/i.png\') no-repeat center;">\n </button>\n <button class="UIcon" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/x.png\') no-repeat center;">\n </button>\n <button class="SIcon" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/-S-.png\') no-repeat center;">\n </button>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;">\n\n </i>\n <button class="textLeft" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/textLeft.png\') no-repeat center;">\n </button>\n <button class="textCenter" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/textCenter.png\') no-repeat center;">\n </button>\n <button class="textRight" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/textRight.png\') no-repeat center;">\n </button>\n <i style="display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;" >\n\n </i>\n <button class="a" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/a.png\') no-repeat center;">\n </button>\n <button class="b" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/b.png\') no-repeat center;">\n </button>\n <button class="c" style="float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/c.png\') no-repeat center;">\n </button>\n </div>\n <div class="editor" contenteditable="true" style="width: 800px;min-height: 300px;border: 1px solid #E6E5E5;overflow: auto;">\n </div>'},U.MD.UI.editor.EditorEventBind=function(e){var t=U.MD.UI.Font();t.style.cssText+="vertical-align: super;";var n=U.MD.UI.WordSize();n.style.cssText+="vertical-align: super;",U.selectEl(".setFont",e).append(t),t.onchange=function(){U.UF.E.setRangeStyle({"font-family":t.value})},U.selectEl(".setSize",e).append(n),n.onchange=function(){U.UF.E.setRangeStyle({"font-size":n.value})},U.selectEl(".pic",e)[0].onclick=function(){U.selectEl(".picUpload",e)[0].click()},U.selectEl(".attachment",e)[0].onclick=function(){U.selectEl(".attachmentUpload",e)[0].click()},U.selectEl(".bIcon",e)[0].onclick=function(){U.UF.E.setRangeStyle({"font-weight":"bold"})},U.selectEl(".iIcon",e)[0].onclick=function(){U.UF.E.setRangeStyle({"font-style":"italic"})},U.selectEl(".UIcon",e)[0].onclick=function(){U.UF.E.setRangeStyle({"text-decoration":"underline"})},U.selectEl(".SIcon",e)[0].onclick=function(){U.UF.E.setRangeStyle({"text-decoration":"line-through"})},U.selectEl(".fontColor",e).bind("click",function(){"none"==$(".fontColorBar",e).css("display")&&(U.MD.UI.colorPicker($(".fontColorBar",e)[0],function(t){U.selectEl(".MD_ColorPicker",U.selectEl(".fontColorBar",e)[0]).remove(),U.selectEl(".fontColorBar",e).hide(),U.UF.E.setRangeStyle({color:t})}),U.selectEl(".fontColorBar",e).show())}),U.selectEl(".backgroundColor",e).bind("click",function(){"none"==$(".backgroundColorBar",e).css("display")&&(U.MD.UI.colorPicker($(".backgroundColorBar",e)[0],function(t){U.selectEl(".MD_ColorPicker",U.selectEl(".backgroundColorBar",e)[0]).remove(),U.selectEl(".backgroundColorBar",e).hide(),U.UF.E.setRangeStyle({backgroundColor:t})}),U.selectEl(".backgroundColorBar",e).show())}),U.selectEl(".a",e).bind("click",function(){U.UF.E.addHref()}),U.selectEl(".c",e).bind("click",function(){U.UF.E.clearStyle(U.UF.E.getRangeAt())}),U.selectEl(".textLeft",e).bind("click",function(){U.UF.E.setLineStyle({"text-align":"left"})}),U.selectEl(".textCenter",e).bind("click",function(){U.UF.E.setLineStyle({"text-align":"center"})}),U.selectEl(".textRight",e).bind("click",function(){U.UF.E.setLineStyle({"text-align":"right"})})},U.MD.UI.editor.Select=function(e,t,n,o){var i="";t.id&&(i=t.id)&&delete t.id;var r=$$("div",{id:i},o||null),l=$$("div",t,r),a=$$("div",{},l);$$("div",{style:{cssText:"border-width: 6px 4px; border-style: solid; border-color: rgb(166, 178, 192) transparent transparent; width: 0; position: absolute; right: 4px; top: 50%; margin-top: -3px"}},l);var s,c=$$("div",{datacontent:"",style:{cssText:"display: none;position: absolute; margin-top:-1px; min-width: 100%; max-width: 280px; max-height: 200px ;border: 1px solid silver; overflow-x: hidden; cursor: pointer;"}},r);for(var d in t.style&&!t.style.position&&(r.style.position="relative"),t.style&&!t.style.textIndent&&(a.style.textIndent="6px"),a.style.whiteSpace="pre",a.style.overflow="hidden",a.style.width=r.offsetWidth-15+"px",e)$$("div",{value:d,innerText:e[d],style:{cssText:"padding: 4px 6px; background: #fff"},onmouseover:function(){this.style.background="#ccc"},onmouseout:function(){this.style.background="#fff"},onclick:function(){a.innerText=this.innerText,U.UF.E.reSelectRange(s),n(this.value||this.innerText)}},c);for(var d in e){a.innerText=e[d];break}return a.style.lineHeight=parseInt(a.style.height)+"px",r.onclick=function(){var e=this.querySelector("div[datacontent]");U.UF.E.reSelectRange(s),"block"===e.style.display?e.style.display="none":e.style.display="block"},U.selectEl(document).bind("click",function(){"none"!=c.style.display&&(c.style.display="none"),$(".BD_BorderPicker")[0]&&"none"!=$(".BD_BorderPicker")[0].style.display&&(U.selectEl(".BD_BorderPicker")[0].style.display="none")},!1),U.selectEl(r).bind("click",function(e){U.UF.EV.stopBubble(e)}),r.onmousedown=function(){s=U.UF.E.getRangeAt()},r},Namespace.register("U.MD.UI.excel"),Namespace.register("U.MD.R"),U.MD.R.data={PID:"",AID:"",URL:"",PageIndex:1,PageSize:20,AllCount:"",CB:null},U.MD.R.reply=function(e){U.MD.R.login.cookieLogin(function(){var t=e.type,n=e.el,o=e.cb;U.MD.R.data.PID=e.pid,U.MD.R.data.AID=U.MD.R.reply.getUrlHash(),U.MD.R.data.URL=U.MD.R.reply.getUrl(),U.MD.R.data.CB=o,t||(n=new U.UF.UI.form("",$$("div"),{style:{width:"800px",height:"800px"}}).content),U.MD.R.reply.init(n),U.UF.DL.asynLoadCss({href:"/css/Controls/Basic/Picture.css",type:"text/css",rel:"stylesheet"}),U.UF.DL.asynLoadJs({type:"text/javascript",src:"/js/Controls/Basic/Picture.js"})})},U.MD.R.reply.init=function(e){var t=U.MD.R.data.PageIndex,n=U.MD.R.data.PageSize;U.MD.R.initPrintHtml(e),U.MD.R.getReplyData(t,n,function(e){U.MD.R.data.AllCount=e[0][0]?Math.ceil(e[0][0].allcount/U.MD.R.data.PageSize):"",U.MD.R.printComment($("#U_MD_R_content_user_comment")[0],1,e,!1,!1,!1),U.MD.R.initLoadMoreBtn(e[0])})},U.MD.R.reply.getUrl=function(){return window.location.href},U.MD.R.reply.getUrlHash=function(){return U.UF.EC.SparkMD5.hash(window.location.href)},U.MD.R.getReplyData=function(e,t,n){U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_Reply","test",U.MD.R.data.AID,"1","",e,t],function(e){n&&n(e.value)})},U.MD.R.initPrintHtml=function(e){var t,n,o,i,r,l,a,s,c,d,p,_,u,g=e;t=$$("div",{className:"U_MD_R_comment"},g),n=$$("div",{className:"U_MD_R_content"},t),o=$$("div",{className:"U_MD_R_content_operation"},n),i=$$("div",{className:"U_MD_R_content_operation_userhead U_MD_R_Reply_Header"},o),r=$$("img",{className:"img",src:"/img/UserHead/UseHead.jpg",onerror:function(){this.src="/img/UserHead/UseHead.jpg"}},i),l=$$("div",{className:"U_MD_R_content_operation_right",style:{width:"calc(100% - 40px - 20px )"}},o),U.selectEl(l).attr({"data-RPID":null,"data-RD":1,"data-RPUID":null}),a=$$("div",{innerHTML:"登录/注册",className:"U_MD_R_content_operation_userlogin U_MD_R_Reply_Name"},l),US.userInfo.userid?(a.innerHTML=US.userInfo.username,r.src="http://fs.1473.cn/"+US.userInfo.UserThumbnailImageHead):a.onclick=function(){U.MD.R.login()},s=$$("div",{id:"editorbox",className:"U_MD_R_Reply_Content",contenteditable:"true",style:{"min-height":"100px",background:"#fff",border:"1px solid black"}},l);var D=document.documentElement.scrollTop;U.UF.E.initEditor(s),document.documentElement.scrollTop=D,c=$$("div",{className:"U_MD_R_content_operation_right_bottom"},l),$$("div",{className:"U_MD_R_content_operation_right_bottom_emoji",onclick:function(){U.UF.EV.stopBubble(),U.MD.UI.face(this,U.selectEl("#editorbox")[0]),U.selectEl("#U_MD_UI_face").css({position:"relative",height:"140px","overflow-y":"scroll",top:"-150px",width:"450px",display:"block"})}},c),d=$$("div",{className:"U_MD_R_content_operation_right_bottom_picturewarp"},c),$$("img",{src:"/img/reply/img.png"},d),p=$$("input",{type:"file"},d),_=$$("div",{className:"U_MD_R_content_operation_right_bottom_release",innerHTML:"发表评论"},c),_.onclick=function(){""!=$(".U_MD_R_Reply_Content")[0].textContent||""!=U.selectEl(".U_MD_R_Reply_Content")[0].innerHTML?U.MD.R.release(l,1,!1,1):U.alert("评论不能为空!")},u=$$("div",{className:"U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image"},l),$$("div",{className:"U_MD_R_content_comment",id:"U_MD_R_content_user_comment"},n),p.onchange=function(){U.MD.R.uploadImages(this,u)},U.MD.R.data.CB&&U.MD.R.data.CB()},U.MD.R.initLoadMoreBtn=function(e){var t=$$("div",{className:"U_MD_R_content_loading"},U.selectEl(".U_MD_R_comment")[0]);e.length>0&&U.MD.R.data.PageIndex<U.MD.R.data.AllCount&&(t.innerHTML="点击加载更多评论",t.onclick=function(){var e=++U.MD.R.data.PageIndex,n=U.MD.R.data.PageSize;U.MD.R.data.PageIndex<=U.MD.R.data.AllCount?U.MD.R.getReplyData(e,n,function(e){U.MD.R.data.AllCount=Math.ceil(e[0][0].allcount/U.MD.R.data.PageSize),U.MD.R.printComment($("#U_MD_R_content_user_comment")[0],1,e,!1,!1,!1)}):U.selectEl(t).hide()})},U.MD.R.printComment=function(e,t,n,o,i,r){var l=U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_Reply","Reply_SelectTypeReplyEnable",U.MD.R.data.PID]);if(1==l.value[0].ProjectReplyEnable)for(var a,s=e,c=t,d=n,p=o,_=i,u=r,g=0;g<n[0].length;g++)a=r?n[0][g].TopReplyNum:U.Json.select(d[2],{ReplyID:d[0][g].ReplyID}).length>0?U.Json.select(d[2],{ReplyID:d[0][g].ReplyID})[0].AllReplyNum:"0",U.MD.R.printCommentHtml(s,c,{rid:d[0][g].ReplyID,rpid:d[0][g].ReplyParentID,deep:d[0][g].ReplyDeep,topid:d[0][g].ReplyID,uid:d[0][g].UserID,un:d[0][g].UserName,tx:d[0][g].ReplyUserThumbnailImageHead,time:d[0][g].ReplyAddTime,content:d[0][g].ReplyContent,shownum:a,likesnum:2==c?U.Json.select(d[4],{ReplyID:d[0][g].ReplyID})[0]:U.Json.select(d[1],{ReplyID:d[0][g].ReplyID})[0]},p,_,u);else{var D=$$("div",{className:"U_MD_R_content_loading"},U.selectEl(".U_MD_R_comment")[0]);D.innerHTML="该评论系统已关闭",U.selectEl("#U_MD_R_content_loading")[0].innerHTML=""}},U.MD.R.viewComment=function(e,t){if(US.userInfo.userid){var n,o,i,r,l,a=e,s=t;n=new U.UF.UI.form("",$$("div",{style:{padding:"20px"}}),{style:{width:"800px",height:"600px"}}),U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_Reply","Reply_SelectThisReply",a],function(e){o=e.value,U.MD.R.printComment(n.content,2,o,!0,!0,!0),s&&U.selectEl(n.content).find(".U_MD_R_content_box_content_edit").show(),i=$$("div",{className:"U_MD_R_content_warp_box"},n.content);for(var t=0;t<o[1].length;t++){r=U.MD.R.printCommentHtml(i,2,{rid:o[1][t].ReplyID,rpid:o[1][t].ReplyParentID,deep:o[1][t].ReplyDeep,topid:o[1][t].ReplyTopID,uid:o[1][t].UserID,tx:o[1][t].ReplyUserThumbnailImageHead,un:o[1][t].UserName,time:o[1][t].ReplyAddTime,content:o[1][t].ReplyContent,likesnum:U.Json.select(o[3],{ReplyID:o[1][t].ReplyID})[0]},!1,!0,!0),l=$$("div",{className:"U_MD_R_content_warp_box"},r),U.selectEl(l).attr({"data-replyid":o[1][t].ReplyID});for(var a=0;a<o[2].length;a++)o[1][t].ReplyID==o[2][a].ReplyParentID&&U.MD.R.printCommentHtml(l,3,{rid:o[2][a].ReplyID,rpid:o[2][a].ReplyParentID,deep:o[2][a].ReplyDeep,topid:o[2][a].ReplyTopID,uid:o[2][a].UserID,tx:o[2][a].ReplyUserThumbnailImageHead,un:o[2][a].UserName,time:o[2][a].ReplyAddTime,content:o[2][a].ReplyContent,likesnum:U.Json.select(o[3],{ReplyID:o[2][a].ReplyID})[0],replyinfo:{uid:o[2][a].uid,un:o[2][a].un,tx:o[2][a].tx}},!1,!0,!0)}})}else U.Alert("请先登录")},U.MD.R.printCommentHtml=function(e,t,n,o,i,r){var l,a,s,c,d,p,_,u,g,D,m,h,M,f,y,b,R,I,x,v,T,E,k=n,C=e,N=t,w=k.rid,B=k.rpid,S=k.deep,H=k.topid,L=k.uid,F=k.tx,j=k.un,P=k.time,A=k.content,J=k.likesnum,z=k.shownum,q=(k.replyinfo&&k.replyinfo.uid,k.replyinfo?k.replyinfo.un:""),G=(k.replyinfo&&k.replyinfo.tx,o),O=r;if(l=$$("div",{className:"U_MD_R_content_box"}),G?U.selectEl(C).append(l,0,U.selectEl(C)[0].firstChild):U.selectEl(C).append(l),a=$$("div",{className:"U_MD_R_content_box_warp"},l),U.selectEl(a).attr({"data-rid":w,"data-RPID":B,"data-RD":S,"data-RBID":H,"data-RPUID":L}),s=$$("div",{className:"U_MD_R_content_box_userhead"},a),$$("img",{src:F,onerror:"U.MD.R.imgError(this)"},s),c=$$("div",{className:"U_MD_R_content_box_content",style:{width:"calc(100% - 40px - 20px )"}},a),d=$$("div",{className:"U_MD_R_content_box_content_top"},c),p=$$("div",{className:"U_MD_R_content_box_content_top_name",innerHTML:j},d),3==N&&(p.innerHTML=j+"回复@"+q),$$("div",{className:"U_MD_R_content_box_content_top_time",innerHTML:P},d),_=$$("div",{className:"U_MD_R_content_box_content_text",innerHTML:A},c),$(_).find("img").length>0&&(U.selectEl(_).find("img")[0].onclick=function(){U.MD.UI.picture([this.src],0),U.selectEl("#U_MD_UI_PictureForm").css("position","fixed"),U.UF.F.topWindow($("#U_MD_UI_PictureForm")[0],!0)}),u=$$("div",{className:"U_MD_R_content_box_content_bottom"},c),g=$$("div",{className:"U_MD_R_content_box_content_bottom_likeswarp"},u),g.onclick=function(){U.MD.R.like(this,w,US.userInfo.userid)},D=$$("img",{src:"/img/reply/NOFabulous.png"},g),m=$$("div",{className:"U_MD_R_content_box_content_bottom_likeswarp_text",innerHTML:0},g),J&&(m.innerHTML=J.ReplyNum,U.A.Request("http://cd.1473.cn/net",["db.1473.cn","UseStudio_Reply","Reply_SelectRepeatLikes_Moblie",w,US.userInfo.userid],function(e){1==e.value[0].mode?D.src="/img/reply/NOFabulous.png":0==e.value[0].mode?D.src="/img/reply/Fabulous.png":D.src="/img/reply/NOFabulous.png"})),h=$$("div",{className:"U_MD_R_content_box_content_bottom_replywarp"},u),h.onclick=O?function(){U.MD.R.subsetReply(this)}:function(){U.MD.R.viewComment(w,!0)},$$("img",{src:"/img/reply/reply.png"},h),$$("div",{innerHTML:"回复",className:"U_MD_R_content_box_content_bottom_replywarp_text"},h),1==N&&(M=$$("div",{className:"U_MD_R_content_box_content_bottom_showmorewarp"},u),$$("img",{src:"/img/reply/list.png"},M),f=$$("div",{className:"U_MD_R_content_box_content_bottom_showmore_text"},M),O?(f.className="U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_secondary",f.innerHTML=z?"共有(<span>"+z+"</span>)条评论":"没有评论(<span>0</span>)"):(f.className="U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_important",f.innerHTML=z?"查看更多(<span>"+z+"</span>)":"查看更多(<span>0</span>)",M.onclick=function(){U.MD.R.viewComment(w,!1)})),1==N&&!r&&U.selectEl(".U_MD_R_content_loading")[0]&&(U.MD.R.data.PageIndex<U.MD.R.data.AllCount?U.selectEl(".U_MD_R_content_loading")[0].innerHTML="点击加载更多评论":U.selectEl(".U_MD_R_content_loading").hide()),2==N||3==N||1==N&&r)return b=$$("div",{className:"U_MD_R_content_box_content_edit",style:{display:"none"}},c),_replyinput=$$("div",{className:"U_MD_R_Reply_Content",contenteditable:"true"},b),R=$$("div",{className:"U_MD_R_content_operation_right_bottom"},b),$$("div",{className:"U_MD_R_content_operation_right_bottom_emoji",onclick:function(){U.UF.EV.stopBubble(),U.MD.UI.face(this,_replyinput),U.selectEl(this)[0].append($("#U_MD_UI_face")[0]),U.selectEl("#U_MD_UI_face").css({position:"relative",height:"140px","overflow-y":"scroll",top:"-150px",width:"450px",display:"block"})}},R),I=$$("div",{className:"U_MD_R_content_operation_right_bottom_picturewarp"},R),$$("img",{src:"/img/reply/img.png"},I),x=$$("input",{type:"file"},I),x.onchange=function(){U.MD.R.uploadImages(this,T)},v=$$("div",{className:"U_MD_R_content_operation_right_bottom_release",innerHTML:"发表评论"},R),v.onclick=function(){1==N?y=2:2==N?y=3:3==N&&(y=4),U.MD.R.release(a,N,!1,y)},T=$$("div",{className:"U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image"},b),3!=N&&(E=$$("div",{className:"U_MD_R_content_comment"},l)),E},U.MD.R.uploadImages=function(e,t){var n,o,i=t,r=/.*(jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG)$/;U.selectEl(i)[0].innerHTML="",n=$$("div",{},i),$$("img",{src:"/img/Reply/loading.gif",style:{width:"100px",height:"100px","margin-right":"10px"}},n),U.UF.UP.inputUpload([e],"http://disk.1473.cn/USUpfile.ashx?typename=UseStudioEditor&UserId=FA92AAC5-4134-449F-9659-0DC12F4F68E9",function(e){o=e.value[0].split(".")[1],o.match(r)?(U.selectEl(n).remove(),n=$$("div",{className:"U_MD_R_content_operation_right_bottom_imgloadbox_warp"},i),$$("img",{src:"http://fs.1473.cn/"+e.value[0]},n),$$("div",{className:"closebtn",onclick:"U.MD.R.uploadImages.close(this)"},n),U.alert("上传成功")):U.alert("请上传图片文件")},[])},U.MD.R.uploadImages.close=function(e){U.selectEl(e).Parent().remove()},U.MD.R.subsetReply=function(e){var t=U.selectEl($(e).Parent(2)).find(".U_MD_R_content_box_content_edit");"block"==t[0].style.display?t.hide():t.show()},U.MD.R.release=function(e,t,n,o){if(US.userInfo.userid){var i=e,r=t,l=n,a=o,s=U.selectEl(i).find(".U_MD_R_Reply_Content")[0],c=U.selectEl(i).find(".U_MD_R_Reply_Image"),d=US.userInfo.userid,p=US.userInfo.username,_="http://fs.1473.cn/"+US.userInfo.UserImageHead;if(""!=s.innerHTML.trim()||c.find("img").length>0){var u=Guid.newGuid(),g=U.selectEl(e).attr("data-rid"),D=U.MD.R.data.PID,m=U.MD.R.data.AID,h="",M=US.userInfo.RegisterIP,f=U.MD.R.data.URL,y=null,b=U.selectEl(e).attr("data-rd"),R=(U.selectEl(e).attr("data-rbid"),U.selectEl(e).attr("data-rpuid")),I=1;1==o?b=1:2==o||3==o?b=parseInt($(e).attr("data-rd"))+1:(b=3,g=U.selectEl(e).attr("data-rpid")),h=$(c).find("img").length>0?s.innerHTML.trim()+c.find("img")[0].outerHTML:s.innerHTML,U.A.Request("http://cd.1473.cn/net",["db.1473.cn","UseStudio_Reply","Reply_InsertReply",u,g,D,m,d,p,_,h,M,f,y,b,R,I,U.MD.R.getNowFormatDate()],function(e){var t,n,o=e.value[0],c=U.selectEl("div[data-rid='"+o.ReplyParentID+"']").find(".U_MD_R_content_box_content_bottom_showmore_text_important span")[0];U.selectEl("div[data-rid='"+o.ReplyParentID+"']").find(".U_MD_R_content_box_content_bottom_showmore_text_secondary span")[0];U.selectEl(i).find(".U_MD_R_Reply_Content")[0].innerHTML="",U.UF.E.initEditor($(i).find(".U_MD_R_Reply_Content")[0]),U.selectEl(i).find(".U_MD_R_Reply_Image")[0].innerHTML="",1==a?(n=!1,t=!0,i=U.selectEl("#U_MD_R_content_user_comment")[0]):(n=!0,_val=c.innerText,2==a&&(i=U.selectEl(i).Parent().nextSibling,r=2,t=!0),3==a&&(i=$($(i)[0].nextSibling).find(".U_MD_R_content_warp_box").length>0?U.selectEl($(i)[0].nextSibling).find(".U_MD_R_content_warp_box"):$$("div",{className:"U_MD_R_content_warp_box"},U.selectEl($(i)[0].nextSibling)[0]),r=2),4==a&&(i=U.selectEl($(i).Parent()).Parent(),r=3),c.innerText=++_val,U.selectEl($(s).Parent()).hide());U.MD.R.printCommentHtml(i,r,{rid:o.ReplyID,rpid:o.ReplyParentID,deep:o.ReplyDeep,topid:o.ReplyTopID,uid:o.UserID,tx:o.ReplyUserThumbnailImageHead,un:o.UserName,time:U.MD.R.getNowFormatDate()+".0",content:o.ReplyContent,replyinfo:{uid:o.uid,un:o.un,tx:o.tx}},t,l,n);U.alert("评论成功")})}else U.alert("请输入评论内容")}else U.Alert("请先登录")},U.MD.R.like=function(e,t,n){if(US.userInfo.userid){var o=e,i=t,r=n;U.A.Request("http://cd.1473.cn/net",["db.1473.cn","UseStudio_Reply","Reply_SelectRepeatLikes",i,r],function(e){var t=U.selectEl(o).find("img")[0],n=U.selectEl(o).find(".U_MD_R_content_box_content_bottom_likeswarp_text")[0],i=parseInt(n.innerHTML);0==e.value[0].mode?(t.src="/img/reply/NOFabulous.png",n.innerHTML=--i):(t.src="/img/reply/Fabulous.png",n.innerHTML=++i)})}else U.Alert("请先登录")},U.MD.R.imgError=function(e){U.selectEl(e)[0].src="/img/UserHead/UseHead.jpg"},U.MD.R.login=function(){$("#U_MD_HomeC_Pop")[0]?U.UF.F.windowTopCenter($("#U_MD_HomeC_Pop")[0]):(U.UF.CD.loadPageCrossDomain(function(){}),U.MD.U.L.setLoginCallBack(function(){U.MD.R.login.cb()}))},U.MD.R.login.cookieLogin=function(e){U.UF.Cookie.get("usestudiosso")&&U.UF.Cookie.get("usestudiosso","userid")[0]?U.UF.CD.loadPageCrossDomain(function(){U.MD.U.L.loginCallBack=function(){e&&e(),U.selectEl(".U_MD_R_content_operation_userhead img")[0].src="http://fs.1473.cn/"+US.userInfo.UserThumbnailImageHead,U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML=US.userInfo.username}}):e&&e()},U.MD.R.login.cb=function(){U.selectEl(".U_MD_R_content_operation_userhead img")[0].src="http://fs.1473.cn/"+US.userInfo.UserThumbnailImageHead,U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML=US.userInfo.username},U.MD.R.getNowFormatDate=function(){var e=new Date,t="-",n=":",o=e.getMonth()+1,i=e.getDate();o>=1&&o<=9&&(o="0"+o),i>=0&&i<=9&&(i="0"+i);var r=e.getFullYear()+t+o+t+i+" "+e.getHours()+n+e.getMinutes()+n+e.getSeconds();return r},Namespace.register("U.MD.UI.table"),U.MD.UI.table=function(e,t,n,o){U.MD.UI.table.thead(e,t,n,o)},U.MD.UI.table.thead=function(e,t,n,o,i,r){var l,a,s,c;for(var d in i||(i=1,r=e.length),l=$$("table",{style:{"text-align":"center",position:"relative",width:" 100%",
- "border-collapse":" collapse","border-width":" 1px","border-style":" solid","border-color":" rgb(213, 213, 213)","border-image":" initial",display:"table"}},o),a=$$("thead",{},l),s=$$("tr",{},a),t)"object"==typeof t[d]?$$("th",{innerHTML:t[d].name,style:{cssText:n[d],padding:"10px 0","font-weight":"normal",border:"1px solid #d5d5d5"},id:"th"},s):$$("th",{innerHTML:t[d],style:{cssText:n[d],padding:"10px 0","font-weight":"normal",border:"1px solid #d5d5d5"},id:"th"},s);return c=$$("tbody",{style:{cssText:"width:100%;"},id:"tbody"},l),U.MD.UI.table.tbody(c,e,t,n,i,r),c},U.MD.UI.table.tbody=function(e,t,n,o,i,r){for(var l,a,s,c=(i-1)*r;c<i*r&&c<t.length;c++)for(var d in l=c%2!=0?$$("tr",{style:{cssText:"background-color: #FFF;"},id:"tr"},e):$$("tr",{style:{cssText:"background-color: #dde4ee;"},id:"tr"},e),n)if(a=$$("td",{id:"td"},l),n[d].content)for(var p=0;p<n[d].content.length;p++)s=U.MD.UI.table.printDiv(a,n[d].content[p]),n[d].content[p].onclick&&U.MD.UI.table.onclick(s,t[c],n[d].content[p].onclick);else s=$$("div",{innerHTML:t[c][d],style:{overflow:"hidden",cssText:o[d]}},a),n[d].id&&(s.id=t[c][n[d].id])},U.MD.UI.table.pageTable=function(e,t,n,o,i,r){var l=$$("div",{style:{left:"0px",right:"0px",width:"100%",margin:"0 auto",top:"200px"}},r),a=$$("div",{},l),s=U.MD.UI.table.thead(e,t,n,a,i,o),c=$$("div",{style:{width:"650px",margin:"20px auto 0 auto"}},l);new U.UF.P.page(c,e.length,o,i,function(i){U.MD.UI.table.delChild(s),U.MD.UI.table.tbody(s,e,t,n,i,o)})},U.MD.UI.table.delChild=function(e){for(var t=e.children.length-1;t>=0;t--)e.removeChild(e.children[t])},U.MD.UI.table.onclick=function(e,t,n){e.onclick=function(){n(t)}},U.MD.UI.table.printDiv=function(e,t){var n;if("string"==typeof t.name&&(n=$$("div",{innerHTML:t.name},e)),"object"==typeof t.name){var o=t.name.cloneNode(!0);e.appendChild(o),n=o}return n},Namespace.register("U.MD.UI.Tree"),U.MD.UI.Tree=function(e,t,n,o){json=[];for(var i=e,r=0;r<i.length;r++)U.MD.UI.Tree.jsonAdd(json,i[r]);t.innerHTML="",U.MD.UI.Tree.treeCreate(json,t,n),t.oncontextmenu=function(e){e.preventDefault()},t.onmousedown=function(e){2==e.button&&o(e,n)}},U.MD.UI.Tree.treeCreate=function(e,t,n){for(var o=0;o<e.length;o++){var i=$$("ul",{className:"U_MD_UI_Tree_a "+e[o].parentID},t),r=$$("li",{id:e[o].id,parentid:e[o].parentid,className:"U_MD_UI_Tree_listyle",parentid:e[o].id,deep:e[o].deep},i),l=$$("img",{onerror:U.MD.C.imgError,src:e[o].img_url,className:"U_MD_UI_Tree_imgstyle"},r);$$("span",{innerHTML:e[o].name,className:"spanstyle"},r);i.style.display="none","1"==e[o].deep&&(i.style.display="block"),l.aa=!1;var a=document.getElementsByClassName("U_MD_UI_Tree_a "+e[o].parentID)[0];i.style.display=a.style.display,r.onclick=function(){if(n(this),a=document.getElementsByClassName("U_MD_UI_Tree_a "+this.parentid),!0===l.aa){l.aa=!1;for(var e=0;e<a.length;e++)a[e].style.display="none"}else{l.aa=!0;for(e=0;e<a.length;e++)a[e].style.display="block"}},e[o].child&&U.MD.UI.Tree.treeCreate(e[o].child,i,n)}},U.MD.UI.Tree.jsonAdd=function(e,t){var n=t.parentID;if("0"==n)return e[e.length]=t,e;for(var o=0;o<e.length;o++){if(e[o].id==n)return e[o].child?(e[o].child[e[o].child.length]=t,e):(e[o].child=[],e[o].child[e[o].child.length]=t,e);if(e[o].child){var i=U.MD.UI.Tree.jsonAdd(e[o].child,t);e[o].child=i}}return e},U.MD.UI.Tree.rightOnclick=function(e,t){var n=$$("li",{className:"U_MD_UI_Tree_rightli",innerHTML:"新建文件夹",parentid:t.path[1].parentid,deep:parseInt(t.path[1].deep)+1},e),o=$$("li",{className:"U_MD_UI_Tree_rightli",innerHTML:"重命名",parentid:t.path[1].parentid,deep:parseInt(t.path[1].deep)+1},e),i=$$("li",{className:"U_MD_UI_Tree_rightli",innerHTML:"删除",parentid:t.path[1].parentid,deep:parseInt(t.path[1].deep+1)},e),r=[];return r[0]=n,r[1]=o,r[2]=i,r},U.MD.UI.Tree.createID=function(e){for(var t=0,n=0;n<e.length;n++)parseInt(e[n].id)>t&&(t=parseInt(e[n].id));return t},Namespace.register("U.MD.UI.txt");
|