r99845 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99844‎ | r99845 | r99846 >
Date:04:28, 15 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
use fancybox on the signup page as well
Modified paths:
  • /trunk/extensions/Contest/Contest.php (modified) (history)
  • /trunk/extensions/Contest/resources/contest.special.signup.js (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestSignup.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialContestSignup.php
@@ -177,6 +177,14 @@
178178 else {
179179 $this->getOutput()->addModules( 'contest.special.signup' );
180180 }
 181+
 182+ $this->getOutput()->addScript(
 183+ Skin::makeVariablesScript(
 184+ array(
 185+ 'ContestConfig' => array( 'rules_page' => ContestUtils::getParsedArticleContent( $contest->getField( 'rules_page' ) ) )
 186+ )
 187+ )
 188+ );
181189 }
182190
183191 /**
@@ -263,7 +271,9 @@
264272 'type' => 'check',
265273 'default' => '0',
266274 'label-message' => array( 'contest-signup-readrules', $contest->getField( 'rules_page' ) ),
267 - 'validation-callback' => array( __CLASS__, 'validateRulesField' )
 275+ 'validation-callback' => array( __CLASS__, 'validateRulesField' ),
 276+ 'id' => 'contest-rules',
 277+ 'data-foo' => 'bar'
268278 );
269279
270280 return $fields;
Index: trunk/extensions/Contest/Contest.php
@@ -221,7 +221,7 @@
222222 'contest.special.signup.js',
223223 ),
224224 'dependencies' => array(
225 - 'jquery.ui.button'
 225+ 'jquery.ui.button', 'jquery.fancybox',
226226 )
227227 );
228228
Index: trunk/extensions/Contest/resources/contest.special.signup.js
@@ -10,8 +10,31 @@
1111
1212 $( document ).ready( function() {
1313
 14+ var contestConfig = mw.config.get( 'ContestConfig' );
 15+
1416 $( '.mw-htmlform-submit' ).button();
1517
 18+ $rules = $( '#contest-rules' );
 19+
 20+ $div = $( '<div />' ).attr( {
 21+ 'style': 'display:none'
 22+ } ).html( $( '<div />' ).attr( { 'id': 'contest-rules-div' } ).html( contestConfig['rules_page'] ) );
 23+
 24+ $a = $( "label[for='contest-rules']" ).find( 'a' );
 25+ $a.attr( { 'href': '#contest-rules-div' } );
 26+
 27+ $rules.closest( 'td' ).append( $div );
 28+
 29+ $a.fancybox( {
 30+ 'width' : '75%',
 31+// 'height' : '75%',
 32+// 'autoScale' : true,
 33+ 'transitionIn' : 'none',
 34+ 'transitionOut' : 'none',
 35+ 'type' : 'inline',
 36+// 'autoDimensions': false
 37+ } );
 38+
1639 } );
1740
1841 })( window.jQuery, window.mediaWiki );
\ No newline at end of file

Status & tagging log