Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -14,6 +14,11 @@ |
15 | 15 | public static $modules = array( |
16 | 16 | 'ext.uploadWizard' => array( |
17 | 17 | 'scripts' => array( |
| 18 | + // jquery ui |
| 19 | + // FIXME: These can be replaced with dependencies when pre-RL compat is dropped |
| 20 | + 'resources/jquery.ui/ui/ui.core.js', |
| 21 | + 'resources/jquery.ui/ui/ui.datepicker.js', |
| 22 | + 'resources/jquery.ui/ui/ui.progressbar.js', |
18 | 23 | |
19 | 24 | // jquery interface helpers |
20 | 25 | 'resources/jquery/jquery.tipsy.js', |
— | — | @@ -116,14 +121,140 @@ |
117 | 122 | 'resources/jquery.ui/themes/redmond/jquery-ui-1.7.1.custom.css' |
118 | 123 | ), |
119 | 124 | 'messages' => array( |
120 | | - // see UploadWizard.i18n.php |
| 125 | + 'linktest', |
| 126 | + 'pluraltest', |
| 127 | + 'magictest', |
| 128 | + 'namespacedtest', |
| 129 | + 'extremelycomplextest', |
| 130 | + 'internallinktest', |
| 131 | + 'uploadwizard', |
| 132 | + 'uploadwizard-desc', |
| 133 | + 'mwe-upwiz-js-off', |
| 134 | + 'mwe-loading-upwiz', |
| 135 | + 'mwe-upwiz-code-unknown', |
| 136 | + 'mwe-upwiz-step-tutorial', |
| 137 | + 'mwe-upwiz-step-file', |
| 138 | + 'mwe-upwiz-step-deeds', |
| 139 | + 'mwe-upwiz-step-details', |
| 140 | + 'mwe-upwiz-step-thanks', |
| 141 | + 'mwe-upwiz-api-error-code', |
| 142 | + 'mwe-upwiz-tutorial-error', |
| 143 | + 'mwe-upwiz-intro', |
| 144 | + 'mwe-upwiz-add-file-n', |
| 145 | + 'mwe-upwiz-add-file-0', |
| 146 | + 'mwe-upwiz-browse', |
| 147 | + 'mwe-upwiz-transported', |
| 148 | + 'mwe-upwiz-click-here', |
| 149 | + 'mwe-upwiz-uploading', |
| 150 | + 'mwe-upwiz-editing', |
| 151 | + 'mwe-upwiz-remove-upload', |
| 152 | + 'mwe-upwiz-remove-description', |
| 153 | + 'mwe-upwiz-upload', |
| 154 | + 'mwe-upwiz-upload-count', |
| 155 | + 'mwe-upwiz-progressbar-uploading', |
| 156 | + 'mwe-upwiz-finished', |
| 157 | + 'mwe-upwiz-secs-remaining', |
| 158 | + 'mwe-upwiz-mins-secs-remaining', |
| 159 | + 'mwe-upwiz-hrs-mins-secs-remaining', |
| 160 | + 'mwe-upwiz-deeds-intro', |
| 161 | + 'mwe-upwiz-deeds-macro-prompt', |
| 162 | + 'mwe-upwiz-deeds-custom-prompt', |
| 163 | + 'mwe-upwiz-details-intro', |
| 164 | + 'mwe-upwiz-source-ownwork', |
| 165 | + 'mwe-upwiz-source-ownwork-assert', |
| 166 | + 'mwe-upwiz-source-ownwork-assert-custom', |
| 167 | + 'mwe-upwiz-source-ownwork-assert-note', |
| 168 | + 'mwe-upwiz-source-permission', |
| 169 | + 'mwe-upwiz-source-thirdparty', |
| 170 | + 'mwe-upwiz-source-thirdparty-intro', |
| 171 | + 'mwe-upwiz-source-thirdparty-custom-multiple-intro', |
| 172 | + 'mwe-upwiz-source-thirdparty-license', |
| 173 | + 'mwe-upwiz-source-thirdparty-accept', |
| 174 | + 'mwe-upwiz-source-custom', |
| 175 | + 'mwe-upwiz-more-options', |
| 176 | + 'mwe-upwiz-fewer-options', |
| 177 | + 'mwe-upwiz-desc', |
| 178 | + 'mwe-upwiz-desc-add-n', |
| 179 | + 'mwe-upwiz-desc-add-0', |
| 180 | + 'mwe-upwiz-title', |
| 181 | + 'mwe-upwiz-categories-intro', |
| 182 | + 'mwe-upwiz-categories-another', |
| 183 | + 'mwe-upwiz-previously-uploaded', |
| 184 | + 'mwe-upwiz-about-this-work', |
| 185 | + 'mwe-upwiz-media-type', |
| 186 | + 'mwe-upwiz-date-created', |
| 187 | + 'mwe-upwiz-location', |
| 188 | + 'mwe-upwiz-copyright-info', |
| 189 | + 'mwe-upwiz-author', |
| 190 | + 'mwe-upwiz-license', |
| 191 | + 'mwe-upwiz-about-format', |
| 192 | + 'mwe-upwiz-autoconverted', |
| 193 | + 'mwe-upwiz-filename-tag', |
| 194 | + 'mwe-upwiz-other', |
| 195 | + 'mwe-upwiz-other-prefill', |
| 196 | + 'mwe-upwiz-showall', |
| 197 | + 'mwe-upwiz-source', |
| 198 | + 'mwe-upwiz-macro-edit-intro', |
| 199 | + 'mwe-upwiz-macro-edit', |
| 200 | + 'mwe-upwiz-thanks-intro', |
| 201 | + 'mwe-upwiz-thanks-explain', |
| 202 | + 'mwe-upwiz-thanks-link', |
| 203 | + 'mwe-upwiz-thanks-wikitext', |
| 204 | + 'mwe-upwiz-thanks-url', |
| 205 | + 'mwe-upwiz-upload-error-bad-filename-extension', |
| 206 | + 'mwe-upwiz-upload-error-duplicate', |
| 207 | + 'mwe-upwiz-upload-error-stashed-anyway', |
| 208 | + 'mwe-upwiz-ok', |
| 209 | + 'mwe-upwiz-cancel', |
| 210 | + 'mwe-upwiz-change', |
| 211 | + 'mwe-upwiz-fileexists-replace', |
| 212 | + 'mwe-upwiz-fileexists', |
| 213 | + 'mwe-upwiz-thumbnail-more', |
| 214 | + 'mwe-upwiz-overwrite', |
| 215 | + 'mwe-copyright-macro', |
| 216 | + 'mwe-copyright-custom', |
| 217 | + 'mwe-upwiz-next', |
| 218 | + 'mwe-upwiz-next-file', |
| 219 | + 'mwe-upwiz-next-deeds', |
| 220 | + 'mwe-upwiz-next-details', |
| 221 | + 'mwe-upwiz-home', |
| 222 | + 'mwe-upwiz-upload-another', |
| 223 | + 'mwe-prevent-close', |
| 224 | + 'mwe-upwiz-files-complete', |
| 225 | + 'mwe-upwiz-tooltip-author', |
| 226 | + 'mwe-upwiz-tooltip-source', |
| 227 | + 'mwe-upwiz-tooltip-sign', |
| 228 | + 'mwe-upwiz-tooltip-title', |
| 229 | + 'mwe-upwiz-tooltip-description', |
| 230 | + 'mwe-upwiz-tooltip-other', |
| 231 | + 'mwe-upwiz-tooltip-more-info', |
| 232 | + 'mwe-upwiz-file-need-file', |
| 233 | + 'mwe-upwiz-file-need-start', |
| 234 | + 'mwe-upwiz-file-need-complete', |
| 235 | + 'mwe-upwiz-deeds-need-deed', |
| 236 | + 'mwe-upwiz-deeds-need-license', |
| 237 | + 'mwe-upwiz-license-incompatible-pd', |
| 238 | + 'mwe-upwiz-license-incompatible-cc', |
| 239 | + 'mwe-upwiz-license-show-all', |
| 240 | + 'mwe-upwiz-license-show-recommended', |
| 241 | + 'mwe-upwiz-error-signature-blank', |
| 242 | + 'mwe-upwiz-error-signature-too-long', |
| 243 | + 'mwe-upwiz-error-signature-too-short', |
| 244 | + 'mwe-upwiz-error-signature-bad-chars', |
| 245 | + 'mwe-upwiz-error-blank', |
| 246 | + 'mwe-upwiz-error-too-long', |
| 247 | + 'mwe-upwiz-error-too-short', |
| 248 | + 'mwe-upwiz-error-bad-chars', |
| 249 | + 'mwe-upwiz-error-date', |
| 250 | + 'mwe-upwiz-license-cc-by-sa-3.0', |
| 251 | + 'mwe-upwiz-license-cc-by-3.0', |
| 252 | + 'mwe-upwiz-license-cc-zero', |
| 253 | + 'mwe-upwiz-license-gfdl', |
| 254 | + 'mwe-upwiz-license-pd-us', |
| 255 | + 'mwe-upwiz-categories', |
| 256 | + 'mwe-upwiz-categories-add', |
| 257 | + 'mwe-upwiz-category-remove', |
121 | 258 | ), |
122 | | - // in ResourceLoader, these will probably have names rather than explicit script paths, or be automatically loaded |
123 | | - 'dependencies' => array( |
124 | | - 'resources/jquery.ui/ui/ui.core.js', |
125 | | - 'resources/jquery.ui/ui/ui.datepicker.js', |
126 | | - 'resources/jquery.ui/ui/ui.progressbar.js' |
127 | | - ), |
128 | 259 | 'group' => 'ext.uploadWizard' |
129 | 260 | ), |
130 | 261 | 'ext.uploadWizard.tests' => array( |
— | — | @@ -139,7 +270,11 @@ |
140 | 271 | * Adds modules to ResourceLoader |
141 | 272 | */ |
142 | 273 | public static function resourceLoaderRegisterModules( &$resourceLoader ) { |
143 | | - global $wgExtensionAssetsPath; |
| 274 | + global $wgExtensionAssetsPath, $wgUploadWizardDisableResourceLoader; |
| 275 | + if ( $wgUploadWizardDisableResourceLoader ) { |
| 276 | + return true; |
| 277 | + } |
| 278 | + |
144 | 279 | $localpath = dirname( __FILE__ ); |
145 | 280 | $remotepath = "$wgExtensionAssetsPath/UploadWizard"; |
146 | 281 | foreach ( self::$modules as $name => $resources ) { |
Index: trunk/extensions/UploadWizard/UploadWizardDependencyLoader.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | public function __construct( $langCode = null ) { |
38 | 38 | $module = UploadWizardHooks::$modules['ext.uploadWizard']; |
39 | 39 | |
40 | | - $this->scripts = array_merge( $module['dependencies'], $module['scripts'] ); |
| 40 | + $this->scripts = $module['scripts']; |
41 | 41 | |
42 | 42 | $this->inlineScripts = array(); |
43 | 43 | if ( $langCode !== null ) { |
Index: trunk/extensions/UploadWizard/UploadWizardMessages.php |
— | — | @@ -19,8 +19,6 @@ |
20 | 20 | * @param String $langCode Name of scriptText module ( that hosts messages ) |
21 | 21 | * @return string |
22 | 22 | */ |
23 | | - |
24 | | - |
25 | 23 | public static function getMessagesJs( $moduleName, $language ) { |
26 | 24 | global $wgOut; |
27 | 25 | |
Index: trunk/extensions/UploadWizard/resources/language/mw.Language.js |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * mw.addMessages function |
29 | | - * Loads a set of json messages into the messegeCache object. |
| 29 | + * Loads a set of json messages into the messageCache object. |
30 | 30 | * |
31 | 31 | * @param {JSON} msgSet The set of msgs to be loaded |
32 | 32 | */ |
— | — | @@ -52,8 +52,14 @@ |
53 | 53 | mw.getMsg = function( messageKey , args ) { |
54 | 54 | |
55 | 55 | // Check for missing message key |
56 | | - if ( ! messageCache[ messageKey ] ){ |
57 | | - return '[' + messageKey + ']'; |
| 56 | + if ( ! messageCache[ messageKey ] ) { |
| 57 | + // Try the ResourceLoader's message store |
| 58 | + // FIXME: The two message stores should be unified in the future |
| 59 | + var rlMsg = mediaWiki.msg( messageKey ); |
| 60 | + if ( rlMsg == ( '<' + messageKey + '>' ) ) { |
| 61 | + return '[' + messageKey + ']'; |
| 62 | + } |
| 63 | + messageCache[ messageKey ] = rlMsg; |
58 | 64 | } |
59 | 65 | // Check if we need to do args replacements: |
60 | 66 | if( typeof args != 'undefined' ) { |
Index: trunk/extensions/UploadWizard/resources/combined.js |
— | — | @@ -5531,7 +5531,7 @@ |
5532 | 5532 | |
5533 | 5533 | /** |
5534 | 5534 | * mw.addMessages function |
5535 | | - * Loads a set of json messages into the messegeCache object. |
| 5535 | + * Loads a set of json messages into the messageCache object. |
5536 | 5536 | * |
5537 | 5537 | * @param {JSON} msgSet The set of msgs to be loaded |
5538 | 5538 | */ |
— | — | @@ -5558,8 +5558,14 @@ |
5559 | 5559 | mw.getMsg = function( messageKey , args ) { |
5560 | 5560 | |
5561 | 5561 | // Check for missing message key |
5562 | | - if ( ! messageCache[ messageKey ] ){ |
5563 | | - return '[' + messageKey + ']'; |
| 5562 | + if ( ! messageCache[ messageKey ] ) { |
| 5563 | + // Try the ResourceLoader's message store |
| 5564 | + // FIXME: The two message stores should be unified in the future |
| 5565 | + var rlMsg = mediaWiki.msg( messageKey ); |
| 5566 | + if ( rlMsg == ( '<' + messageKey + '>' ) ) { |
| 5567 | + return '[' + messageKey + ']'; |
| 5568 | + } |
| 5569 | + messageCache[ messageKey ] = rlMsg; |
5564 | 5570 | } |
5565 | 5571 | // Check if we need to do args replacements: |
5566 | 5572 | if( typeof args != 'undefined' ) { |
Index: trunk/extensions/UploadWizard/resources/combined.min.js |
— | — | @@ -5559,8 +5559,14 @@ |
5560 | 5560 | |
5561 | 5561 | |
5562 | 5562 | if(!messageCache[messageKey]){ |
| 5563 | + |
| 5564 | + |
| 5565 | +var rlMsg=mediaWiki.msg(messageKey); |
| 5566 | +if(rlMsg==('<'+messageKey+'>')){ |
5563 | 5567 | return'['+messageKey+']'; |
5564 | 5568 | } |
| 5569 | +messageCache[messageKey]=rlMsg; |
| 5570 | +} |
5565 | 5571 | |
5566 | 5572 | if(typeof args!='undefined'){ |
5567 | 5573 | |
Index: trunk/extensions/UploadWizard/UploadWizard.php |
— | — | @@ -58,6 +58,4 @@ |
59 | 59 | $wgUploadWizardDisableResourceLoader = true; |
60 | 60 | |
61 | 61 | // for ResourceLoader |
62 | | -if ( !$wgUploadWizardDisableResourceLoader && class_exists( 'ResourceLoader' ) ) { |
63 | | - $wgHooks['ResourceLoaderRegisterModules'][] = 'UploadWizardHooks::resourceLoaderRegisterModules'; |
64 | | -} |
| 62 | +$wgHooks['ResourceLoaderRegisterModules'][] = 'UploadWizardHooks::resourceLoaderRegisterModules'; |