r99526 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99525‎ | r99526 | r99527 >
Date:18:34, 11 October 2011
Author:erik
Status:ok
Tags:
Comment:
challange->challenge
Modified paths:
  • /trunk/extensions/Contest/Contest.php (modified) (history)
  • /trunk/extensions/Contest/Contest.sql (modified) (history)
  • /trunk/extensions/Contest/api/ApiQueryChallenges.php (modified) (history)
  • /trunk/extensions/Contest/resources/contest.special.welcome.css (modified) (history)
  • /trunk/extensions/Contest/resources/contest.special.welcome.js (modified) (history)
  • /trunk/extensions/Contest/resources/jquery.contestChallenges.js (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php
@@ -106,24 +106,24 @@
107107 protected function showChallenges( Contest $contest ) {
108108 $this->showNoJSFallback( $contest );
109109
110 - $this->getOutput()->addHTML( '<div id="contest-challanges"></div>' );
 110+ $this->getOutput()->addHTML( '<div id="contest-challenges"></div>' );
111111
112112 $this->addContestJS( $contest );
113113 }
114114
115115 protected function addContestJS( Contest $contest ) {
116 - $challanges = array();
 116+ $challenges = array();
117117
118118 foreach ( $contest->getChallenges() as /* ContestChallenge */ $challenge ) {
119119 $data = $challenge->toArray();
120120 $data['target'] = $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() );
121 - $challanges[] = $data;
 121+ $challenges[] = $data;
122122 }
123123
124124 $this->getOutput()->addScript(
125125 Skin::makeVariablesScript(
126126 array(
127 - 'ContestChallanges' => $challanges,
 127+ 'ContestChallenges' => $challenges,
128128 'ContestConfig' => array()
129129 )
130130 )
Index: trunk/extensions/Contest/Contest.php
@@ -185,7 +185,7 @@
186186 )
187187 );
188188
189 -$wgResourceModules['jquery.contestChallanges'] = $moduleTemplate + array(
 189+$wgResourceModules['jquery.contestChallenges'] = $moduleTemplate + array(
190190 'scripts' => array(
191191 'jquery.contestChallenges.js'
192192 )
@@ -199,7 +199,7 @@
200200 'contest.special.welcome.css',
201201 ),
202202 'dependencies' => array(
203 - 'jquery.contestChallanges',
 203+ 'jquery.contestChallenges',
204204 ),
205205 'messages' => array(
206206 'contest-welcome-select-header'
Index: trunk/extensions/Contest/api/ApiQueryChallenges.php
@@ -49,7 +49,7 @@
5050 * @see includes/api/ApiBase#getDescription()
5151 */
5252 public function getDescription() {
53 - return 'API module for querying contest challanges';
 53+ return 'API module for querying contest challenges';
5454 }
5555
5656 /**
Index: trunk/extensions/Contest/resources/contest.special.welcome.css
@@ -8,19 +8,19 @@
99
1010
1111 /* dialog type selection */
12 -/*#mw-codechallenge-dialog*/ #contest-challanges-list {
 12+/*#mw-codechallenge-dialog*/ #contest-challenges-list {
1313 float: left;
1414 width: 250px;
1515 }
1616
17 -/*#mw-codechallenge-dialog*/ #contest-challanges-list ul {
 17+/*#mw-codechallenge-dialog*/ #contest-challenges-list ul {
1818 list-style: none;
1919 margin: 0;
2020 padding: 0;
2121 }
2222
23 -/*#mw-codechallenge-dialog*/ #contest-challanges-list ul li,
24 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a
 23+/*#mw-codechallenge-dialog*/ #contest-challenges-list ul li,
 24+/*#mw-codechallenge-dialog*/ #contest-challenges-list a
