From 21da9400fd8e411eef083a0b8ade0da31a994c10 Mon Sep 17 00:00:00 2001 From: Michael Scherle Date: Wed, 22 Mar 2017 16:55:23 +0100 Subject: frontend: fixed roomupdate & removed 10 sec delay --- .../locationinfo/frontend/doorsign.html | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'modules-available/locationinfo/frontend/doorsign.html') diff --git a/modules-available/locationinfo/frontend/doorsign.html b/modules-available/locationinfo/frontend/doorsign.html index 0b50fcfe..cd800283 100755 --- a/modules-available/locationinfo/frontend/doorsign.html +++ b/modules-available/locationinfo/frontend/doorsign.html @@ -279,13 +279,7 @@ optional: var roomsToshow = 0; var roomIds; //Todo change these - var CalendarUpdateTime = 60 * 1000; - var RoomUpdateTime = 60 * 1000; - var date; - - var configJson; - var supportSvg = typeof SVGRect != "undefined"; var calendarQueryUrl; var translation = { @@ -317,12 +311,7 @@ optional: } }; - var overlay = { - "1": { name:"1.svg", - class:"overlay1" - } - } $(document).ready(function () { @@ -343,7 +332,7 @@ optional: cache: false, timeout: 30000, success: function (result) { - if (configJson == null) { + if (room == null) { if (result.room == null) { // Todo Error Handling: wrong id? return; @@ -621,23 +610,25 @@ optional: // Main Update loop, this loop runs every 1 seconds and calls all // function which should be called periodically - var timeSteps = 0; + var timeSteps = 10; + function mainUpdateLoop() { // check ervery 10 sec if rooms need new calendar data or room data // groups request + if(timeSteps > 9) { timeSteps = 0; var calendarUpdateIds =""; var rommUpdateIds=""; for (var property in rooms) { - if (rooms[property].config.lastCalendarUpdate == null || rooms[property].config.lastCalendarUpdate + rooms[property].config.calupdate *60* 1000 < MyDate().getTime()) { + if (rooms[property].config.lastCalendarUpdate == null || rooms[property].config.lastCalendarUpdate + rooms[property].config.calupdate < MyDate().getTime()) { calendarUpdateIds = addIdToUpdateList(calendarUpdateIds,rooms[property].id); rooms[property].config.lastCalendarUpdate = MyDate().getTime(); } - if (rooms[property].config.lastRoomUpdate == null || rooms[property].config.lastRoomUpdate + rooms[property].config.roomupdate *1000 < MyDate().getTime()) { + if (rooms[property].config.lastRoomUpdate == null || rooms[property].config.lastRoomUpdate + rooms[property].config.roomupdate < MyDate().getTime()) { rommUpdateIds= addIdToUpdateList(rommUpdateIds,rooms[property].id); rooms[property].config.lastRoomUpdate = MyDate().getTime(); } @@ -731,6 +722,7 @@ optional: } // inilizes the Calendar for an room + function setUpCalendar(percent, daysToShow, room) { generateCalendarDiv(percent, room); var $calendar = $("#calendar_" + room.id).weekCalendar({ -- cgit v1.2.3-55-g7522