bunti-node/js/app.js

46 lines
1.3 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: {} };
};
} ()
};
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" }
]
};
jQuery(function ($) {
// load the modules
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');
//// create the model
//dashboard = new app.room.View({ model: dataModel });