forked from lkesteloot/turbopascal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
32 lines (29 loc) · 911 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Main program of IDE-based compiler.
'use strict';
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
paths: {
"jquery": "vendor/jquery-1.10.1.min",
"underscore": "vendor/underscore-1.5.2.min"
}
});
require(["jquery", "Screen", "Keyboard", "IDE"], function ($, Screen, Keyboard, IDE) {
var $screen = $("#screen");
var screen = new Screen($screen);
var keyboard = new Keyboard();
$.ajax('./files.json',{
dataType: "json",
isLocal: true,
error: function (e) {
var ide = new IDE(screen, keyboard, []);
ide.printMenu();
ide.screen.printBold("File can't be loaded: files.json");
ide.screen.newLine();
ide.printPrompt();
},
success: function (files) {
var ide = new IDE(screen, keyboard, files);
ide.printMenu();
}
});
});