From 4f9c8337420327802baf73cde7d96b991b1fd1a9 Mon Sep 17 00:00:00 2001
From: svncommit <devs@roundcube.net>
Date: Wed, 07 May 2008 18:16:00 -0400
Subject: [PATCH] /tmp/out

---
 program/js/app.js |   93 ++++++++++++++++++----------------------------
 1 files changed, 36 insertions(+), 57 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 3ed6817..aa90b3f 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -355,7 +355,7 @@
   // start interval for keep-alive/recent_check signal
   this.start_keepalive = function()
     {
-    if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.messagelist)
+    if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.mailboxlist)
       this._int = setInterval(function(){ ref.check_for_recent(); }, this.env.keep_alive * 1000);
     else if (this.env.keep_alive && !this.env.framed && this.task!='login')
       this._int = setInterval(function(){ ref.send_keep_alive(); }, this.env.keep_alive * 1000);    
@@ -405,7 +405,7 @@
       this.init_address_input_events(input_cc);
     if (input_bcc)
       this.init_address_input_events(input_bcc);
-      
+
     // add signature according to selected identity
     if (input_from && input_from.type=='select-one')
       this.change_identity(input_from);
@@ -630,7 +630,7 @@
           var input_email = rcube_find_object('_email');
 
           // user prefs
-          if (input_pagesize && isNaN(input_pagesize.value))
+          if (input_pagesize && isNaN(parseInt(input_pagesize.value)))
             {
             alert(this.get_label('nopagesizewarning'));
             input_pagesize.focus();
@@ -721,7 +721,7 @@
           this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment');
           if (this.attachment_win)
             {
-            setTimeout(function(){ ref.attachment_win.focus(); }, 10);
+            window.setTimeout(function(){ ref.attachment_win.focus(); }, 10);
             break;
             }
           }
@@ -889,7 +889,7 @@
           ref.printwin = window.open(this.env.comm_path+'&_action=print&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox)+(this.env.safemode ? '&_safe=1' : ''));
           if (this.printwin)
           {
-            setTimeout(function(){ ref.printwin.focus(); }, 20);
+            window.setTimeout(function(){ ref.printwin.focus(); }, 20);
             if (this.env.action != 'show')
               this.mark_message('read', uid);
           }
@@ -902,7 +902,7 @@
           {
           ref.sourcewin = window.open(this.env.comm_path+'&_action=viewsource&_uid='+this.env.uid+'&_mbox='+urlencode(this.env.mailbox));
           if (this.sourcewin)
-            setTimeout(function(){ ref.sourcewin.focus(); }, 20);
+            window.setTimeout(function(){ ref.sourcewin.focus(); }, 20);
           }
         break;
 
@@ -1019,7 +1019,7 @@
 
     // set timer for requests
     if (a && this.env.request_timeout)
-      this.request_timer = setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);
+      this.request_timer = window.setTimeout(function(){ ref.request_timed_out(); }, this.env.request_timeout * 1000);
     };
 
 
@@ -1138,7 +1138,7 @@
 
     // start timer for message preview (wait for double click)
     if (selected && this.env.contentframe && !list.multi_selecting)
-      this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10);
+      this.preview_timer = window.setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10);
     else if (this.env.contentframe)
       this.show_contentframe(false);
     };
@@ -1232,9 +1232,12 @@
     var frm;
     if (this.env.contentframe && (frm = rcube_find_object(this.env.contentframe)))
       {
-      if (!show && window.frames[this.env.contentframe] && frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
-        frames[this.env.contentframe].location.href = this.env.blankpage;
-      if (!bw.safari)
+      if (!show && window.frames[this.env.contentframe])
+        {
+        if (window.frames[this.env.contentframe].location.href.indexOf(this.env.blankpage)<0)
+	  window.frames[this.env.contentframe].location.href = this.env.blankpage;
+	}
+      else if (!bw.safari)
         frm.style.display = show ? 'block' : 'none';
       }
       
@@ -1560,13 +1563,13 @@
           rows[uid].classname = rows[uid].classname.replace(/\s*unread/, '');
           this.set_classname(rows[uid].obj, 'unread', false);
 
-          if (rows[uid].replied && this.env.repliedicon)
-            icn_src = this.env.repliedicon;
-          else if (this.env.messageicon)
+          if (this.env.messageicon)
             icn_src = this.env.messageicon;
           }
 
-        if (rows[uid].icon && icn_src)
+        if (rows[uid].icon && icn_src 
+	    && !(rows[uid].replied && this.env.repliedicon)
+            && !(rows[uid].deleted && this.env.deletedicon))
           rows[uid].icon.src = icn_src;
         }
       }
@@ -1587,6 +1590,8 @@
 
         if (rows[uid].replied && parent.rcmail.env.repliedicon)
     	  icn_src = parent.rcmail.env.repliedicon;
+        else if (rows[uid].deleted && parent.rcmail.env.deletedicon)
+    	  icn_src = parent.rcmail.env.deletedicon;
         else if (parent.rcmail.env.messageicon)
           icn_src = parent.rcmail.env.messageicon;
       
@@ -1790,7 +1795,9 @@
       }
 
     // check for empty body
-    if ((input_message.value == '' && (!window.tinyMCE || tinyMCE.getContent() == '')) && !confirm(this.get_label('nobodywarning')))
+    if ((input_message.value == '' &&
+         (!window.tinyMCE || tinyMCE.get('compose-body').getContent() == '')) &&
+        !confirm(this.get_label('nobodywarning')))
       {
       input_message.focus();
       return false;
@@ -1895,25 +1902,17 @@
       }
     else
       {
-      var eid = tinyMCE.getEditorId('_message');
-      // editor is a TinyMCE_Control object
-      var editor = tinyMCE.getInstanceById(eid);
-      // if this is null, we should exit
-      if (editor == null) {
-        return false;
-      }
-      var msgDoc = editor.getDoc();
-      var msgBody = msgDoc.body;
+      var editor = tinyMCE.get('compose-body');
 
       if (this.env.signatures && this.env.signatures[id])
         {
         // Append the signature as a span within the body
-        var sigElem = msgDoc.getElementById("_rc_sig");
+        var sigElem = editor.dom.get("_rc_sig");
         if (!sigElem)
           {
-          sigElem = msgDoc.createElement("span");
+          sigElem = editor.getDoc().createElement("span");
           sigElem.setAttribute("id", "_rc_sig");
-          msgBody.appendChild(sigElem);
+          editor.getBody().appendChild(sigElem);
           }
         if (this.env.signatures[id]['is_html'])
           {
@@ -2164,26 +2163,10 @@
       }
 
     // start timer
-    this.ksearch_timer = setTimeout(function(){ ref.ksearch_get_results(); }, 200);
+    this.ksearch_timer = window.setTimeout(function(){ ref.ksearch_get_results(); }, 200);
     this.ksearch_input = obj;
     
     return true;
-    };
-
-
-  // handler for mouse events on address-fields
-  this.ksearch_onmousemove = function(li)
-    {
-    var last = document.getElementById('rcmksearchSelected');
-    if (last)
-      {
-        last.removeAttribute('id');
-        this.set_classname(last, 'selected', false);
-      }
-
-    li.setAttribute('id', 'rcmksearchSelected');
-    this.set_classname(li, 'selected', true);
-    this.ksearch_selected = li._rcm_id;
     };
 
 
@@ -2207,7 +2190,6 @@
     cpos = p+insert.length;
     if (this.ksearch_input.setSelectionRange)
       this.ksearch_input.setSelectionRange(cpos, cpos);
-    
   };
 
 
@@ -2276,9 +2258,6 @@
         {
         li = document.createElement('LI');
         li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;');
-        li.onmousedown = function(e){ ref.insert_recipient(this._rcm_id); ref.ksearch_pane.show(0); return rcube_event.cancel(e); };
-        li.onmouseover = function(e){ ref.ksearch_onmousemove(this); };
-    	li.style.cursor = 'pointer';
         li._rcm_id = a_result_ids[i];
         ul.appendChild(li);
         }
@@ -2356,7 +2335,7 @@
 
       var id, frame, ref = this;
       if (id = list.get_single_selection())
-        this.preview_timer = setTimeout(function(){ ref.load_contact(id, 'show'); }, this.dblclick_time + 10);
+        this.preview_timer = window.setTimeout(function(){ ref.load_contact(id, 'show'); }, this.dblclick_time + 10);
       else if (this.env.contentframe)
         this.show_contentframe(false);
 
@@ -2497,7 +2476,7 @@
       qs += '&_search='+this.env.search_request;
 
     // send request to server
-    this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_from='+(this.env.action ? this.env.action : '')+qs);
+    this.http_post('delete', '_cid='+urlencode(a_cids.join(','))+'&_source='+urlencode(this.env.source)+'&_from='+(this.env.action ? this.env.action : '')+qs);
     return true;
     };
 
@@ -3168,7 +3147,7 @@
       this.gui_objects.message.onmousedown = function(){ _rcube.hide_message(); return true; };
     
     if (!hold)
-      this.message_timer = setTimeout(function(){ ref.hide_message(); }, this.message_time);
+      this.message_timer = window.setTimeout(function(){ ref.hide_message(); }, this.message_time);
     };
 
 
@@ -3394,16 +3373,16 @@
     };
 
 
-  this.toggle_editor = function(checkbox, textElementName)
+  this.toggle_editor = function(checkbox, textAreaId)
     {
     var ischecked = checkbox.checked;
     if (ischecked)
       {
-        tinyMCE.execCommand('mceAddControl', true, textElementName);
+        tinyMCE.execCommand('mceAddControl', true, textAreaId);
       }
     else
       {
-        tinyMCE.execCommand('mceRemoveControl', true, textElementName);
+        tinyMCE.execCommand('mceRemoveControl', true, textAreaId);
       }
     };
 
@@ -3833,7 +3812,7 @@
 // helper function to call the init method with a delay
 function call_init(o)
   {
-  if (window[o] && window[o].init)
-    setTimeout(o+'.init()', 200);
+    window.setTimeout('if (window[\''+o+'\'] && window[\''+o+'\'].init) { '+o+'.init(); }',
+                      bw.win ? 500 : 200);
   }
 

--
Gitblit v1.9.1