summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/clientscript.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/locationinfo/clientscript.js')
-rw-r--r--modules-available/locationinfo/clientscript.js62
1 files changed, 0 insertions, 62 deletions
diff --git a/modules-available/locationinfo/clientscript.js b/modules-available/locationinfo/clientscript.js
index 25c255fb..f8309a8a 100644
--- a/modules-available/locationinfo/clientscript.js
+++ b/modules-available/locationinfo/clientscript.js
@@ -89,65 +89,3 @@ function simpleToExpert() {
}
return retval;
}
-
-/**
- * Triggered when the form is submitted
- */
-function submitLocationSettings(event) {
- var schedule, s, e;
- var badFormat = false;
- $('#settings-outer').find('.red-bg').removeClass('red-bg');
- if ($('#week-open').length > 0) {
- schedule = simpleToExpert();
- for (var i = 0; i < schedule.length; ++i) {
- s = getTime(schedule[i].openingtime);
- e = getTime(schedule[i].closingtime);
- if (s === false) {
- $(schedule[i].tag + '-open').addClass('red-bg');
- badFormat = true;
- }
- if (e === false || e <= s) {
- $(schedule[i].tag + '-close').addClass('red-bg');
- badFormat = true;
- }
- }
- } else {
- // Serialize
- schedule = [];
- $('#expert-table').find('.expert-row').each(function () {
- var $t = $(this);
- if ($t.find('.i-delete').is(':checked')) return; // Skip marked as delete
- var entry = {
- 'days': [],
- 'openingtime': $t.find('.i-openingtime').val(),
- 'closingtime': $t.find('.i-closingtime').val()
- };
- for (var i = 0; i < allDays.length; ++i) {
- if ($t.find('.i-' + allDays[i]).is(':checked')) {
- entry['days'].push(allDays[i]);
- }
- }
- if (entry.openingtime.length === 0 && entry.closingtime.length === 0 && entry.days.length === 0) return; // Also ignore empty lines
- s = getTime(entry.openingtime);
- e = getTime(entry.closingtime);
- if (s === false) {
- $t.find('.i-openingtime').addClass('red-bg');
- badFormat = true;
- }
- if (e === false || e <= s) {
- $t.find('.i-closingtime').addClass('red-bg');
- badFormat = true;
- }
- if (entry.days.length === 0) {
- $t.find('.days-box').addClass('red-bg');
- badFormat = true;
- }
- if (badFormat) return;
- schedule.push(entry);
- });
- }
- if (badFormat) {
- event.preventDefault();
- }
- $('#json-openingtimes').val(JSON.stringify(schedule));
-} \ No newline at end of file