Commits

Rune Halvorsen committed 188635d

Fixed whitespace and typos

  • Participants
  • Parent commits 64590db

Comments (0)

Files changed (5)

src/exec/color_picker_view.js

     this._selected_color = hex;
   }
 
-  this._set_dimesions = function(container, screenshot_width, screenshot_height)
+  this._set_dimensions = function(container, screenshot_width, screenshot_height)
   {
     this._width = container.offsetWidth - (2 * 280);
     this._height = container.offsetHeight - (2* 12);
     this._container = container;
     var scale = window.settings['color_picker'].get('color-picker-scale');
     scale != this._scale && ( this._scale = scale);
-    this._set_dimesions(container);
+    this._set_dimensions(container);
     container.render(window.templates.color_picker(
       this._screenshot_width,
       this._screenshot_height,
     var area = JSON.parse(json_obj);
     if (this.isvisible())
     {
-      this._set_dimesions (this._container, area.w, area.h);
+      this._set_dimensions (this._container, area.w, area.h);
       this._container.innerHTML = "";
       this.createView(this._container);
     }

src/scripts/cell-layout.js

 
   this.init = function(rough_cell, dir, parent, container)
   {
-    this.width = 
+    this.width =
       rough_cell.width && rough_cell.width > defaults.min_width ?
       rough_cell.width : defaults.min_width;
-    this.height = 
+    this.height =
       rough_cell.height && rough_cell.height > defaults.min_height ?
       rough_cell.height : defaults.min_height;
     this.id = rough_cell.id || getId();
         }
         else
         {
-          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE + 
+          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
             'missing container in cell.update');
         }
       }
       if(this.is_dirty)
       {
-        ele.style.cssText = 
+        ele.style.cssText =
         'left:' + ( this.left = left ) + 'px;' +
         'top:' + ( this.top = top ) + 'px;' +
         'width:' + this.width + 'px;' +
         this.is_dirty = false;
       }
     }
-    
+
 
     // create sliders
 
         }
         else
         {
-          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE + 
+          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
             'missing container in cell.update');
         }
       }
       if( is_dirty )
       {
-        
+
         if( this.dir == HOR )
         {
-          ele.style.cssText = 
+          ele.style.cssText =
             'left:' + left + 'px;' +
             'top:' + ( 2 * defaults.view_border_width + top + this.height ) + 'px;' +
             'width:' + ( 2 * defaults.view_border_width + this.width ) + 'px;' +
         }
         else
         {
-          ele.style.cssText = 
+          ele.style.cssText =
             'left:' + ( 2 * defaults.view_border_width + left + this.width ) + 'px;' +
             'top:' + top + 'px;' +
             'width:' + defaults.border_width + 'px;' +
       }
     }
 
-    return ( this.dir == VER ? this.width : this.height ) + 
+    return ( this.dir == VER ? this.width : this.height ) +
           2 * defaults.view_border_width + defaults.border_width;
   }
-  // helper to get the totalised dimesion
+  // helper to get the totalised dimension
   this.checkChildren = function(dim)
   {
     var child = null, i = 0, sum = 0, length = this.children.length;
         }
         else
         {
-          this.children[length][dim] = defaults['min_' + dim ]; 
+          this.children[length][dim] = defaults['min_' + dim ];
         }
       }
 
-      // min_width is to big 
+      // min_width is to big
 
       if( !length )
       {
         {
           this.children[i][dim] = average_width;
         }
-        this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;       
+        this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
       }
 
-      // inherit one dimesion from the parent
+      // inherit one dimension from the parent
 
       dim = this.dir == HOR ? 'height' : 'width';
       for( i = 0 ; child = this.children[i]; i++)
     }
   }
 
-  
+
   this.getCellById = function(id)
   {
     var child = null, i = 0, ret = null;
     return null;
   }
 
-  // confirme the tested dimesions
+  // confirme the tested dimensions
 
