| 49 | | } |
| 50 | | function renameDir(oldName) { |
| 51 | | // strip directory and extension |
| 52 | | |
| | 50 | } |
| | 51 | |
| | 52 | // IE7 has crippled the prompt() |
| | 53 | if ( Xinha.ie_version > 6 ) |
| | 54 | { |
| | 55 | popupPrompt(i18n("Please enter new name for this file..."), oldName, rename, i18n("Rename")); |
| | 56 | } |
| | 57 | else |
| | 58 | { |
| | 59 | var newName = prompt(i18n('Please enter new name for this file...'), oldName); |
| | 60 | rename(newName); |
| | 61 | } |
| | 62 | } |
| | 63 | function renameDir(oldName) |
| | 64 | { |
| | 65 | // strip directory and extension |
| | 66 | |
| | 67 | function rename(newName) |
| | 68 | { |
| | 69 | if(newName == '' || newName == null || newName == oldName) |
| | 70 | { |
| | 71 | alert(i18n('Cancelled rename.')); |
| | 72 | return false; |
| | 73 | } |
| | 74 | var mode=window.top.document.getElementById('manager_mode').value; |
| | 75 | var selection = window.top.document.getElementById('dirPath'); |
| | 76 | var dir = selection.options[selection.selectedIndex].value; |
| | 77 | selection = window.top.document.getElementById('viewtype'); |
| | 78 | var viewtype = selection.options[selection.selectedIndex].value; |
| | 79 | location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&rename="+oldName+"&renameTo="+newName+"&viewtype="+viewtype; |
| | 80 | } |
| | 81 | |
| | 82 | // IE7 has crippled the prompt() |
| | 83 | if ( Xinha.ie_version > 6 ) |
| | 84 | { |
| | 85 | popupPrompt(i18n('Please enter new name for this folder...'), oldName, rename, i18n("Rename")); |
| | 86 | } |
| | 87 | else |
| | 88 | { |
| 54 | | |
| 55 | | if(newName == '' || newName == null || newName == oldName) |
| 56 | | { |
| 57 | | alert(i18n('Cancelled rename.')); |
| 58 | | return false; |
| 59 | | } |
| 60 | | var mode=window.top.document.getElementById('manager_mode').value; |
| 61 | | var selection = window.top.document.getElementById('dirPath'); |
| 62 | | var dir = selection.options[selection.selectedIndex].value; |
| 63 | | selection = window.top.document.getElementById('viewtype'); |
| 64 | | var viewtype = selection.options[selection.selectedIndex].value; |
| 65 | | location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&rename="+oldName+"&renameTo="+newName+"&viewtype="+viewtype; |
| | 90 | rename(newName); |
| | 91 | } |