alecpl
2009-04-24 79eb4e79ed15d460ecef6baa5ca115b190b83a11
program/js/app.js
@@ -1232,9 +1232,6 @@
  this.drag_start = function(list)
  {
    this.initialBodyScrollTop = bw.ie ? 0 : window.pageYOffset;
    this.initialMailBoxScrollTop = document.getElementById("mailboxlist-container").scrollTop;
    var model = this.task == 'mail' ? this.env.mailboxes : this.env.address_sources;
    this.drag_active = true;
@@ -1244,6 +1241,9 @@
    // save folderlist and folders location/sizes for droptarget calculation in drag_move()
    if (this.gui_objects.folderlist && model)
      {
      this.initialBodyScrollTop = bw.ie ? 0 : window.pageYOffset;
      this.initialListScrollTop = this.gui_objects.folderlist.parentNode.scrollTop;
      var li, pos, list, height;
      list = $(this.gui_objects.folderlist);
      pos = list.offset();
@@ -1266,7 +1266,7 @@
    if (this.gui_objects.folderlist && this.env.folder_coords) {
      // offsets to compensate for scrolling while dragging a message
      var boffset = bw.ie ? -document.documentElement.scrollTop : this.initialBodyScrollTop;
      var moffset = this.initialMailBoxScrollTop-document.getElementById('mailboxlist-container').scrollTop;
      var moffset = this.initialListScrollTop-this.gui_objects.folderlist.parentNode.scrollTop;
      var toffset = -moffset-boffset;
      var li, pos, mouse;
@@ -2568,13 +2568,13 @@
    this.ksearch_value = q;
    
    this.display_message(this.get_label('searching'), 'loading', true);
    this.http_post('autocomplete', '_search='+q);
    this.http_post('autocomplete', '_search='+urlencode(q));
  };
  this.ksearch_query_results = function(results, search)
  {
    // ignore this outdated search response
    if (search != this.ksearch_value)
    if (this.ksearch_value && search != this.ksearch_value)
      return;
      
    this.hide_message();
@@ -3008,7 +3008,6 @@
      var reg = new RegExp('.*['+RegExp.escape(this.env.delimiter)+']');
      this.name_input = document.createElement('INPUT');
      this.name_input.value = this.env.subscriptionrows[id][0].replace(reg, '');
      this.name_input.style.width = '100%';
      reg = new RegExp('['+RegExp.escape(this.env.delimiter)+']?[^'+RegExp.escape(this.env.delimiter)+']+$');
      this.name_input.__parent = this.env.subscriptionrows[id][0].replace(reg, '');
@@ -3707,14 +3706,19 @@
    var rowcount = tbody.rows.length;
    var even = rowcount%2;
    
    var row = $('<tr>').attr('id', 'rcmrow'+cid).addClass('class').addClass(even ? 'even' : 'odd');
    var row = document.createElement('TR');
    row.id = 'rcmrow'+cid;
    row.className = 'contact '+(even ? 'even' : 'odd');
    if (this.contact_list.in_selection(cid))
      row.addClass('selected');
      row.className += ' selected';
    // add each submitted col
    for (var c in cols) {
      col = $('<td>').addClass(String(c).toLowerCase()).html(cols[c]).appendTo(row);
      col = document.createElement('TD');
      col.className = String(c).toLowerCase();
      col.innerHTML = cols[c];
      row.appendChild(col);
    }
    
    this.contact_list.insert_row(row);
@@ -3787,6 +3791,13 @@
      error: function(o) { rcmail.http_error(o); },
      success: function(data) { rcmail.set_busy(false); $(document.getElementById(id)).val(data); console.log(data); }
      });
    }
  this.plain2html = function(plainText, id)
    {
    this.set_busy(true, 'converting');
    $(document.getElementById(id)).val('<pre>'+plainText+'</pre>');
    this.set_busy(false);
    }
@@ -3911,16 +3922,12 @@
  // handle HTTP request errors
  this.http_error = function(request, status, err)
    {
      alert(status+":"+err);
/*
    //alert('Error sending request: '+request_obj.url+' => HTTP '+request_obj.xmlhttp.status);
    if (request_obj.__lock)
      this.set_busy(false);
    var errmsg = request.statusText;
    request_obj.reset();
    request_obj.__lock = false;
    this.display_message('Unknown Server Error!', 'error');
*/
    this.set_busy(false);
    request.abort();
    this.display_message('Unknown Server Error!' + (errmsg ? ' ('+errmsg+')' : ''), 'error');
    };
  // use an image to send a keep-alive siganl to the server