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
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
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
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
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
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
3d78e3729d
Fix issue with PaperScript and array[i++] expressions.
2013-06-18 18:18:39 -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
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
5592bb57e0
Properly export Numerical and PaperScript again.
2013-05-27 15:55:44 -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
a98e39374d
Make PaperScript work again with latest Acorn.js
2013-02-24 15:41:06 -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
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
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
7fe8e3c918
Handle null nodes.
2012-11-21 12:17:01 -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
d671a08205
Introduce Base.toFloat() and rename Base.formatNumber() to Base.formatFloat()
2012-11-14 01:31:08 -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
ee65ee1026
Clean up and improve PaperScript code a bit.
2012-11-02 15:58:41 -07:00
Jürg Lehni
4a74cf9e29
Improve Paper code editor to also display errors.
2012-10-23 20:05:01 -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
75072bde4f
Directly access project.view.
2011-11-18 20:33:27 +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
e238dea3ac
More work to make new events mechanisms work for Tool too.
2011-11-11 19:49:31 +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
14881b8b19
Let View handle the retrieving of the canvas object.
2011-08-01 16:23:56 +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
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
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
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
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
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
Jürg Lehni
28921e9a76
Update PaperScript to work with new parse-js and beautify code so that line numbers in error messages remain correct.
2011-06-28 10:52:50 +02:00
Jürg Lehni
7cd749e63d
Change all documentation to new convention of defining @class outside injection scope, fix some comments and a few errors with examples.
2011-06-22 23:56:05 +01:00
Jürg Lehni
ad335374cd
Copyrights are included correctly in the paper.js file.
2011-05-31 22:22:07 +01:00
Jürg Lehni
84b1d865c1
Remove unused variable.
2011-05-20 14:08:04 +01:00
Jürg Lehni
26269d394a
Rename project/ProjectView -> ui/View.
2011-05-17 13:29:07 +01:00
Jürg Lehni
7b4dd222ac
Completely decouple ProjectView from Project.
2011-05-17 13:25:46 +01:00
Jürg Lehni
cfe968d30e
Rename Document -> Project, DocumentView -> ProjectView, paper.document -> paper.project and paper.documents -> paper.projects, to avoid name clashing with window.document.
2011-05-16 13:33:15 +01:00
Jürg Lehni
9f34042bae
Fix comment.
2011-05-16 11:19:47 +01:00
Jürg Lehni
71bf4fdbca
Two forms of scoping are required when evaluating PaperScripts: with(){} and a function scope, so local vars are not trying to override properties on the scope through with(){} (e.g. var view = ...).
2011-05-16 11:00:33 +01:00
Jürg Lehni
98a59a3011
Rename PaperScript#run() to #evaluate() and add it to PaperScope too.
2011-05-16 01:22:06 +01:00
Jürg Lehni
c403dccea3
Expose capability to run PaperScripts from script tags.
2011-05-16 00:57:13 +01:00
Jürg Lehni
593813660a
Associate PaperScope objects with the script tag that produced them through an assigned unique id.
2011-05-16 00:29:29 +01:00
Jürg Lehni
690a79722f
Add alternative code for setting handler on tool that does not rely on eval(), commented out for now.
2011-05-15 23:56:41 +01:00
Jürg Lehni
535e5fc5fc
Add support for onResize handler.
2011-05-15 23:46:34 +01:00
Jürg Lehni
c1dc823706
Move onFrame handler to DocumentView.
2011-05-15 23:37:40 +01:00
Jürg Lehni
f69b0a404a
Remove unused #document from Tool.
2011-05-15 22:45:15 +01:00
Jürg Lehni
36c9286ca9
Add #count to onFrame() event.
2011-05-15 18:08:41 +01:00
Jürg Lehni
06f16d0c2a
Define a unique id for each PaperScript.
2011-05-15 11:32:42 +01:00
Jürg Lehni
064f3e05d3
Simplify paper scope switching code for now, as key handling code depends on paper object to always point to a valid one. This is a workaround, rethinking of how key handling should be distributed across multiple instances within one page is required.
2011-05-14 20:08:14 +01:00
Jürg Lehni
01fdeb270b
Move PaperScript.js to core.
2011-05-14 17:22:49 +01:00