jQuery theme switcher
trying to make this work - based on ns&i website
by ian_smithz
HTML
<ul class="menu menu--horizontal menu--accessibility">
<li>
<a class="accessibilty-switch" data-theme="monochrome" href="javsscript:void">Monochrome Theme</a>
</li>
</ul>
JavaScript
var themeSwitch = function() {
$.cookie.json = !1;
var b = $(".accessibilty-switch"),
c = $('link[rel="alternate stylesheet"]'),
d = "theme",
e = $.cookie(d);
this.linkTxtDefault = b.text(),
c.attr("disabled", !0),
void 0 !== e && null !== e && (a.themeSwitch.activeTheme = e,
b.addClass("active"),
a.themeSwitch.setButtonText(b),
a.themeSwitch.enableTheme(e)),
b.on("click", function(b) {
var c = $(this),
e = c.attr("data-theme");
$.cookie.json = !1,
b.preventDefault(),
c.toggleClass("active"),
a.themeSwitch.setButtonText(c),
c.hasClass("active") ? e !== $.cookie(d) && (-1 !== window.location.hostname.indexOf("ian_smithz") ? $.cookie(d, e, {
path: "/",
expires: 365,
domain: "jsfiddle.net"
}) : $.cookie(d, e, {
path: "/",
expires: 365
}),
a.themeSwitch.enableTheme(e),
a.themeSwitch.activeTheme = e) : (-1 !== window.location.hostname.indexOf("ian_smithz") ? $.removeCookie(d, {
path: "/",
domain: "jsfiddle.net"
}) : $.removeCookie(d, {
path: "/"
}),
$("body").removeClass(e),
a.themeSwitch.activeTheme = null),
a.forcePsuedoRepaint(),
$.cookie.json = !0
})
}
themeSwitch();