bunti-node/js/app.js

39 lines
1.1 KiB
JavaScript
Executable File

var app = {
module: function () {
var modules = {};
return function (name) {
if (modules[name]) {
return modules[name];
}
return modules[name] = { Views: {} };
};
} ()
},
dataModel = {
rooms: [
{ roomId: 1, title: "Raum 1", devices: [
{ deviceId: 1, type: "switch", options: [{ status: "off"}], pos:{x:280} },
{ deviceId: 2, type: "switch", options: [{ status: "on"}], pos:{x:500,y:280} }
]},
{ roomId: 2, title: "Raum 2", devices: [
{ deviceId: 3, type: "colorpicker", options: [{ color:'FF3300' }], pos:{x:400,y:0} },
{ deviceId: 4, type: "colorpicker", options: [{ color:'FF3300' }], pos:{x:400,y:230} }
]},
{ roomId: 3, title: "Raum 3" },
{ roomId: 4, title: "Raum 4" },
{ roomId: 5, title: "Raum 5" }
]
};
jQuery(function ($) {
// load the modules
app.util = app.module('util');
app.util.preloadTemplates(['room','switch','colorpicker'], function () {
app.router = app.module('router');
app.Router = new app.router.Router();
Backbone.history.start();
});
});