adding all weblabels from weblabels.fsf.org
[weblabels.fsf.org.git] / www.fsf.org / 20131028 / files / static.fsf.org / plone2012 / styleswitcher.js
1
2 /* - styleswitcher.js - */
3 // StyleSwitcher functions written by Paul Sowden
4 // Deprecated; will be removed in Plone 5.
5
6 /*
7 Provides global setActiveStyleSheet
8 */
9
10 /*global createCookie:false, readCookie:false */
11
12 function setActiveStyleSheet(title, reset) {
13 jQuery('link[rel*=style][title]').attr('disabled', true)
14 .find('[title=' + title + ']').attr('disabled', false);
15 if (reset) {
16 createCookie("wstyle", title, 365);
17 }
18 }
19
20 jQuery(function() {
21 var style = readCookie("wstyle");
22 if (style) {
23 setActiveStyleSheet(style, 0);
24 }
25 });
26