mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-28 17:02:24 -05:00
Explain reasons for /* jshint */ statements.
And consistently name Prepro.js
This commit is contained in:
parent
00d2002b6f
commit
7783ebeed1
7 changed files with 10 additions and 10 deletions
|
@ -143,7 +143,7 @@ And to go back to a built library
|
|||
cd build
|
||||
./build.sh
|
||||
|
||||
Note that your PaperScripts examples do not need to change, they can keep loading `dist/paper-full.js`, which will always do the right thing. Note also that `src/load.js` handles both browsers and Node.js, through the handy PrePro JS preprocessing library <http://github.com/lehni/prepro.js>.
|
||||
Note that your PaperScripts examples do not need to change, they can keep loading `dist/paper-full.js`, which will always do the right thing. Note also that `src/load.js` handles both browsers and Node.js, through the handy Prepro.js preprocessing library <http://github.com/lehni/prepro.js>.
|
||||
|
||||
### Branch structure
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
# This script simply creates symbolic links to src/load.js from
|
||||
# dist/paper-full.js and dist/paper-node.js, which loads the library from
|
||||
# separate sources through PrePro both in the browser and in Node.js.
|
||||
# separate sources through Prepro.js both in the browser and in Node.js.
|
||||
|
||||
if [ -f ../dist/paper-full.js ]
|
||||
then
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* @name PaperScript
|
||||
* @namespace
|
||||
*/
|
||||
/* jshint -W082 */
|
||||
/* jshint -W082 */// Do not complain about functions inside Prepro.js statements
|
||||
Base.exports.PaperScript = (function() {
|
||||
// Locally turn of exports and define for inlined acorn.
|
||||
// Just declaring the local vars is enough, as they will be undefined.
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
* All rights reserved.
|
||||
*/
|
||||
|
||||
// This file uses PrePro to preprocess the paper.js source code on the fly in
|
||||
// This file uses Prepro.js to preprocess the paper.js source code on the fly in
|
||||
// the browser, avoiding the step of having to manually preprocess it after each
|
||||
// change. This is very useful during development of the library itself.
|
||||
if (typeof window === 'object') {
|
||||
// Browser based loading through PrePro:
|
||||
// Browser based loading through Prepro.js:
|
||||
if (!window.include) {
|
||||
var scripts = document.getElementsByTagName('script');
|
||||
var src = scripts[scripts.length - 1].getAttribute('src');
|
||||
|
@ -22,7 +22,7 @@ if (typeof window === 'object') {
|
|||
// through dist/paper-full.js, or directly through src/load.js, and
|
||||
// match root as all the parts of the path that lead to that folder.
|
||||
var root = src.match(/^(.*\/)\w*\//)[1];
|
||||
// First load the PrePro's browser.js file, which provides the include()
|
||||
// First load the prepro's browser.js file, which provides the include()
|
||||
// function for the browser.
|
||||
document.write('<script type="text/javascript" src="' + root
|
||||
+ 'node_modules/prepro/lib/browser.js"></script>');
|
||||
|
@ -35,7 +35,7 @@ if (typeof window === 'object') {
|
|||
include('paper.js');
|
||||
}
|
||||
} else {
|
||||
// Node based loading through PrePro:
|
||||
// Node based loading through Prepro.js:
|
||||
var prepro = require('prepro/lib/node.js');
|
||||
// Include deafult browser options.
|
||||
// Step out and back into src in case this is loaded from dist/paper-node.js
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// Define __options for code preprocessing when building the library, as well as
|
||||
// browser based compile-time preprocessing when loading the separate source
|
||||
// files directly through load.js / prepro.js during development.
|
||||
// files directly through load.js / Prepro.js during development.
|
||||
|
||||
// The paper.js version.
|
||||
// NOTE: Adjust value here before calling publish.sh, which then updates and
|
||||
|
|
|
@ -178,7 +178,7 @@ var CompoundPath = PathItem.extend(/** @lends CompoundPath# */{
|
|||
},
|
||||
|
||||
setClockwise: function(clockwise) {
|
||||
/* jshint -W018 */
|
||||
/* jshint -W018 */// Don't complain about confusing use of !:
|
||||
if (this.isClockwise() !== !!clockwise)
|
||||
this.reverse();
|
||||
},
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* center, both useful for constructing artwork that should appear centered on
|
||||
* screen.
|
||||
*/
|
||||
/* jshint -W082 */
|
||||
/* jshint -W082 */// Do not complain about functions inside Prepro.js statements
|
||||
var View = Base.extend(Emitter, /** @lends View# */{
|
||||
_class: 'View',
|
||||
|
||||
|
|
Loading…
Reference in a new issue