});
}
+ var selector;
+
+ function add_themelink(theme, text) {
+ var link = $('<a role="button">' + text + '</a>');
+ link.appendTo(selector.find('ul')).wrap('<li>').on('click', function () { set_style(theme) });
+ }
+
$( document ).ready(function() {
- $('#theme-selector').detach().prependTo($('#sidebar'));
- $('#theme_slate' ).on('click', function () { set_style("slate"); });
- $('#theme_cyborg' ).on('click', function () { set_style("cyborg"); });
- $('#theme_readable').on('click', function () { set_style("readable"); });
+ selector = $('<div>Themes: <ul class="list-inline"></ul></div>');
+ add_themelink('cyborg', 'Black');
+ add_themelink('slate', 'Grey');
+ add_themelink('readable', 'White');
+ $('#sidebar').prepend(selector);
});
var theme = localStorage.getItem("theme");