diff options
Diffstat (limited to 'modules-available/locationinfo/templates')
-rwxr-xr-x | modules-available/locationinfo/templates/frontend-default.html | 10 | ||||
-rw-r--r-- | modules-available/locationinfo/templates/page-config-panel-default.html | 34 |
2 files changed, 42 insertions, 2 deletions
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html index 98149bb9..c59679ee 100755 --- a/modules-available/locationinfo/templates/frontend-default.html +++ b/modules-available/locationinfo/templates/frontend-default.html @@ -499,7 +499,8 @@ optional: if (!scaleFactor) { scaleFactor = 1; } - if (!v || !isFinite(v) || isNaN(v) || v < min * scaleFactor || v > max * scaleFactor) { + if (v === null || !isFinite(v) || isNaN(v) || v < min * scaleFactor || v > max * scaleFactor) { + console.log(property) config[property] = defaultval * scaleFactor; } } @@ -522,6 +523,7 @@ optional: setRoomConfigFromUrl(config, 'calupdate', PARAM_INT, 60 * 1000); setRoomConfigFromUrl(config, 'roomupdate', PARAM_INT, 1000); + setRoomConfigFromUrl(config, 'startday', PARAM_INT); setRoomConfigFromUrl(config, 'daystoshow', PARAM_INT); setRoomConfigFromUrl(config, 'scaledaysauto', PARAM_BOOL); setRoomConfigFromUrl(config, 'vertical', PARAM_BOOL); @@ -535,6 +537,7 @@ optional: // parameter validation putInRange(config, 'switchtime', 5, 120, 6, 1000); putInRange(config, 'scale', 10, 90, 50); + putInRange(config, 'startday', 0, 7, 0); putInRange(config, 'daystoshow', 1, 7, 7); putInRange(config, 'roomupdate', 15, 5 * 60, 60, 1000); putInRange(config, 'calupdate', 1, 60, 30, 60 * 1000); @@ -738,6 +741,9 @@ optional: */ function setUpCalendar(room) { var daysToShow = room.config.daystoshow; + var startDay = room.config.startday; + var startDayDate = new Date(); + if (startDay > 0) startDayDate.setDate((startDayDate.getDate() - (startDayDate.getDay() + 6) % 7) + (startDay - 1)); generateCalendarDiv(room); room.$.calendar.weekCalendar({ timeslotsPerHour: 1, @@ -765,7 +771,7 @@ optional: $event.find(".time").css({"backgroundColor": "#25B002", "border": "1px solid #888"}); } }, - date: MyDate(), + date: startDayDate, dateFormat: "j.n", timeFormat: "G:i", scrollToHourMillis: 500, diff --git a/modules-available/locationinfo/templates/page-config-panel-default.html b/modules-available/locationinfo/templates/page-config-panel-default.html index 43a7db44..5e13190e 100644 --- a/modules-available/locationinfo/templates/page-config-panel-default.html +++ b/modules-available/locationinfo/templates/page-config-panel-default.html @@ -194,6 +194,31 @@ <div class="list-group-item m1-s m2-s m3-h m4-s"> <div class="row"> <div class="col-sm-3"> + <label for="startday">{{lang_startDay}}</label> + </div> + <div class="col-sm-7"> + <select class="form-control" id="startday" name="startday"> + <option value="0">{{lang_currentDay}}</option> + <option value="1">{{lang_monday}}</option> + <option value="2">{{lang_thuesday}}</option> + <option value="3">{{lang_wednesday}}</option> + <option value="4">{{lang_thursday}}</option> + <option value="5">{{lang_friday}}</option> + <option value="6">{{lang_saturday}}</option> + <option value="7">{{lang_sunday}}</option> + </select> + </div> + <div class="col-sm-2"> + <p class="btn btn-static helptext" title="{{lang_startDayTooltip}}"> + <span class="glyphicon glyphicon-question-sign"></span> + </p> + </div> + </div> + </div> + + <div class="list-group-item m1-s m2-s m3-h m4-s"> + <div class="row"> + <div class="col-sm-3"> <label for="scaledaysauto">{{lang_autoScale}}</label> </div> <div class="col-sm-7"> @@ -385,6 +410,7 @@ document.addEventListener("DOMContentLoaded", function () { addLocation(lids[i], $name.text()); } + $('#startday option[value="{{startday}}"]').attr("selected", "selected"); $('#daystoshow option[value="{{daystoshow}}"]').attr("selected", "selected"); $('#rotation option[value="{{rotation}}"]').attr("selected", "selected"); $('#mode option[value="{{mode}}"]').attr("selected", "selected"); @@ -475,6 +501,11 @@ document.addEventListener("DOMContentLoaded", function () { '<div class="col-sm-2"><p class="btn btn-static helptext" title="{{lang_verticalTooltip}}"><span class="glyphicon glyphicon-question-sign"></span></p></div>' + '</div></div>')); $content.append($('<div class="list-group-item om1-s om2-s om3-h om4-s"><div class="row">' + + '<div class="col-sm-3"><label for="override' + id + 'startday">{{lang_startDay}}</label></div>' + + '<div class="col-sm-7"><select class="form-control" id="override' + id + 'startday" name="override' + id + 'startday"><option value="0">{{lang_currentDay}}</option><option value="1">{{lang_monday}}</option><option value="2">{{lang_thuesday}}</option><option value="3">{{lang_wednesday}}</option><option value="4">{{lang_thursday}}</option><option value="5">{{lang_friday}}</option><option value="6">{{lang_saturday}}</option><option value="7">{{lang_sunday}}</option></select></div>' + + '<div class="col-sm-2"><p class="btn btn-static helptext" title="{{lang_startDayTooltip}}"><span class="glyphicon glyphicon-question-sign"></span></p></div>' + + '</div></div>')); + $content.append($('<div class="list-group-item om1-s om2-s om3-h om4-s"><div class="row">' + '<div class="col-sm-3"><label for="override' + id + 'scaledaysauto">{{lang_autoScale}}</label></div>' + '<div class="col-sm-7"><input id="override' + id + 'scaledaysauto" name="override' + id + 'scaledaysauto" type="checkbox"></div>' + '<div class="col-sm-2"><p class="btn btn-static helptext" title="{{lang_autoscaleTooltip}}"><span class="glyphicon glyphicon-question-sign"></span></p></div>' + @@ -514,6 +545,7 @@ document.addEventListener("DOMContentLoaded", function () { $('#override' + id + 'roomplanner').val(overrides[id].roomplanner ? 1 : 0); if (overrides[id].vertical) $('#override' + id + 'vertical').bootstrapSwitch('state', true); if (overrides[id].scaledaysauto) $('#override' + id + 'scaledaysauto').bootstrapSwitch('state', true); + $('#override' + id + 'startday').val(overrides[id].startday); $('#override' + id + 'daystoshow').val(overrides[id].daystoshow); $('#override' + id + 'rotation').val(overrides[id].rotation); scale.val(overrides[id].scale); @@ -522,6 +554,8 @@ document.addEventListener("DOMContentLoaded", function () { $('#override' + id + 'roomplanner').val($('#input-roomplanner').val()); if ($('#input-vertical').bootstrapSwitch('state')) $('#override' + id + 'vertical').bootstrapSwitch('state', true); if ($('#scaledaysauto').bootstrapSwitch('state')) $('#override' + id + 'scaledaysauto').bootstrapSwitch('state', true); + console.log($('#startday').val()) + $('#override' + id + 'startday').val($('#startday').val()); $('#override' + id + 'daystoshow').val($('#daystoshow').val()); $('#override' + id + 'rotation').val($('#rotation').val()); scale.val($('#input-scale').val()); |