Change naming of exported PaperScript methods.

This commit is contained in:
Jürg Lehni 2011-03-08 00:17:19 +00:00
parent 798bcd709a
commit 8f78513174

View file

@ -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