Fix a row of documentation issues.

This commit is contained in:
Jürg Lehni 2012-11-06 13:34:46 -08:00
parent 71ed477bc4
commit 4e1db6a1d1
6 changed files with 25 additions and 15 deletions

View file

@ -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

View file

@ -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

View file

@ -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.
*

View file

@ -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.

View file

@ -16,7 +16,7 @@
/**
* @name CanvasView
*
* @class
* @private
*/
var CanvasView = View.extend(/** @lends CanvasView# */{

View file

@ -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);
};