r66070 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66069‎ | r66070 | r66071 >
Date:14:06, 8 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r66062
Modified paths:
  • /trunk/extensions/Storyboard/Storyboard.i18n.php (modified) (history)
  • /trunk/extensions/Storyboard/Storyboard.php (modified) (history)
  • /trunk/extensions/Storyboard/storyboard.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/Storyboard.i18n.php
@@ -67,6 +67,9 @@
6868 'storyboard-done' => 'Done',
6969 'storyboard-working' => 'Working...',
7070 'storyboard-imagedeleted' => 'Image deleted',
 71+ 'storyboard-showimage' => 'Show image',
 72+ 'storyboard-hideimage' => 'Hide image',
 73+ 'storyboard-imagedeletionconfirm' => 'Are you sure you want to permanently delete this stories image?',
7174
7275 // Story review
7376 'storyreview' => 'Story review',
Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -108,9 +108,17 @@
109109
110110 $storyBody.append( textAndImg );
111111
 112+ var metaDataText;
 113+ if ( story.location != '' ) {
 114+ metaDataText = stbMsgExt( 'storyboard-storymetadatafrom', [story.author, story.location, story.creationtime, story.creationdate] );
 115+ }
 116+ else {
 117+ metaDataText = stbMsgExt( 'storyboard-storymetadata', [story.author, story.creationtime, story.creationdate] );
 118+ }
 119+
112120 $storyBody.append( // TODO: get the actual message here
113121 $( "<div />" ).addClass( "story-metadata" ).append(
114 - $("<span />").addClass( "story-metadata" ).text( " Submitted by $1 from $2 on $3, $4.")
 122+ $("<span />").addClass( "story-metadata" ).text( metaDataText )
115123 )
116124 );
117125
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php
@@ -34,12 +34,42 @@
3535
3636 // TODO: Combine+minfiy JS files, add switch to use combined+minified version
3737 $parser->getOutput()->addHeadItem(
38 - <<<EOT
39 - <link rel="stylesheet" href="$egStoryboardScriptPath/storyboard.css?$wgStyleVersion" />
40 - <script type="$wgJsMimeType" src="$wgStylePath/common/jquery.min.js?$wgStyleVersion"></script>
41 - <script type="$wgJsMimeType" src="$egStoryboardScriptPath/jquery/jquery.ajaxscroll.js?$wgStyleVersion"></script>
42 - <script type="$wgJsMimeType" src="$egStoryboardScriptPath/tags/Storyboard/storyboard.js?$wgStyleVersion"></script>
43 -EOT
 38+ Html::element(
 39+ 'link',
 40+ array(
 41+ 'rel' => 'stylesheet',
 42+ 'type' => 'text/css',
 43+ 'href' => "$egStoryboardScriptPath/storyboard.css?$wgStyleVersion"
 44+ )
 45+ ) .
 46+ Html::element(
 47+ 'script',
 48+ array(
 49+ 'type' => $wgJsMimeType,
 50+ 'src' => "$wgStylePath/common/jquery.min.js?$wgStyleVersion"
 51+ )
 52+ ) .
 53+ Html::element(
 54+ 'script',
 55+ array(
 56+ 'type' => $wgJsMimeType,
 57+ 'src' => "$egStoryboardScriptPath/jquery/jquery.ajaxscroll.js?$wgStyleVersion"
 58+ )
 59+ ) .
 60+ Html::element(
 61+ 'script',
 62+ array(
 63+ 'type' => $wgJsMimeType,
 64+ 'src' => "$egStoryboardScriptPath/tags/Storyboard/storyboard.js?$wgStyleVersion"
 65+ )
 66+ ) .
 67+ Html::element(
 68+ 'script',
 69+ array(
 70+ 'type' => $wgJsMimeType,
 71+ 'src' => "$egStoryboardScriptPath/storyboard.js?$wgStyleVersion"
 72+ )
 73+ )
4474 );
4575
4676 $width = StoryboardUtils::getDimension( $args, 'width', $egStoryboardWidth );
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -59,12 +59,36 @@
6060
6161 // Loading a seperate JS file would be overkill for just these 3 lines, and be bad for performance.
6262 $parser->getOutput()->addHeadItem(
63 - <<<EOT
64 - <link rel="stylesheet" href="$egStoryboardScriptPath/storyboard.css?$wgStyleVersion" />
65 - <script type="$wgJsMimeType" src="$egStoryboardScriptPath/storyboard.js?$wgStyleVersion"></script>
66 - <script type="$wgJsMimeType" src="$wgStylePath/common/jquery.min.js?$wgStyleVersion"></script>
67 - <script type="$wgJsMimeType" src="$egStoryboardScriptPath/jquery/jquery.validate.js?$wgStyleVersion"></script>
68 -<script type="$wgJsMimeType"> /*<![CDATA[*/
 63+ Html::element(
 64+ 'link',
 65+ array(
 66+ 'rel' => 'stylesheet',
 67+ 'type' => 'text/css',
 68+ 'href' => "$egStoryboardScriptPath/storyboard.css?$wgStyleVersion"
 69+ )
 70+ ) .
 71+ Html::element(
 72+ 'script',
 73+ array(
 74+ 'type' => $wgJsMimeType,
 75+ 'src' => "$egStoryboardScriptPath/storyboard.js?$wgStyleVersion"
 76+ )
 77+ ) .
 78+ Html::element(
 79+ 'script',
 80+ array(
 81+ 'type' => $wgJsMimeType,
 82+ 'src' => "$wgStylePath/common/jquery.min.js?$wgStyleVersion"
 83+ )
 84+ ) .
 85+ Html::element(
 86+ 'script',
 87+ array(
 88+ 'type' => $wgJsMimeType,
 89+ 'src' => "$egStoryboardScriptPath/jquery/jquery.validate.js?$wgStyleVersion"
 90+ )
 91+ ) .
 92+ Html::inlineScript( <<<EOT
6993 addOnloadHook( function() {
7094 document.getElementById( 'storysubmission-button' ).disabled = true;
7195 stbValidateStory( document.getElementById('storytext'), $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )
@@ -77,9 +101,9 @@
78102 }
79103 }
80104 });
81 -});
82 -/*]]>*/ </script>
 105+});
