dzxstatic
Version:
The static files of Discuz! X
1 lines • 41.8 kB
JavaScript
function styleCss(t){if("number"!=typeof t)return!1;var e=document.styleSheets[t];this.sheet=e,this.rules=e.cssRules?e.cssRules:e.rules}String.prototype.property2js=function(){return this.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()}))},styleCss.prototype.indexOf=function(t){for(var e=0;e<this.rules.length;e++)if(void 0!==this.rules[e].selectorText&&this.rules[e].selectorText==t)return e;return-1},styleCss.prototype.removeRule=function(t){if("number"==typeof t)t<this.rules.length&&(this.sheet.removeRule?this.sheet.removeRule(t):this.sheet.deleteRule(t));else{var e=this.indexOf(t);e>0&&(this.sheet.removeRule?this.sheet.removeRule(e):this.sheet.deleteRule(e))}},styleCss.prototype.addRule=function(t,e,i,s){var a=this.indexOf(t),n="",o="";-1!=a&&(o=new RegExp("^"+s+".*;","i"),(n=this.getRule(t))&&1==(n=(n=""!=(n=n.replace(t,"").replace("{","").replace("}","").replace(/ /g," ").replace(/^ | $/g,""))&&";"!=n.substr(-1,1)?n+";":n).toLowerCase().replace(o,"")).length&&(n=""),this.removeRule(a)),n=n.indexOf("!important")>-1||n.indexOf("! important")>-1?n:n.replace(/;/g," !important;"),n+=e,void 0!==i&&isNaN(i)||(i=this.rules.length),this.sheet.insertRule?this.sheet.insertRule(t+"{"+n+"}",i):n&&this.sheet.addRule(t,n,i)},styleCss.prototype.setRule=function(t,e,i){var s=this.indexOf(t);return-1!=s&&(this.rules[s].style[e]=i,!0)},styleCss.prototype.getRule=function(t,e){var i=this.indexOf(t);if(-1==i)return"";var s="";return void 0!==(s=void 0===e?void 0!==this.rules[i].cssText?this.rules[i].cssText:this.rules[i].style.cssText:this.rules[i].style[e])?s:""},styleCss.prototype.removeAllRule=function(t){for(var e=this.rules.length,i=0,s=0;s<e;s++){this.rules[this.rules.length-1-i].selectorText;1==t?this.sheet.removeRule?this.sheet.removeRule(this.rules.length-1-i):this.sheet.deleteRule(this.rules.length-1-i):i++}},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var i=this.length;null==e?e=0:((e=isNaN(e)?parseInt(e):e)<0&&(e=i+e),e<0&&(e=0));for(var s=e;s<i;s++){var a=this[s];if((void 0!==a||s in this)&&a===t)return s}return-1}),Array.prototype.filter||(Array.prototype.filter=function(t,e){var i=this.length;if("function"!=typeof t)throw new TypeError;for(var s=new Array,a=(e=arguments[1],0);a<i;a++)if(a in this){var n=this[a];t.call(e,n,a,this)&&s.push(n)}return s});var Util={event:function(t){return Util.e=t||window.event,Util.e.aim=Util.e.target||Util.e.srcElement,Util.e.preventDefault||(Util.e.preventDefault=function(){Util.e.returnValue=!1}),Util.e.stopPropagation||(Util.e.stopPropagation=function(){Util.e.cancelBubble=!0}),void 0===Util.e.layerX&&(Util.e.layerX=Util.e.offsetX),void 0===Util.e.layerY&&(Util.e.layerY=Util.e.offsetY),void 0===Util.e.which&&(Util.e.which=Util.e.button),Util.e},url:function(t){var e=t.replace(/(\(|\)|\,|\s|\'|\"|\\)/g,"\\$1");return/\\\\$/.test(e)&&(e+=" "),"url('"+e+"')"},trimUrl:function(t){return t.toLowerCase().replace(/url\(|\"|\'|\)/g,"")},swapDomNodes:function(t,e){var i=t.nextSibling;if(i!=e){var s=t.parentNode;e.parentNode.replaceChild(t,e),s.insertBefore(e,i)}else swapDomNodes(e,t)},hasClass:function(t,e){return t&&1==t.nodeType&&"string"==typeof t.className&&-1!=t.className.split(/\s+/).indexOf(e)},addClass:function(t,e){t.className+=this.hasClass(t,e)?"":" "+e},removeClass:function(t,e){var i=t.className.split(/\s+/);t.className=i.filter((function(t){return e!=t})).join(" ")},getTarget:function(t,e,i){for(var s=t.target||t.srcElement;null!=s;){if("className"==e){if(this.hasClass(s,i))return s}else if(s[e]==i)return s;s=s.parentNode}return!1},getOffset:function(t,e){for(var i=0;null!=t;)i+=t["offset"+(e?"Left":"Top")],t=t.offsetParent;return i},insertBefore:function(t,e){var i=e.parentNode,s=e.nextSibling;e.id&&e.id.indexOf("temp")>-1||s?i.insertBefore(t,e):i.appendChild(t)},insertAfter:function(t,e){var i=e.parentNode,s=e.nextSibling;s?i.insertBefore(t,s):i.appendChild(t)},getScroll:function(){var t,e,i,s;return document.documentElement&&document.documentElement.scrollTop?(t=document.documentElement.scrollTop,e=document.documentElement.scrollLeft,i=document.documentElement.scrollWidth,s=document.documentElement.scrollHeight):document.body&&(t=document.body.scrollTop,e=document.body.scrollLeft,i=document.body.scrollWidth,s=document.body.scrollHeight),{t:t,l:e,w:i,h:s}},hide:function(t){"string"==typeof t&&(t=$(t)),t&&(t.style.display="none",t.style.visibility="hidden")},show:function(t){"string"==typeof t&&(t=$(t)),t&&(this.removeClass(t,"hide"),t.style.display="",t.style.visibility="visible")},cancelSelect:function(){window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()},getSelectText:function(){return window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection?document.selection.createRange().text:""},toggleEle:function(t){if(!(t="object"!=typeof t?$(t):t))return!1;"none"==this.getFinallyStyle(t,"display")?(this.show(t),this.hide($("uploadmsg_button"))):(this.hide(t),this.show($("uploadmsg_button")))},getFinallyStyle:function(t,e){var i=void 0===(t="object"!=typeof t?$(t):t).currentStyle?window.getComputedStyle(t,null)[e]:t.currentStyle[e];return void 0===i&&"backgroundPosition"==e&&(i=t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY),i},recolored:function(){var t=document.body;t.style.zoom="1"==t.style.zoom?"100%":"1"},getRandom:function(t,e){t=t<0?0:t,e=e&&e<=3?e:3;for(var i="",s=0;s<t;s++){var a=Math.ceil(Math.random()*e);i+=1==a?Math.ceil(9*Math.random()):2==a?String.fromCharCode(Math.ceil(25*Math.random()+65)):String.fromCharCode(Math.ceil(25*Math.random()+97))}return i},fade:function(t,e,i,s,a){if(null==this.stack&&(this.stack=[]),!(t="string"==typeof t?$(t):t))return!1;for(var n=0;n<this.stack.length;n++)if(this.stack[n]==t&&(0==s||100==s))return!1;0!=s&&100!=s||this.stack.push(t),i="in"!=i&&"out"!=i?"out":i;var o=100/((e=e||400)/20);t.style.filter="Alpha(opacity="+s+")",t.style.opacity=s/100,s="in"==i?s+o:s-o;var r=setTimeout((function(){Util.fade(t,e,i,s,a)}),20);if(this["in"==i?"show":"hide"](t),"in"==i&&s>=100||"out"==i&&s<=0){for(clearTimeout(r),n=0;n<this.stack.length;n++)if(this.stack[n]==t){this.stack.splice(n,1);break}(a=a||function(){})(t)}return t},fadeIn:function(t,e,i){return this.fade(t,e,"in",0,i)},fadeOut:function(t,e,i){return this.fade(t,e,"out",100,i)},getStyle:function(t){if(t){var e=t.getAttribute("style")||"";return"object"==typeof e?e.cssText:e}return!1},setStyle:function(t,e){if(t){var i=t.getAttribute("style")||"";return"object"==typeof i?i.cssText=e:t.setAttribute("style",e)}return!1},getText:function(t){var e=t.innerText?t.innerText:t.textContent;return e||""},rgb2hex:function(t){if(!t)return"";var e=new RegExp("(\\d+)[, ]+(\\d+)[, ]+(\\d+)","g").exec(t);null==e&&(e=[0,0,0,0]);var i=e[1],s=e[2],a=e[3],n=(65536*parseInt(i)+256*parseInt(s)+parseInt(a)).toString(16).toUpperCase();return n=new Array(6-n.length+1).join("0")+n},formatColor:function(t){return""==t||t.indexOf("#")>-1||"transparent"==t.toLowerCase()?t:"#"+Util.rgb2hex(t)}};!function(){Frame=function(t,e,i,s,a){this.name=t,this.top=i,this.left=s,this.moveable=!!a,this.columns=[],this.className=e,this.titles=[],void 0===Frame._init&&(Frame.prototype.addColumn=function(t){t instanceof Column&&(this.columns[t.name]=t)},Frame.prototype.addFrame=function(t,e){(e instanceof Frame||e instanceof Tab)&&this.columns[t].children.push(e)},Frame.prototype.addBlock=function(t,e){e instanceof Block&&this.columns[t].children.push(e)}),Frame._init=!0},Column=function(t,e){this.name=t,this.className=e,this.children=[]},Tab=function(t,e,i,s,a){Frame.apply(this,arguments)},Tab.prototype=new Frame,Block=function(t,e,i,s){this.name=t,this.top=i,this.left=s,this.className=e,this.titles=[]},Drag=function(){this.data=[],this.scroll={},this.menu=[],this.data=[],this.allBlocks=[],this.overObj="",this.dragObj="",this.dragObjFrame="",this.overObjFrame="",this.isDragging=!1,this.layout=2,this.frameClass="frame",this.blockClass="block",this.areaClass="area",this.moveableArea=[],this.moveableColumn="column",this.moveableObject="move-span",this.titleClass="title",this.hideClass="hide",this.titleTextClass="titletext",this.frameTitleClass="frame-title",this.tabClass="frame-tab",this.tabActivityClass="tabactivity",this.tabTitleClass="tab-title",this.tabContentClass="tb-c",this.moving="moving",this.contentClass="dxb_bc",this.tmpBoxElement=null,this.dargRelative={},this.scroll={},this.menu=[],this.rein=[],this.newFlag=!1,this.isChange=!1,this.fn="",this._replaceFlag=!1,this.sampleMode=!1,this.sampleBlocks=null,this.advancedStyleSheet=null},Drag.prototype={getTmpBoxElement:function(){return this.tmpBoxElement?this.overObj&&this.overObj.offsetWidth>0&&(this.tmpBoxElement.style.width=this.overObj.offsetWidth-4+"px"):(this.tmpBoxElement=document.createElement("div"),this.tmpBoxElement.id="tmpbox",this.tmpBoxElement.className="tmpbox",this.tmpBoxElement.style.width=this.overObj.offsetWidth-4+"px",this.tmpBoxElement.style.height=this.overObj.offsetHeight-4+"px"),this.tmpBoxElement},getPositionStr:function(){this.initPosition();var t="";for(var e in this.data)if("function"!=typeof this.data[e]){for(var i in t+='<item id="'+e+'">',this.data[e])(this.data[e][i]instanceof Frame||this.data[e][i]instanceof Tab)&&(t+=this._getFrameXML(this.data[e][i]));t+="</item>"}return'<?xml version="1.0" encoding="ISO-8859-1"?><root>'+t+"</root>"},_getFrameXML:function(t){if(!(t instanceof Frame||t instanceof Tab)||t.name.indexOf("temp")>0)return"";var e=t instanceof Tab?"tab":"frame",i="",s=t.name,a=this._getAttrXML(t),n=t.columns;for(var o in n)if(n[o]instanceof Column){var r="",l=n[o].children;for(var h in l)"attr"==h||"function"==typeof l[h]||l[h].name.indexOf("temp")>0||(l[h]instanceof Block?(r+='<item id="block`'+l[h].name+'">',r+=this._getAttrXML(l[h]),r+="</item>"):(l[h]instanceof Frame||l[h]instanceof Tab)&&(r+=this._getFrameXML(l[h])));i+='<item id="column`'+o+'">'+this._getAttrXML(n[o])+r+"</item>"}return'<item id="'+e+"`"+s+'">'+a+i+"</item>"},_getAttrXML:function(t){var e=["left","top"],i="";if(t instanceof Frame||t instanceof Tab||t instanceof Block||t instanceof Column){for(var s in t)if("titles"==s&&(i+=this._getTitlesXML(t[s])),"object"!=typeof t[s]&&"function"!=typeof t[s]){if(e.indexOf(s)>=0)continue;i+='<item id="'+s+'"><![CDATA['+t[s]+"]]></item>"}}else i+="";return'<item id="attr">'+i+"</item>"},_getTitlesXML:function(t){var e='<item id="titles">';for(var i in t)if("function"!=typeof t[i]){for(var s in e+='<item id="'+i+'">',t[i])"function"!=typeof t[i][s]&&(e+='<item id="'+s+'"><![CDATA['+t[i][s]+"]]></item>");e+="</item>"}return e+="</item>"},getCurrentOverObj:function(t){parseInt(this.dragObj.style.left),parseInt(this.dragObj.style.top);var e=1e7;for(var i in this.data)for(var s in this.data[i])if(this.data[i][s]instanceof Frame||this.data[i][s]instanceof Tab){var a=this._getMinDistance(this.data[i][s],e);if(a.distance<e){var n=a.id;e=a.distance}}return $(n)},_getMinDistance:function(t,e){if(t.name==this.dragObj.id)return{id:t.name,distance:e};var i,s=parseInt(this.dragObj.style.left),a=parseInt(this.dragObj.style.top),n=Util.hasClass(this.dragObj,this.tabClass)&&Util.hasClass($(t.name).parentNode.parentNode,this.tabClass);if(t instanceof Frame||t instanceof Tab){if(t.moveable&&!n){var o=Util.hasClass(this.dragObj,this.tabClass),r=Util.hasClass(this.dragObj,this.frameClass),l=Util.hasClass(this.dragObj,this.blockClass)&&Util.hasClass($(t.name).parentNode,this.moveableColumn);if(o||r||l){var h=t.top-a,c=t.left-s;(p=Math.sqrt(Math.pow(c,2)+Math.pow(h,2)))<e&&(e=p,i=t.name)}}for(var d in t.columns){var u=t.columns[d];if(u instanceof Column)for(var f in u.children)if(u.children[f]instanceof Tab||u.children[f]instanceof Frame||u.children[f]instanceof Block){var m=this._getMinDistance(u.children[f],e);m.distance<e&&(i=m.id,e=m.distance)}}return{id:i,distance:e}}if(n)return{id:t.name,distance:e};var p;h=t.top-a,c=t.left-s;return(p=Math.sqrt(Math.pow(c,2)+Math.pow(h,2)))<e?{id:t.name,distance:p}:{id:t.name,distance:e}},getObjByName:function(t,e){if(!t)return!1;if((e=e||this.data)instanceof Frame){if(e.name==t)return e;if(t==(s=this.getObjByName(t,e.columns)).name)return s}else if(e instanceof Block){if(e.name==t)return e}else if("object"==typeof e)for(var i in e){var s;if(t==(s=this.getObjByName(t,e[i])).name)return s}return!1},initPosition:function(){this.data=[],this.allBlocks=[];for(var t=$C(this.blockClass),e=0;e<t.length;e++)t[e].id.indexOf("temp")<0&&(this.checkEdit(t[e]),this.allBlocks.push(t[e].id.replace("portal_block_","")));for(var i=this.moveableArea.length,s=0;s<i;s++){var a=this.moveableArea[s],n=[];if("object"==typeof a){this.checkTempDiv(a.id);var o=a.childNodes;for(var e in o)"object"==typeof o[e]&&(Util.hasClass(o[e],this.frameClass)||Util.hasClass(o[e],this.blockClass)||Util.hasClass(o[e],this.tabClass)||Util.hasClass(o[e],this.moveableObject))&&n.push(this.initFrame(o[e]));this.data[a.id]=n}}this._replaceFlag=!0},removeBlockPointer:function(t){this.removeBlock(t)},toggleContent:function(t){if("string"!=typeof t)var e=(t=Util.event(t)).aim.id.replace("_edit_toggle","");else e=t;var i=this.getObjByName(e),s="";if(i instanceof Block||i instanceof Tab)s=$(e+"_content").style.display,Util.toggleEle(e+"_content");else{var a=i.columns;for(var n in a)s=$(n).style.display,Util.toggleEle($(n))}t.aim.src=""!=s?STATICURL+"/image/common/fl_collapsed_no.gif":STATICURL+"/image/common/fl_collapsed_yes.gif"},checkEdit:function(t){if(!t||Util.hasClass(t,"temp")||t.getAttribute("noedit"))return!1;var e=t.id,i=this;if(!$(e+"_edit")){i=this;var s=document.createElement("div");s.className="edit hide",s.id=e+"_edit",s.innerHTML='<span id="'+e+'_edit_menu">编辑</span>',t.appendChild(s),$(e+"_edit_menu").onclick=function(t){Drag.prototype.toggleMenu.call(i,t,this)}}t.onmouseover=function(t){Drag.prototype.showEdit.call(i,t)},t.onmouseout=function(t){Drag.prototype.hideEdit.call(i,t)}},initFrame:function(t){if("object"!=typeof t)return"";var e=t.id;this.sampleMode||this.checkEdit(t);var i=Util.hasClass(t,this.moveableObject),s="";return Util.hasClass(t,this.tabClass)?(this._initTabActivity(t),s=new Tab(e,t.className,Util.getOffset(t,!1),Util.getOffset(t,!0),i)):(Util.hasClass(t,this.frameClass)||Util.hasClass(t,this.moveableObject))&&(Util.hasClass(t,this.frameClass)&&!this._replaceFlag&&this._replaceFrameColumn(t),s=new Frame(e,t.className,Util.getOffset(t,!1),Util.getOffset(t,!0),i)),this._initColumn(s,t),s},_initColumn:function(t,e){var i=e.children;if(Util.hasClass(e.parentNode.parentNode,this.tabClass)){var s=$(e.id+"_content").children,a=i.length;for(var n in s)"object"==typeof s[n]&&(i[a+n]=s[n])}for(var n in i)if("object"==typeof i[n]&&(Util.hasClass(i[n],this.titleClass)&&this._initTitle(t,i[n]),this._initEleTitle(t,e),Util.hasClass(i[n],this.moveableColumn))){var o=i[n].id,r=new Column(o,i[n].className);t.addColumn(r),this.checkTempDiv(o);for(var l=i[n].children,h=l.length,c=0;c<h;c++){var d=l[c];if(Util.hasClass(d,this.frameClass)||Util.hasClass(d,this.tabClass)){var u=this.initFrame(d);t.addFrame(o,u)}else if(Util.hasClass(d,this.blockClass)||Util.hasClass(d,this.moveableObject)){var f=new Block(d.id,d.className,Util.getOffset(d,!1),Util.getOffset(d,!0));for(var m in d.children)Util.hasClass(d.children[m],this.titleClass)&&this._initTitle(f,d.children[m]);this._initEleTitle(f,d),t.addBlock(o,f)}}}},_initTitle:function(t,e){if(Util.hasClass(e,this.titleClass)){t.titles.className=[e.className],t.titles.style={},e.style.backgroundImage&&(t.titles.style["background-image"]=e.style.backgroundImage),e.style.backgroundRepeat&&(t.titles.style["background-repeat"]=e.style.backgroundRepeat),e.style.backgroundColor&&(t.titles.style["background-color"]=e.style.backgroundColor),t instanceof Tab&&(t.titles.switchType=[],t.titles.switchType[0]=e.getAttribute("switchtype")?e.getAttribute("switchtype"):"click");var i=e.children;for(var s in i)Util.hasClass(i[s],this.titleTextClass)?this._getTitleData(t,i[s],"first"):"object"!=typeof i[s]||Util.hasClass(i[s],this.moveableObject)||this._getTitleData(t,i[s])}},_getTitleData:function(t,e,i){var s,a="",n="",o="",r="",l=e.getElementsByTagName("a");if(l.length>0&&(a=l[0].href,o=l[0].style.color+" !important"),(l=e.getElementsByTagName("img")).length>0&&(r=l[0].src),(s=Util.getText(e))||r){o=o||e.style.color;var h=""==(n=null==(n=e.style.styleFloat?e.style.styleFloat:e.style.cssFloat)?"":n)?"left":n,c={text:s,href:a,color:o,float:n,margin:parseInt(e.style[("margin-"+h).property2js()])||"","font-size":parseInt(e.style.fontSize)||"",className:e.className,src:r};i?t.titles[i]=c:t.titles.push(c)}},_initEleTitle:function(t,e){if(Util.hasClass(e,this.moveableObject))if(t.titles.first&&t.titles.first.text)t.titles.first.text;else t.name},showBlockName:function(t){var e=$C("block-name",t,"div");e.length&&Util.show(e[0])},hideBlockName:function(t){var e=$C("block-name",t,"div");e.length&&Util.hide(e[0])},showEdit:function(t){t=Util.event(t);var e=Util.getTarget(t,"className",this.moveableObject);if(e)Util.show(e.id+"_edit"),e.style.backgroundColor="#fffacd",this.showBlockName(e);else{var i=Util.getTarget(t,"className",this.frameClass);"object"==typeof i&&(Util.show(i.id+"_edit"),i.style.backgroundColor="#fffacd")}},hideEdit:function(t){t=Util.event(t);var e=Util.getTarget(t,"className",this.moveableObject),i=Util.getTarget(t,"className",this.frameClass);"object"==typeof i&&(Util.hide(i.id+"_edit"),i.style.backgroundColor=""),"object"==typeof e&&(Util.hide(e.id+"_edit"),e.style.backgroundColor="",this.hideBlockName(e))},toggleMenu:function(t,e){(t=Util.event(t)).stopPropagation();var i=Util.getOffset(e,!1),s=Util.getOffset(e,!0),a=(e.offsetWidth,e.offsetHeight),n=$("edit_menu");if(n)i+a==Util.getOffset(n,!1)&&s==Util.getOffset(n,!0)?n.parentNode.removeChild(n):(n.style.top=i+a+"px",n.style.left=s+"px",n.innerHTML=this._getMenuHtml(t,e));else{var o=this._getMenuHtml(t,e);if(""!=o){(n=document.createElement("div")).id="edit_menu",n.className="edit-menu",n.style.top=i+a+"px",n.style.left=s+"px",n.innerHTML=o,document.body.appendChild(n);var r=this;document.body.onclick=function(t){Drag.prototype.removeMenu.call(r,t)}}}},_getMenuHtml:function(t,e){var i=e.id.replace("_edit_menu",""),s="<ul>";return"object"==typeof this.menu[i]&&(s+=this._getMenuHtmlLi(i,this.menu[i])),Util.hasClass($(i),this.tabClass)&&"object"==typeof this.menu.tab&&(s+=this._getMenuHtmlLi(i,this.menu.tab)),Util.hasClass($(i),this.frameClass)&&"object"==typeof this.menu.frame&&(s+=this._getMenuHtmlLi(i,this.menu.frame)),Util.hasClass($(i),this.blockClass)&&"object"==typeof this.menu.block&&(s+=this._getMenuHtmlLi(i,this.menu.block)),"object"==typeof this.menu.default&&this.getObjByName(i)&&(s+=this._getMenuHtmlLi(i,this.menu.default)),"<ul></ul>"==(s+="</ul>")?"":s},_getMenuHtmlLi:function(t,e){for(var i="",s=e.length,a=0;a<s;a++)i+='<li class="mitem" id="cmd_'+t+"\" onclick='"+e[a].cmd+"'>"+e[a].cmdName+"</li>";return i},removeMenu:function(t){var e=$("edit_menu");e&&e.parentNode.removeChild(e),document.body.onclick=""},addMenu:function(t,e,i){void 0===this.menu[t]&&(this.menu[t]=[]),this.menu[t].push({cmdName:e,cmd:i})},setDefalutMenu:function(){},setSampleMenu:function(){},getPositionKey:function(t){this.initPosition(),t=parseInt(t);var e=0;for(var i in this.position)if(e++>=t)break;return i},checkTempDiv:function(t){if(t){var e=t+"_temp",i=$(e);null!=i&&void 0!==i||((i=document.createElement("div")).className=this.moveableObject+" temp",i.id=e,$(t).appendChild(i))}},_setCssPosition:function(t,e){for(;t&&t.parentNode&&"ct"!=t.id;)(Util.hasClass(t,this.frameClass)||Util.hasClass(t,this.tabClass))&&(t.style.position=e),t=t.parentNode},initDragObj:function(t){t=Util.event(t);var e=Util.getTarget(t,"className",this.moveableObject);if(!e)return!1;this.overObj!=e&&"tmpbox"!=e.id&&(this.overObj=e,this.overObj.style.cursor="move")},dragStart:function(t){if((t=Util.event(t)).aim.id&&t.aim.id.indexOf&&t.aim.id.indexOf("_edit")>0)return!1;if(1!=t.which)return!1;if(this.overObj=this.dragObj=Util.getTarget(t,"className",this.moveableObject),!this.dragObj||Util.hasClass(this.dragObj,"temp"))return!1;if(!this.getTmpBoxElement())return!1;this.getRelative(),this._setCssPosition(this.dragObj.parentNode.parentNode,"static");var e=Util.getOffset(this.dragObj,!0),i=Util.getOffset(this.dragObj,!1),s=this.dragObj.offsetWidth;this.dragObj.style.position="absolute",this.dragObj.style.left=e+"px",this.dragObj.style.top=i-3+"px",this.dragObj.style.width=s+"px",this.dragObj.lastMouseX=t.clientX,this.dragObj.lastMouseY=t.clientY,Util.insertBefore(this.tmpBoxElement,this.overObj),Util.addClass(this.dragObj,this.moving),this.dragObj.style.zIndex=500,this.scroll=Util.getScroll();var a=this;document.onscroll=function(){Drag.prototype.resetObj.call(a,t)},window.onscroll=function(){Drag.prototype.resetObj.call(a,t)},document.onmousemove=function(t){Drag.prototype.drag.call(a,t)}},getRelative:function(){this.dargRelative={up:this.dragObj.previousSibling,down:this.dragObj.nextSibling}},resetObj:function(t){if(this.dragObj){t=Util.event(t);var e=Util.getScroll(),i=e.t-this.scroll.t,s=e.l-this.scroll.l,a=parseInt(this.dragObj.style.top),n=parseInt(this.dragObj.style.left);a+=i,n+=s,this.dragObj.style.top=a+"px",this.dragObj.style.left=n+"px",this.scroll=Util.getScroll()}},drag:function(t){t=Util.event(t),this.isDragging||(this.dragObj.style.filter="alpha(opacity=60)",this.dragObj.style.opacity=.6,this.isDragging=!0);var e=t.clientX,i=t.clientY;if(this.dragObj.lastMouseX==e&&this.dragObj.lastMouseY==i)return!1;var s,a,n=parseInt(this.dragObj.style.top),o=parseInt(this.dragObj.style.left);o=isNaN(o)?0:o,a=(n=isNaN(n)?0:n)+i-this.dragObj.lastMouseY,s=o+e-this.dragObj.lastMouseX,this.dragObj.style.left=s+"px ",this.dragObj.style.top=a+"px ",this.dragObj.lastMouseX=e,this.dragObj.lastMouseY=i;var r=this.getCurrentOverObj(t);r&&this.overObj!=r&&(this.overObj=r,this.getTmpBoxElement(),Util.insertBefore(this.tmpBoxElement,this.overObj),this.dragObjFrame=this.dragObj.parentNode.parentNode,this.overObjFrame=this.overObj.parentNode.parentNode),Util.cancelSelect()},_pushTabContent:function(t,e){if(Util.hasClass(e,this.frameClass)||Util.hasClass(e,this.tabClass)){var i=$(e.id+"_content");i||((i=document.createElement("div")).id=e.id+"_content",i.className=Util.hasClass(e,this.frameClass)?this.contentClass+" cl "+e.className.substr(e.className.lastIndexOf(" ")+1):this.contentClass+" cl");var s=this.getObjByName(e.id);if(s)for(var a in s.columns)s.columns[a]instanceof Column&&i.appendChild($(a));else{var n=e.childNodes,o=[];for(var a in n)"object"==typeof n[a]&&(Util.hasClass(n[a],this.moveableColumn)||Util.hasClass(n[a],this.tabContentClass))&&o.push(n[a]);var r=o.length;for(a=0;a<r;a++)i.appendChild(o[a])}$(t.id+"_content").appendChild(i)}else Util.hasClass(e,this.blockClass)&&$(e.id+"_content")&&$(t.id+"_content").appendChild($(e.id+"_content"))},_popTabContent:function(t,e){if(Util.hasClass(e,this.frameClass)||Util.hasClass(e,this.tabClass)){Util.removeClass(e,this.tabActivityClass);var i=$(e.id+"_content");if(!i)return!1;var s=i.childNodes,a=[];for(var n in s)"object"==typeof s[n]&&a.push(s[n]);var o=a.length;for(n=0;n<o;n++)e.appendChild(a[n]);s="",$(t.id+"_content").removeChild(i)}else Util.hasClass(e,this.blockClass)&&($(e.id+"_content")&&Util.show($(e.id+"_content")),$(e.id+"_content")&&e.appendChild($(e.id+"_content")))},_initTabActivity:function(t){if(!Util.hasClass(t,this.tabClass))return!1;var e=$(t.id+"_title").childNodes,i=[];for(var s in e)if("object"==typeof e[s]){var a=e[s].id;if(Util.hasClass(e[s],this.frameClass)||Util.hasClass(e[s],this.tabClass)){if(this._replaceFlag||this._replaceFrameColumn(e[s]),!$(a+"_content")){var n=[];for(var o in e[s].childNodes)Util.hasClass(e[s].childNodes[o],this.moveableColumn)&&n.push(e[s].childNodes[o]);(h=document.createElement("div")).id=a+"_content",h.className=Util.hasClass(e[s],this.frameClass)?this.contentClass+" cl "+e[s].className.substr(e[s].className.lastIndexOf(" ")+1):this.contentClass+" cl";for(var r=n.length,l=0;l<r;l++)h.appendChild(n[l])}i.push(e[s])}else if(Util.hasClass(e[s],this.blockClass)){var h;(h=$(a+"_content"))?h=Util.hasClass(h.parentNode,this.blockClass)?h:"":(h=document.createElement("div")).id=a+"_content",i.push(e[s])}h&&$(t.id+"_content").appendChild(h)}var c=i.length;for(s=0;s<c;s++)Util[s>0?"hide":"show"]($(i[s].id+"_content"))},dragEnd:function(t){if(t=Util.event(t),!this.dragObj)return!1;document.onscroll=function(){},window.onscroll=function(){},document.onmousemove=function(t){},document.onmouseup="",this.tmpBoxElement.parentNode&&(this.tmpBoxElement.parentNode==document.body?(document.body.removeChild(this.tmpBoxElement),document.body.removeChild(this.dragObj),this.fn=""):(Util.removeClass(this.dragObj,this.moving),this.dragObj.style.display="none",this.dragObj.style.width="",this.dragObj.style.top="",this.dragObj.style.left="",this.dragObj.style.zIndex="",this.dragObj.style.position="relative",this.dragObj.style.backgroundColor="",this.isDragging=!1,this.tmpBoxElement.parentNode.replaceChild(this.dragObj,this.tmpBoxElement),Util.fadeIn(this.dragObj),this.tmpBoxElement="",this._setCssPosition(this.dragObjFrame,"relative"),this.doEndDrag(),this.initPosition(),this.dargRelative.up==this.dragObj.previousSibling&&this.dargRelative.down==this.dragObj.nextSibling||this.setClose(),this.dragObjFrame=this.overObjFrame=null)),this.newFlag=!1,"function"==typeof this.fn&&this.fn()},doEndDrag:function(){!Util.hasClass(this.dragObjFrame,this.tabClass)&&Util.hasClass(this.overObjFrame,this.tabClass)?this._pushTabContent(this.overObjFrame,this.dragObj):Util.hasClass(this.dragObjFrame,this.tabClass)&&!Util.hasClass(this.overObjFrame,this.tabClass)?this._popTabContent(this.dragObjFrame,this.dragObj):Util.hasClass(this.dragObjFrame,this.tabClass)&&Util.hasClass(this.overObjFrame,this.tabClass)&&this.dragObjFrame!=this.overObjFrame&&(this._popTabContent(this.dragObjFrame,this.dragObj),this._pushTabContent(this.overObjFrame,this.dragObj))},_replaceFrameColumn:function(t,e){var i=t.childNodes,s=t.className.match(/(frame-[\w-]*)/);if(!s)return!1;var a=s[1];for(var n in i)if(Util.hasClass(i[n],this.moveableColumn)){var o=i[n].className;o=(o=(o=(o=(o=o.replace(" col-l"," "+a+"-l")).replace(" col-r"," "+a+"-r")).replace(" col-c"," "+a+"-c")).replace(" mn"," "+a+"-l")).replace(" sd"," "+a+"-r"),i[n].className=o}},stopCmd:function(){this.rein.length>0&&this.rein.pop()()},setClose:function(){this.isChange||(window.onbeforeunload=function(){return"您的数据已经修改,退出将无法保存您的修改。"}),this.isChange=!0},clearClose:function(){this.isChange=!1,window.onbeforeunload=function(){}},_getMoveableArea:function(t){t=t||document.body,this.moveableArea=$C(this.areaClass,t,"div")},initMoveableArea:function(){var t=this;this._getMoveableArea();for(var e=this.moveableArea.length,i=0;i<e;i++){var s=this.moveableArea[i];if(null==s||void 0===s)return!1;s.ondragstart=function(t){return!1},s.onmouseover=function(e){Drag.prototype.initDragObj.call(t,e)},s.onmousedown=function(e){Drag.prototype.dragStart.call(t,e)},s.onmouseup=function(e){Drag.prototype.dragEnd.call(t,e)},s.onclick=function(t){(t=Util.event(t)).preventDefault()}}$("contentframe")&&($("contentframe").ondragstart=function(t){return!1})},disableAdvancedStyleSheet:function(){this.advancedStyleSheet&&(this.advancedStyleSheet.disabled=!0)},enableAdvancedStyleSheet:function(){this.advancedStyleSheet&&(this.advancedStyleSheet.disabled=!1)},init:function(t){return this.initCommon(),this.setSampleMode(t),this.sampleMode?this.initSample():this.initAdvanced(),!0},initAdvanced:function(){this.initMoveableArea(),this.initPosition(),this.setDefalutMenu(),this.enableAdvancedStyleSheet(),this.showControlPanel(),this.initTips(),this.goonDIY&&this.goonDIY(),this.openfn()},openfn:function(){var openfn=loadUserdata("openfn");openfn&&("function"==typeof openfn?openfn():eval(openfn),saveUserdata("openfn",""))},initCommon:function(){this.advancedStyleSheet=$("diy_common"),this.menu=[]},initSample:function(){this._getMoveableArea(),this.initPosition(),this.sampleBlocks=$C(this.blockClass),this.initSampleBlocks(),this.setSampleMenu(),this.disableAdvancedStyleSheet(),this.hideControlPanel()},initSampleBlocks:function(){if(this.sampleBlocks)for(var t=0;t<this.sampleBlocks.length;t++)this.checkEdit(this.sampleBlocks[t])},setSampleMode:function(t){loadUserdata("diy_advance_mode")?this.sampleMode="":(this.sampleMode=t,saveUserdata("diy_advance_mode",t?"":"1"))},hideControlPanel:function(){Util.show("samplepanel"),Util.hide("controlpanel"),Util.hide("diy-tg")},showControlPanel:function(){Util.hide("samplepanel"),Util.show("controlpanel"),Util.show("diy-tg")},checkHasFrame:function(t){for(var e in t=t||this.data){if(t[e]instanceof Frame&&t[e].className.indexOf("temp")<0)return!0;if("object"==typeof t[e]&&this.checkHasFrame(t[e]))return!0}return!1},deleteFrame:function(t){if("string"==typeof t)"object"!=typeof window["c"+t+"_frame"]||BROWSER.ie||delete window["c"+t+"_frame"];else for(var e=0,i=t.length;e<i;e++)"object"!=typeof window["c"+t[e]+"_frame"]||BROWSER.ie||delete window["c"+t[e]+"_frame"]},saveViewTip:function(t){t&&(saveUserdata(t,"1"),Util.hide(t)),doane()},initTips:function(){for(var t=["diy_backup_tip"],e=0;e<t.length;e++)t[e]&&!loadUserdata(t[e])&&Util.show(t[e])},extend:function(t){for(var e in t)this[e]=t[e]}},DIY=function(){this.frames=[],this.isChange=!1,this.spacecss=[],this.style="t1",this.currentDiy="body",this.opSet=[],this.opPointer=0,this.backFlag=!1,this.styleSheet={},this.scrollHeight=0},DIY.prototype={init:function(t){if(drag.init(t),this.style=document.diyform.style.value,""==this.style){var e=RegExp("topic(.*)/style.css"),i=$("style_css")?$("style_css").href:"",s=e.exec(i);this.style=s&&s.length>1?s[1]:""}this.currentLayout=void 0===document.diyform.currentlayout?"":document.diyform.currentlayout.value,this.initStyleSheet(),this.styleSheet.rules&&this.initDiyStyle()},initStyleSheet:function(){for(var t=document.styleSheets,e=0;e<t.length;e++){if("diy_style"==(t[e].ownerNode||t[e].owningElement).id)return this.styleSheet=new styleCss(e),!0}},initDiyStyle:function(t){var e=t||$("diy_style").innerHTML;e=e?e.replace(/\n|\r|\t| /g,""):"";for(var i=Math.random(),s="",a=new RegExp("(.*?) ?{(.*?)}","g");s=a.exec(e);)for(var n=this.checkSelector(s[1]),o=s[2].split(";"),r=o.length,l=0;l<r;l++){var h=trim(o[l].substr(0,o[l].indexOf(":")).toLowerCase()),c=o[l].substr(o[l].indexOf(":")+1).toLowerCase();h&&c&&(this.spacecss[n]||(this.spacecss[n]=[]),this.spacecss[n][h]=c,t&&this.setStyle(n,h,c,i))}},checkSelector:function(t){var e=t.toLowerCase();if(e.toLowerCase().indexOf("body")>-1){var i=BROWSER.ie?"BODY":"body";t=t.replace(/body/i,i)}return e.indexOf(" a")>-1&&(t=BROWSER.ie?t.replace(/ [aA]/," A"):t.replace(/ [aA]/," a")),t},initPalette:function(t){var e,i,s,a,n,o,r,l="",h=0,c=["repeat","no-repeat","repeat-x","repeat-y"],d=["scroll","fixed"],u=["left top","center top","right top","left center","center center","right center","left bottom","center bottom","right bottom"],f=["0% 0%","50% 0%","100% 0%","0% 50%","50% 50%","100% 50%","0% 100%","50% 100%","100% 100%"];i=this.getSelector(t),e=Util.formatColor(this.styleSheet.getRule(i,"backgroundColor")),l=this.styleSheet.getRule(i,"backgroundImage"),s=this.styleSheet.getRule(i,"backgroundRepeat"),a=this.styleSheet.getRule(i,"backgroundPosition"),n=this.styleSheet.getRule(i,"backgroundAttachment"),o=Util.formatColor(this.styleSheet.getRule(i,"color")),r=Util.formatColor(this.styleSheet.getRule(this.getSelector(i+" a"),"color"));var m=0;for(h=0;h<c.length;h++)s==c[h]&&(m=h);for($("repeat_mode").selectedIndex=m,h=0;h<d.length;h++)$("rabga"+h).checked=n==d[h];var p="";for(h=0;h<u.length;h++){var g=a==u[h]?"red":"";$("bgimgposition"+h).className=g,p=p||g}if("red"!=p)for(h=0;h<f.length;h++)g=a==f[h]?"red":"",$("bgimgposition"+h).className=g;$("colorValue").value=e,$("cbpb")&&($("cbpb").style.backgroundColor=e),$("textColorValue").value=o,$("ctpb")&&($("ctpb").style.backgroundColor=o),$("linkColorValue").value=r,$("clpb")&&($("clpb").style.backgroundColor=r),Util.show($("currentimgdiv")),Util.hide($("diyimages")),$("selectalbum")&&($("selectalbum").disabled="disabled"),l=""!=l&&"none"!=l?l.replace(/url\(['|"]{0,1}/,"").replace(/['|"]{0,1}\)/,""):"static/image/common/nophotosmall.gif",$("currentimg").src=l},changeBgImgDiv:function(){Util.hide($("currentimgdiv")),Util.show($("diyimages")),$("selectalbum")&&($("selectalbum").disabled="")},getSpacecssStr:function(){var t="",e=["body","#hd","#ct","BODY"];for(var i in this.spacecss){var s=i.split(" ")[0];if(-1!=e.indexOf(s)||drag.getObjByName(s.substr(1))){var a=this.spacecss[i];if("function"!=typeof a){var n="";for(var o in a=this.formatCssRule(a)){var r=this.spacecss[i][o];r&&"string"==typeof r&&r.length>0&&(n+=o+":"+(r=(r=this.trimCssImportant(r))?r+" !important;":";"))}""!=n&&(t+=i+" {"+n+"}")}}else for(var l in this.spacecss)l.indexOf(i)>-1&&(this.spacecss[l]=[])}return t},formatCssRule:function(t){var e=["top","right","bottom","left"],i=0;if(void 0!==t["margin-top"]){var s=t["margin-bottom"];if(s&&s==t["margin-top"]&&s==t["margin-right"]&&s==t["margin-left"])for(t.margin=s,i=0;i<e.length;i++)delete t["margin-"+e[i]];else delete t.margin}var a="",n="",o="",r="";if(void 0!==t["border-top-color"]||void 0!==t["border-top-width"]||void 0!==t["border-top-style"]){var l=function(t){return(t=t.join(" ").replace(/!( ?)important/g,"").replace(/ /g," ").replace(/^ | $/g,""))?t+" !important":""};a=l([t["border-top-color"],t["border-top-width"],t["border-top-style"]]),o=l([t["border-right-color"],t["border-right-width"],t["border-right-style"]]),n=l([t["border-bottom-color"],t["border-bottom-width"],t["border-bottom-style"]]),r=l([t["border-left-color"],t["border-left-width"],t["border-left-style"]])}else void 0!==t["border-top"]&&(a=t["border-top"],o=t["border-right"],n=t["border-bottom"],r=t["border-left"]);if(a){if(a==n&&a==o&&a==r)for(t.border=a,i=0;i<e.length;i++)delete t["border-"+e[i]];else t["border-top"]=a,t["border-right"]=o,t["border-bottom"]=n,t["border-left"]=r,delete t.border;for(i=0;i<e.length;i++)delete t["border-"+e[i]+"-color"],delete t["border-"+e[i]+"-width"],delete t["border-"+e[i]+"-style"]}return t},changeLayout:function(t){if(this.currentLayout==t)return!1;var e=$("layout"+t).getAttribute("data").split(" "),i=this.currentLayout.length,s=t.length;if(s==i)$("frame1_left").style.width=e[0]+"px",$("frame1_center").style.width=e[1]+"px",void 0!==e[2]&&($("frame1_right").style.width=e[2]+"px");else if(s>i){var a=this.getRandomBlockName(),n=document.createElement("div");n.id="frame1_right",n.className=drag.moveableColumn+" z",n.appendChild($(a)),$("frame1").appendChild(n),$("frame1_left").style.width=e[0]+"px",$("frame1_center").style.width=e[1]+"px",n.style.width=e[2]+"px"}else if(s<i){for(var o=drag.data.diypage[0].columns.frame1_right.children.length,r=$("frame1_center_temp"),l=0;l<o;l++){var h=drag.data.diypage[0].columns.frame1_right.children[l].name;h.indexOf("temp")<0&&$("frame1_center").insertBefore($(h),r)}$("frame1").removeChild($("frame1_right")),$("frame1_left").style.width=e[0]+"px",$("frame1_center").style.width=e[1]+"px"}var c=$("layout"+this.currentLayout).className;$("layout"+this.currentLayout).className="",$("layout"+t).className=c,this.currentLayout=t,drag.initPosition(),drag.setClose()},getRandomBlockName:function(){var t=drag.data.diypage[0].columns.frame1_left.children;if(t.length>2)var e=t[0];else e=drag.data.diypage[0].columns.frame1_center.children[0];return e.name},changeStyle:function(t){if(""==t)return!1;if($("style_css").href=STATICURL+t+"/style.css",!this.backFlag){var e=[this.style],i=[t],s=Math.random();this.addOpRecord("this.changeStyle",i,e,s)}var a=t.split("/");this.style=a[a.length-1],drag.setClose()},setCurrentDiy:function(t){t&&($("diy_tag_"+this.currentDiy).className="",this.currentDiy=t,$("diy_tag_"+this.currentDiy).className="activity",this.initPalette(this.currentDiy))},hideBg:function(){var t=Math.random();this.setStyle(this.currentDiy,"background-image","",t),this.setStyle(this.currentDiy,"background-color","",t),"hd"==this.currentDiy&&this.setStyle(this.currentDiy,"height","",t),this.initPalette(this.currentDiy)},toggleHeader:function(){var t=Math.random();$("header_hide_cb").checked?(this.setStyle("#hd","height","260px",t),this.setStyle("#hd","background-image","none",t),this.setStyle("#hd","border-width","0px",t)):(this.setStyle("#hd","height","",t),this.setStyle("#hd","background-image","",t),this.setStyle("#hd","border-width","",t))},setBgImage:function(t){var e="string"==typeof t?t:t.src;if(e.indexOf(".thumb")>0&&(e=e.substring(0,e.indexOf(".thumb"))),""==e||"undefined"==e)return!1;var i=Math.random();if(this.setStyle(this.currentDiy,"background-image",Util.url(e),i),this.setStyle(this.currentDiy,"background-repeat","repeat",i),"hd"==this.currentDiy){var s=this,a=new Image;a.onload=function(){parseInt(a.height)<140?(DIY.prototype.setStyle.call(s,s.currentDiy,"background-repeat","repeat",i),DIY.prototype.setStyle.call(s,s.currentDiy,"height","",i)):DIY.prototype.setStyle.call(s,s.currentDiy,"height",a.height+"px",i)},a.src=e}},setBgRepeat:function(t){var e=["repeat","no-repeat","repeat-x","repeat-y"];if(void 0===e[t])return!1;this.setStyle(this.currentDiy,"background-repeat",e[t])},setBgAttachment:function(t){var e=["scroll","fixed"];if(void 0===e[t])return!1;this.setStyle(this.currentDiy,"background-attachment",e[t])},setBgColor:function(t){this.setStyle(this.currentDiy,"background-color",t)},setTextColor:function(t){this.setStyle(this.currentDiy,"color",t)},setLinkColor:function(t){this.setStyle(this.currentDiy+" a","color",t)},setBgPosition:function(t){var e=$(t),i=t.substr(t.length-1);e.className="red";for(var s=0;s<9;s++)i!=s&&($("bgimgposition"+s).className="");this.setStyle(this.currentDiy,"background-position",["left top","center top","right top","left center","center center","right center","left bottom","center bottom","right bottom"][i])},getSelector:function(t){var e=t.split(" ");t=e[0];var i="";e.length>1&&(i="a"==e[e.length-1].toLowerCase()?i=" "+e.pop():"",t=e.join(" "));var s="";switch(t){case"blocktitle":s="#ct .move-span .blocktitle";break;case"body":case"BODY":s=BROWSER.ie?"BODY":"body";break;default:s=t.indexOf("#")>-1?t:"#"+t}var a=BROWSER.ie?" A":" a";return s=(s+i).replace(/ a/i,a)},setStyle:function(t,e,i,s,a){var n=(e=trim(e).toLowerCase()).property2js();void 0===i&&(i="");var o=this.getSelector(t);if(!this.backFlag){var r=this.styleSheet.getRule(o,n),l=[t,e,r=r.replace(/([\\"'])/g,"\\$1").replace(/\0/g,"\\0")],h=[t,e,i];void 0===s&&(s=Math.random()),this.addOpRecord("this.setStyle",h,l,s)}var c=(i=(i=this.trimCssImportant(i))?i+" !important":"")?e+":"+i:"";this.styleSheet.addRule(o,c,a,e),Util.recolored(),void 0===this.spacecss[o]&&(this.spacecss[o]=[]),this.spacecss[o][e]=i,drag.setClose()},trimCssImportant:function(t){return t instanceof Array&&(t=t.join(" ")),t?t.replace(/!( ?)important/g,"").replace(/ /g," ").replace(/^ | $/g,""):""},removeCssSelector:function(t){for(var e in this.spacecss)"function"!=typeof this.spacecss[e]&&e.indexOf(t)>-1&&(this.styleSheet.removeRule(e),this.spacecss[e]=[])},undo:function(){if(0==this.opSet.length)return!1;var oldData="";if(this.opPointer<=0)return"";var step=this.opSet[--this.opPointer],random=step.random,cmd=step.cmd.split(","),cmdNum=cmd.length;if(cmdNum>1)for(var i=0;i<cmdNum;i++)oldData=void 0===step.oldData[i]||""==step.oldData?"":'"'+step.oldData[i].join('","')+'"',this.backFlag=!0,eval(cmd[i]+"("+oldData+")"),this.backFlag=!1;else oldData=void 0===step.oldData||""==step.oldData?"":'"'+step.oldData.join('","')+'"',this.backFlag=!0,eval(cmd+"("+oldData+")"),this.backFlag=!1;return $("button_redo").className="",0==this.opPointer?($("button_undo").className="unusable",drag.isChange=!1,drag.clearClose(),""):random==this.opSet[this.opPointer-1].random?(this.undo(),""):""},redo:function(){if(0==this.opSet.length)return!1;var newData="",random="";if(this.opPointer>=this.opSet.length)return"";var step=this.opSet[this.opPointer++];random=step.random;var cmd=step.cmd.split(","),cmdNum=cmd.length;if(cmdNum>1)for(var i=0;i<cmdNum;i++)newData=void 0===step.newData[i]||""==step.oldData?"":'"'+step.newData[i].join('","')+'"',this.backFlag=!0,eval(cmd[i]+"("+newData+")"),this.backFlag=!1;else newData=void 0===step.newData||""==step.oldData?"":'"'+step.newData.join('","')+'"',this.backFlag=!0,eval(cmd+"("+newData+")"),this.backFlag=!1;if($("button_undo").className="",this.opPointer==this.opSet.length)return $("button_redo").className="unusable","";random==this.opSet[this.opPointer].random&&this.redo()},addOpRecord:function(t,e,i,s){0==this.opPointer&&(this.opSet=[]),this.opSet[this.opPointer++]={cmd:t,newData:e,oldData:i,random:s},$("button_undo").className="",$("button_redo").className="unusable",Util.show("recover_button")},recoverStyle:function(){var t=Math.random();for(var e in this.spacecss){var i=this.spacecss[e];if("function"!=typeof i)for(var s in i)"function"!=typeof i[s]&&this.setStyle(e,s,"",t)}Util.hide("recover_button"),drag.setClose(),this.initPalette(this.currentDiy)},uploadSubmit:function(){return document.uploadpic.attach.value.length<3?(alert("请选择您要上传的图片"),!1):(null!=document.uploadpic.albumid&&(document.uploadpic.albumid.value=$("selectalbum").value),!0)},save:function(){return!1},cancel:function(){var t=!1;this.isChange&&(t=confirm(this.cancelConfirm?this.cancelConfirm:"退出将不会保存您刚才的设置。是否确认退出?")),this.isChange&&!t||(location.href=location.href.replace(/[\?|\&]diy\=yes/g,""))},extend:function(t){for(var e in t)this[e]=t[e]}}}();