source: branches/2.2/jabberit_messenger/jmessenger/js/makeW.mini.js @ 3102

Revision 3102, 2.4 KB checked in by amuller, 14 years ago (diff)

Ticket #986 - Efetuado merge para o Branch 2.2( atualizacao do modulo)

  • Property svn:executable set to *
Line 
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)
8getElement(pObj.id_window+'__content').innerHTML=pObj.content;else
9getElement(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);}}
11else
12{if(pObj.barejid&&loadscript.windowPOPUP(pObj.barejid))
13return false;load(pObj.id_window,"display");}}
14function getElement(pElement)
15{return document.getElementById(pElement);}
16function load(pId,pVisible)
17{var _window=document.getElementById(pId+'__parent')
18if(_window!=null)
19{if(pVisible=="display")
20{if(_window.style.left=="-1500px")
21_window.style.left=_window.getAttribute("leftOld");}
22if(pVisible=="hidden")
23{_window.setAttribute("leftOld",_window.style.left);_window.style.left="-1500px";}
24if(pVisible=="remove")
25{document.body.removeChild(_window);}}}
26function _window()
27{if(arguments.length>0)
28{var pId=null;if(arguments.length==1)
29{var obj=arguments[0];pId=obj.id_window
30build(obj);}
31if(arguments.length==2)
32{load((pId=arguments[0]),arguments[1]);}}
33return(new function()
34{this.content=function()
35{if(arguments.length)
36getElement(pId+'__content').appendChild(_dialogs[pId]);return _dialogs[obj.id_window];};});}
37window.bWindow=_window;})();function _winBuild()
38{if(arguments.length>0)
39{if(arguments.length==1)
40return bWindow(arguments[0]);if(arguments.length==2)
41return bWindow(arguments[0],arguments[1]);}
42return false;}
Note: See TracBrowser for help on using the repository browser.