83106 EOT
 107+ )
84108 );
85109
86110 $fieldSize = 50;
Index: trunk/extensions/Storyboard/storyboard.js
@@ -192,7 +192,7 @@
193193 'format': 'json',
194194 'storyid': storyid,
195195 'storyaction': action
196 - },
 196+ },
197197 function( data ) {
198198 if ( data.storyreview ) {
199199 switch( data.storyreview.action ) {
@@ -215,7 +215,7 @@
216216 break;
217217 }
218218 } else {
219 - alert( 'An error occured:\n' + data.error.info ); // TODO: i18n
 219+ alert( stbMsgExt( 'storyboard-anerroroccured', [data.error.info] ) );
220220 }
221221 }
222222 );
@@ -233,7 +233,7 @@
234234 function stbToggeShowImage( sender, storyId, completedAction ) {
235235 if ( completedAction == 'hideimage' ) {
236236 jQuery( '#story_image_' + storyId ).slideUp( 'slow', function () {
237 - sender.innerHTML = 'Show image'; // TODO: i18n
 237+ sender.innerHTML = stbMsg( 'storyboard-showimage' );
238238 sender.onclick = function() {
239239 stbDoStoryAction( sender, storyId, 'unhideimage' );
240240 };
@@ -241,7 +241,7 @@
242242 } );
243243 } else {
244244 jQuery( '#story_image_' + storyId ).slideDown( 'slow', function () {
245 - sender.innerHTML = 'Hide image'; // TODO: i18n
 245+ sender.innerHTML = stbMsg( 'storyboard-hideimage' );
246246 sender.onclick = function() {
247247 stbDoStoryAction( sender, storyId, 'hideimage' );
248248 };
@@ -259,7 +259,7 @@
260260 * @return Boolean indicating whether the deletion was confirmed.
261261 */
262262 function stbDeleteStoryImage( sender, storyid ) {
263 - var confirmed = confirm( 'Are you sure you want to permanently delete this stories image?' ); // TODO: i18n
 263+ var confirmed = confirm( stbMsg( 'storyboard-imagedeletionconfirm' ) );
264264 if ( confirmed ) {
265265 stbDoStoryAction( sender, storyid, 'deleteimage' );
266266 }
Index: trunk/extensions/Storyboard/Storyboard.php
@@ -146,6 +146,9 @@
147147 'storyboard-done',
148148 'storyboard-working',
149149 'storyboard-imagedeleted',
 150+ 'storyboard-showimage',
 151+ 'storyboard-hideimage',
 152+ 'storyboard-imagedeletionconfirm',
150153 );
151154
152155 $data = array();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66062Implemnted JS i18n functionsjeroendedauw12:25, 8 May 2010

Status & tagging log