mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Change naming of exported PaperScript methods.
This commit is contained in:
parent
798bcd709a
commit
8f78513174
1 changed files with 6 additions and 5 deletions
|
@ -149,7 +149,7 @@ var PaperScript = new function() {
|
||||||
|
|
||||||
//#ifdef BROWSER
|
//#ifdef BROWSER
|
||||||
// Code borrowed from Coffee Script:
|
// Code borrowed from Coffee Script:
|
||||||
function load(url) {
|
function request(url) {
|
||||||
var xhr = new (window.ActiveXObject
|
var xhr = new (window.ActiveXObject
|
||||||
|| XMLHttpRequest)('Microsoft.XMLHTTP');
|
|| XMLHttpRequest)('Microsoft.XMLHTTP');
|
||||||
xhr.open('GET', url, true);
|
xhr.open('GET', url, true);
|
||||||
|
@ -163,7 +163,8 @@ var PaperScript = new function() {
|
||||||
};
|
};
|
||||||
return xhr.send(null);
|
return xhr.send(null);
|
||||||
}
|
}
|
||||||
function install() {
|
|
||||||
|
function load() {
|
||||||
var scripts = document.getElementsByTagName('script');
|
var scripts = document.getElementsByTagName('script');
|
||||||
for (var i = 0, l = scripts.length; i < l; i++) {
|
for (var i = 0, l = scripts.length; i < l; i++) {
|
||||||
var script = scripts[i];
|
var script = scripts[i];
|
||||||
|
@ -175,7 +176,7 @@ var PaperScript = new function() {
|
||||||
new Document(canvas);
|
new Document(canvas);
|
||||||
}
|
}
|
||||||
if (script.src) {
|
if (script.src) {
|
||||||
load(script.src);
|
request(script.src);
|
||||||
} else {
|
} else {
|
||||||
run(script.innerHTML);
|
run(script.innerHTML);
|
||||||
}
|
}
|
||||||
|
@ -184,12 +185,12 @@ var PaperScript = new function() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.add(window, { load: install });
|
Events.add(window, { load: load });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
compile: compile,
|
compile: compile,
|
||||||
run: run,
|
run: run,
|
||||||
install: install
|
load: load
|
||||||
};
|
};
|
||||||
|
|
||||||
//#else // !BROWSER
|
//#else // !BROWSER
|
||||||
|
|
Loading…
Reference in a new issue