mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Prebuilt module for commit 7cf844886f
This commit is contained in:
parent
41924fe587
commit
05cf664ae2
5 changed files with 79 additions and 52 deletions
33
dist/docs/assets/js/paper.js
vendored
33
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Apr 4 17:55:43 2016 -0700
|
||||
* Date: Mon Apr 4 23:26:43 2016 -0700
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -829,6 +829,11 @@ var PaperScope = Base.extend({
|
|||
delete PaperScope._scopes[this._id];
|
||||
},
|
||||
|
||||
resolvePath: function(url) {
|
||||
return this.agent.node && !/^(?:[a-z]+:)?\/\//i.test(url)
|
||||
? 'file://' + require('path').resolve(url) : url;
|
||||
},
|
||||
|
||||
statics: new function() {
|
||||
function handleAttribute(name) {
|
||||
name += 'Attribute';
|
||||
|
@ -4877,10 +4882,12 @@ var Raster = Item.extend({
|
|||
initialize: function Raster(object, position) {
|
||||
if (!this._initialize(object,
|
||||
position !== undefined && Point.read(arguments, 1))) {
|
||||
if (typeof object === 'string') {
|
||||
this.setSource(object);
|
||||
var image = typeof object === 'string'
|
||||
? document.getElementById(object) : object;
|
||||
if (image) {
|
||||
this.setImage(image);
|
||||
} else {
|
||||
this.setImage(object);
|
||||
this.setSource(object);
|
||||
}
|
||||
}
|
||||
if (!this._size) {
|
||||
|
@ -5048,23 +5055,24 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSource: function(src) {
|
||||
var crossOrigin = this._crossOrigin,
|
||||
image = document.getElementById(src) || new window.Image();
|
||||
image = new window.Image();
|
||||
image.src = paper.resolvePath(src);
|
||||
var crossOrigin = this._crossOrigin;
|
||||
if (crossOrigin)
|
||||
image.crossOrigin = crossOrigin;
|
||||
if (!image.src)
|
||||
image.src = src;
|
||||
this.setImage(image);
|
||||
},
|
||||
|
||||
getCrossOrigin: function() {
|
||||
return this._image && this._image.crossOrigin || this._crossOrigin || '';
|
||||
var image = this._image;
|
||||
return image && image.crossOrigin || this._crossOrigin || '';
|
||||
},
|
||||
|
||||
setCrossOrigin: function(crossOrigin) {
|
||||
this._crossOrigin = crossOrigin;
|
||||
if (this._image)
|
||||
this._image.crossOrigin = crossOrigin;
|
||||
var image = this._image;
|
||||
if (image)
|
||||
image.crossOrigin = crossOrigin;
|
||||
},
|
||||
|
||||
getElement: function() {
|
||||
|
@ -12735,7 +12743,8 @@ var Tool = PaperScopeItem.extend({
|
|||
var Http = {
|
||||
request: function(options) {
|
||||
var xhr = new window.XMLHttpRequest();
|
||||
xhr.open((options.method || 'get').toUpperCase(), options.url,
|
||||
xhr.open((options.method || 'get').toUpperCase(),
|
||||
paper.resolvePath(options.url),
|
||||
Base.pick(options.async, true));
|
||||
if (options.mimeType)
|
||||
xhr.overrideMimeType(options.mimeType);
|
||||
|
|
33
dist/paper-core.js
vendored
33
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Apr 4 17:55:43 2016 -0700
|
||||
* Date: Mon Apr 4 23:26:43 2016 -0700
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -829,6 +829,11 @@ var PaperScope = Base.extend({
|
|||
delete PaperScope._scopes[this._id];
|
||||
},
|
||||
|
||||
resolvePath: function(url) {
|
||||
return this.agent.node && !/^(?:[a-z]+:)?\/\//i.test(url)
|
||||
? 'file://' + require('path').resolve(url) : url;
|
||||
},
|
||||
|
||||
statics: new function() {
|
||||
function handleAttribute(name) {
|
||||
name += 'Attribute';
|
||||
|
@ -4877,10 +4882,12 @@ var Raster = Item.extend({
|
|||
initialize: function Raster(object, position) {
|
||||
if (!this._initialize(object,
|
||||
position !== undefined && Point.read(arguments, 1))) {
|
||||
if (typeof object === 'string') {
|
||||
this.setSource(object);
|
||||
var image = typeof object === 'string'
|
||||
? document.getElementById(object) : object;
|
||||
if (image) {
|
||||
this.setImage(image);
|
||||
} else {
|
||||
this.setImage(object);
|
||||
this.setSource(object);
|
||||
}
|
||||
}
|
||||
if (!this._size) {
|
||||
|
@ -5048,23 +5055,24 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSource: function(src) {
|
||||
var crossOrigin = this._crossOrigin,
|
||||
image = document.getElementById(src) || new window.Image();
|
||||
image = new window.Image();
|
||||
image.src = paper.resolvePath(src);
|
||||
var crossOrigin = this._crossOrigin;
|
||||
if (crossOrigin)
|
||||
image.crossOrigin = crossOrigin;
|
||||
if (!image.src)
|
||||
image.src = src;
|
||||
this.setImage(image);
|
||||
},
|
||||
|
||||
getCrossOrigin: function() {
|
||||
return this._image && this._image.crossOrigin || this._crossOrigin || '';
|
||||
var image = this._image;
|
||||
return image && image.crossOrigin || this._crossOrigin || '';
|
||||
},
|
||||
|
||||
setCrossOrigin: function(crossOrigin) {
|
||||
this._crossOrigin = crossOrigin;
|
||||
if (this._image)
|
||||
this._image.crossOrigin = crossOrigin;
|
||||
var image = this._image;
|
||||
if (image)
|
||||
image.crossOrigin = crossOrigin;
|
||||
},
|
||||
|
||||
getElement: function() {
|
||||
|
@ -12735,7 +12743,8 @@ var Tool = PaperScopeItem.extend({
|
|||
var Http = {
|
||||
request: function(options) {
|
||||
var xhr = new window.XMLHttpRequest();
|
||||
xhr.open((options.method || 'get').toUpperCase(), options.url,
|
||||
xhr.open((options.method || 'get').toUpperCase(),
|
||||
paper.resolvePath(options.url),
|
||||
Base.pick(options.async, true));
|
||||
if (options.mimeType)
|
||||
xhr.overrideMimeType(options.mimeType);
|
||||
|
|
16
dist/paper-core.min.js
vendored
16
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
33
dist/paper-full.js
vendored
33
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Mon Apr 4 17:55:43 2016 -0700
|
||||
* Date: Mon Apr 4 23:26:43 2016 -0700
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -829,6 +829,11 @@ var PaperScope = Base.extend({
|
|||
delete PaperScope._scopes[this._id];
|
||||
},
|
||||
|
||||
resolvePath: function(url) {
|
||||
return this.agent.node && !/^(?:[a-z]+:)?\/\//i.test(url)
|
||||
? 'file://' + require('path').resolve(url) : url;
|
||||
},
|
||||
|
||||
statics: new function() {
|
||||
function handleAttribute(name) {
|
||||
name += 'Attribute';
|
||||
|
@ -4877,10 +4882,12 @@ var Raster = Item.extend({
|
|||
initialize: function Raster(object, position) {
|
||||
if (!this._initialize(object,
|
||||
position !== undefined && Point.read(arguments, 1))) {
|
||||
if (typeof object === 'string') {
|
||||
this.setSource(object);
|
||||
var image = typeof object === 'string'
|
||||
? document.getElementById(object) : object;
|
||||
if (image) {
|
||||
this.setImage(image);
|
||||
} else {
|
||||
this.setImage(object);
|
||||
this.setSource(object);
|
||||
}
|
||||
}
|
||||
if (!this._size) {
|
||||
|
@ -5048,23 +5055,24 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSource: function(src) {
|
||||
var crossOrigin = this._crossOrigin,
|
||||
image = document.getElementById(src) || new window.Image();
|
||||
image = new window.Image();
|
||||
image.src = paper.resolvePath(src);
|
||||
var crossOrigin = this._crossOrigin;
|
||||
if (crossOrigin)
|
||||
image.crossOrigin = crossOrigin;
|
||||
if (!image.src)
|
||||
image.src = src;
|
||||
this.setImage(image);
|
||||
},
|
||||
|
||||
getCrossOrigin: function() {
|
||||
return this._image && this._image.crossOrigin || this._crossOrigin || '';
|
||||
var image = this._image;
|
||||
return image && image.crossOrigin || this._crossOrigin || '';
|
||||
},
|
||||
|
||||
setCrossOrigin: function(crossOrigin) {
|
||||
this._crossOrigin = crossOrigin;
|
||||
if (this._image)
|
||||
this._image.crossOrigin = crossOrigin;
|
||||
var image = this._image;
|
||||
if (image)
|
||||
image.crossOrigin = crossOrigin;
|
||||
},
|
||||
|
||||
getElement: function() {
|
||||
|
@ -12735,7 +12743,8 @@ var Tool = PaperScopeItem.extend({
|
|||
var Http = {
|
||||
request: function(options) {
|
||||
var xhr = new window.XMLHttpRequest();
|
||||
xhr.open((options.method || 'get').toUpperCase(), options.url,
|
||||
xhr.open((options.method || 'get').toUpperCase(),
|
||||
paper.resolvePath(options.url),
|
||||
Base.pick(options.async, true));
|
||||
if (options.mimeType)
|
||||
xhr.overrideMimeType(options.mimeType);
|
||||
|
|
16
dist/paper-full.min.js
vendored
16
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue