summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2014-09-20 03:52:34 (GMT)
committerChristian Pointner <equinox@helsinki.at>2014-09-20 03:52:34 (GMT)
commit5991153a593bb2244fc69b314f27d45588eb8848 (patch)
treeea8cca5c8d286acf97372d89361b258548953fad /index.html
parent680cef1efc6eeb41d0edfddf2d04ea480a1b553d (diff)
persistent show selection
Diffstat (limited to 'index.html')
-rw-r--r--index.html18
1 files changed, 14 insertions, 4 deletions
diff --git a/index.html b/index.html
index 00f8cee..8e75c5a 100644
--- a/index.html
+++ b/index.html
@@ -53,6 +53,7 @@
+ var shows_currentid;
var shows_list = [];
var current_show;
var group_carts = [];
@@ -102,8 +103,9 @@
}
function showSelectedShow() {
- var id = $('#show-selector option:selected').attr('value');
- current_show = $.grep(shows_list, function(elem) { return elem.id == id; })[0];
+ shows_currentid = $('#show-selector option:selected').attr('value');
+ sessionStorage.setItem("shows_currentid", shows_currentid);
+ current_show = $.grep(shows_list, function(elem) { return elem.id == shows_currentid; })[0];
$('#show-title').text(current_show.title);
$('#show-dow').text(weekday[current_show.dow]);
$('#show-rhythm').text(current_show.rhythm);
@@ -160,15 +162,21 @@
}
}
);
+ $('#show-selector').val(shows_currentid);
showSelectedShow();
}
- function app_shows_init() {
+ function shows_init() {
+ shows_currentid = sessionStorage.getItem("shows_currentid");
shows_list = [];
data = { LOGIN_NAME: username, PASSWORD: token };
$.post("/listdropboxes.cgi", data, updateShowsList, "xml")
}
+ function shows_cleanup() {
+ sessionStorage.removeItem("shows_currentid");
+ delete shows_currentid;
+ }
@@ -186,7 +194,7 @@
$('#app-musicpools').hide();
$('#nav-btn-musicpools').removeClass('active');
app = 'shows';
- app_shows_init();
+ shows_init();
}
sessionStorage.setItem("app", app);
}
@@ -249,6 +257,8 @@
delete token;
sessionStorage.removeItem("app");
delete app;
+
+ shows_cleanup();
$(".alert").alert('close');
$("#username").val('');