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/15 19:43:57 UTC

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

Repository: flex-asjs
Updated Branches:
  refs/heads/develop bb9cbd0d9 -> c417a8756


Addressed issues found 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/c417a875
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c417a875
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c417a875

Branch: refs/heads/develop
Commit: c417a8756859b9320b0235ec403df2afa37a4211
Parents: bb9cbd0
Author: Peter Ent <pe...@apache.org>
Authored: Mon Sep 15 13:43:53 2014 -0400
Committer: Peter Ent <pe...@apache.org>
Committed: Mon Sep 15 13:43:53 2014 -0400

----------------------------------------------------------------------
 .../org/apache/flex/charts/core/ChartBase.js    |  4 +--
 .../apache/flex/core/graphics/GraphicShape.js   | 27 ++++++++++++++------
 .../flex/core/graphics/GraphicsContainer.js     | 14 +++++-----
 .../src/org/apache/flex/core/graphics/IFill.js  |  4 ++-
 .../org/apache/flex/core/graphics/IStroke.js    |  4 ++-
 .../src/org/apache/flex/core/graphics/Line.js   | 20 ++++++++-------
 .../org/apache/flex/core/graphics/SolidColor.js |  2 ++
 .../flex/core/graphics/SolidColorStroke.js      |  9 ++++---
 8 files changed, 53 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/charts/core/ChartBase.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/charts/core/ChartBase.js b/frameworks/js/FlexJS/src/org/apache/flex/charts/core/ChartBase.js
index 504f349..1845da3 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/charts/core/ChartBase.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/charts/core/ChartBase.js
@@ -49,7 +49,7 @@ goog.inherits(
 org.apache.flex.charts.core.ChartBase.prototype.FLEXJS_CLASS_INFO = {
     names: [{ name: 'ChartBase', qName: 'org.apache.flex.charts.core.ChartBase'}]
   };
-  
+
 
 /**
  * @override
@@ -58,7 +58,7 @@ org.apache.flex.charts.core.ChartBase.prototype.createElement = function() {
     org.apache.flex.charts.core.ChartBase.base(this, 'createElement');
     this.element.style.border = 'none';
     this.element.style.overflow = 'visible';
-};
+  };
 
 
 /**

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/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 1642051..4b44a9c 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
@@ -19,6 +19,7 @@ goog.require('org.apache.flex.core.graphics.SolidColor');
 goog.require('org.apache.flex.core.graphics.SolidColorStroke');
 
 
+
 /**
  * @constructor
  */
@@ -53,22 +54,23 @@ org.apache.flex.core.graphics.GraphicShape = function() {
    * @type {number}
    */
   this.xOffset_ = 0;
-  
+
   /**
    * @private
    * @type {number}
    */
   this.yOffset_ = 0;
-  
+
     /**
    * @expose
    * @type {SVGElement}
    */
-  this.element = document.createElementNS("http://www.w3.org/2000/svg","svg");
+  this.element = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
 
 
 };
 
+
 /**
  * Metadata
  *
@@ -87,6 +89,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.get_fill = function() {
   return this.fill_;
 };
 
+
 /**
  * @param {org.apache.flex.core.graphics.SolidColor} value The fill object.
  */
@@ -94,6 +97,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.set_fill = function(value)
   this.fill_ = value;
 };
 
