Improve Paper code editor to also display errors.

This commit is contained in:
Jürg Lehni 2012-10-23 20:05:01 -07:00
parent 7096b37b2e
commit 4a74cf9e29
2 changed files with 3 additions and 2 deletions

View file

@ -15,3 +15,4 @@
./build.sh
cp ../dist/paper.js ../editor/assets/js/paper.js
./load.sh

View file

@ -222,7 +222,7 @@ var PaperScript = this.PaperScript = new function() {
// Only load this script if it not loaded already.
// Support both text/paperscript and text/x-paperscript:
if (/^text\/(?:x-|)paperscript$/.test(script.type)
&& !script.getAttribute('data-paper-loaded')) {
&& !script.getAttribute('data-paper-ignore')) {
// Produce a new PaperScope for this script now. Scopes are
// cheap so let's not worry about the initial one that was
// already created.
@ -241,7 +241,7 @@ var PaperScript = this.PaperScript = new function() {
evaluate(script.innerHTML, scope);
}
// Mark script as loaded now.
script.setAttribute('data-paper-loaded', true);
script.setAttribute('data-paper-ignore', true);
}
}
}