radio/lorgar/main.js

57 lines
2.1 KiB
JavaScript
Raw Normal View History

2018-08-04 21:46:25 +00:00
"use strict";
(function main_js() {
requirejs.config({
"baseUrl": "/"
});
2018-08-04 21:46:25 +00:00
requirejs.onError = function(e) {
throw e;
}
var defineArray = [];
defineArray.push("test/test");
defineArray.push("core/lorgar");
defineArray.push("lib/utils/globalMethods");
defineArray.push("lib/em/wrapper");
2018-08-04 21:46:25 +00:00
require(defineArray, function main_module() {
require("lib/utils/globalMethods");
var Test = require("test/test");
var Lorgar = require("core/lorgar");
var Controller = require("lib/wController/controller");
var View = require("views/view");
window.Mp3Decoder = Module.Decoder;
2018-08-04 21:46:25 +00:00
var waiter = {
views: false,
controllers: false,
check: function(key) {
this[key] = true;
this.launch()
},
launch: function() {
if (this.views && this.controllers) {
window.lorgar = new Lorgar();
window.registerForeignController = window.lorgar.registerForeignController.bind(window.lorgar);
window.unregisterForeignController = window.lorgar.unregisterForeignController.bind(window.lorgar);
window.subscribeForeignController = window.lorgar.subscribeForeignController.bind(window.lorgar);
window.unsubscribeForeignController = window.lorgar.unsubscribeForeignController.bind(window.lorgar);
window.play = window.lorgar.play.bind(window.lorgar);
window.scheduleToPlay = window.lorgar.scheduleToPlay.bind(window.lorgar);
2018-08-04 21:46:25 +00:00
}
}
}
2018-08-04 21:52:16 +00:00
Controller.initialize(["String", "List", "Vocabulary", "Page", "PanesList", "Link", "Image", "Button"], waiter.check.bind(waiter, "controllers"));
View.initialize(["Label", "Page", "PanesList", "Nav", "Image", "Button", "Enumeration"], waiter.check.bind(waiter, "views"));
2018-08-04 21:46:25 +00:00
var test = new Test();
test.run();
});
})();