-  this.setCheckedDimesions = function()
+  this.setCheckedDimensions = function()
   {
     if( this.checked_height )
     {
     var child = null, i = 0;
     for( ; ( child = this.children[i] ) ; i++)
     {
-      child.setCheckedDimesions();
+      child.setCheckedDimensions();
     }
   }
 
   // clear the tested dimensions
 
-  this.clearCheckedDimesions = function()
+  this.clearCheckedDimensions = function()
   {
     this.checked_height = this.checked_width = 0;
     this.is_dirty = false;
     var child = null, i = 0;
     for( ; ( child = this.children[i] ) ; i++)
     {
-      child.clearCheckedDimesions();
+      child.clearCheckedDimensions();
     }
   }
 
         {
           this['checked_' + dim] = defaults['min_' + dim]
         }
-        delta_applied = delta - ( this['checked_' + dim] - this[dim] ); 
+        delta_applied = delta - ( this['checked_' + dim] - this[dim] );
       }
       else // clear
       {
     }
     return delta_applied;
   }
-  
+
   this.getCapTarget = function(dim, target)
   {
     if( !this.children.length ) return 0;
-    var child = null, i = 0, length = this.children.length - 1, 
+    var child = null, i = 0, length = this.children.length - 1,
       sum = length * 2 * defaults.view_border_width + ( length ) * defaults.border_width;
-    
+
     for( ; ( child = this.children[i] ) ; i++)
     {
       if( child != target )
     }
     return this[dim] - sum;
   }
-  
+
   this.handleResizeEvent = function(event, _delta)
   {
     var dim = this.dir == HOR ? 'height' : 'width';
         }
         while (sibling && consumed);
         cap_holder = this;
-        
+
         //cap = this.parent.getCapTarget(dim, this) - this[dim];
         /*
         if( cap = delta + consumed  )
         {
           this.checkDelta(dim, cap, 'next');
-          this.parent.setCheckedDimesions();
+          this.parent.setCheckedDimensions();
           this.parent.update(this.parent.left, this.parent.top);
         }
         else
         {
-          this.parent.clearCheckedDimesions();
+          this.parent.clearCheckedDimensions();
         }
         */
-        
+
       }
       else
       {
         if( cap = delta + consumed )
         {
           this.next.checkDelta(dim, cap, 'next');
-          this.parent.setCheckedDimesions();
+          this.parent.setCheckedDimensions();
           this.parent.update(this.parent.left, this.parent.top);
         }
         else
         {
-          this.parent.clearCheckedDimesions();
+          this.parent.clearCheckedDimensions();
         }
         */
-        
+
       }
-      
+
       if( cap = delta + consumed  )
       {
         cap_holder.checkDelta(dim, cap, 'next');
-        this.parent.setCheckedDimesions();
+        this.parent.setCheckedDimensions();
         this.parent.update(this.parent.left, this.parent.top);
       }
       else
       {
-        this.parent.clearCheckedDimesions();
+        this.parent.clearCheckedDimensions();
       }
-      
+
     }
   }
 }

src/ui-scripts/cells.js

 
   this.init = function(rough_cell, dir, parent, container_id)
   {
-    this.width = 
+    this.width =
       rough_cell.width && rough_cell.width > defaults.min_view_width ?
       rough_cell.width : defaults.min_view_width;
-    this.height = 
+    this.height =
       rough_cell.height && rough_cell.height > defaults.min_view_height ?
       rough_cell.height : defaults.min_view_height;
     ids[ this.id = rough_cell.id || getId()] = this;
     var rough_children = rough_cell.children, rough_child = null, i = 0;
     var child = null, previous = null, next = null;
 
-    
+
 
     if( rough_children )
     {
         // is previoue set for the last?
       }
     }
-    else  
+    else
     {
 
       this.appendUiNodes();
         }
         else
         {
-         
+
           this.toolbar.setDimensions(force_redraw);
           this.tab.setDimensions(force_redraw);
           this.container.setDimensions(force_redraw, is_resize);
         this.is_dirty = false;
       }
     }
