From a30d6730fe0e06b59bb69ed2af7a223c07246385 Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Sun, 11 Nov 2012 17:08:16 -0800 Subject: [PATCH] documented Filters namespace, filters, and Transform class, and cleaned up jsdoc warnings --- src/Global.js | 6 ++++++ src/Node.js | 8 +------- src/filters/Brighten.js | 5 +++-- src/filters/Grayscale.js | 6 ++++-- src/filters/Invert.js | 6 ++++-- src/shapes/Polygon.js | 2 +- src/util/Transform.js | 4 ++++ src/util/Type.js | 2 ++ 8 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/Global.js b/src/Global.js index 2c081a45..2bf51747 100644 --- a/src/Global.js +++ b/src/Global.js @@ -25,7 +25,13 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ +/** + * @namespace + */ var Kinetic = {}; +/** + * @namespace + */ Kinetic.Filters = {}; Kinetic.Plugins = {}; Kinetic.Global = { diff --git a/src/Node.js b/src/Node.js index f986c9c1..99ba47f9 100644 --- a/src/Node.js +++ b/src/Node.js @@ -245,7 +245,7 @@ Kinetic.Node.prototype = { * determine if node is listening or not. Node is listening only * if it's listening and all of its ancestors are listening. If an ancestor * is not listening, this means that the node is also not listening - * @name getVisible + * @name getListening * @methodOf Kinetic.Node.prototype */ getListening: function() { @@ -1166,10 +1166,4 @@ Kinetic.Node.prototype.isVisible = Kinetic.Node.prototype.getVisible; * get offset * @name getOffset * @methodOf Kinetic.Node.prototype - */ - -/** - * determine if listening to events or not - * @name getListening - * @methodOf Kinetic.Node.prototype */ \ No newline at end of file diff --git a/src/filters/Brighten.js b/src/filters/Brighten.js index 86a1c4d1..ad9d7615 100644 --- a/src/filters/Brighten.js +++ b/src/filters/Brighten.js @@ -1,7 +1,8 @@ /** * Brighten Filter - * @function Brighten - * @methodOf Kinetic.Filters + * @function + * @memberOf Kinetic.Filters + * @param {Object} imageData * @param {Object} config * @param {Integer} config.val brightness number from -255 to 255.  Positive values increase the brightness and negative values decrease the brightness, making the image darker */ diff --git a/src/filters/Grayscale.js b/src/filters/Grayscale.js index c153ff33..32b14d41 100644 --- a/src/filters/Grayscale.js +++ b/src/filters/Grayscale.js @@ -1,7 +1,9 @@ /** * Grayscale Filter - * @function Grayscale - * @methodOf Kinetic.Filters + * @function + * @memberOf Kinetic.Filters + * @param {Object} imageData + * @param {Object} config */ Kinetic.Filters.Grayscale = function(imageData, config) { var data = imageData.data; diff --git a/src/filters/Invert.js b/src/filters/Invert.js index cfb4c4df..ee9c65a7 100644 --- a/src/filters/Invert.js +++ b/src/filters/Invert.js @@ -1,7 +1,9 @@ /** * Invert Filter - * @function Invert - * @methodOf Kinetic.Filters + * @function + * @memberOf Kinetic.Filters + * @param {Object} imageData + * @param {Object} config */ Kinetic.Filters.Invert = function(imageData, config) { var data = imageData.data; diff --git a/src/shapes/Polygon.js b/src/shapes/Polygon.js index 5bdd171f..2f5ffdbe 100644 --- a/src/shapes/Polygon.js +++ b/src/shapes/Polygon.js @@ -35,7 +35,7 @@ Kinetic.Polygon.prototype = { /** * set points array * @name setPoints - * @methodOf Kinetic.Line.prototype + * @methodOf Kinetic.Polygon.prototype * @param {Array} can be an array of point objects or an array * of Numbers. e.g. [{x:1,y:2},{x:3,y:4}] or [1,2,3,4] */ diff --git a/src/util/Transform.js b/src/util/Transform.js index fc3bee75..86690f4a 100644 --- a/src/util/Transform.js +++ b/src/util/Transform.js @@ -14,6 +14,10 @@ * class. */ +/** + * Transform constructor + * @constructor + */ Kinetic.Transform = function() { this.m = [1, 0, 0, 1, 0, 0]; } diff --git a/src/util/Type.js b/src/util/Type.js index 0147301f..2fc89440 100644 --- a/src/util/Type.js +++ b/src/util/Type.js @@ -222,6 +222,7 @@ Kinetic.Type = { // if arg is a string, then it's a data url else if(this._isString(arg)) { var imageObj = new Image(); + /** @ignore */ imageObj.onload = function() { callback(imageObj); } @@ -237,6 +238,7 @@ Kinetic.Type = { context.putImageData(arg, 0, 0); var dataUrl = canvas.toDataURL(); var imageObj = new Image(); + /** @ignore */ imageObj.onload = function() { callback(imageObj); }