1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-18 03:37:35 +01:00

Add save-user_flag.js

This commit is contained in:
Jano Slota 2014-07-05 03:11:15 +02:00 committed by czaks
parent a520101e22
commit 586877d800

9
js/save-user_flag.js Normal file
View File

@ -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());
});
});