source: sandbox/filemanager/js/draw_api.js @ 1704

Revision 1704, 3.0 KB checked in by amuller, 14 years ago (diff)

Ticket #597 - Melhorias na visualização do módulo fm com tema azul

Line 
1function resizeDiv(){
2        defaultHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
3        document.getElementById('fmFileWindow').style.height = defaultHeight-170;
4        document.getElementById('content_folders').style.height = defaultHeight - (is_ie ? 230 : 215);
5
6}
7function initDrawApi(){
8        cExecute ('/index.php?menuaction=filemanager.user.get_preferences', save_preferences);
9        var quotaSize = document.getElementById('quotaSize').value;
10        var usedSpace = document.getElementById('usedSpace').value;
11        var currentPath = document.getElementById('currentPath').value;
12        document.getElementById('divAppboxHeader').innerHTML = title_app;
13
14
15        if (parseInt(quotaSize) != 0)
16                document.getElementById('content_quota').innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="../phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+(usedSpace/1024/1024).toFixed(1)+'M/'+(quotaSize/1024/1024)+'M)</span></td></tr></tbody></table></td></tr></table>';
17        displayMessages();
18        resizeDiv();
19        window.onresize = resizeDiv;
20        // Disabled for now
21        // document.getElementById('main_table').style.visibility = "";
22}
23var headerMsgLock = false;
24var labelBefore = "";
25function write_msg (message){
26        if (headerMsgLock){
27                setTimeout('write_msg("'+message+'");', 300);
28                return;
29        }
30        headerMsgLock = true;
31        headerDiv = document.getElementById("divAppboxHeader");
32        labelBefore = headerDiv.innerHTML;
33        headerDiv.innerHTML = '<table width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_info_th">'+message+'</th><th width="40%"></th></tr></tbody></table>';
34        setTimeout('headerMsgLock = false; document.getElementById("divAppboxHeader").innerHTML = labelBefore;', 3000);
35}
36
37function write_error (message){
38        if (headerMsgLock){
39                setTimeout('write_error("'+message+'");', 300);
40                return;
41        }
42        headerMsgLock = true;
43        headerDiv = document.getElementById("divAppboxHeader");
44        labelBefore = headerDiv.innerHTML;
45        headerDiv.innerHTML = '<table width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_error_th">'+message+'</th><th width="40%"></th></tr></tbody></table>';
46        setTimeout('headerMsgLock = false; document.getElementById("divAppboxHeader").innerHTML = labelBefore;', 3000);
47}
48
49function displayMessages(){
50        var messages = document.getElementById("allMessages");
51
52        for (i=0; i < messages.childNodes.length; i++){
53                if (messages.childNodes[i].innerHTML.indexOf(get_lang('Error:')) == 0)
54                        write_error(messages.childNodes[i].innerHTML);
55                else
56                        write_msg(messages.childNodes[i].innerHTML);
57        }
58}
59var preferences;
60function save_preferences(data){
61        preferences = unserialize(data);
62}
Note: See TracBrowser for help on using the repository browser.