aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/barnet/javascript/styleswitch.js
diff options
context:
space:
mode:
authormatthew <matthew>2009-12-15 16:05:42 +0000
committermatthew <matthew>2009-12-15 16:05:42 +0000
commit9b651a64393a6df01f18823f44dd49ebe3cb429b (patch)
tree51ad2159f1e972be4ab34258f787ef0b3860ee10 /web/cobrands/barnet/javascript/styleswitch.js
parent75e0301c9350ec965d0d0b0516e879f6ee0c7daa (diff)
Barnet assets.
Diffstat (limited to 'web/cobrands/barnet/javascript/styleswitch.js')
-rw-r--r--web/cobrands/barnet/javascript/styleswitch.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/web/cobrands/barnet/javascript/styleswitch.js b/web/cobrands/barnet/javascript/styleswitch.js
new file mode 100644
index 000000000..c4afb0b28
--- /dev/null
+++ b/web/cobrands/barnet/javascript/styleswitch.js
@@ -0,0 +1,26 @@
+/**
+* Styleswitch stylesheet switcher built on jQuery
+* Under an Attribution, Share Alike License
+* By Kelvin Luck ( http://www.kelvinluck.com/ )
+**/
+
+$(document).ready(function() {
+ $('.styleswitch').click(function()
+ {
+ switchStylestyle(this.getAttribute("rel"));
+ return false;
+ });
+ var c = readCookie('style');
+ if (c) switchStylestyle(c);
+});
+
+function switchStylestyle(styleName)
+{
+ $('link[@rel*=style][@title]').each(function(i)
+ {
+ this.disabled = true;
+ if (this.getAttribute('title') == styleName) this.disabled = false;
+ });
+ createCookie('style', styleName, 365);
+}
+