summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo
diff options
context:
space:
mode:
authorSimon Rettberg2020-11-03 13:45:37 +0100
committerSimon Rettberg2020-11-03 13:45:37 +0100
commit77f9f9d9e975bd14083656f987b426e81908dd9e (patch)
treef98263140b353ea2a3c9c6a2e19d2eec66fd5115 /modules-available/locationinfo
parent[locationinfo] Clean up styling a bit more (diff)
downloadslx-admin-77f9f9d9e975bd14083656f987b426e81908dd9e.tar.gz
slx-admin-77f9f9d9e975bd14083656f987b426e81908dd9e.tar.xz
slx-admin-77f9f9d9e975bd14083656f987b426e81908dd9e.zip
[locationinfo] Remove unused javascript
Most javascript was needed for editing the opening times of locations. Some javascript was still used to fill the now disabled input forms for display only. This is now done server-side, and the input fields have been replaced by a simple table.
Diffstat (limited to 'modules-available/locationinfo')
-rw-r--r--modules-available/locationinfo/clientscript.js91
-rw-r--r--modules-available/locationinfo/config.json2
-rw-r--r--modules-available/locationinfo/lang/de/module.json10
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json10
-rw-r--r--modules-available/locationinfo/lang/en/module.json12
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json10
-rw-r--r--modules-available/locationinfo/page.inc.php110
-rw-r--r--modules-available/locationinfo/templates/ajax-config-location.html168
-rw-r--r--modules-available/locationinfo/templates/page-config-panel-default.html20
-rw-r--r--modules-available/locationinfo/templates/page-config-panel-summary.html8
-rw-r--r--modules-available/locationinfo/templates/page-locations.html6
11 files changed, 114 insertions, 333 deletions
diff --git a/modules-available/locationinfo/clientscript.js b/modules-available/locationinfo/clientscript.js
deleted file mode 100644
index f8309a8a..00000000
--- a/modules-available/locationinfo/clientscript.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Generic helpers.
- */
-
-/**
- * Initialize timepicker on given element.
- */
-function setTimepicker($e) {
- $e.timepicker({
- minuteStep: 15,
- appendWidgetTo: 'body',
- showSeconds: false,
- showMeridian: false,
- defaultTime: false
- });
-}
-
-function getTime(str) {
- if (!str) return false;
- str = str.split(':');
- if (str.length !== 2) return false;
- var h = parseInt(str[0].replace(/^0/, ''));
- var m = parseInt(str[1].replace(/^0/, ''));
- if (h < 0 || h > 23) return false;
- if (m < 0 || m > 59) return false;
- return h * 60 + m;
-}
-
-const allDays = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
-
-/*
- * Opening times related...
- */
-
-var slxIdCounter = 0;
-
-/**
- * Adds a new opening time to the table in expert mode.
- */
-function newOpeningTime(vals) {
- var $row = $('#expert-template').find('div.row').clone();
- if (vals['days'] && Array.isArray(vals['days'])) {
- for (var i = 0; i < allDays.length; ++i) {
- $row.find('.i-' + allDays[i]).prop('checked', vals['days'].indexOf(allDays[i]) !== -1);
- }
- }
- $row.find('input').each(function() {
- var $inp = $(this);
- if ($inp.length === 0) return;
- slxIdCounter++;
- $inp.prop('id', 'id-inp-' + slxIdCounter);
- $inp.siblings('label').prop('for', 'id-inp-' + slxIdCounter);
- });
- $row.find('.i-openingtime').val(vals['openingtime']);
- $row.find('.i-closingtime').val(vals['closingtime']);
- $('#expert-table').append($row);
- return $row;
-}
-
-/**
- * Convert fields from simple mode view to entries in expert mode.
- * @returns {Array}
- */
-function simpleToExpert() {
- var retval = [];
- if ($('#week-open').val() || $('#week-close').val()) {
- retval.push({
- 'days': ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
- 'openingtime': $('#week-open').val(),
- 'closingtime': $('#week-close').val(),
- 'tag': '#week'
- });
- }
- if ($('#saturday-open').val() || $('#saturday-close').val()) {
- retval.push({
- 'days': ['Saturday'],
- 'openingtime': $('#saturday-open').val(),
- 'closingtime': $('#saturday-close').val(),
- 'tag': '#saturday'
- });
- }
- if ($('#sunday-open').val() || $('#sunday-close').val()) {
- retval.push({
- 'days': ['Sunday'],
- 'openingtime': $('#sunday-open').val(),
- 'closingtime': $('#sunday-close').val(),
- 'tag': '#sunday'
- });
- }
- return retval;
-}
diff --git a/modules-available/locationinfo/config.json b/modules-available/locationinfo/config.json
index 15298ea1..4fa2859e 100644
--- a/modules-available/locationinfo/config.json
+++ b/modules-available/locationinfo/config.json
@@ -1,8 +1,6 @@
{
"category": "main.content",
"dependencies": [
- "js_jqueryui",
- "bootstrap_timepicker",
"locations",
"bootstrap_switch"
]
diff --git a/modules-available/locationinfo/lang/de/module.json b/modules-available/locationinfo/lang/de/module.json
index c344581c..a285351e 100644
--- a/modules-available/locationinfo/lang/de/module.json
+++ b/modules-available/locationinfo/lang/de/module.json
@@ -1,3 +1,11 @@
{
- "module_name": "Infoscreen"
+ "friday": "Freitag",
+ "module_name": "Infoscreen",
+ "monday": "Montag",
+ "page_title": "Inforscreens und Rechercheterminals",
+ "saturday": "Samstag",
+ "sunday": "Sonntag",
+ "thursday": "Donnerstag",
+ "tuesday": "Dienstag",
+ "wednesday": "Mittwoch"
} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
index b376b905..457f071c 100644
--- a/modules-available/locationinfo/lang/de/template-tags.json
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -17,14 +17,12 @@
"lang_checkConnection": "Verbindung pr\u00fcfen",
"lang_chromium": "Chromium",
"lang_closed": "Geschlossen",
- "lang_closingTime": "Schlie\u00dfungszeit",
"lang_configOverride": "Konfiguration \u00fcberschreiben",
"lang_countIp": "\u00fcber IP-Adressbereich",
"lang_countRoomplan": "\u00fcber Raumplaner",
"lang_createPanel": "Panel anlegen",
"lang_credentials": "Anmeldung",
"lang_currentDay": "Aktueller Tag",
- "lang_day": "Tag",
"lang_daysToShow": "Tage",
"lang_daysToShowTooltip": "Legt die Anzahl an Tagen im Kalender fest, die angezeigt werden",
"lang_defaultPanel": "Standard-Panel",
@@ -76,7 +74,6 @@
"lang_mode3": "Raum",
"lang_mode4": "Wechselnd",
"lang_modeTooltip": "Die Anzeigemodi, welche das Frontend unterst\u00fctzt",
- "lang_monTilFr": "Montag - Freitag",
"lang_monday": "Montag",
"lang_nameTooltip": "Legt den Namen des Servers fest",
"lang_noLocationsWarning": "Bitte w\u00e4hlen Sie mindestens einen Ort aus, der vom Panel angezeigt werden soll.",
@@ -119,19 +116,12 @@
"lang_serverTooltip": "Legt fest, von welchem Backend-Server die Kalenderdaten bezogen werden",
"lang_serverType": "Typ",
"lang_shortFri": "Fr",
- "lang_shortFriday": "Fr",
"lang_shortMon": "Mo",
- "lang_shortMonday": "Mo",
"lang_shortSat": "Sa",
- "lang_shortSaturday": "Sa",
"lang_shortSun": "So",
- "lang_shortSunday": "So",
"lang_shortThu": "Do",
- "lang_shortThursday": "Do",
"lang_shortTue": "Di",
- "lang_shortTuesday": "Di",
"lang_shortWed": "Mi",
- "lang_shortWednesday": "Mi",
"lang_showHostname": "Hostname anzeigen",
"lang_showLog": "Log",
"lang_slxbrowser": "SLX Browser",
diff --git a/modules-available/locationinfo/lang/en/module.json b/modules-available/locationinfo/lang/en/module.json
index 2fd14353..183b1877 100644
--- a/modules-available/locationinfo/lang/en/module.json
+++ b/modules-available/locationinfo/lang/en/module.json
@@ -1,3 +1,11 @@
{
- "module_name": "Infoscreen"
-}
+ "friday": "Friday",
+ "module_name": "Infoscreen",
+ "monday": "Monday",
+ "page_title": "Info screens and research terminals",
+ "saturday": "Saturday",
+ "sunday": "Sunday",
+ "thursday": "Thursday",
+ "tuesday": "Tuesday",
+ "wednesday": "Wednesday"
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json
index 27315bea..95e1b23f 100644
--- a/modules-available/locationinfo/lang/en/template-tags.json
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -17,14 +17,12 @@
"lang_checkConnection": "Check connection",
"lang_chromium": "Chromium",
"lang_closed": "Closed",
- "lang_closingTime": "Closing time",
"lang_configOverride": "Configuration override",
"lang_countIp": "by IP-Range",
"lang_countRoomplan": "by Roomplanner",
"lang_createPanel": "Create panel",
"lang_credentials": "Login",
"lang_currentDay": "Current Day",
- "lang_day": "Day",
"lang_daysToShow": "Days",
"lang_daysToShowTooltip": "Defines the amount of days to show in the calendar",
"lang_defaultPanel": "Default panel",
@@ -76,7 +74,6 @@
"lang_mode3": "Room",
"lang_mode4": "Switching",
"lang_modeTooltip": "The display modes the frontend supports",
- "lang_monTilFr": "Monday - Friday",
"lang_monday": "Monday",
"lang_nameTooltip": "Defines the name of the server",
"lang_noLocationsWarning": "Please select at least one location this panel should display.",
@@ -119,19 +116,12 @@
"lang_serverTooltip": "Defines from which server the room queries the calendar data",
"lang_serverType": "Type",
"lang_shortFri": "Fri",
- "lang_shortFriday": "Fri",
"lang_shortMon": "Mon",
- "lang_shortMonday": "Mon",
"lang_shortSat": "Sat",
- "lang_shortSaturday": "Sat",
"lang_shortSun": "Sun",
- "lang_shortSunday": "Sun",
"lang_shortThu": "Thu",
- "lang_shortThursday": "Thu",
"lang_shortTue": "Tue",
- "lang_shortTuesday": "Tue",
"lang_shortWed": "Wed",
- "lang_shortWednesday": "Wed",
"lang_showHostname": "Show hostname",
"lang_showLog": "Log",
"lang_slxbrowser": "SLX Browser",
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index bc918765..df5b3632 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -747,83 +747,101 @@ class Page_LocationInfo extends Page
'id' => $id,
'serverlist' => $serverList,
'serverlocationid' => $locConfig['serverlocationid'],
+ 'openingtimes' => $this->compressTimes($openingtimes),
);
- $data['expertMode'] = !$this->isSimpleMode($openingtimes);
- // !! isSimpleMode might have changed $openingtimes, so order is important here...
- $data['schedule_data'] = json_encode($openingtimes);
echo Render::parse('ajax-config-location', $data);
}
+ private function fmtTime($time)
+ {
+ $t = explode(':', $time);
+ return sprintf('%02d:%02d', $t[0], $t[1]);
+ }
+
/**
* Checks if simple mode or expert mode is active.
* Tries to merge/compact the opening times schedule, and
* will actually modify the passed array iff it can be
- * transformed into easy opening times.
+ * transformed into simple opening times.
*
- * @param array $array of the saved openingtimes.
- * @return bool True if simple mode, false if expert mode
+ * @return array new optimized openingtimes
*/
- private function isSimpleMode(&$array)
+ private function compressTimes(&$array)
{
if (empty($array))
- return true;
+ return [];
// Decompose by day
- $new = array();
+ $DAYLIST = array_flip(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']);
+ $new = [];
foreach ($array as $row) {
$s = $this->getTime($row['openingtime']);
$e = $this->getTime($row['closingtime']);
if ($s === false || $e === false || $e <= $s)
continue;
foreach ($row['days'] as $day) {
+ $day = $DAYLIST[$day] ?? -1;
+ if ($day === -1)
+ continue;
$this->addDay($new, $day, $s, $e);
}
}
- // Merge by timespan, but always keep saturday and sunday separate
- $merged = array();
+ // Merge by timespan
+ $merged = [];
foreach ($new as $day => $ranges) {
foreach ($ranges as $range) {
- if ($day === 'Saturday' || $day === 'Sunday') {
- $add = $day;
- } else {
- $add = '';
+ $range = $range[0] . '#' . $range[1];
+ if (!isset($merged[$range])) {
+ $merged[$range] = [];
}
- $key = '#' . $range[0] . '#' . $range[1] . '#' . $add;
- if (!isset($merged[$key])) {
- $merged[$key] = array();
- }
- $merged[$key][$day] = true;
+ $merged[$range][$day] = true;
}
}
- // Check if it passes as simple mode
- if (count($merged) > 3)
- return false;
- foreach ($merged as $days) {
- if (count($days) === 5) {
- $res = array_keys($days);
- $res = array_intersect($res, array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday"));
- if (count($res) !== 5)
- return false;
- } elseif (count($days) === 1) {
- if (!isset($days['Saturday']) && !isset($days['Sunday'])) {
- return false;
- }
+ // Finally transform to display struct
+ $new = [];
+ foreach ($merged as $span => $days) {
+ $out = explode('#', $span);
+ $new[] = [
+ 'days' => $this->buildDaysString(array_keys($days)),
+ 'open' => sprintf('%02d:%02d', ($out[0] / 60), ($out[0] % 60)),
+ 'close' => sprintf('%02d:%02d', ($out[1] / 60), ($out[1] % 60)),
+ ];
+ }
+ return $new;
+ }
+
+ /**
+ * @param array $daysArray List of days, "Monday", "Tuesday" etc. Must not contain duplicates.
+ * @return string Human readable representation of list of days
+ */
+ private function buildDaysString(array $daysArray)
+ {
+ /* Dictionary::translate('monday') Dictionary::translate('tuesday') Dictionary::translate('wednesday')
+ * Dictionary::translate('thursday') Dictionary::translate('friday') Dictionary::translate('saturday')
+ * Dictionary::translate('sunday')
+ */
+ $DAYLIST = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
+ $output = [];
+ $first = $last = -1;
+ sort($daysArray);
+ $daysArray[] = -1; // One trailing element to enforce a flush
+ foreach ($daysArray as $day) {
+ if ($first === -1) {
+ $first = $last = $day;
+ } elseif ($last + 1 === $day) {
+ // Chain
+ $last++;
} else {
- return false;
+ $string = Dictionary::translate($DAYLIST[$first], true);
+ if ($first !== $last) {
+ $string .= ($first + 1 === $last ? ",\xe2\x80\x89" : "\xe2\x80\x89-\xe2\x80\x89")
+ . Dictionary::translate($DAYLIST[$last], true);
+ }
+ $output[] = $string;
+ $first = $last = $day;
}
}
- // Valid simple mode, finally transform back to what we know
- $new = array();
- foreach ($merged as $span => $days) {
- preg_match('/^#(\d+)#(\d+)#/', $span, $out);
- $new[] = array(
- 'days' => array_keys($days),
- 'openingtime' => floor($out[1] / 60) . ':' . ($out[1] % 60),
- 'closingtime' => floor($out[2] / 60) . ':' . ($out[2] % 60),
- );
- }
- $array = $new;
- return true;
+ return implode(', ', $output);
}
private function addDay(&$array, $day, $s, $e)
diff --git a/modules-available/locationinfo/templates/ajax-config-location.html b/modules-available/locationinfo/templates/ajax-config-location.html
index 530207f6..a5e7e45e 100644
--- a/modules-available/locationinfo/templates/ajax-config-location.html
+++ b/modules-available/locationinfo/templates/ajax-config-location.html
@@ -1,89 +1,13 @@
<input type="hidden" name="locationid" value="{{id}}">
-<div id="settings-outer">
- <h3>{{lang_openingTime}}</h3>
-
- {{^expertMode}}
- <div id="simple-mode">
-
- <div class="clearfix"></div>
- <table class="table table-condensed" style="margin-bottom:0">
- <tr>
- <th>{{lang_day}}</th>
- <th>{{lang_openingTime}}</th>
- <th>{{lang_closingTime}}</th>
- </tr>
-
- <tr class="tablerow">
- <td>{{lang_monTilFr}}</td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="week-open">
- </div>
- </td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="week-close">
- </div>
- </td>
- </tr>
- <tr class="tablerow">
- <td>{{lang_saturday}}</td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="saturday-open">
- </div>
- </td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="saturday-close">
- </div>
- </td>
- </tr>
- <tr class="tablerow">
- <td>{{lang_sunday}}</td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="sunday-open">
- </div>
- </td>
- <td>
- <div class="input-group">
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-time"></span>
- </span>
- <input disabled type="text" class="form-control timepicker2" id="sunday-close">
- </div>
- </td>
- </tr>
- </table>
- </div>
- {{/expertMode}}
-
- <div id="expert-mode" style="{{^expertMode}}display:none{{/expertMode}}">
- <div class="clearfix"></div>
- <div id="expert-table">
- <div class="row">
- <div class="col-sm-6">{{lang_openingTime}}</div>
- <div class="col-sm-4">{{lang_closingTime}}</div>
- </div>
- </div>
- </div>
-</div>
+<h3>{{lang_openingTime}}</h3>
+<table class="table">
+ {{#openingtimes}}
+ <tr>
+ <td>{{days}}</td>
+ <td class="text-right">{{open}}&thinsp;-&thinsp;{{close}}</td>
+ </tr>
+ {{/openingtimes}}
+</table>
<div class="row" style="margin-top: 20px; margin-right: 15px;">
<a class="pull-right" title="{{lang_goToLocationWarning}}" href='?do=locations#{{id}}'>
@@ -93,7 +17,6 @@
</div>
<hr>
-
<h3>{{lang_remoteSchedule}}</h3>
<div class="row">
<div class="col-sm-4">
@@ -134,76 +57,3 @@
{{lang_roomIdTooltip}}
</div>
</div>
-
-<div class="hidden" id="expert-template">
- <div class="row expert-row">
- <hr>
- <div class="col-xs-12 days-box">
- <div class="checkbox checkbox-inline" style="margin-top: 0px;"><input disabled type="checkbox" class="i-Monday"><label>{{lang_shortMonday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Tuesday"><label>{{lang_shortTuesday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Wednesday"><label>{{lang_shortWednesday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Thursday"><label>{{lang_shortThursday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Friday"><label>{{lang_shortFriday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Saturday"><label>{{lang_shortSaturday}}</label></div>
- <div class="checkbox checkbox-inline"><input disabled type="checkbox" class="i-Sunday"><label>{{lang_shortSunday}}</label></div>
- </div>
- <div class="col-sm-6">
- <div class="input-group">
- <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
- <input disabled type="text" class="form-control i-openingtime">
- </div>
- </div>
- <div class="col-sm-6">
- <div class="input-group">
- <span class="input-group-addon"><span class="glyphicon glyphicon-time"></span></span>
- <input disabled type="text" class="form-control i-closingtime">
- </div>
- </div>
- </div>
-</div>
-
-<script type="application/javascript"><!--
- (function() {
-
- var scheduleData = {{{schedule_data}}};
-
- {{#expertMode}}
- for (var i = 0; i < scheduleData.length; ++i) {
- newOpeningTime(scheduleData[i]);
- }
- {{/expertMode}}
- {{^expertMode}}
- for (var i = 0; i < scheduleData.length; ++i) {
- if (scheduleData[i].days.length === 5) {
- $('#week-open').val(scheduleData[i]['openingtime']);
- $('#week-close').val(scheduleData[i]['closingtime']);
- } else if (scheduleData[i].days.length === 1 && scheduleData[i].days[0] === 'Saturday') {
- $('#saturday-open').val(scheduleData[i]['openingtime']);
- $('#saturday-close').val(scheduleData[i]['closingtime']);
- } else if (scheduleData[i].days.length === 1 && scheduleData[i].days[0] === 'Sunday') {
- $('#sunday-open').val(scheduleData[i]['openingtime']);
- $('#sunday-close').val(scheduleData[i]['closingtime']);
- }
- }
- {{/expertMode}}
-
- setTimepicker($('#settings-outer').find('.timepicker2'));
-
- $('#new-openingtime').click(function (e) {
- e.preventDefault();
- setTimepicker(newOpeningTime({}).find('.timepicker2'));
- });
-
- $('#btn-show-expert').click(function (e) {
- e.preventDefault();
- scheduleData = simpleToExpert();
- for (var i = 0; i < scheduleData.length; ++i) {
- setTimepicker(newOpeningTime(scheduleData[i]).find('.timepicker2'));
- }
- $('#simple-mode').remove();
- $('#expert-mode').show();
- });
-
- })();
-
-//--></script>
diff --git a/modules-available/locationinfo/templates/page-config-panel-default.html b/modules-available/locationinfo/templates/page-config-panel-default.html
index 1ffef408..447a8834 100644
--- a/modules-available/locationinfo/templates/page-config-panel-default.html
+++ b/modules-available/locationinfo/templates/page-config-panel-default.html
@@ -60,7 +60,10 @@
<label for="input-eco">{{lang_ecoMode}}</label>
</div>
<div class="col-sm-8">
- <input id="input-eco" type="checkbox" name="eco" {{eco_checked}}>
+ <div class="checkbox">
+ <input id="input-eco" type="checkbox" name="eco" {{eco_checked}}>
+ <label></label>
+ </div>
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{lang_ecoTooltip}}
@@ -74,7 +77,10 @@
<label for="input-prettytime">{{lang_prettytime}}</label>
</div>
<div class="col-sm-8">
- <input id="input-prettytime" type="checkbox" name="prettytime" {{prettytime_checked}}>
+ <div class="checkbox">
+ <input id="input-prettytime" type="checkbox" name="prettytime" {{prettytime_checked}}>
+ <label></label>
+ </div>
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{lang_prettytimeTooltip}}
@@ -198,7 +204,10 @@
<label for="scaledaysauto">{{lang_autoScale}}</label>
</div>
<div class="col-sm-8">
- <input id="scaledaysauto" class="btstrpCheckbox" type="checkbox" name="scaledaysauto" {{scaledaysauto_checked}}>
+ <div class="checkbox">
+ <input id="scaledaysauto" class="btstrpCheckbox" type="checkbox" name="scaledaysauto" {{scaledaysauto_checked}}>
+ <label></label>
+ </div>
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{lang_autoscaleTooltip}}
@@ -253,7 +262,10 @@
<label for="show-hostname">{{lang_showHostname}}</label>
</div>
<div class="col-sm-8">
- <input id="show-hostname" class="btstrpCheckbox" type="checkbox" name="hostname" {{hostname_checked}}>
+ <div class="checkbox">
+ <input id="show-hostname" class="btstrpCheckbox" type="checkbox" name="hostname" {{hostname_checked}}>
+ <label></label>
+ </div>
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{lang_hostnameTooltip}}
diff --git a/modules-available/locationinfo/templates/page-config-panel-summary.html b/modules-available/locationinfo/templates/page-config-panel-summary.html
index b909f873..a7a34217 100644
--- a/modules-available/locationinfo/templates/page-config-panel-summary.html
+++ b/modules-available/locationinfo/templates/page-config-panel-summary.html
@@ -56,7 +56,10 @@
<label for="input-eco">{{lang_ecoMode}}</label>
</div>
<div class="col-sm-8">
- <input id="input-eco" type="checkbox" name="eco" {{eco_checked}}>
+ <div class="checkbox">
+ <input id="input-eco" type="checkbox" name="eco" {{eco_checked}}>
+ <label></label>
+ </div>
</div>
<div class="col-sm-12 small text-muted spacebottop">
{{lang_ecoTooltip}}
@@ -191,9 +194,6 @@ document.addEventListener("DOMContentLoaded", function () {
$(this).siblings().find('.range-display').text($(this).val());
});
// Set state of input controls that aren't statically initialized server side
- $('.modify-inputs input[type="checkbox"]')
- .bootstrapSwitch({size: 'small'});
-
var lids = $locInput.val().split(',');
$selLocs.empty();
for (var i = 0; i < lids.length; ++i) {
diff --git a/modules-available/locationinfo/templates/page-locations.html b/modules-available/locationinfo/templates/page-locations.html
index 553df648..fa2e3a2d 100644
--- a/modules-available/locationinfo/templates/page-locations.html
+++ b/modules-available/locationinfo/templates/page-locations.html
@@ -65,8 +65,7 @@
</div>
</div>
-<script type="text/javascript"><!--
-
+<script>
document.addEventListener("DOMContentLoaded", function () {
/**
* Load a opening time modal of a location.
@@ -79,5 +78,4 @@ document.addEventListener("DOMContentLoaded", function () {
$('#location-modal').modal('show').find('.modal-body').text('...').load("?do=locationinfo&action=config-location&id=" + locationId);
});
});
-
-//--></script>
+</script>