r66072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66071‎ | r66072 | r66073 >
Date:16:42, 8 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added message and some docs
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.i18n.php (modified) (history)
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/Story/Story_body.php (modified) (history)
  • /trunk/extensions/Storyboard/storyboard.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/Storyboard.i18n.php
@@ -58,6 +58,7 @@
5959 'storyboard-submissioncomplete' => 'Submission complete',
6060 'storyboard-submissionincomplete' => 'Submission failed',
6161 'storyboard-alreadyexists' => '"$1" is already taken.',
 62+ 'storyboard-alreadyexistschange' => '"{0}" is already taken, please choose a different title.', // Use {0} not $1!
6263 'storyboard-changetitle' => 'Change the title.',
6364 'storyboard-notsubmitted' => 'Authentication failed, no story has been saved.',
6465 'storyboard-charstomany' => '$1 characters too many!',
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -97,7 +97,7 @@
9898 jQuery("#storyform").validate({
9999 messages: {
100100 storytitle: {
101 - remote: jQuery.validator.format("<b>{0}</b> is already taken, please choose a different title.") // TODO: i18n
 101+ remote: jQuery.validator.format( stbMsg( 'storyboard-alreadyexistschange' ) )
102102 }
103103 }
104104 });
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php
@@ -394,7 +394,7 @@
395395 jQuery("#storyform").validate({
396396 messages: {
397397 storytitle: {
398 - remote: jQuery.validator.format("<b>{0}</b> is already taken, please choose a different title.") // TODO: i18n
 398+ remote: jQuery.validator.format( stbMsg( 'storyboard-alreadyexistschange' ) )
399399 }
400400 }
401401 });
Index: trunk/extensions/Storyboard/storyboard.js
@@ -7,11 +7,29 @@
88 * @author Jeroen De Dauw
99 */
1010
 11+/**
 12+ * i18n functions
 13+ */
1114
 15+/**
 16+ * JS variant of wfMsg. Can only be used after efStoryboardAddJSLocalisation (php function) was called.
 17+ *
 18+ * @param string key
 19+ *
 20+ * @return string The i18n message for the povided language key.
 21+ */
1222 function stbMsg( key ) {
1323 return wgStbMessages[key];
1424 }
1525
 26+/**
 27+ * JS variant of wfMsgExt. Can only be used after efStoryboardAddJSLocalisation (php function) was called.
 28+ *
 29+ * @param string key
 30+ * @param array values The values to replace in the string.
 31+ *
 32+ * @return string The i18n message for the povided language key.
 33+ */
1634 function stbMsgExt( key, values ) {
1735 var message = stbMsg( key );
1836
@@ -23,6 +41,8 @@
2442 return message;
2543 }
2644
 45+
 46+
2747 /**
2848 * Story submission/editting functions
2949 */
@@ -89,6 +109,12 @@
90110 * Story review functions
91111 */
92112
 113+/**
 114+ * Loads an ajaxscroll into a tab.
 115+ *
 116+ * @param tab
 117+ * @param state
 118+ */
93119 function stbShowReviewBoard( tab, state ) {
94120 tab.html( jQuery( "<div />" )
95121 .addClass( "storyreviewboard" )
@@ -107,6 +133,11 @@
108134 } );
109135 }
110136
 137+/**
 138+ * Loads new stories into the board by making a getJSON request to the QueryStories API module.
 139+ *
 140+ * @param $storyboard
 141+ */
111142 function stbUpdateReviewBoard( $storyboard ) {
112143 requestArgs = {
113144 'action': 'query',
@@ -130,6 +161,12 @@
131162 );
132163 }
133164
 165+/**
 166+ * Adds a list of stories to the board.
 167+ *
 168+ * @param $storyboard
 169+ * @param query
 170+ */
134171 function stbAddStories( $storyboard, query ) {
135172 // Remove the empty boxes.
136173 $storyboard.html( '' );
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -149,6 +149,7 @@
150150 'storyboard-showimage',
151151 'storyboard-hideimage',
152152 'storyboard-imagedeletionconfirm',
 153+ 'storyboard-alreadyexistschange',
153154 );
154155
155156 $data = array();

Status & tagging log