From 26bcae27a556594759e50c70aede837059cbde0c Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Sun, 8 Dec 2013 15:56:19 -0800 Subject: [PATCH] Add script example --- bs.html | 33 +++++++++++++++++++++++++++++++++ index.js | 4 ++-- script.js | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 bs.html diff --git a/bs.html b/bs.html new file mode 100644 index 0000000..9745acb --- /dev/null +++ b/bs.html @@ -0,0 +1,33 @@ + +BasicScript demo +

Something important

+ + + + + diff --git a/index.js b/index.js index 462e04b..2b0ec3a 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ -window.onload = function () { +window.addEventListener('DOMContentLoaded', function () { var $ = function (s) { return document.querySelector(s); }; @@ -240,4 +240,4 @@ window.onload = function () { } else { loadFile('samples/sample.default.txt', setSource); } -}; +}); diff --git a/script.js b/script.js index 427b80c..ac9a813 100644 --- a/script.js +++ b/script.js @@ -141,7 +141,7 @@ } window.addEventListener('load', function() { - [].forEach.call(document.querySelectorAll('script'), function(script) { + [].forEach.call($$('script'), function(script) { if (script.type === 'text/applesoft-basic') { var elem = createInstance(script.innerText); script.parentElement.insertBefore(elem, script.nextSibling);