From 86b1d8263660e5a2270d97ff3c60162a49710cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 13 Jul 2011 13:27:14 +0100 Subject: [PATCH 1/2] Add VERSION and DATE to headers and support for it in build scripts. --- build/build.sh | 7 +++++-- build/preprocess.sh | 21 +++++++++++---------- src/core/PaperScope.js | 2 +- src/load.js | 3 +++ src/paper.js | 14 +++++++------- 5 files changed, 27 insertions(+), 20 deletions(-) diff --git a/build/build.sh b/build/build.sh index 101f3195..7cb5a831 100755 --- a/build/build.sh +++ b/build/build.sh @@ -22,6 +22,9 @@ # compressed No comments and no whitespaces # uglified Uses UglifyJS to further reduce file size +VERSION=0.2 +DATE=$(git log -1 --pretty=format:%ad) + if [ $# -eq 0 ] then MODE="stripped" @@ -35,5 +38,5 @@ then mkdir ../dist/ fi -./preprocess.sh ../src/paper.js ../dist/paper.js "-DBROWSER" $MODE -./preprocess.sh ../src/paper.js ../dist/paper-server.js "-DSERVER" $MODE +./preprocess.sh $MODE ../src/paper.js ../dist/paper.js "-DBROWSER -DVERSION=$VERSION -DDATE='$DATE'" +#./preprocess.sh $MODE ../src/paper.js ../dist/paper-server.js "-DSERVER" diff --git a/build/preprocess.sh b/build/preprocess.sh index ed4ba825..d6669022 100755 --- a/build/preprocess.sh +++ b/build/preprocess.sh @@ -21,36 +21,37 @@ # are preserved or stripped and whitespaces are compressed. # # Usage: -# preprocess.sh SOURCE DESTINATION ARGUMENTS MODE +# preprocess.sh MODE SOURCE DESTINATION ARGUMENTS # # ARGUMENTS: # e.g. "-DBROWSER" # # MODE: -# commented Preprocessed but still formated and commented (default) +# commented Preprocessed but still formated and commented # stripped Formated but without comments # compressed No comments and no whitespaces # uglified Uses UglifyJS to further reduce file size KEYWORD="//#" +COMMAND="./filepp.pl -kc $KEYWORD $4 $2" -case $4 in +case $1 in stripped) - ./filepp.pl -kc $KEYWORD $3 $1 | ./jsstrip.pl -w -q | sed -n '/^[ ][ ]*$/d + eval $COMMAND | ./jsstrip.pl -w -q | sed -n '/^[ ][ ]*$/d /./,/^$/!d - p' > $2 + p' > $3 ;; compressed) - ./filepp.pl -kc $KEYWORD $3 $1 | ./jsstrip.pl -q > $2 + eval $COMMAND | ./jsstrip.pl -q > $3 ;; commented) - ./filepp.pl -kc $KEYWORD $3 $1 | sed -n '/^[ ][ ]*$/d + eval $COMMAND | sed -n '/^[ ][ ]*$/d /./,/^$/!d - p' > $2 + p' > $3 ;; uglified) - ./filepp.pl -kc $KEYWORD $3 $1 > temp.js - ../../uglifyjs/bin/uglifyjs temp.js --extra --unsafe --reserved-names "$eval,$sign" > $2 + eval $COMMAND > temp.js + ../../uglifyjs/bin/uglifyjs temp.js --extra --unsafe --reserved-names "$eval,$sign" > $3 rm temp.js ;; esac diff --git a/src/core/PaperScope.js b/src/core/PaperScope.js index 429fb65d..c5a8216c 100644 --- a/src/core/PaperScope.js +++ b/src/core/PaperScope.js @@ -28,7 +28,7 @@ var PaperScope = this.PaperScope = Base.extend(/** @scope _global_ */{ * * @type Number */ - version: 0.2, + version: VERSION, initialize: function(id) { /** @lends _global_# */ diff --git a/src/load.js b/src/load.js index 5f64ace9..40082783 100644 --- a/src/load.js +++ b/src/load.js @@ -19,6 +19,9 @@ // // NOTE: Any files added as includes to paper.js also need to be listed here +// Define VERSION, so PaperScope is not bailing out. +var VERSION = 'dev;' + var sources = [ 'lib/bootstrap.js', 'lib/parse-js.js', diff --git a/src/paper.js b/src/paper.js index e4e5977d..cbfa2d68 100644 --- a/src/paper.js +++ b/src/paper.js @@ -1,9 +1,8 @@ -/*** +/*! + * Paper.js vVERSION * - * Paper.js - * - * A JavaScript Vector Graphics Library, based on Scriptographer.org and - * designed to be largely API compatible. + * This file is part of Paper.js, a JavaScript Vector Graphics Library, + * based on Scriptographer.org and designed to be largely API compatible. * http://paperjs.org/ * http://scriptographer.org/ * @@ -14,6 +13,8 @@ * * All rights reserved. * + * Date: DATE + * *** * * Bootstrap.js JavaScript Framework. @@ -40,8 +41,7 @@ * http://lehni.org/ * * Distributed under the BSD license. - * - ***/ + */ /** * The global PaperScope object From cb3d59effa2774923fdd465cebbbf16f8025d3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 13 Jul 2011 13:30:22 +0100 Subject: [PATCH 2/2] Update dist version to 0.2. --- dist/docs/classes/CharacterStyle.html | 4 +- dist/docs/classes/CompoundPath.html | 125 +- dist/docs/classes/Curve.html | 66 +- dist/docs/classes/CurveLocation.html | 67 +- dist/docs/classes/GradientColor.html | 2 +- dist/docs/classes/GradientStop.html | 2 +- dist/docs/classes/Group.html | 119 +- dist/docs/classes/HSLColor.html | 729 +++++ dist/docs/classes/HitResult.html | 507 ++++ dist/docs/classes/Item.html | 119 +- dist/docs/classes/Layer.html | 121 +- dist/docs/classes/Matrix.html | 120 +- dist/docs/classes/Path.html | 145 +- dist/docs/classes/PathItem.html | 129 +- dist/docs/classes/PathStyle.html | 4 +- dist/docs/classes/PlacedItem.html | 3382 ++++++++++++++++++++++++ dist/docs/classes/PlacedSymbol.html | 164 +- dist/docs/classes/PointText.html | 119 +- dist/docs/classes/Raster.html | 162 +- dist/docs/classes/Rectangle.html | 4 +- dist/docs/classes/TextItem.html | 119 +- dist/docs/classes/ToolEvent.html | 32 + dist/docs/classes/index.html | 1 + dist/docs/resources/css/codemirror.css | 25 +- dist/docs/resources/js/codemirror.js | 2 +- dist/docs/resources/js/paper.js | 1767 ++++++------- dist/paper.js | 1105 ++++---- 27 files changed, 7341 insertions(+), 1800 deletions(-) create mode 100644 dist/docs/classes/HSLColor.html create mode 100644 dist/docs/classes/HitResult.html create mode 100644 dist/docs/classes/PlacedItem.html diff --git a/dist/docs/classes/CharacterStyle.html b/dist/docs/classes/CharacterStyle.html index 0fbfeac1..7b2ea6e5 100644 --- a/dist/docs/classes/CharacterStyle.html +++ b/dist/docs/classes/CharacterStyle.html @@ -150,7 +150,7 @@ text.characterStyle = { @@ -529,7 +529,7 @@ limit on the ratio of the miter length to the RGBColor / HSBColor / GrayColor + RGBColor / HSBColor / HSLColor / GrayColor diff --git a/dist/docs/classes/CompoundPath.html b/dist/docs/classes/CompoundPath.html index c63c4e86..7f9a8154 100644 --- a/dist/docs/classes/CompoundPath.html +++ b/dist/docs/classes/CompoundPath.html @@ -567,16 +567,16 @@ function onMouseDrag(event) { if (myPath) { myPath.remove(); } - + // Create a new path and add a segment point to it // at {x: 150, y: 150): myPath = new Path(); myPath.add(150, 150); - + // Draw an arc through the position of the mouse to 'toPoint' var toPoint = new Point(350, 150); myPath.arcTo(event.point, toPoint); - + // Select the path, so we can see its segments: myPath.selected = true; } @@ -1391,6 +1391,45 @@ circle2.opacity = 0.5; +
+ + +
+ +
+ +
+ + + +
+ + @@ -1910,7 +1981,7 @@ accessing item.children[item.children.length - 1].

@@ -2284,7 +2355,7 @@ miterLimit imposes a limit on the ratio of the miter length to the @@ -3481,18 +3552,18 @@ circle.scale(1.5, circle.bounds.bottomLeft);
-
-