Index: trunk/extensions/Contest/resources/contest.special.submission.js |
— | — | @@ -1,19 +1,19 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -(function( $, mw ) { |
11 | | - |
| 10 | +(function( $, mw ) { |
| 11 | + |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
14 | 14 | $( '.mw-htmlform-submit' ).button(); |
15 | | - |
| 15 | + |
16 | 16 | $( '.contest-submission' ).contestSubmission(); |
17 | | - |
| 17 | + |
18 | 18 | } ); |
19 | 19 | |
20 | | -})( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 20 | +})( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/contest.special.welcome.js |
— | — | @@ -1,32 +1,32 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -(function( $, mw ) { |
11 | | - |
| 10 | +(function( $, mw ) { |
| 11 | + |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
14 | 14 | $( '#contest-challenges' ).contestChallenges( |
15 | 15 | mw.config.get( 'ContestChallenges' ), |
16 | 16 | mw.config.get( 'ContestConfig' ) |
17 | 17 | ); |
18 | | - |
| 18 | + |
19 | 19 | $rules = $( '#contest-rules' ); |
20 | | - |
| 20 | + |
21 | 21 | $div = $( '<div />' ).attr( { |
22 | 22 | 'style': 'display:none' |
23 | 23 | } ).html( $( '<div />' ).attr( { 'id': 'contest-rules-div' } ).html( $rules.attr( 'data-rules' ) ) ); |
24 | | - |
| 24 | + |
25 | 25 | // TODO: fix very ugly message construction. |
26 | 26 | $a = $( '<a />' ).text( mw.msg( 'contest-welcome-rules-link' ) ).attr( { 'href': '#contest-rules-div' } ); |
27 | 27 | $p = $( '<p />' ).text( mw.msg( 'contest-welcome-rules' ) + ' ' ).append( $a ).append( '.' ); |
28 | | - |
| 28 | + |
29 | 29 | $rules.html( $p ).append( $div ); |
30 | | - |
| 30 | + |
31 | 31 | $a.fancybox( { |
32 | 32 | 'width' : '85%', |
33 | 33 | 'height' : '85%', |
Index: trunk/extensions/Contest/resources/jquery.contestSubmission.js |
— | — | @@ -1,13 +1,13 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | 10 | (function( $, mw ) { |
11 | | - |
| 11 | + |
12 | 12 | /** |
13 | 13 | * Regex text escaping function. |
14 | 14 | * Borrowed from http://simonwillison.net/2006/Jan/20/escape/ |
— | — | @@ -15,42 +15,42 @@ |
16 | 16 | RegExp.escape = function( text ) { |
17 | 17 | if ( !arguments.callee.sRE ) { |
18 | 18 | var specials = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\' ]; |
19 | | - arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' ); |
| 19 | + arguments.callee.sRE = new RegExp( '(\\' + specials.join('|\\') + ')', 'g' ); |
20 | 20 | } |
21 | 21 | return text.replace(arguments.callee.sRE, '\\$1'); |
22 | 22 | } |
23 | | - |
| 23 | + |
24 | 24 | $.fn.contestSubmission = function() { |
25 | 25 | var _this = this; |
26 | 26 | var $this = $( this ); |
27 | | - |
| 27 | + |
28 | 28 | this.config = {}; |
29 | 29 | this.status = {}; |
30 | | - |
| 30 | + |
31 | 31 | this.input = null; |
32 | 32 | this.label = null; |
33 | | - |
| 33 | + |
34 | 34 | this.getValue = function() { |
35 | 35 | return this.input.val(); |
36 | 36 | } |
37 | | - |
| 37 | + |
38 | 38 | this.getDomains = function() { |
39 | 39 | return this.config.domains; |
40 | 40 | }; |
41 | | - |
| 41 | + |
42 | 42 | this.validate = function() { |
43 | 43 | var domains = _this.getDomains(); |
44 | | - |
| 44 | + |
45 | 45 | for ( var i = domains.length - 1; i >= 0; i-- ) { |
46 | 46 | var regex = new RegExp( "^https?://(([a-z0-9]+)\\.)?" + RegExp.escape( domains[i] ) + "/(.*)?$", "gi" ); |
47 | 47 | if ( regex.test( this.getValue() ) ) { |
48 | 48 | return true; |
49 | 49 | } |
50 | 50 | } |
51 | | - |
| 51 | + |
52 | 52 | return false; |
53 | 53 | }; |
54 | | - |
| 54 | + |
55 | 55 | this.showStatus = function() { |
56 | 56 | if ( _this.status.valid ) { |
57 | 57 | _this.input.removeClass( 'error' ); |
— | — | @@ -59,16 +59,16 @@ |
60 | 60 | _this.input.addClass( 'error' ); |
61 | 61 | } |
62 | 62 | }; |
63 | | - |
| 63 | + |
64 | 64 | this.onValueChanged = function() { |
65 | 65 | _this.status.valid = _this.validate(); |
66 | 66 | _this.showStatus(); |
67 | 67 | }; |
68 | | - |
| 68 | + |
69 | 69 | this.setup = function() { |
70 | 70 | var message = $this.attr( 'data-value' ) === '' ? 'contest-submission-new-submission' : 'contest-submission-current-submission'; |
71 | 71 | var domainLinks = []; |
72 | | - |
| 72 | + |
73 | 73 | for ( var i = this.config.domains.length - 1; i >= 0; i-- ) { |
74 | 74 | var link = $( '<a />' ).text( this.config.domains[i] ).attr( { |
75 | 75 | 'href': 'http://' + this.config.domains[i], |
— | — | @@ -76,16 +76,16 @@ |
77 | 77 | } ); |
78 | 78 | domainLinks.push( $( '<div />' ).html( link ).html() ); |
79 | 79 | } |
80 | | - |
| 80 | + |
81 | 81 | var links = $( '<span />' ).html( '' ); |
82 | | - |
| 82 | + |
83 | 83 | this.label = $( '<label style="display:block" />' ).attr( { |
84 | 84 | 'for': this.config.name, |
85 | 85 | } ).text( mw.msg( message ) ).append( |
86 | 86 | $( '<br />' ), |
87 | 87 | mw.msg( 'contest-submission-domains', domainLinks.join( ', ' ) ) |
88 | 88 | ); |
89 | | - |
| 89 | + |
90 | 90 | this.input = $( '<input />' ).attr( { |
91 | 91 | 'type': 'text', |
92 | 92 | 'value': $this.attr( 'data-value' ), |
— | — | @@ -93,23 +93,23 @@ |
94 | 94 | 'size': 45, |
95 | 95 | 'id': this.config.name |
96 | 96 | } ); |
97 | | - |
| 97 | + |
98 | 98 | this.html( this.label ); |
99 | 99 | this.append( this.input ); |
100 | | - |
| 100 | + |
101 | 101 | this.input.keyup( this.onValueChanged ); |
102 | 102 | }; |
103 | | - |
| 103 | + |
104 | 104 | this.getConfig = function() { |
105 | 105 | this.config.name = $this.attr( 'data-name' ); |
106 | 106 | this.config.domains = $this.attr( 'data-domains' ).split( '|' ); |
107 | 107 | }; |
108 | | - |
| 108 | + |
109 | 109 | this.getConfig(); |
110 | 110 | this.setup(); |
111 | 111 | this.onValueChanged(); |
112 | | - |
| 112 | + |
113 | 113 | return this; |
114 | 114 | }; |
115 | | - |
116 | | -})( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 115 | + |
| 116 | +})( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/contest.contestant.pager.js |
— | — | @@ -1,19 +1,19 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -(function( $, mw ) { |
11 | | - |
| 10 | +(function( $, mw ) { |
| 11 | + |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
14 | 14 | $( '.contestant-row' ).click( function() { |
15 | 15 | window.location = $( this ).attr( 'data-contestant-target' ); |
16 | 16 | } ); |
17 | | - |
| 17 | + |
18 | 18 | } ); |
19 | 19 | |
20 | | -})( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 20 | +})( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/contest.special.contests.js |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
— | — | @@ -24,12 +24,12 @@ |
25 | 25 | failCallback( mw.msg( 'contest-special-delete-failed' ) ); |
26 | 26 | } |
27 | 27 | } |
28 | | - ); |
| 28 | + ); |
29 | 29 | } |
30 | | - |
| 30 | + |
31 | 31 | $( '.contest-delete' ).click( function() { |
32 | 32 | $this = $( this ); |
33 | | - |
| 33 | + |
34 | 34 | if ( confirm( mw.msg( 'contest-special-confirm-delete' ) ) ) { |
35 | 35 | deleteContest( |
36 | 36 | { |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | function() { |
41 | 41 | $this.closest( 'tr' ).slideUp( 'slow', function() { |
42 | 42 | $( this ).remove(); |
43 | | - |
| 43 | + |
44 | 44 | if ( $( '.contests-table tr' ).length < 2 ) { |
45 | 45 | $( '.contests-table' ).remove(); |
46 | 46 | $( '.contests-title' ).remove(); |
— | — | @@ -53,5 +53,5 @@ |
54 | 54 | } |
55 | 55 | return false; |
56 | 56 | } ); |
57 | | - |
58 | | -} ); })( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 57 | + |
| 58 | +} ); })( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/contest.special.editcontest.js |
— | — | @@ -1,85 +1,85 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | 10 | (function( $, mw ) { |
11 | | - |
| 11 | + |
12 | 12 | function addChallengeToRemove( id ) { |
13 | 13 | if ( !isNaN( id ) ) { |
14 | 14 | var currentVal = $( '#delete-challenges' ).val(); |
15 | | - |
| 15 | + |
16 | 16 | var currentIds = currentVal !== '' ? currentVal.split( '|' ) : []; |
17 | 17 | currentIds.push( id ); |
18 | | - |
| 18 | + |
19 | 19 | $( '#delete-challenges' ).val( currentIds.join( '|' ) ); |
20 | 20 | } |
21 | 21 | } |
22 | | - |
| 22 | + |
23 | 23 | $.fn.mwChallenge = function( options ) { |
24 | | - |
| 24 | + |
25 | 25 | var _this = this; |
26 | 26 | var $this = $( this ); |
27 | 27 | this.options = options; |
28 | | - |
| 28 | + |
29 | 29 | this.titleInput = null; |
30 | 30 | this.textInput = null; |
31 | 31 | this.deleteButton = null; |
32 | | - |
| 32 | + |
33 | 33 | this.remove = function() { |
34 | 34 | addChallengeToRemove( $this.attr( 'data-challenge-id' ) ); |
35 | | - |
| 35 | + |
36 | 36 | $tr = $this.closest( 'tr' ); |
37 | 37 | $tr.slideUp( 'fast', function() { $tr.remove(); } ); |
38 | 38 | }; |
39 | | - |
| 39 | + |
40 | 40 | this.init = function() { |
41 | 41 | $this.html( '' ); |
42 | | - |
| 42 | + |
43 | 43 | this.titleInput = $( '<input />' ).attr( { |
44 | 44 | 'type': 'text', |
45 | 45 | 'name': 'contest-challenge-' + $this.attr( 'data-challenge-id' ), |
46 | 46 | 'size': 45 |
47 | 47 | } ).val( $this.attr( 'data-challenge-title' ) ); |
48 | | - |
49 | | - $this.append( |
| 48 | + |
| 49 | + $this.append( |
50 | 50 | $( '<div />' ).html( |
51 | 51 | $( '<label />' ) |
52 | 52 | .text( mw.msg( 'contest-edit-challenge-title' ) ) |
53 | 53 | .attr( 'for', 'contest-challenge-' + $this.attr( 'data-challenge-id' ) ) |
54 | 54 | ).append( ' ' ).append( this.titleInput ) |
55 | 55 | ); |
56 | | - |
| 56 | + |
57 | 57 | this.onelineInput = $( '<input />' ).attr( { |
58 | 58 | 'type': 'text', |
59 | 59 | 'name': 'challenge-oneline-' + $this.attr( 'data-challenge-id' ), |
60 | 60 | 'size': 45, |
61 | 61 | 'style': 'margin-top: 3px' |
62 | 62 | } ).val( $this.attr( 'data-challenge-oneline' ) ); |
63 | | - |
64 | | - $this.append( |
| 63 | + |
| 64 | + $this.append( |
65 | 65 | $( '<div />' ).html( |
66 | 66 | $( '<label />' ) |
67 | 67 | .text( mw.msg( 'contest-edit-challenge-oneline' ) ) |
68 | 68 | .attr( { 'for': 'contest-oneline-' + $this.attr( 'data-challenge-id' ) } ) |
69 | 69 | ).append( ' ' ).append( this.onelineInput ) |
70 | 70 | ); |
71 | | - |
| 71 | + |
72 | 72 | this.textInput = $( '<textarea />' ).attr( { |
73 | 73 | 'name': 'challenge-text-' + $this.attr( 'data-challenge-id' ) |
74 | 74 | } ).val( $this.attr( 'data-challenge-text' ) ); |
75 | | - |
76 | | - $this.append( |
| 75 | + |
| 76 | + $this.append( |
77 | 77 | $( '<div />' ).html( |
78 | 78 | $( '<label />' ) |
79 | 79 | .text( mw.msg( 'contest-edit-challenge-text' ) ) |
80 | 80 | .attr( 'for', 'challenge-text-' + $this.attr( 'data-challenge-id' ) ) |
81 | 81 | ).append( '<br />' ).append( this.textInput ) |
82 | 82 | ); |
83 | | - |
| 83 | + |
84 | 84 | this.deleteButton = $( '<button />' ) |
85 | 85 | .button( { 'label': mw.msg( 'contest-edit-delete' ) } ) |
86 | 86 | .click( function() { |
— | — | @@ -88,23 +88,23 @@ |
89 | 89 | return false; |
90 | 90 | } |
91 | 91 | } ); |
92 | | - |
| 92 | + |
93 | 93 | $this.append( this.deleteButton ); |
94 | 94 | }; |
95 | | - |
| 95 | + |
96 | 96 | this.init(); |
97 | | - |
| 97 | + |
98 | 98 | return this; |
99 | | - |
| 99 | + |
100 | 100 | }; |
101 | | - |
| 101 | + |
102 | 102 | var newNr = 0; |
103 | 103 | var $table = null; |
104 | | - |
| 104 | + |
105 | 105 | function getNewChallengeMessage() { |
106 | 106 | return mw.msg( 'contest-edit-add-' + ( $( '.contest-challenge-input' ).size() === 0 ? 'first' : 'another' ) ); |
107 | 107 | } |
108 | | - |
| 108 | + |
109 | 109 | function addChallenge( challenge ) { |
110 | 110 | $challenge = $( '<div />' ).attr( { |
111 | 111 | 'class': 'contest-challenge-input', |
— | — | @@ -113,46 +113,46 @@ |
114 | 114 | 'data-challenge-text': challenge.text, |
115 | 115 | 'data-challenge-oneline': challenge.oneline |
116 | 116 | } ); |
117 | | - |
| 117 | + |
118 | 118 | $tr = $( '<tr />' ); |
119 | | - |
| 119 | + |
120 | 120 | $tr.append( $( '<td />' ) ); |
121 | | - |
| 121 | + |
122 | 122 | $tr.append( $( '<td />' ).html( $challenge ).append( '<hr />' ) ); |
123 | | - |
| 123 | + |
124 | 124 | $( '.add-new-challenge' ).before( $tr ); |
125 | | - |
| 125 | + |
126 | 126 | $challenge.mwChallenge(); |
127 | 127 | } |
128 | | - |
| 128 | + |
129 | 129 | $( document ).ready( function() { |
130 | 130 | |
131 | 131 | $( '#cancelEdit' ).click( function() { |
132 | 132 | window.location = $( this ).attr( 'target-url' ); |
133 | 133 | } ); |
134 | | - |
| 134 | + |
135 | 135 | $table = $( '#contest-name-field' ).closest( 'tbody' ); |
136 | | - |
| 136 | + |
137 | 137 | $( '#bodyContent' ).find( '[type="submit"]' ).button(); |
138 | | - |
| 138 | + |
139 | 139 | $table.append( '<tr><td colspan="2"><hr /></td></tr>' ); |
140 | | - |
| 140 | + |
141 | 141 | $addNew = $( '<button />' ).button( { 'label': getNewChallengeMessage() } ).click( function() { |
142 | 142 | addChallenge( { |
143 | 143 | 'id': 'new-' + newNr++ , |
144 | 144 | 'title': '', |
145 | 145 | 'text': '' |
146 | 146 | } ); |
147 | | - |
| 147 | + |
148 | 148 | $( this ).button( { 'label': getNewChallengeMessage() } ); |
149 | | - |
| 149 | + |
150 | 150 | return false; |
151 | 151 | } ); |
152 | | - |
| 152 | + |
153 | 153 | $table.append( $( '<tr />' ).attr( 'class', 'add-new-challenge' ).html( $( '<td />' ) ).append( $( '<td />' ).html( $addNew ) ) ); |
154 | | - |
| 154 | + |
155 | 155 | $table.append( '<tr><td colspan="2"><hr /></td></tr>' ); |
156 | | - |
| 156 | + |
157 | 157 | $( '.contest-challenge' ).each( function( index, domElement ) { |
158 | 158 | $this = $( domElement ); |
159 | 159 | addChallenge( { |
— | — | @@ -162,12 +162,12 @@ |
163 | 163 | 'oneline': $this.attr( 'data-challenge-oneline' ), |
164 | 164 | } ); |
165 | 165 | } ); |
166 | | - |
| 166 | + |
167 | 167 | $( '#contest-edit-end' ).datetimepicker( { |
168 | 168 | minDate: new Date(), |
169 | 169 | dateFormat: 'yy-mm-dd' |
170 | 170 | } ); |
171 | | - |
| 171 | + |
172 | 172 | } ); |
173 | | - |
| 173 | + |
174 | 174 | })( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/contest.special.signup.js |
— | — | @@ -1,30 +1,30 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -(function( $, mw ) { |
11 | | - |
| 10 | +(function( $, mw ) { |
| 11 | + |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
14 | 14 | var contestConfig = mw.config.get( 'ContestConfig' ); |
15 | | - |
| 15 | + |
16 | 16 | $( '.mw-htmlform-submit' ).button(); |
17 | | - |
| 17 | + |
18 | 18 | $rules = $( '#contest-rules' ); |
19 | | - |
| 19 | + |
20 | 20 | $div = $( '<div />' ).attr( { |
21 | 21 | 'style': 'display:none' |
22 | 22 | } ).html( $( '<div />' ).attr( { 'id': 'contest-rules-div' } ).html( contestConfig['rules_page'] ) ); |
23 | | - |
| 23 | + |
24 | 24 | $a = $( "label[for='contest-rules']" ).find( 'a' ); |
25 | 25 | $a.attr( { 'href': '#contest-rules-div' } ); |
26 | | - |
| 26 | + |
27 | 27 | $rules.closest( 'td' ).append( $div ); |
28 | | - |
| 28 | + |
29 | 29 | $a.fancybox( { |
30 | 30 | 'width' : '85%', |
31 | 31 | 'height' : '85%', |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | 'type' : 'inline', |
35 | 35 | 'autoDimensions': false |
36 | 36 | } ); |
37 | | - |
| 37 | + |
38 | 38 | } ); |
39 | 39 | |
40 | 40 | })( window.jQuery, window.mediaWiki ); |
Index: trunk/extensions/Contest/resources/jquery.contestChallenges.js |
— | — | @@ -1,21 +1,21 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | 10 | ( function ( $, mw ) { $.fn.contestChallenges = function( challenges, config ) { |
11 | | - |
| 11 | + |
12 | 12 | this.challenges = challenges; |
13 | 13 | this.config = config; |
14 | | - |
| 14 | + |
15 | 15 | var _this = this; |
16 | 16 | var $this = $( this ); |
17 | | - |
| 17 | + |
18 | 18 | this.challengesList = null; |
19 | | - |
| 19 | + |
20 | 20 | this.addChallenge = function( challenge ) { |
21 | 21 | this.challengesList |
22 | 22 | .append( |
— | — | @@ -76,25 +76,25 @@ |
77 | 77 | ) |
78 | 78 | ); |
79 | 79 | } |
80 | | - |
| 80 | + |
81 | 81 | this.initChallenges = function() { |
82 | 82 | this.challengesList = $( '<ul />' ).attr( 'id', 'contest-challenges-list' ); |
83 | | - |
| 83 | + |
84 | 84 | for ( var i in this.challenges ) { |
85 | 85 | this.addChallenge( this.challenges[i] ); |
86 | 86 | } |
87 | 87 | }; |
88 | | - |
| 88 | + |
89 | 89 | this.init = function() { |
90 | 90 | $this.html( $( '<h3 />' ).text( mw.msg( 'contest-welcome-select-header' ) ) ); |
91 | | - |
| 91 | + |
92 | 92 | this.initChallenges(); |
93 | | - |
| 93 | + |
94 | 94 | $this.append( this.challengesList ); |
95 | 95 | }; |
96 | | - |
| 96 | + |
97 | 97 | this.init(); |
98 | | - |
| 98 | + |
99 | 99 | return this; |
100 | | - |
| 100 | + |
101 | 101 | }; } )( window.jQuery, window.mediaWiki ); |