You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

38 lines
676 B

$(function() {
var options = {
opts: {
tracking: 1
},
init: function() {
options.load();
$('#options-save').click(options.save);
},
load: function() {
for ( option in options.opts ) {
if ( value = localStorage[option] ) {
options.opts[option] = value;
}
}
if ( parseInt(options.opts.tracking) ) {
$('#option-tracking').attr('checked', 'checked');
}
},
save: function() {
options.opts.tracking = $('#option-tracking').is(':checked') ? 1 : 0;
for ( option in options.opts ) {
localStorage[option] = options.opts[option];
}
$('#options-saved').stop().show().fadeOut(2000);
}
};
options.init();
});