Merge branch 'master' into gruntmaster
[gruntmaster-page.git] / js / 90-themes.js
diff --git a/js/90-themes.js b/js/90-themes.js
new file mode 100644 (file)
index 0000000..74506c8
--- /dev/null
@@ -0,0 +1,20 @@
+(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);
+       }
+})();
This page took 0.009177 seconds and 4 git commands to generate.