summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJano Slota <jano@alokal.eu>2014-07-05 03:11:15 +0200
committerczaks <marcin@6irc.net>2014-07-06 01:31:00 +0200
commit23fc32f8358d6eb847beb3934e7daa2a75f62f3f (patch)
tree184526c2abf79c4d495d6c6b12a1ced363aee57d
parent2488e77e86edc3bb2b24377b25e8439f35cc2343 (diff)
Add save-user_flag.js
-rw-r--r--js/save-user_flag.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/js/save-user_flag.js b/js/save-user_flag.js
new file mode 100644
index 00000000..d75b2e26
--- /dev/null
+++ b/js/save-user_flag.js
@@ -0,0 +1,9 @@
+onready(function(){
+ var uri = window.location.pathname.substr(1);
+ var flagStorage = uri.slice(0, -1)+'_flag';
+ var item = window.localStorage.getItem(flagStorage);
+ $('select[name=user_flag]').val(item);
+ $('select[name=user_flag]').change(function() {
+ window.localStorage.setItem(flagStorage, $(this).val());
+ });
+}); \ No newline at end of file