-    
+
 
     // create sliders
 
       if( !ele )
       {
         var container = document.getElementById( this.container_id ) || window.viewport; // set name in defualts
-        
+
         if( container )
         {
           ele = container.appendChild( document.createElement(defaults.slider_name));
         }
         else
         {
-          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE + 
+          opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
             'missing container in cell.update');
         }
       }
       if( is_dirty )
       {
-        
+
         if( this.dir == HOR )
         {
-          css_text = 
+          css_text =
             'left:' + left + 'px;' +
             'top:' + ( 2 * defaults.view_border_width + top + this.height ) + 'px;' +
             'width:' + ( 2 * defaults.view_border_width + this.width ) + 'px;' +
         }
         else
         {
-          css_text = 
+          css_text =
             'left:' + ( 2 * defaults.view_border_width + left + this.width ) + 'px;' +
             'top:' + top + 'px;' +
             'width:' + defaults.slider_border_width + 'px;' +
       }
     }
 
-    return ( this.dir == VER ? this.width : this.height ) + 
+    return ( this.dir == VER ? this.width : this.height ) +
           2 * defaults.view_border_width + defaults.slider_border_width;
   }
 
-  // helper to get the totalised dimesion
+  // helper to get the totalised dimension
 
   this.checkChildren = function(dim)
   {
         }
         else
         {
-          this.children[length][dim] = defaults['min_view_' + dim ]; 
+          this.children[length][dim] = defaults['min_view_' + dim ];
         }
       }
 
-      // min_width is to big 
+      // min_width is to big
 
       if( !length )
       {
         {
           this.children[i][dim] = average_width;
         }
-        this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;       
+        this.children[length - 1][dim] = sum - ( length - 1 ) * average_width;
       }
 
-      // inherit one dimesion from the parent
+      // inherit one dimension from the parent
 
       dim = this.dir == HOR ? 'height' : 'width';
       for( i = 0 ; child = this.children[i]; i++)
     }
   }
 
-  
+
   this.getCellById = function(id)
   {
     return ids[id];
     delete ids[id];
   }
 
-  // confirme the tested dimesions
+  // confirme the tested dimensions
 
-  this.setCheckedDimesions = function()
+  this.setCheckedDimensions = function()
   {
     if( this.checked_height )
     {
     var child = null, i = 0;
     for( ; ( child = this.children[i] ) ; i++)
     {
-      child.setCheckedDimesions();
+      child.setCheckedDimensions();
     }
   }
 
   // clear the tested dimensions
 
-  this.clearCheckedDimesions = function()
+  this.clearCheckedDimensions = function()
   {
     this.checked_height = this.checked_width = 0;
     this.is_dirty = false;
     var child = null, i = 0;
     for( ; ( child = this.children[i] ) ; i++)
     {
-      child.clearCheckedDimesions();
+      child.clearCheckedDimensions();
     }
   }
 
         {
           this['checked_' + dim] = defaults['min_view_' + dim]
         }
-        delta_applied = delta - ( this['checked_' + dim] - this[dim] ); 
+        delta_applied = delta - ( this['checked_' + dim] - this[dim] );
       }
       else // clear
       {
     }
     return delta_applied;
   }
-  
+
   this.getCapTarget = function(dim, target)
   {
     if( !this.children.length ) return 0;
-    var child = null, i = 0, length = this.children.length - 1, 
+    var child = null, i = 0, length = this.children.length - 1,
       sum = length * 2 * defaults.view_border_width + ( length ) * defaults.slider_border_width;
-    
+
     for( ; ( child = this.children[i] ) ; i++)
     {
       if( child != target )
 
   this.handleResizeEvent = function(event, _delta)
   {
-    
+
     var dim = this.dir == HOR ? 'height' : 'width';
     var pos = this.dir == HOR ? 'top' : 'left';
     var delta = Math.round( event[this.dir == HOR ? 'pageY' : 'pageX'] - _delta - ( this[pos] + this[dim] ) );
         }
         while (sibling && consumed);
         cap_holder = this;
-        
+
         //cap = this.parent.getCapTarget(dim, this) - this[dim];
         /*
         if( cap = delta + consumed  )
         {
           this.checkDelta(dim, cap, 'next');
-          this.parent.setCheckedDimesions();
+          this.parent.setCheckedDimensions();
           this.parent.update(this.parent.left, this.parent.top);
         }
         else
         {
-          this.parent.clearCheckedDimesions();
+          this.parent.clearCheckedDimensions();
         }
         */
-        
+
       }
       else
       {
         if( cap = delta + consumed )
         {
           this.next.checkDelta(dim, cap, 'next');
-          this.parent.setCheckedDimesions();
+          this.parent.setCheckedDimensions();
           this.parent.update(this.parent.left, this.parent.top);
         }
         else
         {
-          this.parent.clearCheckedDimesions();
+          this.parent.clearCheckedDimensions();
         }
         */
-        
+
       }
-      
+
       if( cap = delta + consumed  )
       {
         cap_holder.checkDelta(dim, cap, 'next');
-        this.parent.setCheckedDimesions();
+        this.parent.setCheckedDimensions();
         this.parent.update(this.parent.left, this.parent.top);
       }
       else
       {
-        this.parent.clearCheckedDimesions();
+        this.parent.clearCheckedDimensions();
       }
-      
+
     }
   }
 }
 
 /**
-  * @constructor 
+  * @constructor
   * @extends ViewBase
   */
 

