Move paper.populate() functionality back to build.js.

This commit is contained in:
Jürg Lehni 2011-03-03 17:11:14 +00:00
parent 9a9cb91f72
commit fe1a01ecb6
2 changed files with 9 additions and 14 deletions

View file

@ -39,6 +39,14 @@ var paper = new function() {
#include "util/CanvasProvider.js"
#include "util/MathUtils.js"
return paper.populate();
// Inject all prototypes from the paper scope into the paper object.
return Base.each(['Point', 'Size', 'Rectangle', 'Matrix', 'DocumentView', 'Doc',
'Symbol', 'Item', 'Group', 'Layer', 'Raster', 'PlacedSymbol', 'PathStyle',
'Segment', 'Curve', 'PathItem', 'Path', 'CompoundPath', 'Color', 'RGBColor',
'GrayColor', 'GradientColor', 'Gradient', 'GradientStop', 'ToolEvent',
'ToolHandler', 'Tool'],
function(name) {
this[name] = eval(name);
}, paper);
};

View file

@ -2,19 +2,6 @@ var paper = {
document: null,
documents: [],
populate: function() {
// Inject all prototypes from the paper scope into the paper object.
// return this so build.js can use 'return paper.populate()'.
return Base.each(['Point', 'Size', 'Rectangle', 'Matrix', 'DocumentView',
'Doc', 'Symbol', 'Item', 'Group', 'Layer', 'Raster', 'PlacedSymbol',
'PathStyle', 'Segment', 'Curve', 'PathItem', 'Path', 'CompoundPath',
'Color', 'RGBColor', 'GrayColor', 'GradientColor', 'Gradient',
'GradientStop', 'ToolEvent', 'ToolHandler', 'Tool'],
function(name) {
this[name] = eval(name);
}, this);
},
install: function(scope) {
for (var i in paper) {
if (!scope[i])