//编辑器 //excel控件 //编辑器 Namespace.register("U.MD.UI.BTree");U.MD.UI.BTree=function(a,c,b,d,f,g,h,e,l,k,m){U.MD.UI.BTree.jsonStartLeft(a,g[0],c);U.MD.UI.BTree.jsonStartRight(g[1],c,b,d,f,h,e,l,k,m)};U.MD.UI.BTree.treeCreate=function(a,c,b){for(var d=0;dc&&(c=parseInt(a[b].id));return c};Namespace.register("U.MD.UI.editor");U.MD.UI.Editor=U.MD.UI.editor=function(a,c){U.UF.DL.asynLoadCss({rel:"stylesheet",type:"text/css",href:"/css/Controls/Complex/Editor.css"});U.MD.UI.editor.createEditor(a);U.UF.E.initEditor($(".editor",a)[0],c);U.MD.UI.editor.EditorEventBind(a);U.MD.UI.editor.operateJson.editor=$(".editor",a)[0];return U.MD.UI.editor.operateJson};U.MD.UI.editor.operateJson={loadContent:function(a){this.editor.focus();U.UF.E.onpaste(null,this.editor,a)},getContent:function(){return this.editor.innerHTML}};U.MD.UI.editor.createEditor=function(a){a.innerHTML='\x3cdiv class\x3d\'toolbar\' style\x3d"width: 788px;background-color: #f5f5f5;border: 1px solid #c7d3e1;line-height: 0;padding: 6px;height: 25px;"\x3e\n \x3cbutton class\x3d"last" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"future" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n\x3cdiv class\x3d\'setFont\' style\x3d\'float: left;margin: 0 3px;position: relative;padding:0px\'\x3e\x3c/div\x3e \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n\x3cdiv class\x3d\'setSize\' style\x3d\'float: left;margin: 0 3px;position: relative;padding:0px\'\x3e\x3c/div\x3e \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n \x3clabel style\x3d"float: left;margin: 0 3px;position: relative;"\x3e\n \x3cbutton class\x3d"pic" style\x3d"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/pic.png\') no-repeat center;"\x3e\n \x3c/button\x3e\n \x3cinput multiple accept\x3d\'image/*\' type\x3d\'file\' class\x3d\'picUpload\' style\x3d\'display: none;\' /\x3e\n \x3c/label\x3e\n \x3clabel style\x3d"float: left;margin: 0 3px;position: relative;"\x3e\n \x3cbutton class\x3d"attachment" style\x3d"outline: none;cursor: pointer;border: 1px solid transparent;width: 25px;height: 25px;background: url(/img/YS2017.png) no-repeat;background-position: -1054px -593.5px;"\x3e\x3c/button\x3e\n \x3cinput multiple\x3d"" type\x3d"file" class\x3d"attachmentUpload" style\x3d"display: none;"\x3e\n \x3c/label\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n \x3cdiv style\x3d"float: left;margin: 0 3px;position: relative;padding:0px"\x3e\n \x3cbutton class\x3d"fontColor" style\x3d"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/fontColor.png\') no-repeat center;"\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d\'fontColorBar colorBar\' style\x3d\'display:none;position: absolute;\'\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n \x3cdiv style\x3d"float: left;margin: 0 3px;position: relative;padding:0px"\x3e\n \x3cbutton class\x3d"backgroundColor" style\x3d"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url(\'/EditorImage/blockColor.png\') no-repeat center;"\x3e\n \x3c/button\x3e\n \x3cdiv class\x3d\'backgroundColorBar colorBar\' style\x3d\'display:none;position: absolute;\'\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n \x3cbutton class\x3d"bIcon" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"iIcon" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"UIcon" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"SIcon" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;"\x3e\n\n \x3c/i\x3e\n \x3cbutton class\x3d"textLeft" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"textCenter" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"textRight" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3ci style\x3d"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;" \x3e\n\n \x3c/i\x3e\n \x3cbutton class\x3d"a" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"b" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3cbutton class\x3d"c" style\x3d"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;"\x3e\n \x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"editor" contenteditable\x3d"true" style\x3d"width: 800px;min-height: 300px;border: 1px solid #E6E5E5;overflow: auto;"\x3e\n \x3c/div\x3e';$('input.picUpload[type\x3d"file"]',a)[0].onchange=function(){U.UF.E.picture(this,$(".editor",a)[0])};$('input.attachmentUpload[type\x3d"file"]',a)[0].onchange=function(){U.UF.E.attachment(this,$(".editor",a)[0])}};U.MD.UI.editor.EditorEventBind=function(a){var c=U.MD.UI.Font();c.style.cssText+="vertical-align: super;";var b=U.MD.UI.WordSize();b.style.cssText+="vertical-align: super;";$(".setFont",a).append(c);c.onchange=function(){U.UF.E.setRangeStyle({"font-family":c.value})};$(".setSize",a).append(b);b.onchange=function(){U.UF.E.setRangeStyle({"font-size":b.value})};$(".pic",a)[0].onclick=function(){$(".picUpload",a)[0].click()};$(".attachment",a)[0].onclick=function(){$(".attachmentUpload",a)[0].click()};$(".bIcon",a)[0].onclick=function(){U.UF.E.setRangeStyle({"font-weight":"bold"})};$(".iIcon",a)[0].onclick=function(){U.UF.E.setRangeStyle({"font-style":"italic"})};$(".UIcon",a)[0].onclick=function(){U.UF.E.setRangeStyle({"text-decoration":"underline"})};$(".SIcon",a)[0].onclick=function(){U.UF.E.setRangeStyle({"text-decoration":"line-through"})};$(".fontColor",a).bind("click",function(){"none"==$(".fontColorBar",a).css("display")&&(U.MD.UI.colorPicker($(".fontColorBar",a)[0],function(b){$(".MD_ColorPicker",$(".fontColorBar",a)[0]).remove();$(".fontColorBar",a).hide();U.UF.E.setRangeStyle({color:b})}),$(".fontColorBar",a).show())});$(".backgroundColor",a).bind("click",function(){"none"==$(".backgroundColorBar",a).css("display")&&(U.MD.UI.colorPicker($(".backgroundColorBar",a)[0],function(b){$(".MD_ColorPicker",$(".backgroundColorBar",a)[0]).remove();$(".backgroundColorBar",a).hide();U.UF.E.setRangeStyle({backgroundColor:b})}),$(".backgroundColorBar",a).show())});$(".a",a).bind("click",function(){U.UF.E.addHref()});$(".c",a).bind("click",function(){U.UF.E.clearStyle(U.UF.E.getRangeAt())});$(".textLeft",a).bind("click",function(){U.UF.E.setLineStyle({"text-align":"left"})});$(".textCenter",a).bind("click",function(){U.UF.E.setLineStyle({"text-align":"center"})});$(".textRight",a).bind("click",function(){U.UF.E.setLineStyle({"text-align":"right"})})};U.MD.UI.editor.Select=function(a,c,b,d){var f="";c.id&&(f=c.id)&&delete c.id;d=$$("div",{id:f},d||null);var f=$$("div",c,d),g=$$("div",{},f);$$("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"}},f);var h=$$("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;"}},d),e;c.style&&!c.style.position?d.style.position="relative":"";c.style&&!c.style.textIndent?g.style.textIndent="6px":"";g.style.whiteSpace="pre";g.style.overflow="hidden";g.style.width=d.offsetWidth-15+"px";for(var l in a)$$("div",{value:l,innerText:a[l],style:{cssText:"padding: 4px 6px; background: #fff"},onmouseover:function(){this.style.background="#ccc"},onmouseout:function(){this.style.background="#fff"},onclick:function(){g.innerText=this.innerText;U.UF.E.reSelectRange(e);b(this.value||this.innerText)}},h);for(l in a){g.innerText=a[l];break}g.style.lineHeight=parseInt(g.style.height)+"px";d.onclick=function(){var a=this.querySelector("div[datacontent]");U.UF.E.reSelectRange(e);"block"===a.style.display?a.style.display="none":a.style.display="block"};$(document).bind("click",function(){"none"!=h.style.display&&(h.style.display="none");$(".BD_BorderPicker")[0]&&"none"!=$(".BD_BorderPicker")[0].style.display&&($(".BD_BorderPicker")[0].style.display="none")},!1);$(d).bind("click",function(a){U.UF.EV.stopBubble(a)});d.onmousedown=function(){e=U.UF.E.getRangeAt()};return d};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(a){U.MD.R.login.cookieLogin(function(){var c=a.type,b=a.el,d=a.cb;U.MD.R.data.PID=a.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=d;c||(b=(new U.UF.UI.form("",$$("div"),{style:{width:"800px",height:"800px"}})).content);U.MD.R.reply.init(b);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(a){var c=U.MD.R.data.PageIndex,b=U.MD.R.data.PageSize;U.MD.R.initPrintHtml(a);U.MD.R.getReplyData(c,b,function(a){U.MD.R.data.AllCount=a[0][0]?Math.ceil(a[0][0].allcount/U.MD.R.data.PageSize):"";U.MD.R.printComment($("#U_MD_R_content_user_comment")[0],1,a,!1,!1,!1);U.MD.R.initLoadMoreBtn(a[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(a,c,b){U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_Reply","test",U.MD.R.data.AID,"1","",a,c],function(a){b&&b(a.value)})};U.MD.R.initPrintHtml=function(a){var c,b,d,f;a=$$("div",{className:"U_MD_R_comment"},a);a=$$("div",{className:"U_MD_R_content"},a);c=$$("div",{className:"U_MD_R_content_operation"},a);b=$$("div",{className:"U_MD_R_content_operation_userhead U_MD_R_Reply_Header"},c);b=$$("img",{className:"img",src:"/img/UserHead/UseHead.jpg",onerror:function(){this.src="/img/UserHead/UseHead.jpg"}},b);d=$$("div",{className:"U_MD_R_content_operation_right",style:{width:"calc(100% - 40px - 20px )"}},c);$(d).attr({"data-RPID":null,"data-RD":1,"data-RPUID":null});c=$$("div",{innerHTML:"\u767b\u5f55/\u6ce8\u518c",className:"U_MD_R_content_operation_userlogin U_MD_R_Reply_Name"},d);US.userInfo.userid?(c.innerHTML=US.userInfo.UserName,b.src="http://fs.1473.cn/"+US.userInfo.UserThumbnailImageHead):c.onclick=function(){U.MD.R.login()};c=$$("div",{id:"editorbox",className:"U_MD_R_Reply_Content",contenteditable:"true",style:{"min-height":"100px",background:"#fff",border:"1px solid black"}},d);b=document.documentElement.scrollTop;U.UF.E.initEditor(c);document.documentElement.scrollTop=b;c=$$("div",{className:"U_MD_R_content_operation_right_bottom"},d);$$("div",{className:"U_MD_R_content_operation_right_bottom_emoji",onclick:function(){U.UF.EV.stopBubble();U.MD.UI.face(this,$("#editorbox")[0]);$("#U_MD_UI_face").css({position:"relative",height:"140px","overflow-y":"scroll",top:"-150px",width:"450px",display:"block"})}},c);b=$$("div",{className:"U_MD_R_content_operation_right_bottom_picturewarp"},c);$$("img",{src:"/img/reply/img.png"},b);b=$$("input",{type:"file"},b);$$("div",{className:"U_MD_R_content_operation_right_bottom_release",innerHTML:"\u53d1\u8868\u8bc4\u8bba"},c).onclick=function(){""!=$(".U_MD_R_Reply_Content")[0].textContent||""!=$(".U_MD_R_Reply_Content")[0].innerHTML?U.MD.R.release(d,1,!1,1):U.alert("\u8bc4\u8bba\u4e0d\u80fd\u4e3a\u7a7a\uff01")};f=$$("div",{className:"U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image"},d);$$("div",{className:"U_MD_R_content_comment",id:"U_MD_R_content_user_comment"},a);b.onchange=function(){U.MD.R.uploadImages(this,f)};U.MD.R.data.CB&&U.MD.R.data.CB()};U.MD.R.initLoadMoreBtn=function(a){var c=$$("div",{className:"U_MD_R_content_loading"},$(".U_MD_R_comment")[0]);0=c&&(c="0"+c);0<=b&&9>=b&&(b="0"+b);return a.getFullYear()+"-"+c+"-"+b+" "+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()};Namespace.register("U.MD.UI.table");U.MD.UI.table=function(a,c,b,d){U.MD.UI.table.thead(a,c,b,d)};U.MD.UI.table.thead=function(a,c,b,d,f,g){f||(f=1,g=a.length);var h,e;d=$$("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"}},d);h=$$("thead",{},d);h=$$("tr",{},h);for(e in c)"object"===typeof c[e]?$$("th",{innerHTML:c[e].name,style:{cssText:b[e],padding:"10px 0","font-weight":"normal",border:"1px solid #d5d5d5"},id:"th"},h):$$("th",{innerHTML:c[e],style:{cssText:b[e],padding:"10px 0","font-weight":"normal",border:"1px solid #d5d5d5"},id:"th"},h);e=$$("tbody",{style:{cssText:"width:100%;"},id:"tbody"},d);U.MD.UI.table.tbody(e,a,c,b,f,g);return e};U.MD.UI.table.tbody=function(a,c,b,d,f,g){for(var h,e,l,k=(f-1)*g;kc&&(c=parseInt(a[b].id));return c};Namespace.register("U.MD.UI.txt");