+
 /**
  * @expose
  * @return {org.apache.flex.core.graphics.SolidColorStroke} The stroke object.
@@ -102,6 +106,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.get_stroke = function() {
   return this.stroke_;
 };
 
+
 /**
  * @expose
  * @param {org.apache.flex.core.graphics.SolidColorStroke} value The stroke object.
@@ -110,6 +115,10 @@ org.apache.flex.core.graphics.GraphicShape.prototype.set_stroke = function(value
   this.stroke_ = value;
 };
 
+
+/**
+ * @override
+ */
 org.apache.flex.core.graphics.GraphicShape.prototype.addedToParent = function() {
   var bbox = this.element.getBBox();
   this.resize(this.x_, this.y_, bbox);
@@ -122,9 +131,9 @@ org.apache.flex.core.graphics.GraphicShape.prototype.addedToParent = function()
  */
 org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() {
   var fillStr;
-  if(this.get_fill())
+  if (this.get_fill())
   {
-	fillStr = this.get_fill().addFillAttrib(this);
+    fillStr = this.get_fill().addFillAttrib(this);
   }
   else
   {
@@ -132,7 +141,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() {
   }
 
   var strokeStr;
-  if(this.get_stroke())
+  if (this.get_stroke())
   {
     strokeStr = this.get_stroke().addStrokeAttrib(this);
   }
@@ -140,11 +149,12 @@ org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() {
   {
     strokeStr = 'stroke:none';
   }
-  
 
-  return fillStr + ';' + strokeStr ;
+
+  return fillStr + ';' + strokeStr;
 };
 
+
 /**
  * @expose
  * @param {number} x X position.
@@ -157,6 +167,7 @@ org.apache.flex.core.graphics.GraphicShape.prototype.resize = function(x, y, bbo
   this.element.setAttribute('style', 'overflow:visible; position:absolute; left:' + String(x) + 'px; top:' + String(y));
 };
 
+
 /**
  * @expose
  * @param {number} x X position.

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicsContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicsContainer.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicsContainer.js
index 80ae364..9af3541 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicsContainer.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicsContainer.js
@@ -11,11 +11,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 goog.provide('org.apache.flex.core.graphics.GraphicsContainer');
 
 goog.require('org.apache.flex.core.graphics.GraphicShape');
 
+
+
 /**
  * @constructor
  * @extends {org.apache.flex.core.graphics.GraphicShape}
@@ -31,9 +33,9 @@ goog.inherits(org.apache.flex.core.graphics.GraphicsContainer, org.apache.flex.c
  *
  * @type {Object.<string, Array.<Object>>}
  */
-org.apache.flex.core.graphics.GraphicsContainer.prototype.FLEXJS_CLASS_INFO = 
-    { names: [{ name: 'GraphicsContainer', 
-	            qName: 'org.apache.flex.core.graphics.GraphicsContainer'}] };
+org.apache.flex.core.graphics.GraphicsContainer.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'GraphicsContainer',
+      qName: 'org.apache.flex.core.graphics.GraphicsContainer'}] };
 
 
 /**
@@ -66,8 +68,8 @@ org.apache.flex.core.graphics.GraphicsContainer.prototype.drawEllipse = function
   var style = this.getStyleStr();
   var ellipse = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
   ellipse.setAttribute('style', style);
-  ellipse.setAttribute('cx', String(x + width/2));
-  ellipse.setAttribute('cy', String(y + height/2));
+  ellipse.setAttribute('cx', String(x + width / 2));
+  ellipse.setAttribute('cy', String(y + height / 2));
   ellipse.setAttribute('rx', String(width / 2));
   ellipse.setAttribute('ry', String(height / 2));
   this.element.appendChild(ellipse);

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IFill.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IFill.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IFill.js
index ee21ccb..e4c9f9f 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IFill.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IFill.js
@@ -19,6 +19,8 @@
 
 goog.provide('org.apache.flex.core.graphics.IFill');
 
+
+
 /**
  * IFill
  *
@@ -43,7 +45,7 @@ org.apache.flex.core.graphics.IFill.prototype.FLEXJS_CLASS_INFO =
  *
  * @expose
  * @param {org.apache.flex.core.graphics.GraphicShape} value The GraphicShape object on which the fill must be added.
- * @return {string} The fill style attribute 
+ * @return {string} The fill style attribute.
  */
 org.apache.flex.core.graphics.IFill.prototype.addFillAttrib =
     function(value) {};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IStroke.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IStroke.js
index 08ec3ee..52acfb1 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IStroke.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/IStroke.js
@@ -19,6 +19,8 @@
 
 goog.provide('org.apache.flex.core.graphics.IStroke');
 
+
+
 /**
  * IStroke
  *
@@ -43,7 +45,7 @@ org.apache.flex.core.graphics.IStroke.prototype.FLEXJS_CLASS_INFO =
  *
  * @expose
  * @param {org.apache.flex.core.graphics.GraphicShape} value The GraphicShape object on which the stroke must be added.
- * @return {string} The stroke style attribute
+ * @return {string} The stroke style attribute.
  */
 org.apache.flex.core.graphics.IStroke.prototype.addStrokeAttrib =
     function(value) {};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Line.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Line.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Line.js
