]> iEval git - gruntmaster-page.git/blob - js/90-themes.js
Use alternate stylesheets
[gruntmaster-page.git] / js / 90-themes.js
1 (function(){
2 'use strict';
3 function set_style(name){
4 $('link[rel~="stylesheet"]').prop('disabled', true);
5 $('link[title="' + name + '"]').prop('disabled', false);
6 localStorage.setItem("theme", name);
7 }
8
9 $( document ).ready(function() {
10 $('#theme-selector').detach().prependTo($('#sidebar'));
11 $('#theme_slate' ).on('click', function () { set_style("slate"); });
12 $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); });
13 $('#theme_readable').on('click', function () { set_style("readable"); });
14 });
15
16 var theme = localStorage.getItem("theme");
17 if(theme) {
18 if(theme == "cerulean" || theme == "cosmo")
19 theme = "readable";
20 set_style(theme);
21 }
22 })();
This page took 0.042212 seconds and 4 git commands to generate.