Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added node-webkit(nw) compability #760

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified docs/EaselJS_docs-0.8.2.zip
Binary file not shown.
106 changes: 53 additions & 53 deletions lib/easeljs-0.8.2.combined.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/easeljs-0.8.2.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions lib/webgl-0.8.2.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ this.createjs = this.createjs||{};
* @extends Stage
* @constructor
* @param {HTMLCanvasElement | String | Object} canvas A canvas object that the SpriteStage will render to, or the string id
* of a canvas object in the current document.
* of a canvas object in the current window.document.
* @param {Boolean} preserveDrawingBuffer If true, the canvas is NOT auto-cleared by WebGL (spec discourages true). Useful if you want to use p.autoClear = false.
* @param {Boolean} antialias Specifies whether or not the browser's WebGL implementation should try to perform antialiasing.
**/
Expand Down Expand Up @@ -982,7 +982,9 @@ this.createjs = this.createjs||{};
if (!kid.isVisible()) { continue; }

// Get the texture for this display branch:
var image = kid.image || (kid.spriteSheet && kid.spriteSheet._images[0]), texture = image.__easeljs_texture;
var image = kid.image || (kid.spriteSheet && kid.spriteSheet._images[0]);
if (!image) { continue; } // kid that doesn't have image (ex. DOMElement).
var texture = image.__easeljs_texture;
if (!texture && !(texture = this._setupImageTexture(ctx, image))) { continue; } // no texture available (ex. may not be loaded yet).

