Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -98,7 +98,10 @@ |
99 | 99 | 'contest-welcome-unknown' => 'There is no contest with the provided name.', |
100 | 100 | 'contest-welcome-rules' => 'In order to participate, you must agree to [[$1|the contest rules]].', |
101 | 101 | 'contest-welcome-signup' => 'Signup now', |
| 102 | + 'contest-welcome-js-off' => 'Contest uses JavaScript for an improved interface. Your browser either does not support JavaScript or has JavaScript turned off.', |
102 | 103 | |
| 104 | + 'contest-welcome-select-header' => 'Select your challange:', |
| 105 | + |
103 | 106 | // Special:ContestSignup & Special:ContestSubmission |
104 | 107 | 'contest-signup-unknown' => 'There is no contest with the provided name.', |
105 | 108 | 'contest-signup-submit' => 'Signup', |
Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php |
— | — | @@ -62,7 +62,6 @@ |
63 | 63 | $this->showChallenges( $contest ); |
64 | 64 | $this->showOpportunities( $contest ); |
65 | 65 | $this->showRules( $contest ); |
66 | | - $this->showSignupLinks( $contest ); |
67 | 66 | |
68 | 67 | $out->addModules( 'contest.special.welcome' ); |
69 | 68 | } |
— | — | @@ -87,32 +86,41 @@ |
88 | 87 | * @param Contest $contest |
89 | 88 | */ |
90 | 89 | protected function showChallenges( Contest $contest ) { |
91 | | - $out = $this->getOutput(); |
| 90 | + $this->showNoJSFallback( $contest ); |
| 91 | + |
| 92 | + $this->getOutput()->addHTML( '<div id="contest-challanges"></div>' ); |
92 | 93 | |
| 94 | + $this->addContestJS( $contest ); |
| 95 | + } |
| 96 | + |
| 97 | + protected function addContestJS( Contest $contest ) { |
| 98 | + $challanges = array(); |
| 99 | + |
93 | 100 | foreach ( $contest->getChallenges() as /* ContestChallenge */ $challenge ) { |
94 | | - $out->addHTML( '<fieldset>' ); |
95 | | - |
96 | | - $out->addHTML( Html::element( 'legend', array(), $challenge->getField( 'title' ) ) ); |
97 | | - |
98 | | - $out->addHTML( '<div class="contest-challenge">' ); |
99 | | - |
100 | | - $out->addHTML( Html::element( |
101 | | - 'button', |
102 | | - array( |
103 | | - 'class' => 'contest-signup challenge-signup', |
104 | | - 'data-contest-target' => $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() ) |
105 | | - ), |
106 | | - wfMsg( 'contest-welcome-signup' ) |
107 | | - ) ); |
108 | | - |
109 | | - $out->addHTML( Html::element( 'p', array(), $challenge->getField( 'text' ) ) ); |
110 | | - |
111 | | - $out->addHTML( '</div>' ); |
112 | | - |
113 | | - $out->addHTML( '</fieldset>' ); |
| 101 | + $data = $challenge->toArray(); |
| 102 | + $data['target'] = $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() ); |
| 103 | + $challanges[] = $data; |
114 | 104 | } |
| 105 | + |
| 106 | + $this->getOutput()->addScript( |
| 107 | + Skin::makeVariablesScript( |
| 108 | + array( |
| 109 | + 'ContestChallanges' => $challanges, |
| 110 | + 'ContestConfig' => array() |
| 111 | + ) |
| 112 | + ) |
| 113 | + ); |
115 | 114 | } |
116 | 115 | |
| 116 | + protected function showNoJSFallback( Contest $contest ) { |
| 117 | + $out = $this->getOutput(); |
| 118 | + |
| 119 | + $out->addHTML( '<noscript>' ); |
| 120 | + $out->addHTML( '<p class="errorbox">' . htmlspecialchars( wfMsg( 'contest-welcome-js-off' ) ) . '</p>' ); |
| 121 | + // TODO? |
| 122 | + $out->addHTML( '</noscript>' ); |
| 123 | + } |
| 124 | + |
117 | 125 | /** |
118 | 126 | * Show the opportunities for this contest. |
119 | 127 | * |
— | — | @@ -137,27 +145,6 @@ |
138 | 146 | } |
139 | 147 | |
140 | 148 | /** |
141 | | - * Show the signup links for this contest. |
142 | | - * |
143 | | - * @since 0.1 |
144 | | - * |
145 | | - * @param Contest $contest |
146 | | - */ |
147 | | - protected function showSignupLinks( Contest $contest ) { |
148 | | - $out = $this->getOutput(); |
149 | | - |
150 | | - $out->addHTML( Html::element( |
151 | | - 'button', |
152 | | - array( |
153 | | - 'id' => 'contest-signup', |
154 | | - 'class' => 'contest-signup', |
155 | | - 'data-contest-target' => $this->getSignupLink( $contest->getField( 'name' ) ) |
156 | | - ), |
157 | | - wfMsg( 'contest-welcome-signup' ) |
158 | | - ) ); |
159 | | - } |
160 | | - |
161 | | - /** |
162 | 149 | * Gets the URL for the signup links. |
163 | 150 | * When the user has to login, this will be to the login page, |
164 | 151 | * with a retunrto to the signup page. |
— | — | @@ -176,15 +163,15 @@ |
177 | 164 | |
178 | 165 | $signupitle = SpecialPage::getTitleFor( 'ContestSignup', $contestName ); |
179 | 166 | |
180 | | - if ( $this->getUser()->isLoggedIn() ) { |
| 167 | +// if ( $this->getUser()->isLoggedIn() ) { |
181 | 168 | return $signupitle->getLocalURL(); |
182 | | - } |
183 | | - else { |
184 | | - return SpecialPage::getTitleFor( 'UserLogin' )->getLocalURL( array( |
185 | | - //'type' => 'signup', |
186 | | - 'returnto' => $signupitle->getFullText() |
187 | | - ) ); |
188 | | - } |
| 169 | +// } |
| 170 | +// else { |
| 171 | +// return SpecialPage::getTitleFor( 'Userlogin' )->getLocalURL( array( |
| 172 | +// //'type' => 'signup', |
| 173 | +// 'returnto' => $signupitle->getFullText() |
| 174 | +// ) ); |
| 175 | +// } |
189 | 176 | } |
190 | 177 | |
191 | 178 | /** |
— | — | @@ -203,7 +190,7 @@ |
204 | 191 | if ( is_null( $title ) ) { |
205 | 192 | return ''; |
206 | 193 | } |
207 | | - |
| 194 | + |
208 | 195 | $article = new Article( $title, 0 ); |
209 | 196 | return $article->getContent(); |
210 | 197 | } |
Index: trunk/extensions/Contest/Contest.php |
— | — | @@ -166,12 +166,16 @@ |
167 | 167 | $wgResourceModules['contest.special.welcome'] = $moduleTemplate + array( |
168 | 168 | 'scripts' => array( |
169 | 169 | 'contest.special.welcome.js', |
| 170 | + 'jquery.contestChallanges.js' |
170 | 171 | ), |
171 | 172 | 'styles' => array( |
172 | 173 | 'contest.special.welcome.css', |
173 | 174 | ), |
174 | 175 | 'dependencies' => array( |
175 | 176 | 'jquery.ui.button' |
| 177 | + ), |
| 178 | + 'messages' => array( |
| 179 | + 'contest-welcome-select-header' |
176 | 180 | ) |
177 | 181 | ); |
178 | 182 | |
Index: trunk/extensions/Contest/includes/ContestChallenge.php |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | 'contest_id' => 'id', |
87 | 87 | 'text' => 'str', |
88 | 88 | 'title' => 'str', |
| 89 | + 'oneline' => 'str', |
89 | 90 | ); |
90 | 91 | } |
91 | 92 | |
— | — | @@ -99,6 +100,7 @@ |
100 | 101 | return array( |
101 | 102 | 'text' => '', |
102 | 103 | 'title' => '', |
| 104 | + 'oneline' => '', |
103 | 105 | ); |
104 | 106 | } |
105 | 107 | |
Index: trunk/extensions/Contest/resources/contest.special.welcome.css |
— | — | @@ -6,11 +6,178 @@ |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | | -button.challenge-signup { |
| 10 | + |
| 11 | +/* dialog type selection */ |
| 12 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list { |
| 13 | + float: left; |
| 14 | + width: 250px; |
| 15 | +} |
| 16 | + |
| 17 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list ul { |
| 18 | + list-style: none; |
| 19 | + margin: 0; |
| 20 | + padding: 0; |
| 21 | +} |
| 22 | + |
| 23 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list ul li, |
| 24 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a |
| 25 | +{ |
| 26 | + display: block; |
| 27 | + width: 250px; |
| 28 | + height: 66px; |
| 29 | + padding: 0; |
| 30 | + margin: 0; |
| 31 | + position: relative; |
| 32 | + text-decoration: none; |
| 33 | + outline: none; |
| 34 | +} |
| 35 | + |
| 36 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover, |
| 37 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus { |
| 38 | + text-decoration:none; |
| 39 | +} |
| 40 | + |
| 41 | +/* IGNORED BY IE6 */ |
| 42 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list ul > li, |
| 43 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list ul li > a { |
| 44 | + display: inline-block; |
| 45 | +} |
| 46 | + |
| 47 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-left-cap, |
| 48 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-right-cap { |
| 49 | + padding: 0; |
| 50 | + margin: 0; |
| 51 | + width: 6px; |
| 52 | + height: 66px; |
11 | 53 | position: absolute; |
12 | | - right: 5px; |
| 54 | + top: 0px; |
13 | 55 | } |
14 | 56 | |
15 | | -div.contest-challenge { |
16 | | - position: relative; |
| 57 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-l-cap, |
| 58 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-r-cap, |
| 59 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-icon-box { |
| 60 | + background-repeat: no-repeat; |
| 61 | + height: 66px; |
| 62 | + position: absolute; |
| 63 | +} |
| 64 | + |
| 65 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-l-cap, |
| 66 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-r-cap { |
| 67 | + width: 6px; |
| 68 | +} |
| 69 | + |
| 70 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-l-cap { |
| 71 | + /* @noflip */ |
| 72 | + left: 0px; |
| 73 | + /* @embed */ |
| 74 | + background-image: url(images/icon-box-left-cap.png); |
| 75 | +} |
| 76 | + |
| 77 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover .mw-codechallenge-l-cap, |
| 78 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus .mw-codechallenge-l-cap { |
| 79 | + /* @embed */ |
| 80 | + background-image: url(images/icon-box-hover-left-cap.png); |
| 81 | +} |
| 82 | + |
| 83 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-l-cap { |
| 84 | + /* @embed */ |
| 85 | + background-image: url(images/icon-box-selected-left-cap.png); |
| 86 | +} |
| 87 | + |
| 88 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-r-cap { |
| 89 | + /* @noflip */ |
| 90 | + right: 0px; |
| 91 | + /* @embed */ |
| 92 | + background-image: url(images/icon-box-right-cap.png); |
| 93 | +} |
| 94 | + |
| 95 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover .mw-codechallenge-r-cap, |
| 96 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus .mw-codechallenge-r-cap { |
| 97 | + /* @embed */ |
| 98 | + background-image: url(images/icon-box-hover-right-cap.png); |
| 99 | +} |
| 100 | + |
| 101 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-r-cap { |
| 102 | + /* @embed */ |
| 103 | + background-image: url(images/icon-box-selected-right-cap.png); |
| 104 | +} |
| 105 | + |
| 106 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-inside { |
| 107 | + padding: 0; |
| 108 | + margin: 0; |
| 109 | + width: 238px; |
| 110 | + height: 66px; |
| 111 | + position: absolute; |
| 112 | + top: 0px; |
| 113 | + left: 6px; |
| 114 | + |
| 115 | + /* @embed */ |
| 116 | + background-image: url(images/select-bg-sprite.png); |
| 117 | + background-position: 0px 0px; |
| 118 | + background-repeat: repeat-x; |
| 119 | +} |
| 120 | + |
| 121 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover .mw-codechallenge-inside, |
| 122 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus .mw-codechallenge-inside { |
| 123 | + background-position: 0px -66px; |
| 124 | +} |
| 125 | + |
| 126 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-inside { |
| 127 | + background-position: 0px -132px; |
| 128 | +} |
| 129 | + |
| 130 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-icon-box { |
| 131 | + padding: 0; |
| 132 | + margin: 0; |
| 133 | + width: 53px; |
| 134 | + height: 53px; |
| 135 | + position: absolute; |
| 136 | + right: 0px; |
| 137 | + top: 5px; |
| 138 | + /* @embed */ |
| 139 | + background-image: url(images/icon-box.png); |
| 140 | +} |
| 141 | + |
| 142 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-icon-box img { |
| 143 | + padding: 0; |
| 144 | + margin: 0; |
| 145 | + width: 53px; |
| 146 | + height: 53px; |
| 147 | + position: absolute: |
| 148 | + top: 0px; |
| 149 | + left: 0px; |
| 150 | +} |
| 151 | + |
| 152 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover .mw-codechallenge-icon-box, |
| 153 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus .mw-codechallenge-icon-box { |
| 154 | + /* @embed */ |
| 155 | + background-image: url(images/icon-box-hover.png); |
| 156 | +} |
| 157 | + |
| 158 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-icon-box { |
| 159 | + /* @embed */ |
| 160 | + background-image: url(images/icon-box-selected.png); |
| 161 | +} |
| 162 | + |
| 163 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-link-text { |
| 164 | + padding: 0; |
| 165 | + margin: 0; |
| 166 | + width: 170px; |
| 167 | + height: 53px; |
| 168 | + position: absolute; |
| 169 | + left: 64px; |
| 170 | + top: 5px; |
| 171 | + line-height: 53px; |
| 172 | + font-size: 1.2em; |
| 173 | + font-weight: bold; |
| 174 | + text-decoration: none; |
| 175 | + color: white; |
| 176 | +} |
| 177 | + |
| 178 | +/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-no-icon .mw-codechallenge-link-text { |
| 179 | + left: 3px; |
| 180 | +} |
| 181 | + |
| 182 | +#mw-codechallenge-dialog a { |
| 183 | + color: #0645AD; |
17 | 184 | } |
\ No newline at end of file |
Index: trunk/extensions/Contest/resources/contest.special.welcome.js |
— | — | @@ -10,9 +10,10 @@ |
11 | 11 | |
12 | 12 | $( document ).ready( function() { |
13 | 13 | |
14 | | - $( '.contest-signup' ).button().click( function() { |
15 | | - window.location = $( this ).attr( 'data-contest-target' ); |
16 | | - } ); |
| 14 | + $( '#contest-challanges' ).contestChallanges( |
| 15 | + mw.config.get( 'ContestChallanges' ), |
| 16 | + mw.config.get( 'ContestConfig' ) |
| 17 | + ); |
17 | 18 | |
18 | 19 | } ); |
19 | 20 | |
Index: trunk/extensions/Contest/resources/images/icon-box-selected-left-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-selected-left-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
20 | 21 | + image/png |
Index: trunk/extensions/Contest/resources/images/blue_arrow_right.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/blue_arrow_right.png |
___________________________________________________________________ |
Added: svn:mime-type |
21 | 22 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box.png |
___________________________________________________________________ |
Added: svn:mime-type |
22 | 23 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-hover.png |
___________________________________________________________________ |
Added: svn:mime-type |
23 | 24 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-selected-right-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-selected-right-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
24 | 25 | + image/png |
Index: trunk/extensions/Contest/resources/images/select-sprite.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/select-sprite.png |
___________________________________________________________________ |
Added: svn:mime-type |
25 | 26 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-selected.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-selected.png |
___________________________________________________________________ |
Added: svn:mime-type |
26 | 27 | + image/png |
Index: trunk/extensions/Contest/resources/images/button_arrow.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/button_arrow.png |
___________________________________________________________________ |
Added: svn:mime-type |
27 | 28 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-left-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-left-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
28 | 29 | + image/png |
Index: trunk/extensions/Contest/resources/images/blue_arrow_down.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/blue_arrow_down.png |
___________________________________________________________________ |
Added: svn:mime-type |
29 | 30 | + image/png |
Index: trunk/extensions/Contest/resources/images/button_arrow_hover.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/button_arrow_hover.png |
___________________________________________________________________ |
Added: svn:mime-type |
30 | 31 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-hover-left-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-hover-left-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
31 | 32 | + image/png |
Index: trunk/extensions/Contest/resources/images/select-bg-sprite.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/select-bg-sprite.png |
___________________________________________________________________ |
Added: svn:mime-type |
32 | 33 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-right-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-right-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
33 | 34 | + image/png |
Index: trunk/extensions/Contest/resources/images/icon-box-hover-right-cap.png |
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
Property changes on: trunk/extensions/Contest/resources/images/icon-box-hover-right-cap.png |
___________________________________________________________________ |
Added: svn:mime-type |
34 | 35 | + image/png |
Index: trunk/extensions/Contest/resources/jquery.contestChallanges.js |
— | — | @@ -0,0 +1,66 @@ |
| 2 | +/** |
| 3 | + * JavasSript for the Contest MediaWiki extension. |
| 4 | + * @see https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Extension:Contest |
| 5 | + * |
| 6 | + * @licence GNU GPL v3 or later |
| 7 | + * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
| 8 | + */ |
| 9 | + |
| 10 | +( function ( $, mw ) { $.fn.contestChallanges = function( challanges, config ) { |
| 11 | + |
| 12 | + this.challanges = challanges; |
| 13 | + this.config = config; |
| 14 | + |
| 15 | + var _this = this; |
| 16 | + var $this = $( this ); |
| 17 | + |
| 18 | + this.challangesList = null; |
| 19 | + |
| 20 | + this.showChallange = function( challange ) { |
| 21 | + // TODO |
| 22 | + console.log( challange ); |
| 23 | + }; |
| 24 | + |
| 25 | + this.addChallange = function( challange ) { |
| 26 | + var item = $( '<a />' ).attr( 'href', '#' ).html( '' ).click( function() { |
| 27 | + _this.showChallange( challange ); |
| 28 | + } ); |
| 29 | + |
| 30 | + item.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-l-cap' ) ); |
| 31 | + |
| 32 | + var innerDiv = $( '<div />' ).attr( 'class', 'mw-codechallenge-inside' ); |
| 33 | + |
| 34 | + innerDiv.html( $( '<div />' ).attr( 'class', 'mw-codechallenge-link-text' ) |
| 35 | + .html( $( '<p />' ).text( challange.title ) ) |
| 36 | + .append( $( '<p />' ).text( challange.oneline ) ) |
| 37 | + ); |
| 38 | + |
| 39 | + innerDiv.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-icon-box' ) ); |
| 40 | + item.append( innerDiv ); |
| 41 | + |
| 42 | + item.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-r-cap' ) ); |
| 43 | + |
| 44 | + this.challangesList.append( $( '<li />' ).html( item ) ); |
| 45 | + } |
| 46 | + |
| 47 | + this.initChallanges = function() { |
| 48 | + this.challangesList = $( '<ul />' ).attr( 'id', 'contest-challanges-list' ); |
| 49 | + |
| 50 | + for ( i in this.challanges ) { |
| 51 | + this.addChallange( this.challanges[i] ); |
| 52 | + } |
| 53 | + }; |
| 54 | + |
| 55 | + this.init = function() { |
| 56 | + $this.html( $( '<h3 />' ).text( mw.msg( 'contest-welcome-select-header' ) ) ); |
| 57 | + |
| 58 | + this.initChallanges(); |
| 59 | + |
| 60 | + $this.append( this.challangesList ); |
| 61 | + }; |
| 62 | + |
| 63 | + this.init(); |
| 64 | + |
| 65 | + return this; |
| 66 | + |
| 67 | +}; } )( window.jQuery, window.mediaWiki ); |
Property changes on: trunk/extensions/Contest/resources/jquery.contestChallanges.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 68 | + native |
Index: trunk/extensions/Contest/Contest.sql |
— | — | @@ -48,7 +48,8 @@ |
49 | 49 | challenge_contest_id INT unsigned NOT NULL, |
50 | 50 | |
51 | 51 | challenge_text TEXT NOT NULL, |
52 | | - challenge_title VARCHAR(255) NOT NULL |
| 52 | + challenge_title VARCHAR(255) NOT NULL, |
| 53 | + challenge_oneline TEXT NOT NULL |
53 | 54 | ) /*$wgDBTableOptions*/; |
54 | 55 | |
55 | 56 | -- Judge votes |