Changeset 1865 for sandbox/filemanager/js
- Timestamp:
- 12/17/09 10:56:50 (14 years ago)
- Location:
- sandbox/filemanager/js
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/js/common_functions.js
r1846 r1865 79 79 } 80 80 } 81 81 function crypt(data1,data2){ 82 ret = ""; 83 for (var i=0;i < data1.length; i++) 84 { 85 ret += String.fromCharCode(data1.charCodeAt(i) ^ data2.charCodeAt(i)); 86 } 87 return ret; 88 } 82 89 /* 83 90 * base64.js - Base64 encoding and decoding functions -
sandbox/filemanager/js/draw_api.js
r1854 r1865 236 236 retBuff += '<td></td>'; 237 237 238 if (file.mime == 'text/html') 239 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><img alt="'+get_lang('export')+'" title="'+get_lang('export')+'" src="'+templatePath+'images/button_export.png"></a></td>'; 240 else 241 retBuff += '<td></td>'; 238 switch (file.mime) 239 { 240 case 'text/html': 241 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><img alt="'+get_lang('export')+'" title="'+get_lang('export')+'" src="'+templatePath+'images/button_export.png"></a></td>'; 242 break; 243 case 'application/zip': 244 retBuff += '<td><a href="javascript:unarchive(\''+file.name+'\')"><img alt="'+get_lang('unarchive')+'" title="'+get_lang('unarchive')+'" src="'+templatePath+'images/button_export.png"></a></td>' 245 break; 246 default: 247 retBuff += '<td></td>'; 248 } 242 249 retBuff += fl.td+'<img src="'+(file.icon)+'">'; 243 250 if((file.mime).toUpperCase().indexOf('IMAGE') == 0) … … 481 488 } 482 489 password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only')); 490 if (password == null) 491 return; 483 492 if (password.length > 0) 484 493 { … … 491 500 } 492 501 // TODO use DES, or something strong 493 pswd = ""; 494 for (var i=0;i < password.length; i++) 495 { 496 pswd += String.fromCharCode(password.charCodeAt(i) ^ currentPath.charCodeAt(i)); 497 } 502 var pswd = crypt(password,currentPath); 498 503 cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 499 504 break; … … 575 580 var toolbar = new toolbar(); 576 581 582 function unarchive(filename){ 583 password = prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted')); 584 if (password == null) 585 return; 586 var pswd = crypt(password,currentPath); 587 cExecute('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(pswd)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 588 } 577 589 578 590 function draw_card(filename){ … … 590 602 menu.width = "100%"; 591 603 menu.innerHTML = '<img src="'+url+'">'; 592 menu.onmouseout = function () { menuTimeout = setTimeout(" document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",50);}604 menu.onmouseout = function () { menuTimeout = setTimeout("var e=document.getElementById('menu_newFile"+id+"');if(e!=null) e.style.visibility = 'hidden'",50);} 593 605 menu.onmouseover = function () { clearTimeout(menuTimeout); }; 594 606 menu.style.zIndex='1'; … … 603 615 menu.style.visibility = 'visible'; 604 616 clearTimeout(menuTimeout); 605 menuTimeout = setTimeout(" document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",3000);606 } 607 617 menuTimeout = setTimeout("var e=document.getElementById('menu_newFile"+id+"'); if (e!=null) e.style.visibility = 'hidden'",2000); 618 } 619 -
sandbox/filemanager/js/handler.js
r1854 r1865 86 86 } 87 87 handler.prototype.archive = function(data) { 88 returnVal = data.split(':'); 89 if (returnVal[0] == 'False') 90 { 91 write_error(get_lang('It was not possible to execute it')); 92 } 93 else 94 if (returnVal[0] == 'wpasswd') 95 { 96 write_error(get_lang('Wrong password')); 97 return; 98 } 99 else 100 write_msg(get_lang('Your operation was successfully executed')); 88 101 toolbar.control('reload'); 102 89 103 } 90 104
Note: See TracChangeset
for help on using the changeset viewer.