--- /dev/null
+(function(){
+ 'use strict';
+ function set_style(name){
+ $('#stylesheet').attr("href", "/css/" + name + ".css");
+ localStorage.setItem("theme", name);
+ }
+
+ $( document ).ready(function() {
+ $('#theme-selector').removeClass('hidden');
+ $('#theme_slate' ).on('click', function () { set_style("slate"); });
+ $('#theme_cerulean').on('click', function () { set_style("cerulean"); });
+ $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); });
+ $('#theme_cosmo' ).on('click', function () { set_style("cosmo"); });
+ });
+
+ var theme = localStorage.getItem("theme");
+ if(theme) {
+ set_style(theme);
+ }
+})();