r100434 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100433‎ | r100434 | r100435 >
Date:18:09, 21 October 2011
Author:brion
Status:ok
Tags:
Comment:
MFT r100433: fix bug 31860, 31861 in Contest extension by reverting most of r99837 which turned a regular link into a weird inline frame popup thing that's hard to work with, and made the i18n messages harder to construct properly.
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/Contest.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.welcome.js (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php
@@ -109,8 +109,7 @@
110110
111111 // Special:ContestWelcome
112112 'contest-welcome-unknown' => 'There is no contest with the provided name.',
113 - 'contest-welcome-rules' => 'In order to participate, you are required to agree to', // js i18n
114 - 'contest-welcome-rules-link' => 'the contest rules', // js i18n
 113+ 'contest-welcome-rules' => 'In order to participate, you must agree to [[$1|the contest rules]].',
115114 'contest-welcome-signup' => 'Signup now',
116115 'contest-welcome-js-off' => 'The contest user interface uses JavaScript. Your browser does not support JavaScript or JavaScript is disabled.',
117116 'contest-welcome-accept-challenge' => 'Challenge accepted',
Index: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php
@@ -187,13 +187,8 @@
188188 * @param Contest $contest
189189 */
190190 protected function showRules( Contest $contest ) {
191 - $this->getOutput()->addHTML( Html::element(
192 - 'div',
193 - array(
194 - 'id' => 'contest-rules',
195 - 'data-rules' => ContestUtils::getParsedArticleContent( $contest->getField( 'rules_page' ) )
196 - )
197 - ) );
 191+ // TODO: we might want to have a pop-up with the content here, instead of a link to the page.
 192+ $this->getOutput()->addWikiMsgArray( 'contest-welcome-rules', $contest->getField( 'rules_page' ) );
198193 }
199194
200195 /**
Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.php
@@ -234,9 +234,7 @@
235235 'jquery.contestChallenges', 'jquery.fancybox',
236236 ),
237237 'messages' => array(
238 - 'contest-welcome-select-header',
239 - 'contest-welcome-rules',
240 - 'contest-welcome-rules-link',
 238+ 'contest-welcome-select-header'
241239 )
242240 );
243241
Index: branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.welcome.js
@@ -14,27 +14,6 @@
1515 mw.config.get( 'ContestChallenges' ),
1616 mw.config.get( 'ContestConfig' )
1717 );
18 -
19 - $rules = $( '#contest-rules' );
20 -
21 - $div = $( '<div />' ).attr( {
22 - 'style': 'display:none'
23 - } ).html( $( '<div />' ).attr( { 'id': 'contest-rules-div' } ).html( $rules.attr( 'data-rules' ) ) );
24 -
25 - // TODO: fix very ugly message construction.
26 - $a = $( '<a />' ).text( mw.msg( 'contest-welcome-rules-link' ) ).attr( { 'href': '#contest-rules-div' } );
27 - $p = $( '<p />' ).text( mw.msg( 'contest-welcome-rules' ) + ' ' ).append( $a ).append( '.' );
28 -
29 - $rules.html( $p ).append( $div );
30 -
31 - $a.fancybox( {
32 - 'width' : '85%',
33 - 'height' : '85%',
34 - 'transitionIn' : 'none',
35 - 'transitionOut' : 'none',
36 - 'type' : 'inline',
37 - 'autoDimensions': false
38 - } );
3918 } );
4019
4120 })( window.jQuery, window.mediaWiki );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99837use jquery fqncybox for rules displayjeroendedauw01:49, 15 October 2011
r100433* (bug 31860, bug 31861) Revert most of r99837: i18n construction regression,...brion18:07, 21 October 2011

Status & tagging log