summaryrefslogtreecommitdiffstats
path: root/sitestatic
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2014-03-09 17:58:51 +0100
committerDan McGee <dan@archlinux.org>2014-03-09 17:58:51 +0100
commit268317dd331bcdbe1c2828583034c0274a19eea3 (patch)
treed0a7f120ddd881a6f0ae12a2af7340c0d3b0e1ec /sitestatic
parent697a2b15c1e402c1c624af1ffeaf5123d7fb0e9f (diff)
downloadarchweb-268317dd331bcdbe1c2828583034c0274a19eea3.tar.gz
archweb-268317dd331bcdbe1c2828583034c0274a19eea3.tar.xz
Use localStorage to save/restore developer report filters
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'sitestatic')
-rw-r--r--sitestatic/archweb.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/sitestatic/archweb.js b/sitestatic/archweb.js
index 457e334..0a97949 100644
--- a/sitestatic/archweb.js
+++ b/sitestatic/archweb.js
@@ -386,6 +386,22 @@ function filter_todolist_load(list_id) {
});
}
+function filter_report_save(report_id) {
+ var state = $('#report_filter').serializeArray();
+ localStorage['filter_report_' + report_id] = JSON.stringify(state);
+}
+function filter_report_load(report_id) {
+ var state = localStorage['filter_report_' + report_id];
+ if (!state)
+ return;
+ state = JSON.parse(state);
+ $('#report_filter input[type="checkbox"]').removeAttr('checked')
+ $.each(state, function (i, v) {
+ // this assumes our only filters are checkboxes
+ $('#report_filter input[name="' + v['name'] + '"]').attr('checked', 'checked');
+ });
+}
+
/* signoffs.html */
function signoff_package() {
// TODO: fix usage of this