[3100] | 1 | |
---|
| 2 | (function() |
---|
| 3 | {var _xtools=null;var dragDrop=null;var path=path_jabberit;var _dialogs=[];function build(pObj) |
---|
| 4 | {var _window=getElement(pObj.id_window+'__parent');_xtools=new xtools(path);if(_window==null) |
---|
| 5 | {pObj.width=((pObj.width>160)?pObj.width:160);pObj.height=((pObj.height>80)?pObj.height:80);pObj.onclick="_winBuild('"+pObj.id_window+"', '"+pObj.closeAction+"')";_window=document.createElement("div");_window.id=pObj.id_window+"__parent";_window.setAttribute("onselectstart","return false");_window.style.width=pObj.width+"px";_window.style.height=pObj.height+"px";_window.style.top=pObj.top+"px";_window.style.left=pObj.left+"px";_window.style.position="absolute";_window.style.zIndex=pObj.zindex;_window.innerHTML=_xtools.parse(_xtools.xml('window_main'),'window.xsl',pObj);if(pObj.closeAction=="hidden") |
---|
| 6 | _window.setAttribute("leftOld",pObj.left+"px");if(pObj.leftOld) |
---|
| 7 | _window.setAttribute("leftOld",pObj.leftOld+"px");window.document.body.insertBefore(_window,document.body.lastChild);if(pObj.content.constructor==String) |
---|
| 8 | getElement(pObj.id_window+'__content').innerHTML=pObj.content;else |
---|
| 9 | getElement(pObj.id_window+'__content').appendChild(pObj.content);_dialogs[pObj.id_window]=getElement(pObj.id_window+'__content').firstChild;if(pObj.draggable) |
---|
| 10 | {dragDrop=new _drag_drop();dragDrop.set(pObj.id_window);}} |
---|
| 11 | else |
---|
| 12 | {if(pObj.barejid&&loadscript.windowPOPUP(pObj.barejid)) |
---|
| 13 | return false;load(pObj.id_window,"display");}} |
---|
| 14 | function getElement(pElement) |
---|
| 15 | {return document.getElementById(pElement);} |
---|
| 16 | function load(pId,pVisible) |
---|
| 17 | {var _window=document.getElementById(pId+'__parent') |
---|
| 18 | if(_window!=null) |
---|
| 19 | {if(pVisible=="display") |
---|
| 20 | {if(_window.style.left=="-1500px") |
---|
| 21 | _window.style.left=_window.getAttribute("leftOld");} |
---|
| 22 | if(pVisible=="hidden") |
---|
| 23 | {_window.setAttribute("leftOld",_window.style.left);_window.style.left="-1500px";} |
---|
| 24 | if(pVisible=="remove") |
---|
| 25 | {document.body.removeChild(_window);}}} |
---|
| 26 | function _window() |
---|
| 27 | {if(arguments.length>0) |
---|
| 28 | {var pId=null;if(arguments.length==1) |
---|
| 29 | {var obj=arguments[0];pId=obj.id_window |
---|
| 30 | build(obj);} |
---|
| 31 | if(arguments.length==2) |
---|
| 32 | {load((pId=arguments[0]),arguments[1]);}} |
---|
| 33 | return(new function() |
---|
| 34 | {this.content=function() |
---|
| 35 | {if(arguments.length) |
---|
| 36 | getElement(pId+'__content').appendChild(_dialogs[pId]);return _dialogs[obj.id_window];};});} |
---|
| 37 | window.bWindow=_window;})();function _winBuild() |
---|
| 38 | {if(arguments.length>0) |
---|
| 39 | {if(arguments.length==1) |
---|
| 40 | return bWindow(arguments[0]);if(arguments.length==2) |
---|
| 41 | return bWindow(arguments[0],arguments[1]);} |
---|
| 42 | return false;} |
---|