Changeset 907 in subversion


Ignore:
Timestamp:
Oct 28, 2007 10:13:33 AM (6 years ago)
Author:
thomasb
Message:

Use UTF-8 folder name for renaming; don't use setAttribute but an object property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/js/app.js

    r888 r907  
    24172417      var anchors = row.obj.getElementsByTagName('A'); 
    24182418      if (anchors[0]) 
    2419         anchors[0].onclick = function() { p.rename_folder(row.id); }; 
     2419        anchors[0].onclick = function() { p.rename_folder(row.id); return false; }; 
    24202420      if (anchors[1]) 
    2421         anchors[1].onclick = function() { p.delete_folder(row.id); }; 
     2421        anchors[1].onclick = function() { p.delete_folder(row.id); return false; }; 
    24222422      row.obj.onmouseover = function() { p.focus_subscription(row.id); }; 
    24232423      row.obj.onmouseout = function() { p.unfocus_subscription(row.id); }; 
     
    25632563    { 
    25642564    var temp, row, form; 
    2565     var folder = this.env.subscriptionrows[id][0]; 
    25662565 
    25672566    // reset current renaming 
     
    25732572    } 
    25742573 
    2575     if (id && (row = document.getElementById(id))) 
     2574    if (id && this.env.subscriptionrows[id] && (row = document.getElementById(id))) 
    25762575      { 
    25772576      var reg = new RegExp('.*['+RegExp.escape(this.env.delimiter)+']'); 
    25782577      this.name_input = document.createElement('INPUT'); 
    2579       this.name_input.value = folder.replace(reg, ''); 
     2578      this.name_input.value = this.env.subscriptionrows[id][1].replace(reg, ''); 
    25802579      this.name_input.style.width = '100%'; 
     2580       
    25812581      reg = new RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$'); 
    2582       this.name_input.setAttribute('parent', folder.replace(reg, '')); 
     2582      this.name_input.__parent = this.env.subscriptionrows[id][0].replace(reg, ''); 
    25832583      this.name_input.onkeypress = function(e){ rcmail.name_input_keypress(e); }; 
    25842584       
     
    26182618      if (this.edit_folder && newname) 
    26192619        { 
    2620         if (this.name_input.getAttribute('parent') && this.name_input.getAttribute('parent')!='') 
    2621           newname = this.name_input.getAttribute('parent')+this.env.delimiter+newname; 
    2622           this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname)); 
     2620        if (this.name_input.__parent) 
     2621          newname = this.name_input.__parent + this.env.delimiter + newname; 
     2622        this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname)); 
    26232623        } 
    26242624      } 
Note: See TracChangeset for help on using the changeset viewer.