mtx = kid._props.matrix;
Expand Down
2 changes: 1 addition & 1 deletion lib/webgl-0.8.2.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/createjs/events/Event.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Event
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
4 changes: 2 additions & 2 deletions src/createjs/events/EventDispatcher.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* EventDispatcher
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
10 changes: 5 additions & 5 deletions src/createjs/utils/Ticker.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Ticker
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -452,7 +452,7 @@ this.createjs = this.createjs||{};
* @static
* @param {Number} [ticks] The number of previous ticks over which to measure the actual frames / ticks per second.
* Defaults to the number of ticks per second.
* @return {Number} The actual frames / ticks per second. Depending on performance, this may differ
* @return {Number} The actual frames / ticks per second. Depending on window.performance, this may differ
* from the target frames per second.
**/
Ticker.getMeasuredFPS = function(ticks) {
Expand Down Expand Up @@ -627,9 +627,9 @@ this.createjs = this.createjs||{};
* @static
* @protected
**/
var now = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
var now = window.window.performance && (window.performance.now || window.performance.mozNow || window.performance.msNow || window.performance.oNow || window.performance.webkitNow);
Ticker._getTime = function() {
return ((now&&now.call(performance))||(new Date().getTime())) - Ticker._startTime;
return ((now&&now.call(window.performance))||(new Date().getTime())) - Ticker._startTime;
};


Expand Down
4 changes: 2 additions & 2 deletions src/createjs/utils/extend.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* extend
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
4 changes: 2 additions & 2 deletions src/createjs/utils/indexOf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* indexOf
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
6 changes: 3 additions & 3 deletions src/createjs/utils/promote.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* promote
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -41,7 +41,7 @@ this.createjs = this.createjs||{};
* Promotes any methods on the super class that were overridden, by creating an alias in the format `prefix_methodName`.
* It is recommended to use the super class's name as the prefix.
* An alias to the super class's constructor is always added in the format `prefix_constructor`.
* This allows the subclass to call super class methods without using `function.call`, providing better performance.
* This allows the subclass to call super class methods without using `function.call`, providing better window.performance.
*
* For example, if `MySubClass` extends `MySuperClass`, and both define a `draw` method, then calling `promote(MySubClass, "MySuperClass")`
* would add a `MySuperClass_constructor` method to MySubClass and promote the `draw` method on `MySuperClass` to the
Expand Down
14 changes: 7 additions & 7 deletions src/easeljs/display/Bitmap.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Bitmap
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -75,7 +75,7 @@ this.createjs = this.createjs||{};
* @type HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
**/
if (typeof imageOrUri == "string") {
this.image = document.createElement("img");
this.image = window.document.createElement("img");
this.image.src = imageOrUri;
} else {
this.image = imageOrUri;
Expand Down Expand Up @@ -145,12 +145,12 @@ this.createjs = this.createjs||{};
return true;
};

//Note, the doc sections below document using the specified APIs (from DisplayObject) from
//Note, the doc sections below window.document using the specified APIs (from DisplayObject) from
//Bitmap. This is why they have no method implementations.

/**
* Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances.
* You should <b>not</b> cache Bitmap instances as it can degrade performance.
* You should <b>not</b> cache Bitmap instances as it can degrade window.performance.
*
* <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong>
* To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}}
Expand All @@ -160,7 +160,7 @@ this.createjs = this.createjs||{};

/**
* Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances.
* You should <b>not</b> cache Bitmap instances as it can degrade performance.
* You should <b>not</b> cache Bitmap instances as it can degrade window.performance.
*
* <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong>
* To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}}
Expand All @@ -170,7 +170,7 @@ this.createjs = this.createjs||{};

/**
* Because the content of a Bitmap is already in a simple format, cache is unnecessary for Bitmap instances.
* You should <b>not</b> cache Bitmap instances as it can degrade performance.
* You should <b>not</b> cache Bitmap instances as it can degrade window.performance.
*
* <strong>However: If you want to use a filter on a Bitmap, you <em>MUST</em> cache it, or it will not work.</strong>
* To see the API for caching, please visit the DisplayObject {{#crossLink "DisplayObject/cache"}}{{/crossLink}}
Expand Down
4 changes: 2 additions & 2 deletions src/easeljs/display/BitmapText.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* BitmapText
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
10 changes: 5 additions & 5 deletions src/easeljs/display/Container.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Container
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -81,7 +81,7 @@ this.createjs = this.createjs||{};
this.mouseChildren = true;

/**
* If false, the tick will not be propagated to children of this Container. This can provide some performance benefits.
* If false, the tick will not be propagated to children of this Container. This can provide some window.performance benefits.
* In addition to preventing the "tick" event from being dispatched, it will also prevent tick related updates
* on some display objects (ex. Sprite & MovieClip frame advancing, DOMElement visibility handling).
* @property tickChildren
Expand Down Expand Up @@ -354,7 +354,7 @@ this.createjs = this.createjs||{};
*
* @method sortChildren
* @param {Function} sortFunction the function to use to sort the child list. See JavaScript's <code>Array.sort</code>
* documentation for details.
* window.documentation for details.
**/
p.sortChildren = function(sortFunction) {
this.children.sort(sortFunction);
Expand Down Expand Up @@ -471,7 +471,7 @@ this.createjs = this.createjs||{};
* and {{#crossLink "mouseChildren:property"}}{{/crossLink}} properties will be respected.</li>
* <li>Setting the `mode` to `2` additionally excludes display objects that do not have active mouse event
* listeners or a {{#crossLink "DisplayObject:cursor:property"}}{{/crossLink}} property. That is, only objects
* that would normally intercept mouse interaction will be included. This can significantly improve performance
* that would normally intercept mouse interaction will be included. This can significantly improve window.performance
* in some cases by reducing the number of display objects that need to be tested.</li>
* </li>
*
Expand Down
6 changes: 3 additions & 3 deletions src/easeljs/display/DOMElement.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* DOMElement
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -73,7 +73,7 @@ this.createjs = this.createjs||{};
function DOMElement(htmlElement) {
this.DisplayObject_constructor();

if (typeof(htmlElement)=="string") { htmlElement = document.getElementById(htmlElement); }
if (typeof(htmlElement)=="string") { htmlElement = window.document.getElementById(htmlElement); }
this.mouseEnabled = false;

var style = htmlElement.style;
Expand Down
14 changes: 7 additions & 7 deletions src/easeljs/display/DisplayObject.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* DisplayObject
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -111,7 +111,7 @@
*
* <h4>Browser Support</h4>
* All modern browsers that support Canvas will support EaselJS (<a href="http://caniuse.com/canvas">http://caniuse.com/canvas</a>).
* Browser performance may vary between platforms, for example, Android Canvas has poor hardware support, and is much
* Browser window.performance may vary between platforms, for example, Android Canvas has poor hardware support, and is much
* slower on average than most other browsers.
*
* @module EaselJS
Expand Down Expand Up @@ -192,7 +192,7 @@ this.createjs = this.createjs||{};
this.mouseEnabled = true;

/**
* If false, the tick will not run on this display object (or its children). This can provide some performance benefits.
* If false, the tick will not run on this display object (or its children). This can provide some window.performance benefits.
* In addition to preventing the "tick" event from being dispatched, it will also prevent tick related updates
* on some display objects (ex. Sprite & MovieClip frame advancing, DOMElement visibility handling).
* @property tickEnabled
Expand Down Expand Up @@ -519,7 +519,7 @@ this.createjs = this.createjs||{};
* @static
* @protected
**/
var canvas = createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"); // prevent errors on load in browsers without canvas.
var canvas = createjs.createCanvas?createjs.createCanvas():window.document.createElement("canvas"); // prevent errors on load in browsers without canvas.
if (canvas.getContext) {
DisplayObject._hitTestCanvas = canvas;
DisplayObject._hitTestContext = canvas.getContext("2d");
Expand Down Expand Up @@ -780,7 +780,7 @@ this.createjs = this.createjs||{};
p.cache = function(x, y, width, height, scale) {
// draw to canvas.
scale = scale||1;
if (!this.cacheCanvas) { this.cacheCanvas = createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"); }
if (!this.cacheCanvas) { this.cacheCanvas = createjs.createCanvas?createjs.createCanvas():window.document.createElement("canvas"); }
this._cacheWidth = width;
this._cacheHeight = height;
this._cacheOffsetX = x;
Expand Down Expand Up @@ -1256,7 +1256,7 @@ this.createjs = this.createjs||{};
* @protected
**/
p._tick = function(evtObj) {
// because tick can be really performance sensitive, check for listeners before calling dispatchEvent.
// because tick can be really window.performance sensitive, check for listeners before calling dispatchEvent.
var ls = this._listeners;
if (ls && ls["tick"]) {
// reset & reuse the event object to avoid construction / GC costs:
Expand Down
8 changes: 4 additions & 4 deletions src/easeljs/display/Graphics.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Graphics
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down Expand Up @@ -382,7 +382,7 @@ this.createjs = this.createjs||{};
* @protected
* @type {CanvasRenderingContext2D}
**/
var canvas = (createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"));
var canvas = (createjs.createCanvas?createjs.createCanvas():window.document.createElement("canvas"));
if (canvas.getContext) {
Graphics._ctx = canvas.getContext("2d");
canvas.width = canvas.height = 1;
Expand Down Expand Up @@ -1098,7 +1098,7 @@ this.createjs = this.createjs||{};
* the existing store. This also affects `drawAsPath()`.
*
* This is useful in cases where you are creating vector graphics in an iterative manner (ex. generative art), so
* that only new graphics need to be drawn (which can provide huge performance benefits), but you wish to retain all
* that only new graphics need to be drawn (which can provide huge window.performance benefits), but you wish to retain all
* of the vector instructions for later use (ex. scaling, modifying, or exporting).
*
* Note that calling store() will force the active path (if any) to be ended in a manner similar to changing
Expand Down
4 changes: 2 additions & 2 deletions src/easeljs/display/MovieClip.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* MovieClip
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
4 changes: 2 additions & 2 deletions src/easeljs/display/Shadow.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Shadow
* Visit http://createjs.com/ for documentation, updates and examples.
* Visit http://createjs.com/ for window.documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* obtaining a copy of this software and associated window.documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
Expand Down
Loading