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 14:25:01 +00:00
|
|
|
|
var 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" },
|
|
|
|
|
{ roomId: 3, title: "Raum 3" },
|
|
|
|
|
{ roomId: 4, title: "Raum 4" },
|
|
|
|
|
{ roomId: 5, title: "Raum 5" }
|
|
|
|
|
]
|
|
|
|
|
};
|
|
|
|
|
|
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');
|
|
|
|
|
app.util.preloadTemplates(['room','switch'], function () {
|
|
|
|
|
app.router = app.module('router');
|
|
|
|
|
app.Router = new app.router.Router();
|
|
|
|
|
Backbone.history.start();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
//app.room = app.module('room');
|
|
|
|
|
//app.option = app.module('option');
|
2012-07-17 22:22:38 +00:00
|
|
|
|
|
2012-07-19 14:25:01 +00:00
|
|
|
|
//// create the model
|
|
|
|
|
//dashboard = new app.room.View({ model: dataModel });
|
|
|
|
|
|