summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorSimon Rettberg2022-12-06 11:40:55 +0100
committerSimon Rettberg2022-12-06 11:40:55 +0100
commit51049ea72c6102bc499832a638787305063c2420 (patch)
tree9c71b085a2b12199c7d7e03e80ec41d817d4284a /modules-available
parent[locationinfo] Minor JS tweaks (diff)
downloadslx-admin-51049ea72c6102bc499832a638787305063c2420.tar.gz
slx-admin-51049ea72c6102bc499832a638787305063c2420.tar.xz
slx-admin-51049ea72c6102bc499832a638787305063c2420.zip
[locationinfo] Add Slider to configure browser zoom in URL panel
Closes #3915
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/locationinfo/inc/locationinfo.inc.php1
-rw-r--r--modules-available/locationinfo/inc/locationinfohooks.inc.php3
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json6
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json6
-rw-r--r--modules-available/locationinfo/page.inc.php2
-rw-r--r--modules-available/locationinfo/templates/page-config-panel-url.html25
6 files changed, 39 insertions, 4 deletions
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php
index 737f2275..0fdf4781 100644
--- a/modules-available/locationinfo/inc/locationinfo.inc.php
+++ b/modules-available/locationinfo/inc/locationinfo.inc.php
@@ -129,6 +129,7 @@ class LocationInfo
'bookmarks' => '',
'allow-tty' => '',
'url' => '',
+ 'zoom-factor' => 100,
);
}
return array();
diff --git a/modules-available/locationinfo/inc/locationinfohooks.inc.php b/modules-available/locationinfo/inc/locationinfohooks.inc.php
index 9f8a27dd..ee46260a 100644
--- a/modules-available/locationinfo/inc/locationinfohooks.inc.php
+++ b/modules-available/locationinfo/inc/locationinfohooks.inc.php
@@ -72,6 +72,9 @@ class LocationInfoHooks
if ($data['allow-tty'] === 'yes' || $data['allow-tty'] === 'no') {
ConfigHolder::add('SLX_TTY_SWITCH', $data['allow-tty'], 1000);
}
+ if (($data['zoom-factor'] ?? 100) != 100) {
+ ConfigHolder::add('SLX_BROWSER_ZOOM', $data['zoom-factor']);
+ }
} else {
// Not URL panel
ConfigHolder::add('SLX_BROWSER_URL', 'http://' . $_SERVER['SERVER_ADDR'] . '/panel/' . $panelUuid);
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
index 36df12a9..fe6a3e53 100644
--- a/modules-available/locationinfo/lang/de/template-tags.json
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -149,5 +149,7 @@
"lang_verticalTooltip": "Legt fest, ob Kalender und Raum \u00fcbereinander angezeigt werden sollen",
"lang_wednesday": "Mittwoch",
"lang_when": "Wann",
- "lang_whitelist": "Whitelist"
-}
+ "lang_whitelist": "Whitelist",
+ "lang_zoomFactor": "Zoom-Faktor",
+ "lang_zoomFactorTooltip": "Initialer Zoom-Faktor beim Start des Panels. Je nach gew\u00e4hltem Browser kann der Faktor vom Benutzer angepasst werden."
+} \ 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 6014ec02..5f612d16 100644
--- a/modules-available/locationinfo/lang/en/template-tags.json
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -149,5 +149,7 @@
"lang_verticalTooltip": "Defines whether the room and calendar are shown above each other",
"lang_wednesday": "Wednesday",
"lang_when": "When",
- "lang_whitelist": "Whitelist"
-}
+ "lang_whitelist": "Whitelist",
+ "lang_zoomFactor": "Zoom level",
+ "lang_zoomFactorTooltip": "Initial zoom level at startup. Depending on selected browser, this can later be changed by the user."
+} \ No newline at end of file
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index de21aae2..f563e727 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -356,6 +356,7 @@ class Page_LocationInfo extends Page
'interactive' => Request::post('interactive', '0', 'bool'),
'bookmarks' => $bookmarkString ? $bookmarkString : '',
'allow-tty' => Request::post('allow-tty', '', 'string'),
+ 'zoom-factor' => Request::post('zoom-factor', 100, 'int'),
);
return array('config' => $conf, 'locationids' => []);
}
@@ -1001,6 +1002,7 @@ class Page_LocationInfo extends Page
'uuid' => $id,
'panelname' => $panel['panelname'],
'url' => $config['url'],
+ 'zoom-factor' => $config['zoom-factor'],
'ssl_checked' => $config['insecure-ssl'] ? 'checked' : '',
'reloadminutes' => (int)$config['reload-minutes'],
'whitelist' => str_replace("\n", "\r\n", $config['whitelist']),
diff --git a/modules-available/locationinfo/templates/page-config-panel-url.html b/modules-available/locationinfo/templates/page-config-panel-url.html
index 05913921..3aaf8620 100644
--- a/modules-available/locationinfo/templates/page-config-panel-url.html
+++ b/modules-available/locationinfo/templates/page-config-panel-url.html
@@ -216,6 +216,24 @@
{{/bookmarks}}
</div>
+ <div class="list-group-item">
+ <div class="row">
+ <div class="col-sm-4">
+ <label for="zoom-factor">{{lang_zoomFactor}}</label>
+ </div>
+ <div class="col-sm-7 col-xs-10">
+ <input class="form-control" id="zoom-factor" type="range" min="50" max="300" step="5"
+ name="zoom-factor" value="{{zoom-factor}}">
+ </div>
+ <div class="col-sm-1 col-xs-2" id="zoom-value">
+
+ </div>
+ <div class="col-sm-12 small text-muted spacebottop">
+ {{lang_zoomFactorTooltip}}
+ </div>
+ </div>
+ </div>
+
</div>
</div>
<div class="text-right">
@@ -233,6 +251,13 @@ document.addEventListener("DOMContentLoaded", function () {
// load value to dropdown menus
$('#browser option[value="{{browser}}"]').prop("selected", true);
browserChange();
+ var $zv = $('#zoom-value');
+ var $zf = $('#zoom-factor');
+ var sliderUpdate = function() {
+ $zv.text($zf.val() + '%');
+ };
+ $zf.on('input', sliderUpdate);
+ sliderUpdate();
});
// Hide interactive-input if slx-browser is selected