2525 {
2626 display: block;
2727 width: 250px;
@@ -32,19 +32,19 @@
3333 outline: none;
3434 }
3535
36 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover,
37 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus {
 36+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:hover,
 37+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:focus {
3838 text-decoration:none;
3939 }
4040
4141 /* IGNORED BY IE6 */
42 -/*#mw-codechallenge-dialog*/ #contest-challanges-list ul > li,
43 -/*#mw-codechallenge-dialog*/ #contest-challanges-list ul li > a {
 42+/*#mw-codechallenge-dialog*/ #contest-challenges-list ul > li,
 43+/*#mw-codechallenge-dialog*/ #contest-challenges-list ul li > a {
4444 display: inline-block;
4545 }
4646
47 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-left-cap,
48 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-right-cap {
 47+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-left-cap,
 48+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-right-cap {
4949 padding: 0;
5050 margin: 0;
5151 width: 6px;
@@ -53,56 +53,56 @@
5454 top: 0px;
5555 }
5656
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 {
 57+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-l-cap,
 58+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-r-cap,
 59+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-icon-box {
6060 background-repeat: no-repeat;
6161 height: 66px;
6262 position: absolute;
6363 }
6464
65 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-l-cap,
66 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-r-cap {
 65+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-l-cap,
 66+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-r-cap {
6767 width: 6px;
6868 }
6969
70 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-l-cap {
 70+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-l-cap {
7171 /* @noflip */
7272 left: 0px;
7373 /* @embed */
7474 background-image: url(images/icon-box-left-cap.png);
7575 }
7676
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 {
 77+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:hover .mw-codechallenge-l-cap,
 78+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:focus .mw-codechallenge-l-cap {
7979 /* @embed */
8080 background-image: url(images/icon-box-hover-left-cap.png);
8181 }
8282
83 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-l-cap {
 83+/*#mw-codechallenge-dialog*/ #contest-challenges-list a.selected .mw-codechallenge-l-cap {
8484 /* @embed */
8585 background-image: url(images/icon-box-selected-left-cap.png);
8686 }
8787
88 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-r-cap {
 88+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-r-cap {
8989 /* @noflip */
9090 right: 0px;
9191 /* @embed */
9292 background-image: url(images/icon-box-right-cap.png);
9393 }
9494
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 {
 95+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:hover .mw-codechallenge-r-cap,
 96+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:focus .mw-codechallenge-r-cap {
9797 /* @embed */
9898 background-image: url(images/icon-box-hover-right-cap.png);
9999 }
100100
101 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-r-cap {
 101+/*#mw-codechallenge-dialog*/ #contest-challenges-list a.selected .mw-codechallenge-r-cap {
102102 /* @embed */
103103 background-image: url(images/icon-box-selected-right-cap.png);
104104 }
105105
106 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-inside {
 106+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-inside {
107107 padding: 0;
108108 margin: 0;
109109 width: 238px;
@@ -117,16 +117,16 @@
118118 background-repeat: repeat-x;
119119 }
120120
121 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a:hover .mw-codechallenge-inside,
122 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a:focus .mw-codechallenge-inside {
 121+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:hover .mw-codechallenge-inside,
 122+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:focus .mw-codechallenge-inside {
123123 background-position: 0px -66px;
124124 }
125125
126 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-inside {
 126+/*#mw-codechallenge-dialog*/ #contest-challenges-list a.selected .mw-codechallenge-inside {
127127 background-position: 0px -132px;
128128 }
129129
130 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-icon-box {
 130+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-icon-box {
131131 padding: 0;
132132 margin: 0;
133133 width: 53px;
@@ -138,7 +138,7 @@
139139 background-image: url(images/button_arrow.png);
140140 }
141141
142 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-icon-box img {
 142+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-icon-box img {
143143 padding: 0;
144144 margin: 0;
145145 width: 53px;
@@ -148,18 +148,18 @@
149149 left: 0px;
150150 }
151151
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 {
 152+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:hover .mw-codechallenge-icon-box,
 153+/*#mw-codechallenge-dialog*/ #contest-challenges-list a:focus .mw-codechallenge-icon-box {
154154 /* @embed */
155155 background-image: url(images/button_arrow_hover.png);
156156 }
157157
158 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a.selected .mw-codechallenge-icon-box {
 158+/*#mw-codechallenge-dialog*/ #contest-challenges-list a.selected .mw-codechallenge-icon-box {
159159 /* @embed */
160160 background-image: url(images/icon-box-selected.png);
161161 }
162162
163 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-link-text {
 163+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-link-text {
164164 padding: 0;
165165 margin: 0;
166166 width: 170px;
@@ -174,7 +174,7 @@
175175 color: white;
176176 }
177177
178 -/*#mw-codechallenge-dialog*/ #contest-challanges-list a .mw-codechallenge-no-icon .mw-codechallenge-link-text {
 178+/*#mw-codechallenge-dialog*/ #contest-challenges-list a .mw-codechallenge-no-icon .mw-codechallenge-link-text {
179179 left: 3px;
180180 }
181181
Index: trunk/extensions/Contest/resources/contest.special.welcome.js
@@ -10,8 +10,8 @@
1111
1212 $( document ).ready( function() {
1313
14 - $( '#contest-challanges' ).contestChallanges(
15 - mw.config.get( 'ContestChallanges' ),
 14+ $( '#contest-challenges' ).contestChallenges(
 15+ mw.config.get( 'ContestChallenges' ),
1616 mw.config.get( 'ContestConfig' )
1717 );
1818
Index: trunk/extensions/Contest/resources/jquery.contestChallenges.js
@@ -6,24 +6,24 @@
77 * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
88 */
99
10 -( function ( $, mw ) { $.fn.contestChallanges = function( challanges, config ) {
 10+( function ( $, mw ) { $.fn.contestChallenges = function( challenges, config ) {
1111
12 - this.challanges = challanges;
 12+ this.challenges = challenges;
1313 this.config = config;
1414
1515 var _this = this;
1616 var $this = $( this );
1717
18 - this.challangesList = null;
 18+ this.challengesList = null;
1919
20 - this.showChallange = function( challange ) {
21 - // TODO: show challange pop-up with text and participate button
22 - window.location = challange.target;
 20+ this.showChallenge = function( challenge ) {
 21+ // TODO: show challenge pop-up with text and participate button
 22+ window.location = challenge.target;
2323 };
2424
25 - this.addChallange = function( challange ) {
 25+ this.addChallenge = function( challenge ) {
2626 var item = $( '<a />' ).attr( 'href', '#' ).html( '' ).click( function() {
27 - _this.showChallange( challange );
 27+ _this.showChallenge( challenge );
2828 } );
2929
3030 item.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-l-cap' ) );
@@ -31,8 +31,8 @@
3232 var innerDiv = $( '<div />' ).attr( 'class', 'mw-codechallenge-inside' );
3333
3434 innerDiv.html( $( '<div />' ).attr( 'class', 'mw-codechallenge-link-text' )
35 - .html( $( '<p />' ).text( challange.title ) )
36 - .append( $( '<p />' ).text( challange.oneline ) )
 35+ .html( $( '<p />' ).text( challenge.title ) )
 36+ .append( $( '<p />' ).text( challenge.oneline ) )
3737 );
3838
3939 innerDiv.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-icon-box' ) );
@@ -40,23 +40,23 @@
4141
4242 item.append( $( '<div />' ).attr( 'class', 'mw-codechallenge-r-cap' ) );
4343
44 - this.challangesList.append( $( '<li />' ).html( item ) );
 44+ this.challengesList.append( $( '<li />' ).html( item ) );
4545 }
4646
47 - this.initChallanges = function() {
48 - this.challangesList = $( '<ul />' ).attr( 'id', 'contest-challanges-list' );
 47+ this.initChallenges = function() {
 48+ this.challengesList = $( '<ul />' ).attr( 'id', 'contest-challenges-list' );
4949
50 - for ( var i in this.challanges ) {
51 - this.addChallange( this.challanges[i] );
 50+ for ( var i in this.challenges ) {
 51+ this.addChallenge( this.challenges[i] );
5252 }
5353 };
5454
5555 this.init = function() {
5656 $this.html( $( '<h3 />' ).text( mw.msg( 'contest-welcome-select-header' ) ) );
5757
58 - this.initChallanges();
 58+ this.initChallenges();
5959
60 - $this.append( this.challangesList );
 60+ $this.append( this.challengesList );
6161 };
6262
6363 this.init();
Index: trunk/extensions/Contest/Contest.sql
@@ -49,9 +49,9 @@
5050 challenge_id INT unsigned NOT NULL auto_increment PRIMARY KEY, -- Challenge id
5151 challenge_contest_id INT unsigned NOT NULL, -- Foreign key on contests.contest_id
5252
53 - challenge_text TEXT NOT NULL, -- Full challange description
54 - challenge_title VARCHAR(255) NOT NULL, -- Title of the challange
55 - challenge_oneline TEXT NOT NULL -- One line description of the challange
 53+ challenge_text TEXT NOT NULL, -- Full challenge description
 54+ challenge_title VARCHAR(255) NOT NULL, -- Title of the challenge
 55+ challenge_oneline TEXT NOT NULL -- One line description of the challenge
5656 ) /*$wgDBTableOptions*/;
5757
5858 -- Judge votes

Status & tagging log