From 23fc32f8358d6eb847beb3934e7daa2a75f62f3f Mon Sep 17 00:00:00 2001 From: Jano Slota Date: Sat, 5 Jul 2014 03:11:15 +0200 Subject: [PATCH] Add save-user_flag.js --- js/save-user_flag.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 js/save-user_flag.js 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