source: branches/2.2/filemanager/tp/expressowindow/js/makeW.js @ 3568

Revision 3568, 2.4 KB checked in by alexandrecorreia, 13 years ago (diff)

Ticket #1395 - Corrigido o path para o carregamento dinamico dos temas setados nas preferencias.

Line 
1(function()
2{
3        var _xtools             = null;
4        var dragDrop    = null;
5        var path                = path_filemanager + "tp/expressowindow/";
6       
7        function build(pObj)
8        {
9                var _window = getElement( pObj.id_window + '__parent');
10                _xtools = new xtools(path);             
11               
12                if( _window == null )
13                {
14                        pObj.width              = ( ( pObj.width > 160 ) ? pObj.width : 160 );
15                        pObj.height             = ( ( pObj.height > 80 ) ? pObj.height : 80 );
16                        pObj.onclick    = "_winBuild('" + pObj.id_window + "', '" + pObj.closeAction + "')";
17                       
18                        _window = document.createElement("div");
19                        _window.id      = pObj.id_window + "__parent";
20                        _window.setAttribute("onselectstart" , "return false");
21                        _window.style.width             = pObj.width + "px";
22                        _window.style.height    = pObj.height + "px";
23                        _window.style.top               = pObj.top + "px";
24                        _window.style.left              = pObj.left + "px";
25                        _window.style.position  = "absolute";
26                        _window.style.zIndex    = pObj.zindex;
27                        _window.innerHTML               = _xtools.parse( _xtools.xml('window_main'), 'window.xsl', pObj );
28
29                        if( pObj.closeAction == "hidden" )
30                                _window.setAttribute("leftOld", pObj.left + "px" );
31                       
32                        window.document.body.insertBefore( _window, document.body.lastChild );
33                       
34                        getElement(pObj.id_window + '__content').innerHTML = pObj.content;
35                       
36                        if( pObj.draggable )
37                        {
38                                dragDrop = new _drag_drop();
39                                dragDrop.set( pObj.id_window );
40                        }
41                }
42                else
43                {
44                        load(pObj.id_window, "display");
45                }
46        }
47
48        function getElement(pElement)
49        {
50                return document.getElementById(pElement);
51        }
52       
53        function load( pId, pVisible )
54        {
55                var _window = document.getElementById( pId + '__parent')
56               
57                if( _window != null )
58                {
59                        if ( pVisible == "display" )
60                        {
61                                _window.style.left = _window.getAttribute("leftOld");
62                        }
63                       
64                        if ( pVisible == "hidden")
65                        {
66                                _window.setAttribute("leftOld" , _window.style.left );
67                                _window.style.left = "-1500px";
68                        }
69                       
70                        if( pVisible == "remove" )
71                        {
72                                document.body.removeChild( _window );
73                        }
74                }
75        }
76       
77        function _window()
78        {
79                if( arguments.length > 0 )
80                {
81                        if( arguments.length == 1 )
82                        {
83                                JSLoader.load([path + "css/" + theme_filemanager]);
84                               
85                                var obj = arguments[0];
86                               
87                                setTimeout(function(){ build(obj);}, 200);
88                        }
89                       
90                        if( arguments.length == 2 )
91                        {
92                                load(arguments[0], arguments[1]);
93                        }       
94                }
95        }
96
97        window.bWindow  = _window;
98
99})();
100
101function _winBuild()
102{
103        if( arguments.length > 0 )
104        {       
105                if( arguments.length == 1 )
106                        _win = new bWindow( arguments[0] );
107               
108                if( arguments.length == 2 )
109                        _win = new bWindow( arguments[0], arguments[1]);       
110        }
111}
Note: See TracBrowser for help on using the repository browser.