bunti-node/js/app.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

var app = {
module: function () {
var modules = {};
return function (name) {
if (modules[name]) {
return modules[name];
}
return modules[name] = { Views: {} };
};
} ()
2012-07-19 21:45:22 +00:00
},
dataModel = {
rooms: [
2012-07-19 21:45:22 +00:00
{ 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');
2012-07-19 21:45:22 +00:00
app.util.preloadTemplates(['room','switch','colorpicker'], function () {
app.router = app.module('router');
app.Router = new app.router.Router();
Backbone.history.start();
});
});