Pull CodeMirror from CDN, use submodule for polyfill
This commit is contained in:
parent
207fed95cb
commit
728c1599e5
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "polyfill"]
|
||||||
|
path = polyfill
|
||||||
|
url = https://github.com/inexorabletash/polyfill.git
|
11
README.md
11
README.md
|
@ -1,15 +1,9 @@
|
||||||
jsbasic - Applesoft BASIC in JavaScript
|
jsbasic - Applesoft BASIC in JavaScript
|
||||||
=======================================
|
=======================================
|
||||||
|
|
||||||
This is hosted for playing with at http://calormen.com/applesoft/
|
This is hosted for playing with at http://calormen.com/applesoft/
|
||||||
|
|
||||||
For older browsers, the code depends on various [polyfills](http://github.com/inexorabletash/polyfill).
|
Use `git clone --recursive` to get [polyfill](http://github.com/inexorabletash/polyfill) for older browsers.
|
||||||
For syntax highlighting, the editor optionally uses [CodeMirror](http://codemirror.net) and custom BASIC parser/styles.
|
|
||||||
Clone these into sibling directories, so you end up with a structure like:
|
|
||||||
|
|
||||||
jsbasic/
|
|
||||||
polyfill/
|
|
||||||
CodeMirror/
|
|
||||||
|
|
||||||
Notes & Known Issues
|
Notes & Known Issues
|
||||||
--------------------
|
--------------------
|
||||||
|
@ -35,4 +29,3 @@ You can run your basic programs from the command line (with only basic text inpu
|
||||||
* Clone the repository locally
|
* Clone the repository locally
|
||||||
* On Windows, run from a command prompt via: `cscript.exe cbasic.js your_program.txt`
|
* On Windows, run from a command prompt via: `cscript.exe cbasic.js your_program.txt`
|
||||||
* On Mac/Linux, install Mozilla Rhino, run from the command prompt via: `java -jar PATH_TO/js.jar cbasic.js your_program.txt`
|
* On Mac/Linux, install Mozilla Rhino, run from the command prompt via: `java -jar PATH_TO/js.jar cbasic.js your_program.txt`
|
||||||
|
|
||||||
|
|
36
index.htm
36
index.htm
|
@ -6,16 +6,16 @@
|
||||||
<link rel="stylesheet" href="styles.css" type="text/css">
|
<link rel="stylesheet" href="styles.css" type="text/css">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Suppress browser compat button -->
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Suppress browser compat button -->
|
||||||
|
|
||||||
<script type="text/javascript" src="../polyfill/polyfill.js?update=2012-02-08"></script>
|
<script src="polyfill/polyfill.js?update=2012-02-08"></script>
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
function load(url) { document.write('<script type="text/javascript" src="' + url + '"></' + 'script>'); }
|
function load(url) { document.write('<script src="' + url + '"></' + 'script>'); }
|
||||||
if (!window.JSON) { load('../polyfill/json2.js'); }
|
if (!window.JSON) { load('polyfill/json2.js'); }
|
||||||
if (!window.localStorage || !window.sessionStorage) { load('../polyfill/storage.js'); }
|
if (!window.localStorage || !window.sessionStorage) { load('polyfill/storage.js'); }
|
||||||
if (!('getContext' in document.createElement('canvas'))) { load('../polyfill/flashcanvas.js'); }
|
if (!('getContext' in document.createElement('canvas'))) { load('polyfill/flashcanvas.js'); }
|
||||||
}());
|
}());
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="../polyfill/keyboard.js"></script>
|
<script src="polyfill/keyboard.js"></script>
|
||||||
|
|
||||||
<h1>Applesoft BASIC in Javascript</h1>
|
<h1>Applesoft BASIC in Javascript</h1>
|
||||||
<p>
|
<p>
|
||||||
|
@ -130,8 +130,8 @@ By <a href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
|
||||||
<div id="paper"></div>
|
<div id="paper"></div>
|
||||||
|
|
||||||
<!-- CodeMirror syntax highlighting - this is optional -->
|
<!-- CodeMirror syntax highlighting - this is optional -->
|
||||||
<script src="../CodeMirror/lib/codemirror.js"></script>
|
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.js"></script>
|
||||||
<link rel="stylesheet" href="../CodeMirror/lib/codemirror.css">
|
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.css">
|
||||||
<script src="cm/basic.js"></script>
|
<script src="cm/basic.js"></script>
|
||||||
<link rel="stylesheet" href="cm/basic.css">
|
<link rel="stylesheet" href="cm/basic.css">
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
|
@ -139,17 +139,17 @@ By <a href="mailto:inexorabletash@gmail.com">Joshua Bell</a>
|
||||||
.CodeMirror-scroll { height: 100%; }
|
.CodeMirror-scroll { height: 100%; }
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="basic.js?2012-02-08"></script>
|
<script src="basic.js?2012-02-08"></script>
|
||||||
<script type="text/javascript" src="bell.js"></script>
|
<script src="bell.js"></script>
|
||||||
<script type="text/javascript" src="tty.js"></script>
|
<script src="tty.js"></script>
|
||||||
<script type="text/javascript" src="lores.js"></script>
|
<script src="lores.js"></script>
|
||||||
<script type="text/javascript" src="hires.js"></script>
|
<script src="hires.js"></script>
|
||||||
<script type="text/javascript" src="dos.js"></script>
|
<script src="dos.js"></script>
|
||||||
<script type="text/javascript" src="printer.js"></script>
|
<script src="printer.js"></script>
|
||||||
<script type="text/javascript" src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
|
|
||||||
<!-- Google Analytics -->
|
<!-- Google Analytics -->
|
||||||
<script type="text/javascript">
|
<script>
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
_gaq.push(['_setAccount', 'UA-18610679-3']);
|
_gaq.push(['_setAccount', 'UA-18610679-3']);
|
||||||
_gaq.push(['_trackPageview']);
|
_gaq.push(['_trackPageview']);
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit fc2ff48f6ebed7e80c7b3cd62f83e2f22fd3b9bb
|
|
@ -594,7 +594,7 @@ function which implements the logic for walking over the array.<p>
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script type="text/javascript" src="../polyfill/polyfill.js"></script>
|
<script src="polyfill/polyfill.js"></script>
|
||||||
<script>
|
<script>
|
||||||
(function buildTOC(el) {
|
(function buildTOC(el) {
|
||||||
var html = [];
|
var html = [];
|
||||||
|
|
18
script.js
18
script.js
|
@ -7,15 +7,15 @@
|
||||||
|
|
||||||
document.write('<link rel="stylesheet" href="' + baseURL + 'display.css">');
|
document.write('<link rel="stylesheet" href="' + baseURL + 'display.css">');
|
||||||
|
|
||||||
function load(url) { document.write('<script type="text/javascript" src="' + url + '"></script>'); }
|
function load(url) { document.write('<script src="' + baseURL + url + '"></script>'); }
|
||||||
load(baseURL + '../polyfill/polyfill.js');
|
load('polyfill/polyfill.js');
|
||||||
load(baseURL + '../polyfill/keyboard.js');
|
load('polyfill/keyboard.js');
|
||||||
load(baseURL + 'tty.js');
|
load('tty.js');
|
||||||
load(baseURL + 'lores.js');
|
load('lores.js');
|
||||||
load(baseURL + 'hires.js');
|
load('hires.js');
|
||||||
load(baseURL + 'bell.js');
|
load('bell.js');
|
||||||
load(baseURL + 'dos.js');
|
load('dos.js');
|
||||||
load(baseURL + 'basic.js');
|
load('basic.js');
|
||||||
|
|
||||||
function createInstance(src) {
|
function createInstance(src) {
|
||||||
function ce(element, attributes, children) {
|
function ce(element, attributes, children) {
|
||||||
|
|
Loading…
Reference in New Issue