Index: trunk/extensions/Contest/specials/SpecialContestSignup.php |
— | — | @@ -177,6 +177,14 @@ |
178 | 178 | else { |
179 | 179 | $this->getOutput()->addModules( 'contest.special.signup' ); |
180 | 180 | } |
| 181 | + |
| 182 | + $this->getOutput()->addScript( |
| 183 | + Skin::makeVariablesScript( |
| 184 | + array( |
| 185 | + 'ContestConfig' => array( 'rules_page' => ContestUtils::getParsedArticleContent( $contest->getField( 'rules_page' ) ) ) |
| 186 | + ) |
| 187 | + ) |
| 188 | + ); |
181 | 189 | } |
182 | 190 | |
183 | 191 | /** |
— | — | @@ -263,7 +271,9 @@ |
264 | 272 | 'type' => 'check', |
265 | 273 | 'default' => '0', |
266 | 274 | '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' |
268 | 278 | ); |
269 | 279 | |
270 | 280 | return $fields; |
Index: trunk/extensions/Contest/Contest.php |
— | — | @@ -221,7 +221,7 @@ |
222 | 222 | 'contest.special.signup.js', |
223 | 223 | ), |
224 | 224 | 'dependencies' => array( |
225 | | - 'jquery.ui.button' |
| 225 | + 'jquery.ui.button', 'jquery.fancybox', |
226 | 226 | ) |
227 | 227 | ); |
228 | 228 | |
Index: trunk/extensions/Contest/resources/contest.special.signup.js |
— | — | @@ -10,8 +10,31 @@ |
11 | 11 | |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
| 14 | + var contestConfig = mw.config.get( 'ContestConfig' ); |
| 15 | + |
14 | 16 | $( '.mw-htmlform-submit' ).button(); |
15 | 17 | |
| 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 | + |
16 | 39 | } ); |
17 | 40 | |
18 | 41 | })( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |