[Svn] r3337 - trunk/roundcubemail/skins/default

trac at roundcube.net trac at roundcube.net
Sun Mar 7 18:42:09 CET 2010


Author: alec
Date: 2010-03-07 11:42:09 -0600 (Sun, 07 Mar 2010)
New Revision: 3337

Modified:
   trunk/roundcubemail/skins/default/functions.js
   trunk/roundcubemail/skins/default/splitter.js
Log:
- code cleanup


Modified: trunk/roundcubemail/skins/default/functions.js
===================================================================
--- trunk/roundcubemail/skins/default/functions.js	2010-03-07 08:14:41 UTC (rev 3336)
+++ trunk/roundcubemail/skins/default/functions.js	2010-03-07 17:42:09 UTC (rev 3337)
@@ -13,7 +13,7 @@
     tab = '#settingstab' + (rcmail.env.action=='preferences' ? 'default' : (rcmail.env.action.indexOf('identity')>0 ? 'identities' : rcmail.env.action.replace(/\./g, '')));
 
   $(tab).addClass('tablink-selected');
-  $(tab + '> a').removeAttr('onclick').unbind('click').bind('click', function(){return false});
+  $(tab + '> a').removeAttr('onclick').unbind('click').bind('click', function(){return false;});
 }
 
 function rcube_show_advanced(visible)
@@ -39,12 +39,12 @@
     
   link.style.display = 'none';
 
-  if (row = document.getElementById('compose-' + id))
+  if ((row = document.getElementById('compose-' + id)))
     {
     var div = document.getElementById('compose-div');
     var headers_div = document.getElementById('compose-headers-div');
     row.style.display = (document.all && !window.opera) ? 'block' : 'table-row';
-    div.style.top = (parseInt(headers_div.offsetHeight)) + 'px';
+    div.style.top = parseInt(headers_div.offsetHeight, 10) + 'px';
     }
 
   return false;
@@ -52,7 +52,7 @@
 
 function rcmail_hide_header_form(id)
 {
-  var row, parent, ns, ps, link, links;
+  var row, parent, ns, link, links;
 
   link = document.getElementById(id + '-link');
   link.style.display = '';
@@ -71,12 +71,12 @@
 
   document.getElementById('_' + id).value = '';
 
-  if (row = document.getElementById('compose-' + id))
+  if ((row = document.getElementById('compose-' + id)))
     {
     var div = document.getElementById('compose-div');
     var headers_div = document.getElementById('compose-headers-div');
     row.style.display = 'none';
-    div.style.top = (parseInt(headers_div.offsetHeight)) + 'px';
+    div.style.top = parseInt(headers_div.offsetHeight, 10) + 'px';
     }
 
   return false;
@@ -175,7 +175,7 @@
 set_searchmod: function(elem)
 {
   if (!rcmail.env.search_mods)
-    rcmail.env.search_mods = new Object();
+    rcmail.env.search_mods = {};
   
   if (!rcmail.env.search_mods[rcmail.env.mailbox])
     rcmail.env.search_mods[rcmail.env.mailbox] = rcube_clone_object(rcmail.env.search_mods['*']);

Modified: trunk/roundcubemail/skins/default/splitter.js
===================================================================
--- trunk/roundcubemail/skins/default/splitter.js	2010-03-07 08:14:41 UTC (rev 3336)
+++ trunk/roundcubemail/skins/default/splitter.js	2010-03-07 17:42:09 UTC (rev 3337)
@@ -75,7 +75,7 @@
       this.layer.move(this.layer.x, Math.round(this.pos - lh / 2 + 1));
       if (bw.ie)
         {
-        var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top) - (bw.ie8 ? 2 : 0));
+        var new_height = parseInt(this.p2.parentNode.offsetHeight, 10) - parseInt(this.p2.style.top, 10) - (bw.ie8 ? 2 : 0);
         this.p2.style.height = (new_height > 0 ? new_height : 0) +'px';
         }
       }
@@ -85,7 +85,7 @@
       this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2) + 'px';
       this.layer.move(Math.round(this.pos - this.layer.width / 2 + 1), this.layer.y);
       if (bw.ie)
-        this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px';
+        this.p2.style.width = parseInt(this.p2.parentNode.offsetWidth, 10) - parseInt(this.p2.style.left, 10) + 'px';
       }
     };
 
@@ -124,14 +124,14 @@
         // the position of each iframe when the event is received
         var s = this;
         var id = '#'+iframes[n].id;
-        this.iframe_events[n] = function(e){ e._offset = $(id).offset(); return s.onDrag(e); }
+        this.iframe_events[n] = function(e){ e._offset = $(id).offset(); return s.onDrag(e); };
 
         if (iframedoc.addEventListener)
           iframedoc.addEventListener('mousemove', this.iframe_events[n], false);
         else if (iframes[n].attachEvent)
           iframedoc.attachEvent('onmousemove', this.iframe_events[n]);
         else
-          iframedoc['onmousemove'] = this.iframe_events[n];
+          iframedoc.onmousemove = this.iframe_events[n];
 
         rcube_event.add_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'});
         }
@@ -201,6 +201,7 @@
         iframedoc = iframes[n].contentWindow.document;
       else if (iframes[n].document)
         iframedoc = iframes[n].document;
+
       if (iframedoc)
         {
         if (this.iframe_events[n]) {
@@ -209,7 +210,7 @@
           else if (iframedoc.detachEvent)
             iframedoc.detachEvent('onmousemove', this.iframe_events[n]);
           else
-            iframedoc['onmousemove'] = null;
+            iframedoc.onmousemove = null;
           }
 
         rcube_event.remove_listener({element:iframedoc, event:'mouseup', object:this, method:'onDragStop'});
@@ -228,11 +229,11 @@
     {
     if (this.horizontal)
       {
-      var new_height = (parseInt(this.p2.parentNode.offsetHeight) - parseInt(this.p2.style.top) - (bw.ie8 ? 2 : 0));
+      var new_height = parseInt(this.p2.parentNode.offsetHeight, 10) - parseInt(this.p2.style.top, 10) - (bw.ie8 ? 2 : 0);
       this.p2.style.height = (new_height > 0 ? new_height : 0) +'px';
       }
     else
-      this.p2.style.width = (parseInt(this.p2.parentNode.offsetWidth) - parseInt(this.p2.style.left))+'px';
+      this.p2.style.width = parseInt(this.p2.parentNode.offsetWidth, 10) - parseInt(this.p2.style.left, 10) + 'px';
     };
 
   this.set_cookie = function()
@@ -241,6 +242,6 @@
     var exp = new Date();
     exp.setYear(exp.getFullYear() + 1);
     bw.set_cookie(this.id, this.pos, exp);
-    }
+    };
 
   }  // end class rcube_splitter

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list