]>
Commit | Line | Data |
---|---|---|
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 | })(); |