centralnotice - function toggleNotice cfw var big =...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
function toggleNotice() { var big = getElementsByClassName(document,'div','siteNoticeBig'); var small = getElementsByClassName(document,'div','siteNoticeSmall'); if (!wgNoticeToggleState) { toggleNoticeStyle(big,'block'); toggleNoticeStyle(small,'none'); toggleNoticeCookie('0'); } else { toggleNoticeStyle(big,'none'); toggleNoticeStyle(small,'block'); toggleNoticeCookie('1'); } wgNoticeToggleState = !wgNoticeToggleState; } function toggleNoticeStyle(elems, display) { if(elems) for(var i=0;i<elems.length;i++) elems[i].style.display = display; } function toggleNoticeCookie(state) { var e = new Date(); e.setTime( e.getTime() + (7*24*60*60*1000) ); // one week var work='hidesnmessage='+state+'; expires=' + e.toGMTString() + '; path=/'; document.cookie = work; } function pickTemplate(templates, weights) { var weightedTemplates = new Array(); var currentTemplate = 0; var totalWeight = 0; if (templates.length == 0) return ''; while (currentTemplate < templates.length) { totalWeight += weights[currentTemplate]; for (i=0; i<weights[currentTemplate]; i++) { weightedTemplates[weightedTemplates.length] = templates[currentTemplate]; } currentTemplate++; } if (totalWeight == 0) return ''; var randomnumber=Math.floor(Math.random()*totalWeight); return weightedTemplates[randomnumber]; } var wgNoticeToggleState = (document.cookie.indexOf('hidesnmessage=1')==-1); document.writeln( wgNoticeToggleState ? "\x3cstyle type=\"text/css\"\x3e.siteNoticeSmall{display:none;}\x3c/style\x3e" : "\x3cstyle type=\"text/css\"\x3e.siteNoticeBig{display:none;}\x3c/style\x3e"); document.writeln("\x3cstyle type=\"text/css\"\x3e.siteNoticeToggle{display:none;}\x3c/style\x3e"); wgNotice=pickTemplate(["\x3cstyle type=\"text/css\"\x3e\n/*\nStyles for Notices\n*/\n\n.notice-wrapper, .notice-collapsed-wrapper {\n margin: 0;\n
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
padding: 0;\n font-family: Arial,Helvetica,Tahoma,sans-serif;\n color: #333;\n background-color: #ddd;\n font-size: 1.2em;\n font-weight: 200;\n}\n\n.notice-wrapper a,\n.notice-collapsed-wrapper a\n{\n color: #006699;\n text-decoration: none;\n}\n\n.notice-wrapper\n{\n border: 1px solid #bbb;\n background-color: #fcfcfc;\n background- repeat: no-repeat;\n height: 115px;\n font-size: 1.4em;\n padding: 5px 5px;\n}\n\n.notice-collapsed-wrapper\n{\n border: 1px solid #bbb;\n text- align: left;\n background-color: #fcfcfc;\n font-size: 1.7em;\n padding: 5px 5px;\n}\n\n.notice-wrapper a:hover { text-decoration: none; }\n.notice- collapsed-wrapper a:hover { text-decoration: none; }\n\n.toggle-box\n{\n float: right;\n font-size: 0.6em;\n}\n\n.notice-text\n{\n padding: 0 120px;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 5px;\n}\n\n.progress-meter\n{\n background-image: url(http://upload.wikimedia.org/centralnotice/images/progress/p2.5.png);\n background-repeat: no-repeat;\n background-position: top center;\n font-size: 0.8em;\n text-align: left;\n width: 606px;\n height: 28px;\n padding-top: 10px;\n margin-left: auto;\n margin-right: auto;\n padding-left: 120px;\n
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

centralnotice - function toggleNotice cfw var big =...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online