Ignore:
Timestamp:
12/22/09 09:24:26 (15 years ago)
Author:
amuller
Message:

Ticket #597 - Melhoria do FM. melhorias na interface, criação de pastas

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/filemanager/js/draw_api.js

    r1879 r1880  
    148148 
    149149function initDrawApi(){ 
     150        SecEl = document.getElementById('userKey'); 
     151        crypt = new crypt(SecEl.value); 
     152        SecEl.parentNode.removeChild(SecEl); 
     153 
    150154        loadPreferences(); 
    151155        currentPath = document.getElementById('currentPath').value; 
     
    286290                if (preferences.createdby_id =='1') retBuff += fl.td+file.creatdby+'</td>'; 
    287291                if (preferences.modifiedby_id =='1') retBuff += fl.td+file.modifdby+'</td>'; 
    288                 if (preferences.comment =='1') retBuff += fl.td+'<input id="'+file.name+'" class="inputComment" onkeydown="enterComments(event,this)" onclick="presetComments(this)" onblur="setComments(this)" value="'+file.comm+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>'; 
     292                if (preferences.comment =='1') retBuff += fl.td+'<input id="'+file.name+'" class="inputComment" onkeydown="enterComments(event,this)" onclick="presetComments(this)" onblur="setComments(this)" value="'+(file.comm==null?'':file.comm)+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>'; 
    289293                if (preferences.version =='1') retBuff += fl.td+'<span onclick="loadHistory(\''+file.name+'\')">'+file.vers+'</span></td>'; 
    290294                return retBuff; 
     
    499503                        } 
    500504                        // TODO use DES, or something strong 
    501                         var pswd = crypt(password,currentPath); 
     505                        var pswd = crypt.encode(password); 
    502506                        cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 
    503507                        break; 
     
    578582 
    579583function unarchive(filename){ 
    580         password = prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted')); 
     584        password = crypt.encode(prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted'))); 
    581585        if (password == null) 
    582586                return; 
    583         var pswd = crypt(password,currentPath); 
    584         cExecute('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(pswd)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 
     587        cExecute('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 
    585588} 
    586589 
     
    600603        } 
    601604        else 
    602         if (operation == 'remove'){ 
     605                if (operation == 'remove'){ 
    603606                        var Dfolder = document.getElementById('folders_box').value; 
    604607                        if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), '')) 
    605608                        { 
    606                                 var now = new Date(); 
    607                                 nowTs = parseInt(now.getTime()/5000).toString(); 
    608                                 for (var i=0 ;i < 20; i++) 
    609                                         nowTs+=nowTs; 
    610                                 var toRemove = crypt(Dfolder,nowTs); 
    611                                 cExecute('./index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(toRemove),handler.refreshDir); 
    612                                 var lastIndex = Dfolder.lastIndexOf('/'); 
     609                                cExecute('./index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir); 
     610                                var lastIndex = Dfolder.lastIndexOf('/'); 
    613611                                currentPath = Dfolder.substr(0,lastIndex); 
    614612                                close_window(); 
    615613                        } 
    616         } 
    617         else{ 
    618         var buf = "<select id='folders_box'>"; 
    619         for (var i=0; i < folders.length; i++) 
    620                 buf += "<option value='"+folders[i]+"'>"+folders[i]+"</option>"; 
    621         buf += "</select>"; 
    622         code = "<table><tbody><tr><td>"+buf+"</td></tr><tr><td><input type='button' onclick='editFolders(\"new\")' value='"+get_lang('new folder')+"'></td><td><input type='button' onclick='editFolders(\"remove\")' value='"+get_lang('remove folder')+"'></td></tr></tbody></table>"; 
    623         draw_window(code); 
    624         } 
     614                } 
     615                else{ 
     616                        var buf = "<select id='folders_box'>"; 
     617                        for (var i=0; i < folders.length; i++) 
     618                                buf += "<option value='"+folders[i]+"'>"+folders[i]+"</option>"; 
     619                        buf += "</select>"; 
     620                        code = "<table><tbody><tr><td>"+buf+"</td></tr><tr><td><input type='button' onclick='editFolders(\"new\")' value='"+get_lang('new folder')+"'></td><td><input type='button' onclick='editFolders(\"remove\")' value='"+get_lang('remove folder')+"'></td></tr></tbody></table>"; 
     621                        draw_window(code); 
     622                } 
    625623} 
    626624 
Note: See TracChangeset for help on using the changeset viewer.