Changeset 1880 for sandbox/filemanager/js/draw_api.js
- Timestamp:
- 12/22/09 09:24:26 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/js/draw_api.js
r1879 r1880 148 148 149 149 function initDrawApi(){ 150 SecEl = document.getElementById('userKey'); 151 crypt = new crypt(SecEl.value); 152 SecEl.parentNode.removeChild(SecEl); 153 150 154 loadPreferences(); 151 155 currentPath = document.getElementById('currentPath').value; … … 286 290 if (preferences.createdby_id =='1') retBuff += fl.td+file.creatdby+'</td>'; 287 291 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>'; 289 293 if (preferences.version =='1') retBuff += fl.td+'<span onclick="loadHistory(\''+file.name+'\')">'+file.vers+'</span></td>'; 290 294 return retBuff; … … 499 503 } 500 504 // TODO use DES, or something strong 501 var pswd = crypt (password,currentPath);505 var pswd = crypt.encode(password); 502 506 cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 503 507 break; … … 578 582 579 583 function 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'))); 581 585 if (password == null) 582 586 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); 585 588 } 586 589 … … 600 603 } 601 604 else 602 if (operation == 'remove'){605 if (operation == 'remove'){ 603 606 var Dfolder = document.getElementById('folders_box').value; 604 607 if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), '')) 605 608 { 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('/'); 613 611 currentPath = Dfolder.substr(0,lastIndex); 614 612 close_window(); 615 613 } 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 } 625 623 } 626 624
Note: See TracChangeset
for help on using the changeset viewer.