diff --git a/src/main/webapp/resources/js/main.js b/src/main/webapp/resources/js/main.js index 9fb3d14..497b13f 100644 --- a/src/main/webapp/resources/js/main.js +++ b/src/main/webapp/resources/js/main.js @@ -24,6 +24,8 @@ $(document).ready(function() { window.rooms = new Rooms(); window.roomsView = new RoomsView({collection: rooms}); + window.devices = new Devices(); + window.devicesView = new DevicesView({collection: devices}); window.App = new Workspace(); Backbone.history.start() diff --git a/src/main/webapp/resources/js/models.js b/src/main/webapp/resources/js/models.js index d29a530..8ac1861 100644 --- a/src/main/webapp/resources/js/models.js +++ b/src/main/webapp/resources/js/models.js @@ -4,4 +4,9 @@ model: Room, url: '/resources/json/rooms.json' }); + window.Device = Backbone.Model.extend({}); + window.Devices = Backbone.Collection.extend({ + model: Device, + url: '/control/devices' + }); })(jQuery); \ No newline at end of file diff --git a/src/main/webapp/resources/js/views.js b/src/main/webapp/resources/js/views.js index ce01f0b..d0fac59 100644 --- a/src/main/webapp/resources/js/views.js +++ b/src/main/webapp/resources/js/views.js @@ -12,3 +12,11 @@ window.RoomsView = Backbone.View.extend({ return this; } }); +window.DevicesView = Backbone.View.extend({ + initialize: function() { + this.collection.bind('reset', this.render, this); + }, + render: function() { + + } +});