Changeset 2226 for trunk/jabberit_messenger
- Timestamp:
- 03/11/10 15:57:41 (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/js/makeW.js
r1579 r2226 7 7 function build(pObj) 8 8 { 9 var _window = document.getElementById( pObj.id_window + '__parent');9 var _window = getElement( pObj.id_window + '__parent'); 10 10 Xtools = new JITXtools(path); 11 11 … … 14 14 pObj.width = ( ( pObj.width > 160 ) ? pObj.width : 160 ); 15 15 pObj.height = ( ( pObj.height > 80 ) ? pObj.height : 80 ); 16 pObj.onclick = "winBuild 16 pObj.onclick = "winBuild('" + pObj.id_window + "', '" + pObj.closeAction + "')"; 17 17 18 18 _window = document.createElement("div"); … … 27 27 _window.innerHTML = Xtools.parse( Xtools.xml('window_main'), 'window.xsl', pObj ); 28 28 29 if( pObj.closeAction == "hidden" ) 30 _window.setAttribute("leftOld", pObj.left + "px" ); 31 29 32 window.document.body.insertBefore( _window, document.body.lastChild ); 33 34 getElement(pObj.id_window + '__content').innerHTML = pObj.content; 30 35 31 36 if( pObj.draggable ) … … 36 41 } 37 42 else 38 _load(pObj.id_window, "display"); 43 { 44 load(pObj.id_window, "display"); 45 } 39 46 } 40 47 41 function _content( pId, pContent)48 function getElement(pElement) 42 49 { 43 var _contentWindow = function() 44 { 45 var _win_content = document.getElementById(pId + "__content"); 46 _win_content.innerHTML = pContent; 47 }; 48 49 setTimeout( _contentWindow, 220 ); 50 return document.getElementById(pElement); 50 51 } 51 52 52 function Load( pId, pVisible )53 function load( pId, pVisible ) 53 54 { 54 var winM = document.getElementById( pId + '__parent') ;55 var winM = document.getElementById( pId + '__parent') 55 56 56 57 if( winM != null ) 57 58 { 58 59 if ( pVisible == "display" ) 59 winM.style.left = "70px"; 60 { 61 if(winM.getAttribute("leftOld") != "-1500px") 62 winM.style.left = winM.getAttribute("leftOld"); 63 else 64 winM.style.left = "70px"; 65 } 60 66 61 67 if ( pVisible == "hidden") 68 { 69 winM.setAttribute("leftOld" , winM.style.left ); 62 70 winM.style.left = "-1500px"; 71 } 63 72 64 73 if( pVisible == "remove" ) 74 { 65 75 document.body.removeChild( winM ); 76 } 66 77 } 67 78 } … … 69 80 function _window() 70 81 { 71 var objectW = null; 72 73 if( arguments.length == 1 ) 82 if( arguments.length > 0 ) 74 83 { 75 objectW = arguments[0]; 84 if( arguments.length == 1 ) 85 { 86 JSLoader.load([path + "js/dragdrop.js"]); 87 JSLoader.load([path + "templates/default/css/button.css"]) 76 88 77 JSLoader.load([path + "js/dragdrop.js"]); 78 JSLoader.load([path + "templates/default/css/button.css"]) 89 var obj = arguments[0]; 90 91 setTimeout(function(){ build(obj);}, 200); 92 } 79 93 80 setTimeout( function(){ build(objectW); }, 200 ); 81 } 82 83 if( arguments.length == 2 ) 84 Load(arguments[0], arguments[1]); 85 86 if( arguments.length === 3 ) 87 _content( arguments[0], arguments[1]); 94 if( arguments.length == 2 ) 95 { 96 load(arguments[0], arguments[1]); 97 } 98 } 88 99 } 89 100 … … 94 105 function winBuild() 95 106 { 96 if( arguments.length == 1)97 _win = new bWindow( arguments[0] );98 99 if( arguments.length == 2 )100 _win = new bWindow( arguments[0], arguments[1] );101 102 if( arguments.length == 3 )103 _win = new bWindow( arguments[0], arguments[1], arguments[2] );107 if( arguments.length > 0 ) 108 { 109 if( arguments.length == 1 ) 110 _win = new bWindow( arguments[0] ); 111 112 if( arguments.length == 2 ) 113 _win = new bWindow( arguments[0], arguments[1] ); 114 } 104 115 }
Note: See TracChangeset
for help on using the changeset viewer.