Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | updateBatch: updateStoryboard, |
13 | 13 | maxOffset: 500, |
14 | 14 | batchSize: 4, |
15 | | - batchNum: 2, |
| 15 | + batchNum: 1, |
16 | 16 | batchClass: "batch", |
17 | 17 | boxClass: "storyboard-box", |
18 | 18 | emptyBatchClass: "storyboard-empty", |
— | — | @@ -26,6 +26,7 @@ |
27 | 27 | 'list': 'stories', |
28 | 28 | 'stcontinue': $storyboard.attr( 'offset' ) + '-0', // TODO: get modification date and id of the last story |
29 | 29 | 'stlimit': 4, |
| 30 | + 'stlanguage': window.storyboardLanguage, |
30 | 31 | 'format': 'json' |
31 | 32 | }, |
32 | 33 | function( data ) { |
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php |
— | — | @@ -25,8 +25,6 @@ |
26 | 26 | * @param $frame |
27 | 27 | * |
28 | 28 | * @return array |
29 | | - * |
30 | | - * TODO: add language filter |
31 | 29 | */ |
32 | 30 | public static function render( $input, array $args, Parser $parser, $frame ) { |
33 | 31 | global $wgJsMimeType, $wgScriptPath, $wgStylePath, $wgStyleVersion, $wgContLanguageCode; |
— | — | @@ -45,14 +43,18 @@ |
46 | 44 | $width = StoryboardUtils::getDimension( $args, 'width', $egStoryboardWidth ); |
47 | 45 | $height = StoryboardUtils::getDimension( $args, 'height', $egStoryboardHeight ); |
48 | 46 | |
49 | | - // TODO: use this value in the js |
50 | 47 | $languages = Language::getLanguageNames(); |
| 48 | + |
51 | 49 | if ( array_key_exists( 'language', $args ) && array_key_exists( $args['language'], $languages ) ) { |
52 | 50 | $language = $args['language']; |
53 | 51 | } else { |
54 | 52 | $language = $wgContLanguageCode; |
55 | 53 | } |
56 | 54 | |
| 55 | + $parser->getOutput()->addHeadItem( |
| 56 | + Html::inlineScript( "var storyboardLanguage = '$language';" ) |
| 57 | + ); |
| 58 | + |
57 | 59 | $output = Html::element( 'div', array( |
58 | 60 | 'class' => 'storyboard', |
59 | 61 | 'style' => "height: $height; width: $width;" |
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php |
— | — | @@ -75,6 +75,23 @@ |
76 | 76 | jQuery(function() { |
77 | 77 | jQuery("#storyreview-tabs").tabs(); |
78 | 78 | }); |
| 79 | + /* |
| 80 | + $('#$unpublished').click( stbLoadStoriesForReview ); |
| 81 | + |
| 82 | + function stbLoadStoriesForReview() { |
| 83 | + $.getJSON( |
| 84 | + wgScriptPath + '/api.php', |
| 85 | + { |
| 86 | + 'action': 'query', |
| 87 | + 'list': 'stories', |
| 88 | + |
| 89 | + }, |
| 90 | + function ( data ) { |
| 91 | + |
| 92 | + } |
| 93 | + ); |
| 94 | + } |
| 95 | + */ |
79 | 96 | </script> |
80 | 97 | EOT; |
81 | 98 | |
— | — | @@ -177,7 +194,6 @@ |
178 | 195 | $buttons[] = <<<EOT |
179 | 196 | <button type="button" onclick="stbDeleteStoryImage( this, $story->story_id )">$deleteImageMsg</button> |
180 | 197 | EOT; |
181 | | - |
182 | 198 | } |
183 | 199 | |
184 | 200 | $buttonHtml = implode( ' ', $buttons ); |
— | — | @@ -198,7 +214,7 @@ |
199 | 215 | $buttonHtml |
200 | 216 | </td> |
201 | 217 | </tr> |
202 | | - </table> |
| 218 | + </table> |
203 | 219 | EOT; |
204 | 220 | } |
205 | 221 | |
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php |
— | — | @@ -63,6 +63,10 @@ |
64 | 64 | $this->addOption( 'LIMIT', $params['limit'] + 1 ); |
65 | 65 | $this->addOption( 'ORDER BY', 'story_modified, story_id DESC' ); |
66 | 66 | |
| 67 | + if ( !is_null( $params['language'] ) ) { |
| 68 | + $this->addWhere( "story_lang_code = '$params[language]'" ); |
| 69 | + } |
| 70 | + |
67 | 71 | if ( !is_null( $params['continue'] ) ) { |
68 | 72 | $continueParams = explode( '-', $params['continue'] ); |
69 | 73 | if ( count( $continueParams ) != 2 ) { |
— | — | @@ -123,6 +127,9 @@ |
124 | 128 | ApiBase :: PARAM_MAX2 => ApiBase :: LIMIT_BIG2 |
125 | 129 | ), |
126 | 130 | 'continue' => null, |
| 131 | + 'language' => array( |
| 132 | + ApiBase :: PARAM_TYPE => 'string', |
| 133 | + ) |
127 | 134 | ); |
128 | 135 | } |
129 | 136 | |
— | — | @@ -134,6 +141,7 @@ |
135 | 142 | return array ( |
136 | 143 | 'continue' => 'Number of the first story to return', |
137 | 144 | 'limit' => 'Amount of stories to return', |
| 145 | + 'language' => 'The language of the stories to return', |
138 | 146 | ); |
139 | 147 | } |
140 | 148 | |
— | — | @@ -152,7 +160,7 @@ |
153 | 161 | protected function getExamples() { |
154 | 162 | return array ( |
155 | 163 | 'api.php?action=query&list=stories', |
156 | | - 'api.php?action=query&list=stories&stlimit=42', |
| 164 | + 'api.php?action=query&list=stories&stlimit=42&stlanguage=en', |
157 | 165 | 'api.php?action=query&list=stories&stcontinue=20100319202223|4&stlimit=2', |
158 | 166 | ); |
159 | 167 | } |