- 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() {
- 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");
- if(theme) {
- if(theme == "cerulean" || theme == "cosmo")
- theme = "readable";
- set_style(theme);
- }
-})();
+let theme = localStorage.getItem("theme");
+if(theme) {
+ if(theme == "cerulean" || theme == "cosmo")
+ theme = "readable";
+ set_style(theme, false);
+}