Commit graph

393 commits

Author SHA1 Message Date
Jürg Lehni
593e0d8d7f Remove Base.merge() and use a new Straps.js feature instead.
A more clever Base() constructor that allows merging.
2013-11-28 22:20:00 +01:00
Jürg Lehni
57227b9ff6 Fix newly introduce bug in Callback#fire() 2013-11-28 15:48:28 +01:00
Jürg Lehni
ed8de613c4 Improve error handling of PaperScripts on Firefox. 2013-11-27 19:07:02 +01:00
Jürg Lehni
ff538870e0 Fix error lineNumbers in PaperScript code for Firefox and Chrome. 2013-11-27 16:41:39 +01:00
Jürg Lehni
e87bf817de Do not use Base.each() loops where it's not necessary. 2013-11-27 16:02:24 +01:00
Jürg Lehni
ca3993fe8e Solve variable scoping issue differently by using Base.each() to provide a local closure scope. 2013-11-26 23:46:53 +01:00
Jürg Lehni
c18a5e6ffb Remove Node.js specific bug-fix by msand again, since code won't be executed on Node anymore. 2013-11-26 23:41:24 +01:00
Jürg Lehni
f224bb3e86 Merge github.com:msand/paper.js into msand-master 2013-11-26 23:38:40 +01:00
Jürg Lehni
adac126e6c Rename Ast -> AST 2013-11-25 19:34:39 +01:00
Jürg Lehni
da9e1f8de7 Define Project#isEmpty() 2013-11-24 22:53:41 +01:00
msand
22a918190d Fix indent. 2013-11-24 17:36:35 +02:00
msand
3b22f185ce Fix to make sure that attribute methods exists before calling. Check of hidpi attribute in canvas was crashing in Node.js, as the getAttribute method is undefined in node-canvas. 2013-11-24 17:26:09 +02:00
Jürg Lehni
af4410953f Various clean-ups regarding the handling of activeLayer, JSON deserialization, DOM insertion and and layer reusing.
JSON deserialization does no longer insert items into DOM twice now, and should therefore be faster.
2013-11-24 16:25:13 +01:00
msand
900cea3123 Fix async loading of PaperScript to use correct scope. 2013-11-24 17:19:45 +02:00
Jürg Lehni
42ec121c0a Optimize Base#merge() to not use Base#each() 2013-11-24 15:03:51 +01:00
Jürg Lehni
8f4b70a7d3 Minor clean up. 2013-11-14 14:42:28 +01:00
Jürg Lehni
b514d04f58 Export Http so the separate PaperScript scope can reach it. 2013-11-06 02:22:24 +01:00
Jürg Lehni
056dcceacc Implement #importSVG() from external URL. 2013-11-02 21:17:11 +01:00
Jürg Lehni
df80eb2f23 Define PaperScope#paper as a reference to the local scope.
And use it to fix Raster JSON example.
2013-11-01 11:46:31 +01:00
Jürg Lehni
c76dae5b06 Implement a new strategy for importing JSON, where it is imported into the item itself, not its children list, if the class match. 2013-11-01 11:26:11 +01:00
Jürg Lehni
49a8ea24af No need for Object.getPrototypeOf().
Simply point _filtering directly at the original object.
2013-10-19 12:08:04 +02:00
Jürg Lehni
d59ed6d7c0 Implement a way to use fast _filtered inheritance trick and still use #hasOwnProperty() checks in Base#_set() 2013-10-19 12:05:53 +02:00
Jürg Lehni
1decf451b4 Implement efficient filtering of already consumed values in argument reading from object literals. 2013-10-16 15:08:44 +02:00
Jürg Lehni
ac5c45906f Update to latest straps.js, with changed Base.create() method. 2013-10-14 23:37:43 +02:00
Jürg Lehni
dfa1687a90 Adapt to new bower_components directory. 2013-10-11 00:20:30 +02:00
Jürg Lehni
c68a7d33da Switch from options.browser and options.node to options.environment 2013-10-10 23:09:00 +02:00
Jürg Lehni
94fac965ec Minor improvement in Base.equals() 2013-10-10 20:15:56 +02:00
Jürg Lehni
9c98ef8316 Have paper.install() override existing definitions.
And include a warning about this approach in the documentation.
2013-09-23 11:49:23 -07:00
Jürg Lehni
19c7788617 Fix documentation irregularities. 2013-08-23 19:45:28 -07:00
Jürg Lehni
720dd1b35d Do not apply operator overloading in situations where UpdateExpressions happen inside other contexts that would cause a change of behavior, e.g. array[i++], or if (i++ < 1).
Closes #260.
2013-08-09 10:58:29 -07:00
Jürg Lehni
6b19f25f4b Fix typos in comments. 2013-08-08 15:21:35 -07:00
Jürg Lehni
86a8f85874 Allow Base#_set() to exclude properties. 2013-07-21 15:43:20 -07:00
Jürg Lehni
6af59f7adf Filter out the insert parameter in _set for now, to prevent issues with cloning().
Work in progress.
2013-07-19 18:45:59 -07:00
Jürg Lehni
ec4f194b84 Avoid use of 'window' for Node, and pass on reference to root scope instead. 2013-07-19 15:48:50 -07:00
Jürg Lehni
6e1c89234d Define PaperScope#activate()
Closes #256.
2013-07-18 19:21:57 -07:00
Jürg Lehni
098f3e84cc Include Acorn / Esprima only into local PaperScript scope, and locally deactivate AMD.
Closes #255.
2013-07-18 09:49:30 -07:00
Jürg Lehni
e8765d18d5 Make argument reading more flexible by introducing options object for readNull and clone, and passing it on to the constructor through this.__options for additional values. 2013-06-28 07:37:03 -07:00
Jürg Lehni
16ff78a8ba Import Base into PaperScript scope. 2013-06-28 06:39:00 -07:00
Jürg Lehni
8f254202e8 Use new @operator tag to mark math operator methods. 2013-06-28 05:59:07 -07:00
Jürg Lehni
5b574877e9 Make PaperScript math operator methods 'hidden' and use aliases to visible methods.
Avoids Path#add() being misinterpreted as an operator, and console.log(path + ' hi'); causing weird issues.
2013-06-28 05:15:49 -07:00
Jürg Lehni
899ec1d360 Make built version of paper.js for node work and work towards using that in NPM. 2013-06-27 14:31:03 -07:00
Jürg Lehni
5245a30930 Improve PaperScript extension code for Node.js 2013-06-27 13:52:30 -07:00
Jürg Lehni
4f5dac8567 Improved PrePro to be able to dynamically load Node.js code too, and improve load.js to handle both environments.
Also moved PaperScript .pjs extension code to PaperScript, and DOM related Node.js code to dom/node.js
2013-06-27 13:49:04 -07:00
Jürg Lehni
94ce1f1312 Fix include statements.
They're not to be indented.
2013-06-27 04:46:20 -07:00
Jürg Lehni
77c27f8a36 Switch to using dependencies as bower components. 2013-06-27 04:21:06 -07:00
Jürg Lehni
9c5416360c Use direct constructor instead of #initialize(). 2013-06-25 09:56:34 -07:00
Jürg Lehni
c6e50375df Expose nativeBlendModes and amend BlendModes example with information about the use of native modes. 2013-06-24 15:55:15 -07:00
Jürg Lehni
1866e4ff15 Remove need for all special arguments in minification, and restructure code to avoid warnings. 2013-06-24 10:15:54 -07:00
Jürg Lehni
eef736f3d8 Move define() statement to export.js and remove define hack in PaperScript. 2013-06-24 04:40:35 -07:00
Jürg Lehni
4b53d558f1 Refactor PaperScript code so it can be moved outside of main paper scope.
Allowing for better minifaction and the potential use of strict mode due to absence of with() statements inside the main paper scope.
2013-06-24 04:40:07 -07:00
Jürg Lehni
fa3f91a754 Move PaperScript.get/setAttribute() to PaperScope. 2013-06-24 04:23:34 -07:00
Jürg Lehni
75c1225d4f Prevent overriding exported classes by inheriting classes with same _class value. 2013-06-24 04:22:43 -07:00
Jürg Lehni
a4535edbb9 Bring back _class names, since code minification breaks reliance on constructor.name.
Closes #248.
2013-06-23 20:18:32 -07:00
Jürg Lehni
3d78e3729d Fix issue with PaperScript and array[i++] expressions. 2013-06-18 18:18:39 -07:00
Jürg Lehni
75acdf1025 Add support for direct drawing of native blendModes for items that allow it.
Bypassing compositing into separate canvases completely.
2013-06-18 14:18:57 -07:00
Jürg Lehni
1b42822c2d Remove trailing comma. 2013-06-17 16:35:28 -07:00
Jürg Lehni
ab2bfe2d40 Rename nativeDash to dash. 2013-06-17 15:52:16 -07:00
Jürg Lehni
2196ef2a74 Streamline various #equals() methods. 2013-06-12 18:57:12 -07:00
Jürg Lehni
4a8469b740 Define Base.isPlainValue() and use it to implement more flexible #equals() for Color and Rectangle. 2013-06-12 18:55:14 -07:00
Jürg Lehni
294bfc9c9a Improve IE Function#name fix and move it to straps.js, since constructor.name is used there too.
Cache result and improve RegExp.
2013-06-12 18:36:18 -07:00
Jürg Lehni
f8c36b8276 Adopt Function#name regular expression to accommodate different scenarios of white-spaces. 2013-06-12 08:49:15 -07:00
Jürg Lehni
b99d54f8c3 Add support for AMD (e.g. require.js)
Fixes #223.
2013-06-11 23:50:59 -07:00
Jürg Lehni
ce7d584c05 Revert readNull and clone parameter sequence in arguments reading code. 2013-06-11 19:49:35 -07:00
Jürg Lehni
2e565dcfce Fix Function#name on browsers that don't support it.
Closes #236.
2013-06-11 19:07:25 -07:00
Jürg Lehni
b896a98b1e Properly fix exporting of classes into Base.exports. 2013-06-02 16:17:54 -07:00
Jürg Lehni
a81fdc2758 Fix exporting of Base, Numerical and PaperScript into PaperScope. 2013-05-30 14:37:04 -07:00
Jürg Lehni
178b09caa7 Fix issue with local paper variable shielding global one.
We need a cleaner fix for this on the long run.
2013-05-30 11:26:47 -07:00
Jürg Lehni
0b4bc678bc Properly fix issue with Project#exportJSON() creating separate projects on import. 2013-05-28 07:42:38 -07:00
Jürg Lehni
961451b271 Handle exporting of Numerical and PaperScript in export.js
Allowing build.sh to work again.
2013-05-27 18:28:35 -07:00
Jürg Lehni
70d6050900 Accessors cannot define the writable property. 2013-05-27 18:12:25 -07:00
Jürg Lehni
5592bb57e0 Properly export Numerical and PaperScript again. 2013-05-27 15:55:44 -07:00
Jürg Lehni
6ac5463630 Switch to using common string format for paper.version (major.minor.build) 2013-05-27 14:27:05 -07:00
Jürg Lehni
10d5de3ed6 Implement a better way to name and export class constructors.
This change also simplified the way classes are exported to PaperScope objects.
2013-05-27 12:48:58 -07:00
Jürg Lehni
c533dda7b5 Finally found a better and faster alternative for this.base() calls, by setting base on the function object instead.
base can be accessed on named functions very easily, leading to another measurable speed increase. Finally all performance reasons against straps.js are eliminated!
2013-05-27 10:04:05 -07:00
Jürg Lehni
c70b985911 Make sure the Base class is exposed in Node.js 2013-05-12 14:29:21 -07:00
Jürg Lehni
dd96d67fe1 Further refine Node.js integration. 2013-05-09 16:06:45 -07:00
Jürg Lehni
bc090dcf66 Switch from bootstrap.js to the renamed straps.js 2013-05-08 00:13:02 -07:00
Jürg Lehni
8e53829e9c Define Callback#once() 2013-05-06 20:57:08 -07:00
Jürg Lehni
b59a98f7ce Add jQuery style aliases to Callback and use #on() in the examples rather than #attach(). 2013-05-06 20:56:58 -07:00
Jürg Lehni
cebeb11301 Rename Json acronyms in API to JSON. 2013-04-23 07:13:51 -07:00
Jürg Lehni
6800a6d534 Use separate id ranges for different classes. 2013-04-22 19:09:59 -07:00
Jürg Lehni
e1807214f4 Large refactoring of Style handling for notable speed improvements. 2013-04-19 19:31:29 -07:00
Jürg Lehni
9efbc288a1 Merge Path.Rectangle and Path.RoundRectangle. 2013-04-19 12:36:49 -07:00
Jürg Lehni
fbe8a558bd Refactor Format literal to Formatter class that keeps precision stored. 2013-04-09 17:32:19 -07:00
Jürg Lehni
2d3f9c36eb Update JSDoc and fix documentation issues. 2013-04-09 17:07:41 -07:00
Jürg Lehni
5209e97c8d Merge GradientColor into Color.
Work in progress.
2013-04-09 01:21:36 -07:00
Jürg Lehni
218732e320 Implement a row of simple optimizations to increase performance of Item constructors. 2013-04-07 17:36:09 -07:00
Jürg Lehni
f43b322d2a Rename Base#_type property to #_class. 2013-04-06 09:16:08 +02:00
Jürg Lehni
9adfc01c8d Handle both strings and objects in Base.importJson().
And keep returning strings from #exportJson().
2013-04-05 16:58:00 +02:00
Jürg Lehni
9c38a76525 Add support for Item#data serialization. 2013-03-19 17:52:46 -07:00
Jürg Lehni
1d1e6425fa Remove all left-overs of call chaining, except for where it's in use. 2013-03-05 20:39:07 -08:00
Jürg Lehni
7294c5499c Simplify Base.readNamed() methods. 2013-03-03 15:28:55 -08:00
Jürg Lehni
0599aabdb9 Handle reinsertion of items into the same children list.
Fixes failing test.
2013-03-01 23:06:29 -08:00
Jürg Lehni
3f5d0a6925 Merge constructor._name with _type and use CamelCase for Item types. 2013-03-01 17:13:22 -08:00
Jürg Lehni
7405858f32 Simplify code for reading of named arguments, removing the need for filtering arguments by using 'in' checks instead for the presence of properties / setters. 2013-03-01 14:06:04 -08:00
Jürg Lehni
06e33ba412 Improve flexibility of reading rectangles in Path.Constructor.
We can now define the rectangle by any property that it has setters for.
2013-03-01 13:52:11 -08:00
Jürg Lehni
5501f48570 Move Item#toString() functionality to Base#toString().
For objects that define #_id and/or #_name.
2013-03-01 11:47:49 -08:00
Jürg Lehni
9d8cddbe42 Implement new private Format object that handles formatting of number, point, size and rectangle. 2013-02-28 19:14:05 -08:00
Jürg Lehni
e392496f9d Remove Base.toFloat() and replace with direct parseFloat() calls. 2013-02-28 19:14:05 -08:00
Jürg Lehni
65a9795a8a Rename #from/#toJson() to #import/#exportJson() and move them to Project / Item.
To reflect naming of #import/#exportSvg().
2013-02-25 16:17:33 -08:00
Jürg Lehni
a98e39374d Make PaperScript work again with latest Acorn.js 2013-02-24 15:41:06 -08:00
Jürg Lehni
119e5acbf9 Move #_setProperties() and #set() from Item to Base, rename it to #_set and use it for Tool too. 2013-02-15 18:28:49 -08:00
Jürg Lehni
24a5016470 Reuse scopes associated with canvases to support multiple scripts per canvas.
As described in #171.
2013-02-15 00:15:44 -08:00
Jürg Lehni
da08e74374 Clean up code from #156. 2013-02-14 12:50:51 -08:00
Jürg Lehni
6729646e7a Merge pull request #156 from ubershmekel/patch-2
Late load of paperjs should still run paperscripts
2013-02-14 12:49:51 -08:00
Jürg Lehni
ca3cc7f46d Define CanvasProvider.getContext() next to getCanvas(), and support both types in release(). 2013-02-12 16:06:24 -08:00
Jürg Lehni
51150cb20d Support CanvasProvider.get(width, height) arguments. 2013-02-12 15:57:02 -08:00
Jürg Lehni
357b7dbc54 Shorten CanvasProvider method names. 2013-02-12 15:53:27 -08:00
Jürg Lehni
24d467e292 Implement support for native dash strokes, through both setLineDash() and mozDash. 2013-02-12 15:32:21 -08:00
Jürg Lehni
fdd15e675f Add options argument to #toJson() methods, and use to implement optional fractional digit precision control. 2013-02-12 14:57:54 -08:00
Jürg Lehni
22218e0db0 Simplify Base.serialize(). 2013-02-12 14:16:25 -08:00
Jürg Lehni
80ffd41560 Add optional precision argument to Base.formatFloat(). 2013-02-12 14:16:06 -08:00
Jürg Lehni
ee73b4e15b Add some explaining comments to dictionary code. 2013-02-11 19:35:11 -08:00
Jürg Lehni
15554b8bf2 Simplify adding / referencing of JSON dictionary entries. 2013-02-11 19:31:58 -08:00
Jürg Lehni
00dcd05549 Implement support for dictionary definitions and references in JSON serialization. 2013-02-11 18:59:05 -08:00
Jürg Lehni
aa6e2fae09 Improve Base#equals(). 2013-02-11 18:24:08 -08:00
Jürg Lehni
6d39a91c87 Implement simple Project serialization. 2013-02-11 16:43:31 -08:00
Jürg Lehni
565fb86430 Give any item / object that needs to be exported as a definition / symbol its own unique id.
This will be useful in SVG and JSON exporter.
2013-02-10 09:37:40 -08:00
Jürg Lehni
dc35fdbd02 Move named inner functions out of nested scopes, to prepare for 'use strict;' transition. 2013-02-08 18:23:33 -08:00
Jürg Lehni
bd62b4b819 Do not export paper.load() any more.
Use paper.PaperScript.load() instead.
2013-02-08 18:17:37 -08:00
Jürg Lehni
6c9c16ad3d Update copyright information comments, and year. 2013-01-28 18:03:27 -08:00
Yuval Greenfield
a3a211eead Late load of paperjs should still run paperscripts
See this problem html http://stackoverflow.com/questions/14110205/dynamically-loading-a-script-changes-its-behaviour/14114337 and note how jquery handle this at https://github.com/jquery/jquery/blob/master/src/core.js#L768
2013-01-02 01:57:30 +02:00
Jürg Lehni
8bed8cb15d Define mechanism for flexible reading of named arguments through Base.readNamed() and Base.hasNamed(), and use it to implement property object literal versions of Path.Constructor code. 2012-12-30 18:24:33 +01:00
Jürg Lehni
24b5f870bd Change Base.isObject() to also check for instances of plain Base objects, and rename it to Base.isPlainObject(). 2012-12-30 17:30:13 +01:00
Jürg Lehni
2abefee336 Merge Base.readValue() with Base.read() and rename Base.peekValue() to Base.peek().
When called directly on Base, read() reads values, otherwise the specific type of the subclass it is called on.
2012-12-30 16:07:20 +01:00
Jürg Lehni
4f83e0eee6 Commit first version of serialization / deserialization mechanism.
It appears to work fine already for Paths and Groups.
2012-12-27 12:45:55 +01:00
Jürg Lehni
3ac039bd66 Implement properties object literal initialization for all Item constructors. 2012-12-25 22:12:25 +01:00
Jürg Lehni
8f093f6dd7 Remove all PORT comments, since we won't port back features to Scriptographer. 2012-12-25 16:07:48 +01:00
Jürg Lehni
9fb48d1dd4 Fix a bug Base.equals(), causing endless recursion.
Closes #148.
2012-12-17 21:49:48 +01:00
Jürg Lehni
14e6edb8ee Fix #toString() for event objects. 2012-12-08 19:57:04 -08:00
Jürg Lehni
7fe8e3c918 Handle null nodes. 2012-11-21 12:17:01 -08:00
Jürg Lehni
1e744e3db7 Handle case where no project is created through execution errors. 2012-11-21 10:38:54 -08:00
Jürg Lehni
302f23bc5a Update Acorn.js and use it now by default, thanks to Marijn's fast bugfix:
https://github.com/marijnh/acorn/issues/14
2012-11-18 12:25:37 -08:00
Jürg Lehni
b977e18e3b No need to throw operator exceptions since we're checking for their existence in the parsing. 2012-11-18 10:13:50 -08:00
Jürg Lehni
34819e6a73 Switch to using Mozilla's standardized AST model for PaperScript parsing though Acorn.js or Esprima.js and their support for ranges.
No more AST mingling but direct code modification means we're finally getting accurate error messages! Sticking to Esprima for now since Acorn still has some issues with ranges: https://github.com/marijnh/acorn/issues/14
2012-11-18 10:06:16 -08:00
Jürg Lehni
3fe936addf Expose Palettes through PaperScope#palettes. 2012-11-14 12:05:36 -08:00
Jürg Lehni
c4a66cff0a Support more than one argument in Callback#fire(). 2012-11-14 01:31:34 -08:00
Jürg Lehni
d671a08205 Introduce Base.toFloat() and rename Base.formatNumber() to Base.formatFloat() 2012-11-14 01:31:08 -08:00
Jürg Lehni
e6c59672ac Update camelize() and hyphenate() to simpler versions. 2012-11-10 22:24:50 -08:00
Jürg Lehni
01342fa073 Implement onActivate() onDeactivate() handlers on Tool, and remove onSelect() / onDeselect() which never worked. 2012-11-07 01:02:09 -08:00
Jürg Lehni
4e1db6a1d1 Fix a row of documentation issues. 2012-11-06 13:35:50 -08:00
Jürg Lehni
b354e01f49 Move Base.equals() to Base extension, where it belongs. 2012-11-06 07:19:04 -08:00
Jürg Lehni
1fad063a30 Revert to version without optional digits, for speed reasons.
Since we don't actually use the other version anywhere.
2012-11-06 07:17:14 -08:00
Jürg Lehni
ab633f15ac Add optional digits precision to Base.formatNumber, default to 5. 2012-11-06 07:15:01 -08:00
Jürg Lehni
6ed1d67ada Modernize Bootstrap.js, introduce Base.create() and use it instead of the Constructor.dont hack for object creation without the calling of initialize. 2012-11-03 21:49:37 -07:00
Jürg Lehni
ee65ee1026 Clean up and improve PaperScript code a bit. 2012-11-02 15:58:41 -07:00
Jürg Lehni
bdb74b67e2 Define #isActive() for PaperScopeItems. 2012-10-30 11:43:40 -07:00
Jürg Lehni
4a74cf9e29 Improve Paper code editor to also display errors. 2012-10-23 20:05:01 -07:00
Jürg Lehni
30374ae3b4 Implement proper index independent argument list reading of basic types.
Implemented for Point, Size, Rectangle and Color.
2012-10-18 14:24:15 -07:00
Jürg Lehni
4d1920ee8b Improve Base.read() to support cloning of objects that are already provided in the required type. 2012-10-10 19:26:00 -07:00
Jürg Lehni
b29995f376 Clean up code. 2012-09-30 19:50:42 -07:00
Jonathan Puckey
7247c1a5a2 Fix Node.js support. 2012-09-01 19:27:38 +02:00
Jürg Lehni
6e3cef6eb4 Implement PaperScope#tool accessor.
For better handling of automatic tool creation in PaperScript.
2011-12-27 16:33:17 +01:00
Jürg Lehni
df5c33571f Do not exceed 80 chars per line. 2011-12-27 16:05:02 +01:00
Jürg Lehni
c8f3f3be27 Document Base.hyphenate() 2011-12-10 19:57:18 +01:00
Jürg Lehni
75072bde4f Directly access project.view. 2011-11-18 20:33:27 +01:00
Jürg Lehni
e4586cfeeb Commit beginning of item based mouse events. So far only onMousedown / 'mousedown' is supported. 2011-11-12 23:57:25 +01:00
Jürg Lehni
36846d6e38 Remove code from previous commit again. 2011-11-12 19:52:36 +01:00
Jürg Lehni
d89d7f1ef7 Commit temporary support for attach() and detach() handler on event entries, to be removed again. 2011-11-12 19:51:51 +01:00
Jürg Lehni
8eaddc759e Fix code sequence when attaching and detaching event handlers. 2011-11-12 17:14:49 +01:00
Jürg Lehni
da5a837da2 Merge remote-tracking branch 'origin/master' 2011-11-12 16:56:35 +01:00
Jürg Lehni
719ae2315c Remove global views list, link View to Project and allow projects to only have one view. 2011-11-12 16:56:23 +01:00
Jonathan Puckey
d631288dc7 Fire resize event directly after evaluation, so we don't need to call onResize ourselves from PaperScript. 2011-11-12 16:31:22 +01:00
Jürg Lehni
78d1ce1540 Make new events work properly for key handlers. 2011-11-11 20:12:29 +01:00
Jürg Lehni
e238dea3ac More work to make new events mechanisms work for Tool too. 2011-11-11 19:49:31 +01:00
Jürg Lehni
5fd7753c60 Remove dev comments. 2011-11-11 18:39:12 +01:00
Jürg Lehni
256e48b511 Define Callback code for callback based event handling (#atach() / #detach() #fire()) and start implementing it in View. 2011-11-11 18:29:28 +01:00
Jürg Lehni
fe97b94340 Define PaperScopeItem as a private base class for all classes that have lists and references in the PaperScope (Project, View, Tool), so they can share functionality (#initialize(), #activate(), #remove()), and add support for multiple tools. Closes #27 2011-08-02 10:08:08 +01:00
Jürg Lehni
2d5788540d Hide internal properties even if they are enumerable in Base#toString() 2011-08-02 08:32:55 +01:00
Jürg Lehni
14881b8b19 Let View handle the retrieving of the canvas object. 2011-08-01 16:23:56 +01:00
Jürg Lehni
022de4d781 Some documentation fixes for v0.2 2011-08-01 14:25:46 +01:00
Jürg Lehni
ea629fefda Remove debug log. 2011-08-01 12:03:23 +01:00
Jürg Lehni
14895f412c Fix PaperScope#install() so classes actually get injected. 2011-08-01 12:02:50 +01:00
Jürg Lehni
8cdc5ea2aa Change PaperScope#install() to be clever about project, view and tool references and link them through a getter to their current state in PaperScope. 2011-08-01 11:21:22 +01:00
Jürg Lehni
3fc21cd4b6 Always call View#draw() since it won't redraw internally if nothing has changed. 2011-08-01 11:02:00 +01:00
Jürg Lehni
6b6d5909c1 Revert back to PaperScope#setup() and keep #initialize0 simple. 2011-08-01 11:01:27 +01:00
Jürg Lehni
5b963b13e1 Export classes through PaperScope in dev mode too. 2011-08-01 08:53:07 +01:00
Jürg Lehni
c6cf4f9cf0 Only create an empty Project for a PaperScope if a canvas was provided for it. 2011-08-01 08:52:51 +01:00
Jürg Lehni
e1d90c921c Do not parse PaperScript code in exigent mode. Relaxes requirements of semicolons, etc. 2011-07-31 12:14:37 +01:00
Jürg Lehni
1519a1d220 Improve documentation for PaperScope. 2011-07-27 22:58:45 +01:00
Jürg Lehni
297aef643d Simplify the way PaperScope objects are created and linked to Canvas elements, in order to facilitate usage through plain JavaScript. 2011-07-27 22:39:58 +01:00
Jürg Lehni
c6525ec4fa Fix link to global paper variable. 2011-07-27 22:02:42 +01:00
Jürg Lehni
f98c8f29fc Implement Prepro.js for the browser too, in order to be able to load the library from paper.js source files and preprocess on the fly on the browser side. 2011-07-26 12:27:36 +01:00
Jürg Lehni
8eaeb7fb5e Remove filepp.pl as preprocessor and switch to our own Prepro.js, a simple preprocesssor for JavaScript that speaks JavaScript, written in JavaScript, allowing preprocessing to either happen at build time or compile time. 2011-07-26 10:09:31 +01:00
Jürg Lehni
43cc8e45b2 Clean up and separate PaperScript documetation from JavaScript related classes. Work in progress. 2011-07-25 00:25:23 +01:00
Jürg Lehni
688c1671ed Remove all parameters from Tool constructor, to simplify use outside PaperScript. 2011-07-19 23:53:13 +01:00
Jürg Lehni
9f1f4d334e Introduce PaperScope#setup(canvas), as a simple way to setup a standard project when not using PaperScript. 2011-07-19 23:52:32 +01:00
Jürg Lehni
470360301c Improve documentation for PaperScope#install() 2011-07-19 23:51:50 +01:00
Jürg Lehni
86b1d82636 Add VERSION and DATE to headers and support for it in build scripts. 2011-07-13 13:27:14 +01:00
Jürg Lehni
62453a4212 Increase version number. 2011-07-11 12:24:05 +02:00
Jürg Lehni
51df37b8ec Fix recently broken support for text-paperscript mime type. 2011-07-09 17:11:57 +02:00
Jürg Lehni
9abdcb571e Add support for both text/paperscript and text/x-paperscript mime types. 2011-07-09 16:58:53 +02:00
Jürg Lehni
6694d08d0f Fix PaperScript code generation to wrap on new-lines, so missing colons will not cause errors. 2011-07-09 09:20:13 +02:00
Jürg Lehni
cc00f40532 Have Base.hyphenate() convert the result to lowercase. 2011-07-08 23:09:51 +02:00
Jürg Lehni
dfbe3135ad Remove HitResult inheritance from CurveLocation, but have a #location property pointing to it. 2011-07-08 22:25:42 +02:00
Jürg Lehni
2851d8e403 Define Base#toString() as a mean to render Base objects as object literals, and use it for Key.modifier and onFrame() event objects, through Base.merge() conversion. 2011-07-07 14:10:02 +02:00
Jürg Lehni
d1185c5f8b Implement support for properly validating 'data-paper-NAME' attribute names, along with the current 'NAME'. 2011-07-06 21:19:38 +02:00
Jürg Lehni
79c0ad8cc5 Update copyright notices. 2011-07-01 12:17:45 +02:00
Richard D. Worth
ac39873693 Whitespace. Removed all trailing whitespace from .js files 2011-06-30 06:01:51 -04:00
Jonathan Puckey
5982196c66 PaperScript: add todo for supporting scripts with type: 'text/x-paperscript'. 2011-06-30 10:58:09 +02:00