src/ui-scripts/topCell.js

 
 /**
-  * @constructor 
+  * @constructor
   * @extends CellBase
   * a bit different from a normal cell, it holds the main view ui elements but also the main conatiner
   */
 {
   var self = this;
   var resize_timeout = new Timeouts();
-  this.setStartDimesions = setDimensions || function()
+  this.setStartDimensions = setDimensions || function()
   {
     this.top = 0;
     this.left = 0;
   };
   this.onresize = onresize || function()
   {
-    this.setStartDimesions();
+    this.setStartDimensions();
     this.update();
     var view_id = this.tab && this.tab.activeTab;
     if( view_id )
     self.onresize();
     messages.post('resize');
   }
-  
+
   var setDelayedResize = function()
   {
     resize_timeout.set(delayed_resize, 32);
 
   }
 
-  
+
 
   this.showView = function(view_id)
   {
 
   this.addTemporaryTabs = function()
   {
-    var 
+    var
     store = global_state.ui_framework.temporary_tabs,
-    view_id = '', 
+    view_id = '',
     i = 0;
 
     for( ; view_id = store[i]; i++)
   // constructor calls
   window.topCell = this;
   this.init(layout);
-  this.setStartDimesions();
+  this.setStartDimensions();
   if(this.toolbar)
   {
   this.toolbar.setup(this.id);
   }
   this.addTemporaryTabs();
   this.tab.setActiveTab
-  ( 
-    global_state 
+  (
+    global_state
     && global_state.ui_framework.last_selected_top_tab
     && composite_view_convert_table[opera.attached.toString()][global_state.ui_framework.last_selected_top_tab]
-    || this.tab.tabs[0].ref_id 
+    || this.tab.tabs[0].ref_id
   );
   this.container.setup(this.id);
   this.update(this.left, this.top, true);

src/ui-scripts/viewSlider.js

 /**
-  * @constructor 
+  * @constructor
   */
 
 var SlideViews = function(container)
 {
   const VER = 'v', HOR = 'h';
-  var self = this; 
+  var self = this;
   var focus_catcher = null;
 
   var mousedownevents = null;
 
   var resizehandler = function()
   {
-    if( !self.checkDimesions() )
+    if( !self.checkDimensions() )
     {
       self.cell.update(self.cell.left, self.cell.top, true);
     }
   var intervaled_mousemovehandler = function(event)
   {
     _target.handleResizeEvent(_event, _delta);
-    
-  } 
+
+  }
 
   var mousemovehandler = function(event)
   {
       }
       else
       {
-        opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE + 
+        opera.postError(ui_strings.DRAGONFLY_INFO_MESSAGE +
           'missing target in mousedownhandler in slideViews');
       }
 
       {
         focus_catcher = UIBase.getFocusCatcher();
       }
-      
+
     }
   }
 
-  container.addEventListener('mousedown', mousedownhandler, false); 
+  container.addEventListener('mousedown', mousedownhandler, false);
 
 }