You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pe...@apache.org on 2014/09/18 16:37:12 UTC

git commit: [flex-asjs] [refs/heads/develop] - Corrects issues uncovered by gjslint and jshint.

Repository: flex-asjs
Updated Branches:
  refs/heads/develop d924c8063 -> f1e401b97


Corrects issues uncovered by gjslint and jshint.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f1e401b9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f1e401b9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f1e401b9

Branch: refs/heads/develop
Commit: f1e401b97859696857a8de58f59da48d63a42afd
Parents: d924c80
Author: Peter Ent <pe...@apache.org>
Authored: Thu Sep 18 10:37:06 2014 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Thu Sep 18 10:37:06 2014 -0400

----------------------------------------------------------------------
 .../apache/flex/core/graphics/GradientBase.js   | 19 +++----
 .../apache/flex/core/graphics/GradientEntry.js  |  8 +--
 .../apache/flex/core/graphics/GraphicShape.js   |  5 +-
 .../apache/flex/core/graphics/LinearGradient.js | 60 +++++++++++---------
 .../org/apache/flex/core/graphics/SolidColor.js |  3 +-
 .../flex/html/beads/layouts/ButtonBarLayout.js  |  2 +-
 .../ButtonBarButtonItemRenderer.js              |  2 +-
 7 files changed, 52 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientBase.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientBase.js
index 46719ae..0d6c06a 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientBase.js
@@ -23,6 +23,7 @@
 goog.provide('org.apache.flex.core.graphics.GradientBase');
 
 
+
 /**
  * @constructor
  */