index c223cd5..0a76a95 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Line.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Line.js
@@ -42,23 +42,24 @@ org.apache.flex.core.graphics.Line.prototype.FLEXJS_CLASS_INFO =
 
 /**
  * @expose
- *  @param {number} x1 The x1 attribute defines the start of the line on the x-axis
- *  @param {number} y1 The y1 attribute defines the start of the line on the y-axis
- *  @param {number} x2 The x2 attribute defines the end of the line on the x-axis
- *  @param {number} y2 The y2 attribute defines the end of the line on the y-axis
+ *  @param {number} x1 The x1 attribute defines the start of the line on the x-axis.
+ *  @param {number} y1 The y1 attribute defines the start of the line on the y-axis.
+ *  @param {number} x2 The x2 attribute defines the end of the line on the x-axis.
+ *  @param {number} y2 The y2 attribute defines the end of the line on the y-axis.
  */
 org.apache.flex.core.graphics.Line.prototype.drawLine = function(x1, y1, x2, y2) {
     var style = this.getStyleStr();
     var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
     line.setAttribute('style', style);
     line.setAttribute('x1', 0);
-	line.setAttribute('y1', y1);
-	line.setAttribute('x2', x2-x1);
-	line.setAttribute('y2', y2);
-	this.setPosition(x1,y2,this.get_stroke().get_weight(),this.get_stroke().get_weight());
+    line.setAttribute('y1', y1);
+    line.setAttribute('x2', x2 - x1);
+    line.setAttribute('y2', y2);
+    this.setPosition(x1, y2, this.get_stroke().get_weight(), this.get_stroke().get_weight());
     this.element.appendChild(line);
   };
 
+
 /**
  * @override
  * @expose
@@ -70,5 +71,6 @@ org.apache.flex.core.graphics.Line.prototype.resize = function(x, y, bbox) {
   this.element.setAttribute('width', String(bbox.width) + 'px');
   this.element.setAttribute('height', String(bbox.height) + 'px');
 
-  this.element.setAttribute('style', 'position:absolute; left:' + String(x + bbox.x - this.xOffset_) + 'px; top:' + String(bbox.y - this.yOffset_) + 'px;');
+  this.element.setAttribute('style', 'position:absolute; left:' + String(x + bbox.x - this.xOffset_) +
+      'px; top:' + String(bbox.y - this.yOffset_) + 'px;');
 };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/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 1013952..ca11b93 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
@@ -16,6 +16,7 @@ goog.provide('org.apache.flex.core.graphics.SolidColor');
 goog.require('org.apache.flex.core.graphics.IFill');
 
 
+
 /**
  * @constructor
  * @implements {org.apache.flex.core.graphics.IFill}
@@ -80,6 +81,7 @@ org.apache.flex.core.graphics.SolidColor.prototype.set_alpha = function(value) {
   this.alpha_ = value;
 };
 
+
 /**
  * addFillAttrib()
  *

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c417a875/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
index 7fa495d..5b40304 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
@@ -20,7 +20,7 @@ goog.require('org.apache.flex.core.graphics.IStroke');
 /**
  * @constructor
  * @implements {org.apache.flex.core.graphics.IStroke}
- 
+ *
  */
 org.apache.flex.core.graphics.SolidColorStroke = function() {
 
@@ -105,6 +105,7 @@ org.apache.flex.core.graphics.SolidColorStroke.prototype.set_weight = function(v
   this.weight_ = value;
 };
 
+
 /**
  * addStrokeAttrib()
  *
@@ -117,6 +118,6 @@ org.apache.flex.core.graphics.SolidColorStroke.prototype.addStrokeAttrib = funct
     if (strokeColor.length == 1) strokeColor = '00' + strokeColor;
     if (strokeColor.length == 2) strokeColor = '00' + strokeColor;
     if (strokeColor.length == 4) strokeColor = '00' + strokeColor;
-	return 'stroke:#' + String(strokeColor) + ';stroke-width:' +
-         String(this.get_weight()) + ';stroke-opacity:' + String(this.get_alpha())
-};
+    return 'stroke:#' + String(strokeColor) + ';stroke-width:' +
+         String(this.get_weight()) + ';stroke-opacity:' + String(this.get_alpha());
+  };