summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/templates
diff options
context:
space:
mode:
authorJannik Schönartz2017-03-21 13:52:23 +0100
committerJannik Schönartz2017-03-21 13:52:23 +0100
commit2040275191f2e808d1c721f98342506fc955ba43 (patch)
treec93515242ffe82e31c47f8554967c2a08efaa1ed /modules-available/locationinfo/templates
parentAdmin-panel: Redesigned config. Added helpboxes. (diff)
downloadslx-admin-2040275191f2e808d1c721f98342506fc955ba43.tar.gz
slx-admin-2040275191f2e808d1c721f98342506fc955ba43.tar.xz
slx-admin-2040275191f2e808d1c721f98342506fc955ba43.zip
Locationinfo: Added Comments to the functions.
Diffstat (limited to 'modules-available/locationinfo/templates')
-rw-r--r--modules-available/locationinfo/templates/config.html27
-rw-r--r--modules-available/locationinfo/templates/location-info.html36
-rw-r--r--modules-available/locationinfo/templates/server-settings.html13
-rw-r--r--modules-available/locationinfo/templates/timetable.html7
4 files changed, 79 insertions, 4 deletions
diff --git a/modules-available/locationinfo/templates/config.html b/modules-available/locationinfo/templates/config.html
index 1b42ff34..adce047b 100644
--- a/modules-available/locationinfo/templates/config.html
+++ b/modules-available/locationinfo/templates/config.html
@@ -279,7 +279,9 @@
initBootstrap();
loadValues();
-
+ /**
+ * Initialize the bootstrap elements.
+ */
function initBootstrap() {
// Init Bootstrap stuff.
$('#help-updateroom').tooltip();
@@ -298,6 +300,9 @@
$('#help-switchtime').tooltip();
}
+ /**
+ * Loads the Values in the config form elements.
+ */
function loadValues() {
$("#{{language}}").attr("selected", "selected");
@@ -394,14 +399,29 @@
modeChange(mode.val());
}
+ /**
+ * Updates the value from the scale slider.
+ *
+ * @param newValue The new value the scale slider was set to.
+ */
function showScaleValue(newValue) {
$("#scale").text(newValue + " %");
}
+ /**
+ * Updates the value from the switchtime slider.
+ *
+ * @param newValue The new value the switchtime slider was set to.
+ */
function showSwitchValue(newValue) {
$("#switch").text(newValue + " " + '{{lang_sec}}');
}
+ /**
+ * If the mode was changed the mode settings have to be adjusted.
+ *
+ * @param value The new mode that was set. 1-4
+ */
function modeChange(value) {
$('#item-vertical').hide();
$('#item-autoscale').hide();
@@ -429,6 +449,11 @@
}
}
+ /**
+ * If the auto scale changes the days to show must be shown / hided
+ *
+ * @param value The new value of the autoscale switch.
+ */
function autoScaleChange(value) {
autoscale = value;
if (value) {
diff --git a/modules-available/locationinfo/templates/location-info.html b/modules-available/locationinfo/templates/location-info.html
index 86d30260..f14faa23 100644
--- a/modules-available/locationinfo/templates/location-info.html
+++ b/modules-available/locationinfo/templates/location-info.html
@@ -123,6 +123,12 @@
<script type="text/javascript">
var lastPcSubTable = false;
+ /**
+ * Sets the checkbox value and calls the php hide action.
+ *
+ * @param cb The checkbox which was clicked.
+ * @param locID the locationID of the checkbox.
+ */
function cbClick(cb, locID) {
var value;
@@ -134,6 +140,12 @@
window.location.href = "?do=locationinfo&action=hide&id=" + locID + "&value=" + value;
}
+ /**
+ * Loads the settings modal of a server.
+ *
+ * @param serverid The id of the server.
+ * @param servername The name of the server.
+ */
function loadSettingsModal(serverid, servername) {
$('#myModalHeader').text("{{lang_locationSettings}}").css("font-weight", "Bold");
@@ -141,6 +153,12 @@
$('#myModalBody').load("?do=locationinfo&action=serverSettings&id=" + serverid);
}
+ /**
+ * Load a opening time modal of a location.
+ *
+ * @param locationId The id of the location.
+ * @param locationName The name of the location.
+ */
function loadTimeModal(locationId, locationName) {
$('#myModalHeader').text("[" + locationId + "] " + locationName).css("font-weight", "Bold");
@@ -149,9 +167,10 @@
}
/**
+ * Loads the config modal of a location.
*
- * @param locationId
- * @param locationName
+ * @param locationId The id of the location
+ * @param locationName the name of the location
*/
function loadConfigModal(locationId, locationName) {
$('#myModalHeader').text("[" + locationId + "] " + locationName).css("font-weight", "Bold");
@@ -167,6 +186,11 @@
var preEditPassword;
var preEditType;
+ /**
+ * Deletes a server.
+ *
+ * @param id The serverid
+ */
function deleteButtonClick(id) {
var del = confirm("{{lang_deleteConfirmation}}");
if (del == true) {
@@ -175,12 +199,20 @@
}
}
+ /**
+ * Calls the checkConnection php function to check a server connection.
+ *
+ * @param id The id of the server.
+ */
function refreshButtonClick(id) {
$('#refresh-btn-animate-' + id).addClass('glyphicon-refresh-animate');
$('#serverFormAction-' + id).val("checkConnection");
$('#submit-serverForm-' + id).trigger("click");
}
+ /**
+ * Loads a new / empty server settings modal.
+ */
function addServer() {
loadSettingsModal(0, '');
}
diff --git a/modules-available/locationinfo/templates/server-settings.html b/modules-available/locationinfo/templates/server-settings.html
index f885c0c1..641873ef 100644
--- a/modules-available/locationinfo/templates/server-settings.html
+++ b/modules-available/locationinfo/templates/server-settings.html
@@ -82,12 +82,20 @@
loadCredentials();
initalizeBootstrap();
+ /**
+ * Initialize the bootstrap elements.
+ */
function initalizeBootstrap() {
$('#help-name').tooltip();
$('#help-url').tooltip();
$('#help-type').tooltip();
}
+ /**
+ * Loads the dynamic credentials forms.
+ *
+ * @param {bool} useValue If false the form elements will be empty. Default = true.
+ */
function loadCredentials(useValue = true) {
// {{name}} name of auth {{type}} type of auth (string, int etc.) {{value}} value from the db
{{#backendList}}
@@ -145,6 +153,11 @@
}
+ /**
+ * After the servertype switch changed, the new credentials needs to be loaded.
+ *
+ * @param {string} value The new type of the server which credentials needs to be loaded.
+ */
function servertype_changed(value) {
type = value;
$('#credentials-div').fadeOut('fast', function() {
diff --git a/modules-available/locationinfo/templates/timetable.html b/modules-available/locationinfo/templates/timetable.html
index 78d13e29..7143facd 100644
--- a/modules-available/locationinfo/templates/timetable.html
+++ b/modules-available/locationinfo/templates/timetable.html
@@ -146,6 +146,9 @@
}
});
+ /**
+ * Sets the timepicker element.
+ */
function setTimepicker() {
$('.timepicker2').timepicker({
minuteStep: 1,
@@ -157,6 +160,9 @@
});
}
+ /**
+ * Adds a new opening time to the table in expert mode.
+ */
function newOpeningTime() {
$('#lastOpenTimesTableElement').before('<tr>\
<td>\
@@ -172,7 +178,6 @@
<input type="hidden" name="days[]" value="-">\
</td>\
<td>\
- \
<div class="input-group bootstrap-timepicker">\
<span class="input-group-addon">\
<span class="glyphicon glyphicon-time"></span>\