Show
Ignore:
Timestamp:
03/27/07 18:30:28 (5 years ago)
Author:
ray
Message:

Ticket #908 Prompts broken in IE7: fixed for EFM & ImageManager

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/ExtendedFileManager/assets/images.js

    r710 r799  
    3232 
    3333function renameFile(oldPath) { 
    34     // strip directory and extension 
    35     var oldName=oldPath.replace(/.*%2F/,'').replace(/\..*$/,''); 
    36     var newName = prompt(i18n('Please enter new name for this file...'), oldName); 
    37  
     34 // strip directory and extension 
     35  var oldName=oldPath.replace(/.*%2F/,'').replace(/\..*$/,''); 
     36   
     37  var rename = function (newName) 
     38  { 
    3839    if(newName == '' || newName == null || newName == oldName) 
    3940    { 
     
    4748    var viewtype = selection.options[selection.selectedIndex].value; 
    4849    location.href = _backend_url + "__function=images&mode="+mode+"&dir="+dir+"&rename="+oldPath+"&renameTo="+newName+"&viewtype="+viewtype; 
    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} 
     63function 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  { 
    5389    var newName = prompt(i18n('Please enter new name for this folder...'), oldName); 
    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  } 
    6692} 
    6793function copyFile(file,action)