@@ -52,14 +53,12 @@ org.apache.flex.core.graphics.GradientBase.prototype.alphas = [];
 
 
 /**
- * @private
  * @type {Array}
  */
 org.apache.flex.core.graphics.GradientBase.prototype._entries = [];
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientBase.prototype._rotation = 0.0;
@@ -86,10 +85,10 @@ org.apache.flex.core.graphics.GradientBase.prototype.set_entries = function(valu
 /**
  * @expose
  *  By default, the LinearGradientStroke defines a transition
- *  from left to right across the control. 
- *  Use the <code>rotation</code> property to control the transition direction. 
+ *  from left to right across the control.
+ *  Use the <code>rotation</code> property to control the transition direction.
  *  For example, a value of 180.0 causes the transition
- *  to occur from right to left, rather than from left to right. 
+ *  to occur from right to left, rather than from left to right.
  * @return {number}
  */
 org.apache.flex.core.graphics.GradientBase.prototype.get_rotation = function() {
@@ -107,7 +106,6 @@ org.apache.flex.core.graphics.GradientBase.prototype.set_rotation = function(val
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientBase.prototype._x = 0;
@@ -132,7 +130,6 @@ org.apache.flex.core.graphics.GradientBase.prototype.set_x = function(value) {
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientBase.prototype._y = 0;
@@ -158,9 +155,9 @@ org.apache.flex.core.graphics.GradientBase.prototype.get_y = function() {
 
 /**
  * @expose
- * @return {string} A new gradient id value
+ * @return {string} A new gradient id value.
  */
-org.apache.flex.core.graphics.GradientBase.prototype.get_newId = function(value) {
+org.apache.flex.core.graphics.GradientBase.prototype.get_newId = function() {
   return String(Math.floor((Math.random() * 100000) + 1));
 };
 
@@ -170,4 +167,6 @@ org.apache.flex.core.graphics.GradientBase.prototype.get_newId = function(value)
  *
  * @type {Object.<string, Array.<Object>>}
  */
-org.apache.flex.core.graphics.GradientBase.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'GradientBase', qName: 'org.apache.flex.core.graphics.GradientBase'}] };
+org.apache.flex.core.graphics.GradientBase.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'GradientBase', qName: 'org.apache.flex.core.graphics.GradientBase'}]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientEntry.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientEntry.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientEntry.js
index 8fc7b58..68cd762 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientEntry.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GradientEntry.js
@@ -23,6 +23,7 @@
 goog.provide('org.apache.flex.core.graphics.GradientEntry');
 
 
+
 /**
  * @constructor
  * @param {number} alpha
@@ -37,21 +38,18 @@ org.apache.flex.core.graphics.GradientEntry = function(alpha, color, ratio) {
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientEntry.prototype._alpha = 1.0;
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientEntry.prototype._color = 0x000000;
 
 
 /**
- * @private
  * @type {number}
  */
 org.apache.flex.core.graphics.GradientEntry.prototype._ratio = 0x000000;
@@ -140,4 +138,6 @@ org.apache.flex.core.graphics.GradientEntry.prototype.end = function(s) {
  *
  * @type {Object.<string, Array.<Object>>}
  */
-org.apache.flex.core.graphics.GradientEntry.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'GradientEntry', qName: 'org.apache.flex.core.graphics.GradientEntry'}] };
+org.apache.flex.core.graphics.GradientEntry.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'GradientEntry', qName: 'org.apache.flex.core.graphics.GradientEntry'}]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
index 2fd902a..11e831b 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
@@ -117,7 +117,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.set_stroke = function(value
 
 
 /**
- * 
+ *
  */
 org.apache.flex.core.graphics.GraphicShape.prototype.addedToParent = function() {
   var bbox = this.element.getBBox();
@@ -164,7 +164,8 @@ org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() {
 org.apache.flex.core.graphics.GraphicShape.prototype.resize = function(x, y, bbox) {
   this.element.setAttribute('width', String(bbox.width + bbox.x + this.xOffset_) + 'px');
   this.element.setAttribute('height', String(bbox.height + bbox.y + this.yOffset_) + 'px');
-  this.element.setAttribute('style', 'overflow:visible; position:absolute; left:' + String(x) + 'px; top:' + String(y) + 'px');
+  this.element.setAttribute('style', 'overflow:visible; position:absolute; left:' +
+      String(x) + 'px; top:' + String(y) + 'px');
 };
 
 

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/LinearGradient.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/LinearGradient.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/LinearGradient.js
index 1ef3e71..a8b2a45 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/LinearGradient.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/LinearGradient.js
@@ -23,6 +23,8 @@
 goog.provide('org.apache.flex.core.graphics.LinearGradient');
 goog.require('org.apache.flex.core.graphics.GradientBase');
 
+
+
 /**
  * @constructor
  * @extends {org.apache.flex.core.graphics.GradientBase}
@@ -35,10 +37,9 @@ goog.inherits(org.apache.flex.core.graphics.LinearGradient, org.apache.flex.core
 
 
 /**
- * @private
  * @type {number}
  */
-org.apache.flex.core.graphics.LinearGradient.prototype._scaleX;
+org.apache.flex.core.graphics.LinearGradient.prototype._scaleX = 1.0;
 
 
 /**
@@ -69,48 +70,48 @@ org.apache.flex.core.graphics.LinearGradient.prototype.set_scaleX = function(val
 org.apache.flex.core.graphics.LinearGradient.prototype.addFillAttrib = function(value) {
   //Create and add a linear gradient def
   var svgNS = value.element.namespaceURI;
-  var grad  = document.createElementNS(svgNS,'linearGradient');
+  var grad = document.createElementNS(svgNS, 'linearGradient');
   var gradientId = this.get_newId();
-  grad.setAttribute('id',gradientId);
+  grad.setAttribute('id', gradientId);
 
   //Set x1, y1, x2, y2 of gradient
-  grad.setAttribute('x1','0%');
-  grad.setAttribute('y1','0%');
-  grad.setAttribute('x2','100%');
-  grad.setAttribute('y2','0%');
+  grad.setAttribute('x1', '0%');
+  grad.setAttribute('y1', '0%');
+  grad.setAttribute('x2', '100%');
+  grad.setAttribute('y2', '0%');
 
   //Apply rotation to the gradient if get_rotatation() is a number
-  if (this.get_rotation() )
+  if (this.get_rotation())
   {
-    grad.setAttribute('gradientTransform', 'rotate(' + this.get_rotation() +  ' 0.5 0.5)');
+    grad.setAttribute('gradientTransform', 'rotate(' + this.get_rotation() + ' 0.5 0.5)');
   }
 
-  //Process gradient entries and create a stop for each entry  
+  //Process gradient entries and create a stop for each entry
   var entries = this.get_entries();
-  for (var i=0;i<entries.length;i++)
+  for (var i = 0; i < entries.length; i++)
   {
     var gradientEntry = entries[i];
-    var stop = document.createElementNS(svgNS,'stop');
-	//Set Offset
-	stop.setAttribute('offset', String(gradientEntry.get_ratio() * 100) + '%');
-	//Set Color
-	var color = Number(gradientEntry.get_color()).toString(16);
-	if (color.length == 1) color = '00' + color;
-	if (color.length == 2) color = '00' + color;
-	if (color.length == 4) color = '00' + color;
-	stop.setAttribute('stop-color', '#' + String(color));
-	//Set Alpha
-	stop.setAttribute('stop-opacity', String(gradientEntry.get_alpha()));
-	
+    var stop = document.createElementNS(svgNS, 'stop');
+    //Set Offset
+    stop.setAttribute('offset', String(gradientEntry.get_ratio() * 100) + '%');
+    //Set Color
+    var color = Number(gradientEntry.get_color()).toString(16);
+    if (color.length == 1) color = '00' + color;
+    if (color.length == 2) color = '00' + color;
+    if (color.length == 4) color = '00' + color;
+    stop.setAttribute('stop-color', '#' + String(color));
+    //Set Alpha
+    stop.setAttribute('stop-opacity', String(gradientEntry.get_alpha()));
+
     grad.appendChild(stop);
   }
-  
+
   //Add defs element if not available already
   //Add newly created gradient to defs element
   var defs = value.element.querySelector('defs') ||
-      value.element.insertBefore( document.createElementNS(svgNS,'defs'), value.element.firstChild);
+      value.element.insertBefore(document.createElementNS(svgNS, 'defs'), value.element.firstChild);
   defs.appendChild(grad);
-  
+
   //Return the fill attribute
   return 'fill:url(#' + gradientId + ')';
 };
@@ -121,4 +122,7 @@ org.apache.flex.core.graphics.LinearGradient.prototype.addFillAttrib = function(
  *
  * @type {Object.<string, Array.<Object>>}
  */
-org.apache.flex.core.graphics.LinearGradient.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'LinearGradient', qName: 'org.apache.flex.core.graphics.LinearGradient'}], interfaces: [org.apache.flex.core.graphics.IFill] };
+org.apache.flex.core.graphics.LinearGradient.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'LinearGradient', qName: 'org.apache.flex.core.graphics.LinearGradient'}],
+    interfaces: [org.apache.flex.core.graphics.IFill]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
index 20516b0..31a5045 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
@@ -45,7 +45,8 @@ org.apache.flex.core.graphics.SolidColor = function() {
  */
 org.apache.flex.core.graphics.SolidColor.prototype.FLEXJS_CLASS_INFO =
     { names: [{ name: 'SolidColor',
-                qName: 'org.apache.flex.core.graphics.SolidColor' }], interfaces: [org.apache.flex.core.graphics.IFill] };
+                qName: 'org.apache.flex.core.graphics.SolidColor' }],
+                interfaces: [org.apache.flex.core.graphics.IFill] };
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js b/frameworks/js/FlexJS/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
index 531cbfd..abfada9 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/beads/layouts/ButtonBarLayout.js
@@ -118,7 +118,7 @@ org.apache.flex.html.beads.layouts.ButtonBarLayout.
     ir.element.style['text-align'] = 'center';
     ir.element.style['left-margin'] = 'auto';
     ir.element.style['right-margin'] = 'auto';
-  
+
     ir.set_height(useHeight);
     if (this.buttonWidths_ && !isNaN(this.buttonWidths_[i])) ir.set_width(this.buttonWidths_[i]);
     else ir.set_width(useWidth);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f1e401b9/frameworks/js/FlexJS/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.js
index 48762b4..a40948b 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/supportClasses/ButtonBarButtonItemRenderer.js
@@ -109,6 +109,6 @@ org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer.
     this.button.innerHTML = value.title;
   }
   else {
-    this.button.innerHTML = value
+    this.button.innerHTML = value;
   }
 };