r100014 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100013‎ | r100014 | r100015 >
Date:05:37, 17 October 2011
Author:kaldari
Status:ok
Tags:
Comment:
removing some deprecated functionality regarding centralnotice cookies
Modified paths:
  • /trunk/extensions/CentralNotice/centralnotice.js (modified) (history)
  • /trunk/extensions/CentralNotice/special/SpecialBannerController.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialBannerController.php
@@ -197,23 +197,8 @@
198198 }
199199 // This function is deprecated
200200 function toggleNotice() {
201 - var notice = document.getElementById('centralNotice');
202 - if (!wgNoticeToggleState) {
203 - notice.className = notice.className.replace('collapsed', 'expanded');
204 - toggleNoticeCookie('0'); // Expand banners
205 - } else {
206 - notice.className = notice.className.replace('expanded', 'collapsed');
207 - toggleNoticeCookie('1'); // Collapse banners
208 - }
209 - wgNoticeToggleState = !wgNoticeToggleState;
 201+ hideBanner();
210202 }
211 -// This function is deprecated
212 -function toggleNoticeCookie(state) {
213 - var e = new Date();
214 - e.setTime( e.getTime() + (7*24*60*60*1000) ); // one week
215 - var work='hidesnmessage='+state+'; expires=' + e.toGMTString() + '; path=/';
216 - document.cookie = work;
217 -}
218203
219204 JAVASCRIPT;
220205 return $script;
Index: trunk/extensions/CentralNotice/centralnotice.js
@@ -67,15 +67,9 @@
6868 var bannerField = document.getElementById('templateBody');
6969 switch( buttonType ) {
7070 case 'close': // Insert close button
71 - if ( $( '#fundraising' ).is( ':checked' ) ) {
72 - var buttonValue = '<a href="#" onclick="hideBanner(\'fundraising\');return false;">'
73 - + '<img border="0" src="' + mw.config.get( 'stylepath' )
74 - + '/common/images/closewindow.png" alt="Close" /></a>';
75 - } else {
76 - var buttonValue = '<a href="#" onclick="hideBanner();return false;">'
77 - + '<img border="0" src="' + mw.config.get( 'stylepath' )
78 - + '/common/images/closewindow.png" alt="Close" /></a>';
79 - }
 71+ var buttonValue = '<a href="#" onclick="hideBanner();return false;">'
 72+ + '<img border="0" src="' + mw.config.get( 'stylepath' )
 73+ + '/common/images/closewindow.png" alt="Close" /></a>';
8074 break;
8175 }
8276 if (document.selection) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r102477MFT r99497, r100014, r100015, r100085, 100087, r100780, r102204, r102273awjrichards01:42, 9 November 2011

Status & tagging log