r74110 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74109‎ | r74110 | r74111 >
Date:21:27, 1 October 2010
Author:kaldari
Status:resolved (Comments)
Tags:
Comment:
add in close button stuff
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.i18n.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)
  • /trunk/extensions/CentralNotice/centralnotice.js (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.i18n.php
@@ -108,10 +108,11 @@
109109 'centralnotice-clone-name' => 'Name:',
110110 'centralnotice-preview-all-template-translations' => 'Preview all available translations of banner',
111111 'centralnotice-insert' => 'Insert: $1',
112 - 'centralnotice-hide-button' => '{{int:centralnotice-shared-hide}} button',
113 - 'centralnotice-collapse-button' => '{{int:centralnotice-shared-collapse}} button',
114 - 'centralnotice-expand-button' => '{{int:centralnotice-shared-expand}} button',
115 - 'centralnotice-translate-button' => 'Help translate button',
 112+ 'centralnotice-hide-button' => '{{int:centralnotice-shared-hide}} link',
 113+ 'centralnotice-collapse-button' => '{{int:centralnotice-shared-collapse}} link',
 114+ 'centralnotice-expand-button' => '{{int:centralnotice-shared-expand}} link',
 115+ 'centralnotice-close-button' => 'Close button',
 116+ 'centralnotice-translate-button' => 'Help translate link',
116117 'centralnotice-donate-button' => 'Donate button',
117118 'centralnotice-expanded-banner' => 'Expanded banner',
118119 'centralnotice-collapsed-banner' => 'Collapsed banner',
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -241,6 +241,7 @@
242242 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-banner' ) );
243243 $htmlOut .= wfMsg( 'centralnotice-edit-template-summary' );
244244 $buttons = array();
 245+ $buttons[] = '<a href="#" onclick="insertButton(\'close\');return false;">' . wfMsg( 'centralnotice-close-button' ) . '</a>';
245246 $buttons[] = '<a href="#" onclick="insertButton(\'hide\');return false;">' . wfMsg( 'centralnotice-hide-button' ) . '</a>';
246247 $buttons[] = '<a href="#" onclick="insertButton(\'translate\');return false;">' . wfMsg( 'centralnotice-translate-button' ) . '</a>';
247248 $htmlOut .= Xml::tags( 'div',
@@ -488,6 +489,7 @@
489490 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-edit-template' ) );
490491 $htmlOut .= wfMsg( 'centralnotice-edit-template-summary' );
491492 $buttons = array();
 493+ $buttons[] = '<a href="#" onclick="insertButton(\'close\');return false;">' . wfMsg( 'centralnotice-close-button' ) . '</a>';
492494 $buttons[] = '<a href="#" onclick="insertButton(\'hide\');return false;">' . wfMsg( 'centralnotice-hide-button' ) . '</a>';
493495 $buttons[] = '<a href="#" onclick="insertButton(\'translate\');return false;">' . wfMsg( 'centralnotice-translate-button' ) . '</a>';
494496 $htmlOut .= Xml::tags( 'div',
Index: trunk/extensions/CentralNotice/centralnotice.js
@@ -20,11 +20,14 @@
2121 var bannerField = document.getElementById('templateBody');
2222 switch( buttonType ) {
2323 case 'translate':
24 - var buttonValue = '[<a href="http://meta.wikimedia.org/wiki/CentralNotice">{{int:centralnotice-shared-help-translate}}</a>]';
25 - break;
 24+ var buttonValue = '[<a href="http://meta.wikimedia.org/wiki/CentralNotice">{{int:centralnotice-shared-help-translate}}</a>]';
 25+ break;
2626 case 'hide':
27 - var buttonValue = '[<a href="#" onclick="toggleNotice();return false">{{int:centralnotice-shared-hide}}</a>]';
28 - break;
 27+ var buttonValue = '[<a href="#" onclick="toggleNotice();return false">{{int:centralnotice-shared-hide}}</a>]';
 28+ break;
 29+ case 'close':
 30+ var buttonValue = '<a href="#" onclick="toggleNotice();return false"><img border="0" src="http://upload.wikimedia.org/wikipedia/commons/1/1b/Close_window_X.gif" width="10" height="10" alt="Close" /></a>';
 31+ break;
2932 }
3033 if (document.selection) {
3134 // IE support

Follow-up revisions

RevisionCommit summaryAuthorDate
r74277switching to icon on bits for better security/stability, per comment at r74110kaldari21:12, 4 October 2010
r74320fix for r74277 and r74110kaldari18:57, 5 October 2010
r79696removing wikimedia specific stuff per r74110, r74277, and r74320kaldari00:56, 6 January 2011

Comments

#Comment by Brion VIBBER (talk | contribs)   02:36, 3 October 2010

Hardcoding a commons image URL for a UI component doesn't seem stable; include the icon with the extension instead.

#Comment by Kaldari (talk | contribs)   21:17, 4 October 2010

fixed. see below.

#Comment by Kaldari (talk | contribs)   21:16, 4 October 2010

Fixed in r74275 and r74277.

Status & tagging log