diff --git a/public/js/vroom.js b/public/js/vroom.js index dcac84d..2b2692c 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -251,168 +251,66 @@ function initIndex(){ }); } -// Used on the management page -function initManage(){ - - var data = {}; +// Used on the admin page +function initAdmin(){ + var roomList = {}; + var matches = 0; + + // Update display of room list + function updateDeviceList(filter, min, max){ + $('#deviceList').html(''); + var filterRe = new RegExp(filter, "gi"); + var i = 0; + matches = 0; + $.each(roomList, function (index, obj){ + if (filter === '' || obj.name.match(filterRe)){ + matches++; + if (i >= min && i < max){ + $('#deviceList').append($('
- <%=l 'ROOM_NAME' %> - | -- <%=l 'MANAGE' %> - | -||
---|---|---|---|
- <%= $room %> - | -
-
+
+
+
+
|