Merge paper.js and build.js, to make sure the global paper object exists also when including seperate files during development and when running tests.

This commit is contained in:
Jürg Lehni 2011-03-04 16:52:17 +00:00
parent 92bf51a7cc
commit 66f5fcc847
3 changed files with 50 additions and 51 deletions

View file

@ -20,5 +20,5 @@ then
mkdir ../out/
fi
./preprocess.sh ../src/build.js ../out/paper-browser.js "-DBROWSER" $MODE
./preprocess.sh ../src/build.js ../out/paper.js "" $MODE
./preprocess.sh ../src/paper.js ../out/paper-browser.js "-DBROWSER" $MODE
./preprocess.sh ../src/paper.js ../out/paper.js "" $MODE

View file

@ -1,43 +0,0 @@
var paper = new function() {
//#include "paper.js"
//#include "basic/Point.js"
//#include "basic/Size.js"
//#include "basic/Rectangle.js"
//#include "basic/Matrix.js"
//#include "document/DocumentView.js"
//#include "document/Document.js"
//#include "document/Symbol.js"
//#include "item/Item.js"
//#include "item/Group.js"
//#include "item/Layer.js"
//#include "item/Raster.js"
//#include "item/PlacedSymbol.js"
//#include "item/PathStyle.js"
//#include "path/Segment.js"
//#include "path/Curve.js"
//#include "path/PathItem.js"
//#include "path/Path.js"
//#include "path/CompoundPath.js"
//#include "path/Path.Constructors.js"
//#include "color/Color.js"
//#include "color/RGBColor.js"
//#include "color/GrayColor.js"
//#include "color/GradientColor.js"
//#include "color/Gradient.js"
//#include "color/GradientStop.js"
//#include "tool/ToolEvent.js"
//#include "tool/ToolHandler.js"
//#include "tool/Tool.js"
//#include "util/CanvasProvider.js"
//#include "util/MathUtils.js"
//#include "util/PaperScript.js"
};

View file

@ -1,8 +1,50 @@
this.document = null;
this.documents = [];
var paper = new function() {
this.document = null;
this.documents = [];
this.install = function(scope) {
for (var i in this) {
scope[i] = this[i];
}
};
//#include "basic/Point.js"
//#include "basic/Size.js"
//#include "basic/Rectangle.js"
//#include "basic/Matrix.js"
//#include "document/DocumentView.js"
//#include "document/Document.js"
//#include "document/Symbol.js"
//#include "item/Item.js"
//#include "item/Group.js"
//#include "item/Layer.js"
//#include "item/Raster.js"
//#include "item/PlacedSymbol.js"
//#include "item/PathStyle.js"
//#include "path/Segment.js"
//#include "path/Curve.js"
//#include "path/PathItem.js"
//#include "path/Path.js"
//#include "path/CompoundPath.js"
//#include "path/Path.Constructors.js"
//#include "color/Color.js"
//#include "color/RGBColor.js"
//#include "color/GrayColor.js"
//#include "color/GradientColor.js"
//#include "color/Gradient.js"
//#include "color/GradientStop.js"
//#include "tool/ToolEvent.js"
//#include "tool/ToolHandler.js"
//#include "tool/Tool.js"
//#include "util/CanvasProvider.js"
//#include "util/MathUtils.js"
//#include "util/PaperScript.js"
this.install = function(scope) {
for (var i in this) {
scope[i] = this[i];
}
};