Index: trunk/extensions/Storyboard/Storyboard.i18n.php |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | 'storyboard-submissioncomplete' => 'Submission complete', |
60 | 60 | 'storyboard-submissionincomplete' => 'Submission failed', |
61 | 61 | 'storyboard-alreadyexists' => '"$1" is already taken.', |
| 62 | + 'storyboard-alreadyexistschange' => '"{0}" is already taken, please choose a different title.', // Use {0} not $1! |
62 | 63 | 'storyboard-changetitle' => 'Change the title.', |
63 | 64 | 'storyboard-notsubmitted' => 'Authentication failed, no story has been saved.', |
64 | 65 | 'storyboard-charstomany' => '$1 characters too many!', |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | jQuery("#storyform").validate({ |
99 | 99 | messages: { |
100 | 100 | 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' ) ) |
102 | 102 | } |
103 | 103 | } |
104 | 104 | }); |
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -394,7 +394,7 @@ |
395 | 395 | jQuery("#storyform").validate({ |
396 | 396 | messages: { |
397 | 397 | 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' ) ) |
399 | 399 | } |
400 | 400 | } |
401 | 401 | }); |
Index: trunk/extensions/Storyboard/storyboard.js |
— | — | @@ -7,11 +7,29 @@ |
8 | 8 | * @author Jeroen De Dauw |
9 | 9 | */ |
10 | 10 | |
| 11 | +/** |
| 12 | + * i18n functions |
| 13 | + */ |
11 | 14 | |
| 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 | + */ |
12 | 22 | function stbMsg( key ) { |
13 | 23 | return wgStbMessages[key]; |
14 | 24 | } |
15 | 25 | |
| 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 | + */ |
16 | 34 | function stbMsgExt( key, values ) { |
17 | 35 | var message = stbMsg( key ); |
18 | 36 | |
— | — | @@ -23,6 +41,8 @@ |
24 | 42 | return message; |
25 | 43 | } |
26 | 44 | |
| 45 | + |
| 46 | + |
27 | 47 | /** |
28 | 48 | * Story submission/editting functions |
29 | 49 | */ |
— | — | @@ -89,6 +109,12 @@ |
90 | 110 | * Story review functions |
91 | 111 | */ |
92 | 112 | |
| 113 | +/** |
| 114 | + * Loads an ajaxscroll into a tab. |
| 115 | + * |
| 116 | + * @param tab |
| 117 | + * @param state |
| 118 | + */ |
93 | 119 | function stbShowReviewBoard( tab, state ) { |
94 | 120 | tab.html( jQuery( "<div />" ) |
95 | 121 | .addClass( "storyreviewboard" ) |
— | — | @@ -107,6 +133,11 @@ |
108 | 134 | } ); |
109 | 135 | } |
110 | 136 | |
| 137 | +/** |
| 138 | + * Loads new stories into the board by making a getJSON request to the QueryStories API module. |
| 139 | + * |
| 140 | + * @param $storyboard |
| 141 | + */ |
111 | 142 | function stbUpdateReviewBoard( $storyboard ) { |
112 | 143 | requestArgs = { |
113 | 144 | 'action': 'query', |
— | — | @@ -130,6 +161,12 @@ |
131 | 162 | ); |
132 | 163 | } |
133 | 164 | |
| 165 | +/** |
| 166 | + * Adds a list of stories to the board. |
| 167 | + * |
| 168 | + * @param $storyboard |
| 169 | + * @param query |
| 170 | + */ |
134 | 171 | function stbAddStories( $storyboard, query ) { |
135 | 172 | // Remove the empty boxes. |
136 | 173 | $storyboard.html( '' ); |
Index: trunk/extensions/Storyboard/Storyboard.php |
— | — | @@ -149,6 +149,7 @@ |
150 | 150 | 'storyboard-showimage', |
151 | 151 | 'storyboard-hideimage', |
152 | 152 | 'storyboard-imagedeletionconfirm', |
| 153 | + 'storyboard-alreadyexistschange', |
153 | 154 | ); |
154 | 155 | |
155 | 156 | $data = array(); |