]>
iEval git - gruntmaster-page.git/blob - js/90-themes.js
a61b4c0c0089983ff69f06341667ceb9f6d57e15
1 function set_style(name
){
2 $('link[rel~="stylesheet"]').each(function (e
){
5 $('link[title="' + name
+ '"]')[0].disabled
= false;
6 localStorage
.setItem("theme", name
);
11 function add_themelink(theme
, text
) {
12 theme_ul
.innerHTML
+= '<li><a role="button" data-theme="' + theme
+ '">' + text
+ '</a>'
16 theme_ul
= document
.createElement('ul');
17 theme_ul
.className
= 'list-inline';
18 theme_ul
.id
= 'themes';
19 add_themelink('cyborg', 'Black');
20 add_themelink('slate', 'Grey');
21 add_themelink('readable', 'White');
22 var sidebar
= $('#sidebar')[0];
23 sidebar
.insertBefore(theme_ul
, sidebar
.firstChild
);
24 $('#themes a').on('click', function(e
){
25 set_style(this.dataset
.theme
);
29 var theme
= localStorage
.getItem("theme");
31 if(theme
== "cerulean" || theme
== "cosmo")
This page took 0.05368 seconds and 3 git commands to generate.