r99142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99141‎ | r99142 | r99143 >
Date:21:05, 6 October 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added short description field for challenges
Modified paths:
  • /trunk/extensions/Contest/Contest.i18n.php (modified) (history)
  • /trunk/extensions/Contest/Contest.php (modified) (history)
  • /trunk/extensions/Contest/resources/contest.special.contest.js (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialEditContest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/Contest.i18n.php
@@ -93,6 +93,7 @@
9494 'contest-edit-confirm-delete' => 'Are you sure you want to delete this challenge?',
9595 'contest-edit-challenge-title' => 'Challenge title',
9696 'contest-edit-challenge-text' => 'Challenge text',
 97+ 'contest-edit-challenge-oneline' => 'Short description',
9798
9899 // Special:ContestWelcome
99100 'contest-welcome-unknown' => 'There is no contest with the provided name.',
Index: trunk/extensions/Contest/specials/SpecialEditContest.php
@@ -313,6 +313,7 @@
314314 'id' => $challengeDbId,
315315 'text' => $request->getText( "challenge-text-$challengeId" ),
316316 'title' => $request->getText( "contest-challenge-$challengeId" ),
 317+ 'oneline' => $request->getText( "challenge-oneline-$challengeId" ),
317318 ) );
318319 }
319320
Index: trunk/extensions/Contest/Contest.php
@@ -157,6 +157,7 @@
158158 'contest-edit-confirm-delete',
159159 'contest-edit-challenge-title',
160160 'contest-edit-challenge-text',
 161+ 'contest-edit-challenge-oneline',
161162 ),
162163 'dependencies' => array(
163164 'jquery.ui.button'
Index: trunk/extensions/Contest/resources/contest.special.contest.js
@@ -55,6 +55,20 @@
5656 ).append( ' ' ).append( this.titleInput )
5757 );
5858
 59+ this.onelineInput = $( '<input />' ).attr( {
 60+ 'type': 'text',
 61+ 'name': 'challenge-oneline-' + $this.attr( 'data-challenge-id' ),
 62+ 'size': 45
 63+ } ).val( $this.attr( 'data-challenge-oneline' ) );
 64+
 65+ $this.append(
 66+ $( '<div />' ).html(
 67+ $( '<label />' )
 68+ .text( mw.msg( 'contest-edit-challenge-oneline' ) )
 69+ .attr( 'for', 'contest-oneline-' + $this.attr( 'data-challenge-id' ) )
 70+ ).append( '&#160;' ).append( this.onelineInput )
 71+ );
 72+
5973 this.textInput = $( '<textarea />' ).attr( {
6074 'name': 'challenge-text-' + $this.attr( 'data-challenge-id' )
6175 } ).val( $this.attr( 'data-challenge-text' ) );
@@ -97,7 +111,8 @@
98112 'class': 'contest-challenge-input',
99113 'data-challenge-id': challenge.id,
100114 'data-challenge-title': challenge.title,
101 - 'data-challenge-text': challenge.text
 115+ 'data-challenge-text': challenge.text,
 116+ 'data-challenge-oneline': challenge.oneline
102117 } );
103118
104119 $tr = $( '<tr />' );
@@ -140,7 +155,8 @@
141156 addChallenge( {
142157 'id': $this.attr( 'data-challenge-id' ),
143158 'title': $this.attr( 'data-challenge-title' ),
144 - 'text': $this.attr( 'data-challenge-text' )
 159+ 'text': $this.attr( 'data-challenge-text' ),
 160+ 'oneline': $this.attr( 'data-challenge-oneline' ),
145161 } );
146162 } );
147163

Status & tagging log