From 4e1db6a1d1770cc752cac4342c17542e5127d999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Tue, 6 Nov 2012 13:34:46 -0800 Subject: [PATCH] Fix a row of documentation issues. --- build/docs.sh | 3 +-- src/core/Callback.js | 4 ++++ src/svg/SvgExport.js | 8 ++++++-- src/svg/SvgImport.js | 4 ++-- src/ui/CanvasView.js | 2 +- src/util/ProxyContext.js | 19 +++++++++++-------- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/build/docs.sh b/build/docs.sh index b55606a0..4eaa387b 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -33,6 +33,5 @@ cd .. if [ $MODE = "docs" ] then # Build paper.js library for documentation - ./preprocess.sh stripped ../src/paper.js ../dist/docs/resources/js/paper.js\ - '{ "browser": true }' + ./preprocess.sh stripped ../src/paper.js '{ "browser": true }' ../src/constants.js ../dist/docs/resources/js/paper.js fi diff --git a/src/core/Callback.js b/src/core/Callback.js index 51307121..b125ebb7 100644 --- a/src/core/Callback.js +++ b/src/core/Callback.js @@ -14,6 +14,10 @@ * All rights reserved. */ +/** + * @name Callback + * @namespace + */ var Callback = { attach: function(type, func) { // If an object literal is passed, attach all callbacks defined in it diff --git a/src/svg/SvgExport.js b/src/svg/SvgExport.js index 0e0fa86e..f95b90c8 100644 --- a/src/svg/SvgExport.js +++ b/src/svg/SvgExport.js @@ -362,8 +362,10 @@ new function() { return setAttributes(svg, attrs); } - Item.inject(/** @Lends Item# */{ + Item.inject(/** @lends Item# */{ /** + * {@grouptitle SVG Conversion} + * * Exports the item and all its child items as an SVG DOM, all contained * in one top level SVG group node. * @@ -376,8 +378,10 @@ new function() { } }); - Project.inject(/** @Lends Project# */{ + Project.inject(/** @lends Project# */{ /** + * {@grouptitle SVG Conversion} + * * Exports the project and all its layers and child items as an SVG DOM, * all contained in one top level SVG group node. * diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 39a6076a..ec6a06ef 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -421,7 +421,7 @@ new function() { } - Item.inject(/** @Lends Item# */{ + Item.inject(/** @lends Item# */{ /** * Converts the passed svg node into a Paper.js item and adds it to the * children of this item. @@ -434,7 +434,7 @@ new function() { } }); - Project.inject(/** @Lends Project# */{ + Project.inject(/** @lends Project# */{ /** * Converts the passed svg node into a Paper.js item and adds it to the * active layer of this project. diff --git a/src/ui/CanvasView.js b/src/ui/CanvasView.js index f56ba49e..d136c340 100644 --- a/src/ui/CanvasView.js +++ b/src/ui/CanvasView.js @@ -16,7 +16,7 @@ /** * @name CanvasView - * + * @class * @private */ var CanvasView = View.extend(/** @lends CanvasView# */{ diff --git a/src/util/ProxyContext.js b/src/util/ProxyContext.js index 343445bf..24d6887d 100644 --- a/src/util/ProxyContext.js +++ b/src/util/ProxyContext.js @@ -20,6 +20,8 @@ * @class The ProxyContext is a helper class that helps Canvas debugging * by logging all interactions with a 2D Canvas context. * + * @private + * * @classexample * view._context = new ProxyContext(view._context); */ @@ -46,11 +48,12 @@ var ProxyContext = new function() { 'createImageData(imagedata)', 'getImageData(sx,sy,sw,sh)', 'putImageData(imagedata,dx,dy,dirtyX,dirtyY,dirtyWidth,dirtyHeight)' ]; - var param = { + var fields = /** @lends ProxyContext# */ { initialize: function(context) { this._ctx = context; this._indents = 0; }, + getIndentation: function() { var str = ''; for (var i = 0; i < this._indents; i++) { @@ -60,11 +63,11 @@ var ProxyContext = new function() { } }; Base.each(descriptions, function(description) { - var matches = description.match(/^([^(]+)(\()*/), - name = matches[1], - isFunction = !!matches[2]; + var match = description.match(/^([^(]+)(\()*/), + name = match[1], + isFunction = !!match[2]; if (isFunction) { - param[name] = function() { + fields[name] = function() { if (name == 'restore') { this._indents--; } @@ -78,16 +81,16 @@ var ProxyContext = new function() { }; } else { var capitalized = Base.capitalize(name); - param['set' + capitalized] = function(value) { + fields['set' + capitalized] = function(value) { var logValue = value && value.substring ? '\'' + value + '\'' : value, string = 'ctx.' + name + ' = ' + logValue + ';'; console.log(this.getIndentation() + string); return this._ctx[name] = value; }; - param['get' + capitalized] = function() { + fields['get' + capitalized] = function() { return this._ctx[name]; }; } }); - return Base.extend(param); + return Base.extend(fields); };