Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/libexec/webmin/mailboxes/xinha/modules/Dialogs/ drwxr-xr-x |
Viewing file: XinhaDialog.js (18.53 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ /* This file is part of version 0.96beta2 released Fri, 20 Mar 2009 11:01:14 +0100 */ Xinha.Dialog=function(g,k,a,m,f){var r=this;this.id={};this.r_id={};this.editor=g;this.document=document;this.size=m;this.modal=(f&&f.modal===false)?false:true;this.closable=(f&&f.closable===false)?false:true;this.resizable=(f&&f.resizable===false)?false:true;this.layer=(f&&f.layer)?f.layer:0;this.centered=(f&&f.centered===true)?true:false;this.closeOnEscape=(f&&f.closeOnEscape===true)?true:false;this.rootElem=null;this.captionBar=null;this.main=null;this.background=null;this.centered=null;this.greyout=null;this.buttons=null;this.closer=null;this.icon=null;this.resizer=null;this.initialZ=null;var b=g.config.dialogOptions;if(b){if(typeof b.centered!="undefined"){this.centered=b.centered}if(typeof b.resizable!="undefined"){this.resizable=b.resizable}if(typeof b.closable!="undefined"){this.closable=b.closable}if(typeof b.greyout!="undefined"){this.greyout=b.greyout}if(typeof b.closeOnEscape!="undefined"){this.closeOnEscape=b.closeOnEscape}}var n;if(Xinha.is_ie){n=document.createElement("iframe");n.src="about:blank";n.onreadystatechange=function(){var w=window.event.srcElement.contentWindow.document;if(this.readyState=="complete"&&w&&w.body){var y=w.createElement("div");var s,x=document.styleSheets;for(var p=0;p<x.length;p++){if(x[p].id.indexOf("Xinha")!=-1&&x[p].cssText){s+=x[p].cssText}}y.innerHTML='<br><style type="text/css">\n'+s+"\n</style>";w.getElementsByTagName("body")[0].appendChild(y);w.body.className="xinha_dialog_background";if(r.modal){w.body.className+="_modal"}if(r.greyout){w.body.className+="_greyout"}}}}else{n=document.createElement("div")}n.className="xinha_dialog_background";if(this.modal){n.className+="_modal"}if(this.greyout){n.className+="_greyout"}var j=1000;if(!Xinha.Dialog.initialZ){var o=g._htmlArea;while(o){if(o.style&&parseInt(o.style.zIndex,10)>j){j=parseInt(o.style.zIndex,10)}o=o.parentNode}Xinha.Dialog.initialZ=j}j=Xinha.Dialog.initialZ;var l=n.style;l.position="absolute";l.top=0;l.left=0;l.border="none";l.overflow="hidden";l.display="none";l.zIndex=(this.modal?j+25:j+1)+this.layer;document.body.appendChild(n);this.background=n;n=null;Xinha.freeLater(this,"background");var c=document.createElement("div");c.style.position=(Xinha.is_ie||!this.modal)?"absolute":"fixed";c.style.zIndex=(this.modal?j+27:j+3)+this.layer;c.style.display="none";if(!this.modal){Xinha._addEvent(c,"mousedown",function(){Xinha.Dialog.activateModeless(r)})}c.className="dialog"+(this.modal?"":" modeless");if(Xinha.is_chrome){c.className+=" chrome"}document.body.appendChild(c);c.style.paddingBottom="10px";c.style.width=(m&&m.width)?m.width+"px":"";if(m&&m.height){if(Xinha.ie_version<7){c.style.height=m.height+"px"}else{c.style.minHeight=m.height+"px"}}k=this.translateHtml(k,a);var h=document.createElement("div");c.appendChild(h);h.innerHTML=k;this.fixupDOM(h,a);var u=h.removeChild(h.getElementsByTagName("h1")[0]);c.insertBefore(u,h);Xinha._addEvent(u,"mousedown",function(i){r.dragStart(i)});u.style.MozUserSelect="none";u.style.WebkitUserSelect="none";u.unselectable="on";u.onselectstart=function(){return false};this.buttons=document.createElement("div");l=this.buttons.style;l.position="absolute";l.top="0";l.right="2px";c.appendChild(this.buttons);if(this.closable&&this.closeOnEscape){Xinha._addEvent(document,"keypress",function(i){if(i.keyCode==27){if(Xinha.Dialog.activeModeless==r||r.modal){r.hide();return true}}})}this.closer=null;if(this.closable){this.closer=document.createElement("div");this.closer.className="closeButton";this.closer.onmousedown=function(i){this.className="closeButton buttonClick";Xinha._stopEvent(Xinha.getEvent(i));return false};this.closer.onmouseout=function(i){this.className="closeButton";Xinha._stopEvent(Xinha.getEvent(i));return false};this.closer.onmouseup=function(){this.className="closeButton";r.hide();return false};this.buttons.appendChild(this.closer);var v=document.createElement("span");v.className="innerX";v.style.position="relative";v.style.top="-3px";v.appendChild(document.createTextNode("\u00D7"));this.closer.appendChild(v);v=null}this.icon=document.createElement("img");var t=this.icon;t.className="icon";t.src=g.config.iconList.dialogCaption;t.style.position="absolute";t.style.top="3px";t.style.left="2px";t.ondrag=function(){return false};u.style.paddingLeft="22px";c.appendChild(this.icon);var e=c.getElementsByTagName("*");for(var q=0;q<e.length;q++){var d=e[q];if(d.tagName.toLowerCase()=="textarea"||d.tagName.toLowerCase()=="input"){}else{d.unselectable="on"}}this.resizer=null;if(this.resizable){this.resizer=document.createElement("div");this.resizer.className="resizeHandle";l=this.resizer.style;l.position="absolute";l.bottom="0px";l.right="0px";l.MozUserSelect="none";Xinha._addEvent(this.resizer,"mousedown",function(i){r.resizeStart(i)});c.appendChild(this.resizer)}this.rootElem=c;this.captionBar=u;this.main=h;u=null;c=null;h=null;Xinha.freeLater(this,"rootElem");Xinha.freeLater(this,"captionBar");Xinha.freeLater(this,"main");Xinha.freeLater(this,"buttons");Xinha.freeLater(this,"closer");Xinha.freeLater(this,"icon");Xinha.freeLater(this,"resizer");Xinha.freeLater(this,"document");this.size={}};Xinha.Dialog.prototype.onresize=function(){return true};Xinha.Dialog.prototype.show=function(m){var c=this.rootElem;var n=c.style;var l=this.modal;var b=this.editor.scrollPos();this.scrollPos=b;var i=this;if(this.attached){this.editor.showPanel(c)}if(Xinha._someEditorHasBeenActivated){this._lastRange=this.editor.saveSelection();if(Xinha.is_ie&&!l){i.saveSelection=function(){i._lastRange=i.editor.saveSelection()};Xinha._addEvent(this.editor._doc,"mouseup",i.saveSelection)}}if(l){this.editor.deactivateEditor();this.editor.suspendUpdateToolbar=true;this.editor.currentModal=i}if(Xinha.is_ff2&&l){this._restoreTo=[this.editor._textArea.style.display,this.editor._iframe.style.visibility,this.editor.hidePanels()];this.editor._textArea.style.display="none";this.editor._iframe.style.visibility="hidden"}if(!this.attached){if(l){this.showBackground();this.posBackground({top:0,left:0});this.resizeBackground(Xinha.Dialog.calcFullBgSize())}else{this.background.style.display=""}Xinha.Dialog.fadeIn(this.rootElem,100,function(){if(l){var o=i.rootElem.getElementsByTagName("input");for(var p=0;p<o.length;p++){if(o[p].type=="text"){o[p].focus();break}}}});var k=c.offsetHeight;var e=c.offsetWidth;var h=Xinha.viewportSize();var f=h.y;var g=h.x;if(k>f){n.height=f+"px";if(c.scrollHeight>k){i.main.style.overflowY="auto"}}if(this.size.top&&this.size.left){n.top=parseInt(this.size.top,10)+"px";n.left=parseInt(this.size.left,10)+"px"}else{if(this.editor.btnClickEvent&&!this.centered){var a=this.editor.btnClickEvent;if(n.position=="absolute"){n.top=a.clientY+this.scrollPos.y+"px"}else{n.top=a.clientY+"px"}if(k+c.offsetTop>f){n.top=(n.position=="absolute"?this.scrollPos.y:0)+"px"}if(n.position=="absolute"){n.left=a.clientX+this.scrollPos.x+"px"}else{n.left=a.clientX+"px"}if(e+c.offsetLeft>g){n.left=a.clientX-e+"px";if(c.offsetLeft<0){n.left=0}}this.editor.btnClickEvent=null}else{var j=(f-k)/2;var d=(g-e)/2;n.top=((j>0)?j:0)+"px";n.left=((d>0)?d:0)+"px"}}}this.width=e;this.height=k;if(!l){this.resizeBackground({width:e+"px",height:k+"px"});this.posBackground({top:n.top,left:n.left})}if(typeof m!="undefined"){this.setValues(m)}this.dialogShown=true};Xinha.Dialog.prototype.hide=function(){if(this.attached){this.editor.hidePanel(this.rootElem)}else{Xinha.Dialog.fadeOut(this.rootElem);this.hideBackground();var a=this;if(Xinha.is_ff2&&this.modal){this.editor._textArea.style.display=this._restoreTo[0];this.editor._iframe.style.visibility=this._restoreTo[1];this.editor.showPanels(this._restoreTo[2])}if(!this.editor._isFullScreen&&this.modal){window.scroll(this.scrollPos.x,this.scrollPos.y)}if(Xinha.is_ie&&!this.modal){Xinha._removeEvent(this.editor._doc,"mouseup",a.saveSelection)}if(this.modal){this.editor.suspendUpdateToolbar=false;this.editor.currentModal=null;this.editor.activateEditor()}}if(this.modal){this.editor.restoreSelection(this._lastRange)}this.dialogShown=false;this.editor.updateToolbar();this.editor.focusEditor();return this.getValues()};Xinha.Dialog.prototype.toggle=function(){if(this.rootElem.style.display=="none"){this.show()}else{this.hide()}};Xinha.Dialog.prototype.collapse=function(){if(this.collapsed){this.collapsed=false;this.show()}else{this.main.style.height=0;this.collapsed=true}};Xinha.Dialog.prototype.getElementById=function(a){return this.document.getElementById(this.id[a]?this.id[a]:a)};Xinha.Dialog.prototype.getElementsByName=function(a){var b=this.document.getElementsByName(this.id[a]?this.id[a]:a);return Xinha.collectionToArray(b)};Xinha.Dialog.prototype.getElementsByClassName=function(a){return Xinha.getElementsByClassName(this.rootElem,a)};Xinha.Dialog.prototype.dragStart=function(c){if(this.attached||this.dragging){return}if(!this.modal){this.posBackground({top:0,left:0});this.resizeBackground(Xinha.Dialog.calcFullBgSize());this.editor.suspendUpdateToolbar=true}c=Xinha.getEvent(c);var b=this;b.dragging=true;b.scrollPos=b.editor.scrollPos();var a=b.rootElem.style;b.xOffs=c.offsetX||c.layerX;b.yOffs=c.offsetY||c.layerY;b.mouseMove=function(d){b.dragIt(d)};Xinha._addEvent(document,"mousemove",b.mouseMove);if(Xinha.is_ie){Xinha._addEvent(this.background.contentWindow.document,"mousemove",b.mouseMove)}b.mouseUp=function(d){b.dragEnd(d)};Xinha._addEvent(document,"mouseup",b.mouseUp);if(Xinha.is_ie){Xinha._addEvent(this.background.contentWindow.document,"mouseup",b.mouseUp)}};Xinha.Dialog.prototype.dragIt=function(c){var b=this;if(!b.dragging){return false}var d,e,a;if(b.rootElem.style.position=="absolute"){d=(c.clientY+this.scrollPos.y)-b.yOffs+"px";e=(c.clientX+this.scrollPos.x)-b.xOffs+"px";a={top:d,left:e}}else{if(b.rootElem.style.position=="fixed"){d=c.clientY-b.yOffs+"px";e=c.clientX-b.xOffs+"px";a={top:d,left:e}}}b.posDialog(a)};Xinha.Dialog.prototype.dragEnd=function(b){var a=this;if(!this.modal){this.editor.suspendUpdateToolbar=false}if(!a.dragging){return false}a.dragging=false;Xinha._removeEvent(document,"mousemove",a.mouseMove);if(Xinha.is_ie){Xinha._removeEvent(this.background.contentWindow.document,"mousemove",a.mouseMove)}Xinha._removeEvent(document,"mouseup",a.mouseUp);if(Xinha.is_ie){Xinha._removeEvent(this.background.contentWindow.document,"mouseup",a.mouseUp)}var c=a.rootElem.style;a.size.top=c.top;a.size.left=c.left;if(!this.modal){this.sizeBgToDialog()}};Xinha.Dialog.prototype.resizeStart=function(c){var b=this;if(b.resizing){return}b.resizing=true;if(!this.modal){this.editor.suspendUpdateToolbar=true;this.posBackground({top:0,left:0});this.resizeBackground(Xinha.Dialog.calcFullBgSize())}b.scrollPos=b.editor.scrollPos();var a=b.rootElem.style;a.minHeight="";a.overflow="hidden";b.xOffs=parseInt(a.left,10);b.yOffs=parseInt(a.top,10);b.mouseMove=function(d){b.resizeIt(d)};Xinha._addEvent(document,"mousemove",b.mouseMove);if(Xinha.is_ie){Xinha._addEvent(this.background.contentWindow.document,"mousemove",b.mouseMove)}b.mouseUp=function(d){b.resizeEnd(d)};Xinha._addEvent(document,"mouseup",b.mouseUp);if(Xinha.is_ie){Xinha._addEvent(this.background.contentWindow.document,"mouseup",b.mouseUp)}};Xinha.Dialog.prototype.resizeIt=function(c){var b=this;if(!b.resizing){return false}var d,e;if(b.rootElem.style.position=="absolute"){d=c.clientY+b.scrollPos.y;e=c.clientX+b.scrollPos.x}else{d=c.clientY;e=c.clientX}e-=b.xOffs;d-=b.yOffs;var a={};a.width=((e>10)?e:10)+8+"px";a.height=((d>10)?d:10)+"px";b.sizeDialog(a);b.width=b.rootElem.offsetWidth;b.height=b.rootElem.offsetHeight;b.onresize()};Xinha.Dialog.prototype.resizeEnd=function(b){var a=this;a.resizing=false;if(!this.modal){this.editor.suspendUpdateToolbar=false}Xinha._removeEvent(document,"mousemove",a.mouseMove);if(Xinha.is_ie){Xinha._removeEvent(this.background.contentWindow.document,"mouseup",a.mouseUp)}Xinha._removeEvent(document,"mouseup",a.mouseUp);if(Xinha.is_ie){Xinha._removeEvent(this.background.contentWindow.document,"mouseup",a.mouseUp)}a.size.width=a.rootElem.offsetWidth;a.size.height=a.rootElem.offsetHeight;if(!this.modal){this.sizeBgToDialog()}};Xinha.Dialog.prototype.attachToPanel=function(c){var b=this;var a=this.rootElem;var d=this.editor;this.attached=true;this.rootElem.side=c;this.captionBar.ondblclick=function(e){b.detachFromPanel(Xinha.getEvent(e))};a.style.position="static";a.parentNode.removeChild(a);this.background.style.display="none";this.captionBar.style.paddingLeft="3px";this.resizer.style.display="none";if(this.closable){this.closer.style.display="none"}this.icon.style.display="none";if(c=="left"||c=="right"){a.style.width=d.config.panel_dimensions[c]}else{a.style.width=""}Xinha.addClasses(a,"panel");d._panels[c].panels.push(a);d._panels[c].div.appendChild(a);d.notifyOf("panel_change",{action:"add",panel:a})};Xinha.Dialog.prototype.detachFromPanel=function(){var b=this;var a=b.rootElem;var d=a.style;var c=b.editor;b.attached=false;var e=Xinha.getElementTopLeft(a);d.position="absolute";d.top=e.top+"px";d.left=e.left+"px";b.captionBar.style.paddingLeft="22px";b.resizer.style.display="";if(b.closable){b.closer.style.display=""}b.icon.style.display="";if(b.size.width){a.style.width=b.size.width+"px"}Xinha.removeClasses(a,"panel");c.removePanel(a);document.body.appendChild(a);b.captionBar.ondblclick=function(){b.attachToPanel(a.side)};this.background.style.display="";this.sizeBgToDialog()};Xinha.Dialog.calcFullBgSize=function(){var b=Xinha.pageSize();var a=Xinha.viewportSize();return{width:(b.x>a.x?b.x:a.x)+"px",height:(b.x>a.y?b.y:a.y)+"px"}};Xinha.Dialog.prototype.sizeBgToDialog=function(){var a=this.rootElem.style;var b=this.background.style;b.top=a.top;b.left=a.left;b.width=a.width;b.height=a.height};Xinha.Dialog.prototype.hideBackground=function(){Xinha.Dialog.fadeOut(this.background)};Xinha.Dialog.prototype.showBackground=function(){Xinha.Dialog.fadeIn(this.background,70)};Xinha.Dialog.prototype.posBackground=function(a){if(this.background.style.display!="none"){this.background.style.top=a.top;this.background.style.left=a.left}};Xinha.Dialog.prototype.resizeBackground=function(a){if(this.background.style.display!="none"){this.background.style.width=a.width;this.background.style.height=a.height}};Xinha.Dialog.prototype.posDialog=function(b){var a=this.rootElem.style;a.left=b.left;a.top=b.top};Xinha.Dialog.prototype.sizeDialog=function(c){var b=this.rootElem.style;b.height=c.height;b.width=c.width;var d=parseInt(c.width,10);var a=parseInt(c.height,10)-this.captionBar.offsetHeight;this.main.style.height=(a>20)?a:20+"px";this.main.style.width=(d>10)?d:10+"px"};Xinha.Dialog.prototype.setValues=function(d){for(var g in d){if(typeof g=="string"){var c=this.getElementsByName(g);if(!c){continue}for(var a=0;a<c.length;a++){var h=c[a];switch(h.tagName.toLowerCase()){case"select":for(var f=0;f<h.options.length;f++){if(typeof d[g]=="object"){for(var b=0;b<d[g].length;b++){if(d[g][b]==h.options[f].value){h.options[f].selected=true}}}else{if(d[g]==h.options[f].value){h.options[f].selected=true}}}break;case"textarea":case"input":switch(h.getAttribute("type")){case"radio":if(h.value==d[g]){h.checked=true}break;case"checkbox":if(typeof d[g]=="object"){for(f in d[g]){if(d[g][f]==h.value){h.checked=true}}}else{if(d[g]==h.value){h.checked=true}}break;default:h.value=d[g];break}}}}}};Xinha.Dialog.prototype.getValues=function(){var d=[];var b=Xinha.collectionToArray(this.rootElem.getElementsByTagName("input")).append(Xinha.collectionToArray(this.rootElem.getElementsByTagName("textarea"))).append(Xinha.collectionToArray(this.rootElem.getElementsByTagName("select")));for(var a=0;a<b.length;a++){var f=b[a];if(!(f.name&&this.r_id[f.name])){continue}if(typeof d[this.r_id[f.name]]=="undefined"){d[this.r_id[f.name]]=null}var c=d[this.r_id[f.name]];switch(f.tagName.toLowerCase()){case"select":if(f.multiple){if(!c.push){if(c!==null){c=[c]}else{c=[]}}for(var e=0;e<f.options.length;e++){if(f.options[e].selected){c.push(f.options[e].value)}}}else{if(f.selectedIndex>=0){c=f.options[f.selectedIndex]}}break;default:switch(f.type.toLowerCase()){case"radio":if(f.checked){c=f.value}break;case"checkbox":if(c===null){if(this.getElementsByName(this.r_id[f.name]).length>1){c=[]}}if(f.checked){if(c!==null&&typeof c=="object"&&c.push){c.push(f.value)}else{c=f.value}}break;default:c=f.value;break}}d[this.r_id[f.name]]=c}return d};Xinha.Dialog.prototype.translateHtml=function(c,a){var b=this;if(typeof a=="function"){b._lc=a}else{if(a){this._lc=function(d){return Xinha._lc(d,a)}}else{this._lc=function(d){return d}}}c=c.replace(/((?:name)|(?:id))=(['"])\[([a-z0-9_]+)\]\2/ig,function(f,e,d,g){return e+"="+d+b.createId(g)+d}).replace(/<l10n>(.*?)<\/l10n>/ig,function(d,e){return b._lc(e)}).replace(/\="_\((.*?)\)"/g,function(d,e){return'="'+b._lc(e)+'"'});return c};Xinha.Dialog.prototype.fixupDOM=function(j,e){var g=this;if(typeof e!="string"){e="GenericPlugin"}var a=function(l,m){switch(m){case"editor":return _editor_url;case"plugin":return Xinha.getPluginDir(e);case"images":return g.editor.imgURL("images")}};var h=Xinha.collectionToArray(j.getElementsByTagName("img"));for(var f=0;f<h.length;++f){var b=h[f];var c=b.getAttribute("src");if(c){var d=c.replace(/^\[(editor|plugin|images)\]/,a);if(d!=c){b.setAttribute("src",d)}}}var k=Xinha.collectionToArray(j.getElementsByTagName("a"));for(var f=0;f<k.length;++f){var i=k[f];var c=i.getAttribute("href");if(c){var d=c.replace(/^\[(editor|plugin|images)\]/,a);if(d!=c){i.setAttribute("href",d)}}}};Xinha.Dialog.prototype.createId=function(b){var a=this;if(typeof a.id[b]=="undefined"){a.id[b]=Xinha.uniq("Dialog");a.r_id[a.id[b]]=b}return a.id[b]};Xinha.Dialog.activateModeless=function(a){if(Xinha.Dialog.activeModeless==a||a.attached){return}if(Xinha.Dialog.activeModeless){Xinha.Dialog.activeModeless.rootElem.style.zIndex=parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex,10)-10}Xinha.Dialog.activeModeless=a;Xinha.Dialog.activeModeless.rootElem.style.zIndex=parseInt(Xinha.Dialog.activeModeless.rootElem.style.zIndex,10)+10};Xinha.Dialog.setOpacity=function(a,b){if(typeof a.style.filter!="undefined"){a.style.filter=(b<100)?"alpha(opacity="+b+")":""}else{a.style.opacity=b/100}};Xinha.Dialog.fadeIn=function(c,b,f,a,d){a=a||1;d=d||25;b=b||100;c.op=c.op||0;var e=c.op;if(c.style.display=="none"){Xinha.Dialog.setOpacity(c,0);c.style.display=""}if(e<b){c.op+=d;Xinha.Dialog.setOpacity(c,e);c.timeOut=setTimeout(function(){Xinha.Dialog.fadeIn(c,b,f,a,d)},a)}else{Xinha.Dialog.setOpacity(c,b);c.op=b;c.timeOut=null;if(typeof f=="function"){f.call()}}};Xinha.Dialog.fadeOut=function(b,a,c){a=a||1;c=c||30;if(typeof b.op=="undefined"){b.op=100}var d=b.op;if(d>=0){b.op-=c;Xinha.Dialog.setOpacity(b,d);b.timeOut=setTimeout(function(){Xinha.Dialog.fadeOut(b,a,c)},a)}else{Xinha.Dialog.setOpacity(b,0);b.style.display="none";b.op=0;b.timeOut=null}}; |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0131 ]-- |