2012-07-17 22:22:38 +00:00
|
|
|
|
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 = {
|
2012-07-19 14:25:01 +00:00
|
|
|
|
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" }
|
|
|
|
|
]
|
2012-07-19 14:25:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2012-07-17 22:22:38 +00:00
|
|
|
|
jQuery(function ($) {
|
|
|
|
|
// load the modules
|
2012-07-19 14:25:01 +00:00
|
|
|
|
app.util = app.module('util');
|
2012-07-19 21:45:22 +00:00
|
|
|
|
app.util.preloadTemplates(['room','switch','colorpicker'], function () {
|
2012-07-19 14:25:01 +00:00
|
|
|
|
app.router = app.module('router');
|
|
|
|
|
app.Router = new app.router.Router();
|
|
|
|
|
Backbone.history.start();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|