thomascube
2007-08-10 31d9efd97d9da09605d4329457ee218cba48f82f
program/js/app.js
@@ -35,7 +35,7 @@
 
  // webmail client settings
  this.dblclick_time = 500;
  this.message_time = 5000;
  this.message_time = 3000;
  
  this.identifier_expr = new RegExp('[^0-9a-z\-_]', 'gi');
  
@@ -463,7 +463,7 @@
        break;
      case 'logout':
        this.goto_url('logout');
        this.goto_url('logout', true);
        break;      
      // commands to switch task
@@ -694,7 +694,7 @@
            }
          }
        this.goto_url('get', qstring+'&_download=1');
        this.goto_url('get', qstring+'&_download=1', false);
        break;
        
      case 'select-all':
@@ -1063,7 +1063,9 @@
      this.unfocus_folder(id);
      this.command('moveto', id);
      }
    // Hide message command buttons until a message is selected
    this.enable_command('reply', 'reply-all', 'forward', 'delete', 'print', false);
    return false;
    };
@@ -1088,15 +1090,16 @@
      clearTimeout(this.preview_timer);
    var selected = list.selection.length==1;
    // Hide certain command buttons when Drafts folder is selected
    if (this.env.mailbox == this.env.drafts_mailbox)
      {
      this.enable_command('show', selected);
      this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false);
      this.enable_command('reply', 'reply-all', 'forward', false);
      this.enable_command('show', 'delete', 'moveto', selected);
      }
    else
      {
      this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected);
      this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false);
      this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', 'delete', 'moveto', selected);
      }
    // start timer for message preview (wait for double click)
@@ -1244,12 +1247,14 @@
    if (!page && mbox != this.env.mailbox)
      {
      page = 1;
      add_url += '&_refresh=1';
      this.env.current_page = page;
      if (this.message_list)
        this.message_list.clear_selection();
      this.show_contentframe(false);
      }
    if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort))
      add_url += '&_refresh=1';
    
    this.select_folder(mbox, this.env.mailbox);
    this.env.mailbox = mbox;
@@ -1678,13 +1683,10 @@
      }
    // check for empty body
    if ((input_message.value=='')&&(tinyMCE.getContent()==''))
    if ((input_message.value == '' || (window.tinyMCE && tinyMCE.getContent() == '')) && !confirm(this.get_label('nobodywarning')))
      {
      if (!confirm(this.get_label('nobodywarning')))
        {
        input_message.focus();
        return false;
        }
      input_message.focus();
      return false;
      }
    return true;
@@ -1709,6 +1711,9 @@
    {
    if (this.env.draft_autosave)
      this.save_timer = self.setTimeout(function(){ ref.command("savedraft"); }, this.env.draft_autosave * 1000);
    // Unlock interface now that saving is complete
    this.busy = false;
    };
@@ -2913,17 +2918,16 @@
  // display a system message
  this.display_message = function(msg, type, hold)
    {
    // pass command to parent window
    if (this.env.framed && parent.rcmail )
      return parent.rcmail.display_message(msg, type, hold);
    this.set_busy(false);
    if (!this.loaded)  // save message in order to display after page loaded
      {
      this.pending_message = new Array(msg, type);
      return true;
      }
    // pass command to parent window
    if (this.env.framed && parent.rcmail)
      return parent.rcmail.display_message(msg, type, hold);
    if (!this.gui_objects.message)
      return false;
@@ -2934,12 +2938,12 @@
    if (type)
      cont = '<div class="'+type+'">'+cont+'</div>';
    this.gui_objects.message._rcube = this;
    var _rcube = this;
    this.gui_objects.message.innerHTML = cont;
    this.gui_objects.message.style.display = 'block';
    if (type!='loading')
      this.gui_objects.message.onmousedown = function(){ this._rcube.hide_message(); return true; };
      this.gui_objects.message.onmousedown = function(){ _rcube.hide_message(); return true; };
    
    if (!hold)
      this.message_timer = setTimeout(function(){ ref.hide_message(); }, this.message_time);
@@ -3186,9 +3190,11 @@
  /*********        remote request methods        *********/
  /********************************************************/
  this.redirect = function(url)
  this.redirect = function(url, lock)
    {
    this.set_busy(true);
    if (lock || lock === null)
      this.set_busy(true);
    if (this.env.framed && window.parent)
      parent.location.href = url;
    else  
@@ -3197,11 +3203,8 @@
  this.goto_url = function(action, query, lock)
    {
    if (lock)
    this.set_busy(true);
    var querystring = query ? '&'+query : '';
    this.redirect(this.env.comm_path+'&_action='+action+querystring);
    this.redirect(this.env.comm_path+'&_action='+action+querystring, lock);
    };
@@ -3492,12 +3495,13 @@
      return false;
      }
    var ref = this;
    var _ref = this;
    this.url = url;
    this.busy = true;
    this.xmlhttp.onreadystatechange = function(){ ref.xmlhttp_onreadystatechange(); };
    this.xmlhttp.onreadystatechange = function(){ _ref.xmlhttp_onreadystatechange(); };
    this.xmlhttp.open('GET', url);
    this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('sessid'));
    this.xmlhttp.send(null);
    };
@@ -3531,6 +3535,7 @@
    this.xmlhttp.onreadystatechange = function() { ref.xmlhttp_onreadystatechange(); };
    this.xmlhttp.open('POST', url, true);
    this.xmlhttp.setRequestHeader('Content-Type', contentType);
    this.xmlhttp.setRequestHeader('X-RoundCube-Referer', bw.get_cookie('sessid'));
    this.xmlhttp.send(req_body);
    };