Index: branches/uploadwizard/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -1,62 +1,40 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -/** |
5 | | - * Contains list of related resources and hooks which anticipate the use of Resource Loader, whenever that is released |
6 | | - */ |
7 | 4 | class UploadWizardHooks { |
8 | 5 | |
9 | | - /* We define scripts here for Resource Loader, but in the meantime we are going to load these the old-fashioned way |
10 | | - (see SpecialUploadWizard.php). |
11 | | - |
12 | | - So this list of scripts has to be topologically-sorted by hand. That is, the depended-upon stuff comes first. |
13 | | - There can be no circular dependencies. */ |
14 | | - |
15 | | - public static $modules = array( |
| 6 | + /* Protected Static Members */ |
| 7 | + |
| 8 | + protected static $modules = array( |
16 | 9 | 'ext.uploadWizard' => array( |
17 | 10 | 'scripts' => array( |
18 | | - |
19 | | - // jquery interface helpers |
20 | 11 | 'extensions/UploadWizard/resources/jquery/jquery.tipsy.js', |
21 | 12 | 'extensions/UploadWizard/resources/jquery/jquery.tipsyPlus.js', |
22 | 13 | 'extensions/UploadWizard/resources/jquery/jquery.morphCrossfade.js', |
23 | 14 | 'extensions/UploadWizard/resources/jquery/jquery.validate.js', |
24 | 15 | 'extensions/UploadWizard/resources/jquery/jquery.arrowSteps.js', |
| 16 | + 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js', |
25 | 17 | 'extensions/UploadWizard/resources/jquery/jquery.autocomplete.js', |
26 | 18 | 'extensions/UploadWizard/resources/jquery/jquery.spinner.js', |
27 | | - |
28 | | - // mediawiki-specific interface helper (relies on mediawiki globals) |
29 | | - 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js', |
30 | | - |
31 | | - // common utilities |
32 | | - 'extensions/UploadWizard/resources/mw.js', // <-- obsolete? |
| 19 | + 'extensions/UploadWizard/resources/mw.js', |
33 | 20 | 'extensions/UploadWizard/resources/mw.Log.js', |
34 | 21 | 'extensions/UploadWizard/resources/mw.Utilities.js', |
35 | 22 | 'extensions/UploadWizard/resources/mw.UtilitiesTime.js', |
36 | 23 | 'extensions/UploadWizard/resources/mw.Uri.js', |
37 | 24 | 'extensions/UploadWizard/resources/mw.Api.js', |
38 | 25 | 'extensions/UploadWizard/resources/mw.Api.edit.js', |
39 | | - 'extensions/UploadWizard/resources/mw.Title.js', |
40 | | - |
41 | | - // message parsing |
42 | 26 | 'extensions/UploadWizard/resources/language/mw.Language.js', |
43 | 27 | 'extensions/UploadWizard/resources/language/mw.Parser.js', |
44 | 28 | 'extensions/UploadWizard/resources/mw.LanguageUpWiz.js', |
45 | | - |
46 | | - // workhorse libraries |
47 | 29 | 'extensions/UploadWizard/resources/mw.IframeTransport.js', |
48 | 30 | 'extensions/UploadWizard/resources/mw.ApiUploadHandler.js', |
49 | 31 | 'extensions/UploadWizard/resources/mw.DestinationChecker.js', |
50 | | - 'extensions/UploadWizard/resources/mw.UploadWizardUtil.js', |
51 | | - |
52 | | - // interface libraries |
53 | 32 | 'extensions/UploadWizard/resources/mw.GroupProgressBar.js', |
54 | | - |
55 | | - // UploadWizard specific abstractions |
| 33 | + 'extensions/UploadWizard/resources/mw.Title.js', |
| 34 | + 'extensions/UploadWizard/resources/mw.UploadWizard.js', |
56 | 35 | 'extensions/UploadWizard/resources/mw.UploadWizardDeed.js', |
57 | 36 | 'extensions/UploadWizard/resources/mw.UploadWizardLicenseInput.js', |
58 | | - |
59 | | - // launcher |
60 | | - 'extensions/UploadWizard/UploadWizardPage.js' |
| 37 | + 'extensions/UploadWizard/resources/mw.UploadWizardUtil.js', |
| 38 | + 'extensions/UploadWizard/UploadWizardPage.js', |
61 | 39 | ), |
62 | 40 | 'languageScripts' => array( |
63 | 41 | 'am' => 'extensions/UploadWizard/resources/languages/classes/LanguageAm.js', |
— | — | @@ -103,26 +81,154 @@ |
104 | 82 | 'ti' => 'extensions/UploadWizard/resources/languages/classes/LanguageTi.js', |
105 | 83 | 'tl' => 'extensions/UploadWizard/resources/languages/classes/LanguageTl.js', |
106 | 84 | 'uk' => 'extensions/UploadWizard/resources/languages/classes/LanguageUk.js', |
107 | | - 'wa' => 'extensions/UploadWizard/resources/languages/classes/LanguageWa.js' |
| 85 | + 'wa' => 'extensions/UploadWizard/resources/languages/classes/LanguageWa.js', |
108 | 86 | ), |
109 | 87 | 'styles' => array( |
110 | 88 | 'extensions/UploadWizard/resources/jquery/jquery.tipsy.css', |
111 | 89 | 'extensions/UploadWizard/resources/uploadWizard.css', |
112 | 90 | 'extensions/UploadWizard/resources/jquery/jquery.arrowSteps.css', |
113 | | - 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.css' |
| 91 | + 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.css', |
114 | 92 | ), |
115 | | - 'messages' => array( |
116 | | - // see UploadWizard.i18n.php |
| 93 | + 'messages' => array( |
| 94 | + 'linktest', |
| 95 | + 'pluraltest', |
| 96 | + 'magictest', |
| 97 | + 'namespacedtest', |
| 98 | + 'extremelycomplextest', |
| 99 | + 'internallinktest', |
| 100 | + 'uploadwizard', |
| 101 | + 'uploadwizard-desc', |
| 102 | + 'mwe-loading-upwiz', |
| 103 | + 'mwe-upwiz-code-unknown', |
| 104 | + 'mwe-upwiz-step-file', |
| 105 | + 'mwe-upwiz-step-deeds', |
| 106 | + 'mwe-upwiz-step-details', |
| 107 | + 'mwe-upwiz-step-thanks', |
| 108 | + 'mwe-upwiz-intro', |
| 109 | + 'mwe-upwiz-add-file-n', |
| 110 | + 'mwe-upwiz-add-file-0', |
| 111 | + 'mwe-upwiz-browse', |
| 112 | + 'mwe-upwiz-transported', |
| 113 | + 'mwe-upwiz-click-here', |
| 114 | + 'mwe-upwiz-uploading', |
| 115 | + 'mwe-upwiz-editing', |
| 116 | + 'mwe-upwiz-remove-upload', |
| 117 | + 'mwe-upwiz-remove-description', |
| 118 | + 'mwe-upwiz-upload', |
| 119 | + 'mwe-upwiz-upload-count', |
| 120 | + 'mwe-upwiz-progressbar-uploading', |
| 121 | + 'mwe-upwiz-finished', |
| 122 | + 'mwe-upwiz-secs-remaining', |
| 123 | + 'mwe-upwiz-mins-secs-remaining', |
| 124 | + 'mwe-upwiz-hrs-mins-secs-remaining', |
| 125 | + 'mwe-upwiz-deeds-intro', |
| 126 | + 'mwe-upwiz-deeds-macro-prompt', |
| 127 | + 'mwe-upwiz-deeds-custom-prompt', |
| 128 | + 'mwe-upwiz-details-intro', |
| 129 | + 'mwe-upwiz-source-ownwork', |
| 130 | + 'mwe-upwiz-source-ownwork-assert', |
| 131 | + 'mwe-upwiz-source-ownwork-assert-custom', |
| 132 | + 'mwe-upwiz-source-ownwork-assert-note', |
| 133 | + 'mwe-upwiz-source-permission', |
| 134 | + 'mwe-upwiz-source-thirdparty', |
| 135 | + 'mwe-upwiz-source-thirdparty-intro', |
| 136 | + 'mwe-upwiz-source-thirdparty-custom-multiple-intro', |
| 137 | + 'mwe-upwiz-source-thirdparty-license', |
| 138 | + 'mwe-upwiz-source-thirdparty-accept', |
| 139 | + 'mwe-upwiz-source-custom', |
| 140 | + 'mwe-upwiz-more-options', |
| 141 | + 'mwe-upwiz-fewer-options', |
| 142 | + 'mwe-upwiz-desc', |
| 143 | + 'mwe-upwiz-desc-add-n', |
| 144 | + 'mwe-upwiz-desc-add-0', |
| 145 | + 'mwe-upwiz-title', |
| 146 | + 'mwe-upwiz-categories-intro', |
| 147 | + 'mwe-upwiz-categories-another', |
| 148 | + 'mwe-upwiz-previously-uploaded', |
| 149 | + 'mwe-upwiz-about-this-work', |
| 150 | + 'mwe-upwiz-media-type', |
| 151 | + 'mwe-upwiz-date-created', |
| 152 | + 'mwe-upwiz-location', |
| 153 | + 'mwe-upwiz-copyright-info', |
| 154 | + 'mwe-upwiz-author', |
| 155 | + 'mwe-upwiz-license', |
| 156 | + 'mwe-upwiz-about-format', |
| 157 | + 'mwe-upwiz-autoconverted', |
| 158 | + 'mwe-upwiz-filename-tag', |
| 159 | + 'mwe-upwiz-other', |
| 160 | + 'mwe-upwiz-other-prefill', |
| 161 | + 'mwe-upwiz-showall', |
| 162 | + 'mwe-upwiz-source', |
| 163 | + 'mwe-upwiz-macro-edit-intro', |
| 164 | + 'mwe-upwiz-macro-edit', |
| 165 | + 'mwe-upwiz-thanks-intro', |
| 166 | + 'mwe-upwiz-thanks-explain', |
| 167 | + 'mwe-upwiz-thanks-link', |
| 168 | + 'mwe-upwiz-thanks-wikitext', |
| 169 | + 'mwe-upwiz-thanks-url', |
| 170 | + 'mwe-upwiz-upload-error-bad-filename-extension', |
| 171 | + 'mwe-upwiz-upload-error-duplicate', |
| 172 | + 'mwe-upwiz-upload-error-stashed-anyway', |
| 173 | + 'mwe-upwiz-ok', |
| 174 | + 'mwe-upwiz-cancel', |
| 175 | + 'mwe-upwiz-change', |
| 176 | + 'mwe-upwiz-fileexists-replace', |
| 177 | + 'mwe-upwiz-fileexists', |
| 178 | + 'mwe-upwiz-thumbnail-more', |
| 179 | + 'mwe-upwiz-overwrite', |
| 180 | + 'mwe-copyright-macro', |
| 181 | + 'mwe-copyright-custom', |
| 182 | + 'mwe-upwiz-next', |
| 183 | + 'mwe-upwiz-next-file', |
| 184 | + 'mwe-upwiz-next-deeds', |
| 185 | + 'mwe-upwiz-next-details', |
| 186 | + 'mwe-upwiz-home', |
| 187 | + 'mwe-upwiz-upload-another', |
| 188 | + 'mwe-prevent-close', |
| 189 | + 'mwe-upwiz-files-complete', |
| 190 | + 'mwe-upwiz-tooltip-author', |
| 191 | + 'mwe-upwiz-tooltip-source', |
| 192 | + 'mwe-upwiz-tooltip-sign', |
| 193 | + 'mwe-upwiz-tooltip-title', |
| 194 | + 'mwe-upwiz-tooltip-description', |
| 195 | + 'mwe-upwiz-tooltip-other', |
| 196 | + 'mwe-upwiz-tooltip-more-info', |
| 197 | + 'mwe-upwiz-file-need-file', |
| 198 | + 'mwe-upwiz-file-need-start', |
| 199 | + 'mwe-upwiz-file-need-complete', |
| 200 | + 'mwe-upwiz-deeds-need-deed', |
| 201 | + 'mwe-upwiz-deeds-need-license', |
| 202 | + 'mwe-upwiz-license-incompatible-pd', |
| 203 | + 'mwe-upwiz-license-incompatible-cc', |
| 204 | + 'mwe-upwiz-license-show-all', |
| 205 | + 'mwe-upwiz-license-show-recommended', |
| 206 | + 'mwe-upwiz-error-signature-blank', |
| 207 | + 'mwe-upwiz-error-signature-too-long', |
| 208 | + 'mwe-upwiz-error-signature-too-short', |
| 209 | + 'mwe-upwiz-error-signature-bad-chars', |
| 210 | + 'mwe-upwiz-error-blank', |
| 211 | + 'mwe-upwiz-error-too-long', |
| 212 | + 'mwe-upwiz-error-too-short', |
| 213 | + 'mwe-upwiz-error-bad-chars', |
| 214 | + 'mwe-upwiz-error-date', |
| 215 | + 'mwe-upwiz-license-cc-by-sa-3.0', |
| 216 | + 'mwe-upwiz-license-cc-by-3.0', |
| 217 | + 'mwe-upwiz-license-cc-zero', |
| 218 | + 'mwe-upwiz-license-gfdl', |
| 219 | + 'mwe-upwiz-license-pd-us', |
| 220 | + 'mwe-upwiz-categories', |
| 221 | + 'mwe-upwiz-categories-add', |
| 222 | + 'mwe-upwiz-category-remove', |
117 | 223 | ), |
118 | 224 | 'dependencies' => array( |
119 | | - // see SpecialUploadWizard.php |
120 | | - // see SpecialUploadWizard.php |
| 225 | + 'jquery.ui.datepicker', |
| 226 | + 'jquery.ui.progressbar', |
121 | 227 | ), |
122 | | - 'group' => 'ext.uploadWizard' |
| 228 | + 'group' => 'ext.uploadWizard', |
123 | 229 | ), |
124 | 230 | 'ext.uploadWizard.tests' => array( |
125 | 231 | 'scripts' => array( |
126 | | - 'extensions/UploadWizard/resources/mw.MockUploadHandler.js' |
| 232 | + 'extensions/UploadWizard/resources/mw.MockUploadHandler.js', |
127 | 233 | ), |
128 | 234 | ), |
129 | 235 | ); |
Index: branches/uploadwizard/extensions/UploadWizard/UploadWizardMessages.php |
— | — | @@ -8,8 +8,17 @@ |
9 | 9 | * @ingroup Upload |
10 | 10 | */ |
11 | 11 | |
12 | | -/* This class is temporary, until Resource Loader is available. */ |
| 12 | +/* This class is temporary. |
| 13 | + |
| 14 | + With the rejection of JS2 and reassignment of Michael Dale, there seems to be no currently supported |
| 15 | + resource loader (July 2010), but UploadWizard already relies on things like |
| 16 | + pluralization in messages which were only available in JS2. Also we have problems with how JS2 loads |
| 17 | + things in IE6; there are bugs which neither I nor Trevor Parscal can figure out. So, we are temporarily |
| 18 | + falling back to a simpler method of loading messages, which will hopefully |
| 19 | + be superseded by the new loader Roan Kattouw & Trevor Parscal are writing. |
13 | 20 | |
| 21 | +*/ |
| 22 | + |
14 | 23 | class UploadWizardMessages { |
15 | 24 | |
16 | 25 | /** |
Index: branches/uploadwizard/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js |
— | — | @@ -1,8 +1,3 @@ |
2 | | -/** |
3 | | - * Simple predictive typing category adder for Mediawiki. |
4 | | - * Relies on globals: wgScriptPath, wgNamespaceIds, wgFormattedNamespaces |
5 | | - * Add to the page and then use getWikiText() to get wiki text representing the categories. |
6 | | - */ |
7 | 2 | ( function ( $j ) { $j.fn.mwCoolCats = function( options ) { |
8 | 3 | |
9 | 4 | var defaults = { |
Index: branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -57,46 +57,8 @@ |
58 | 58 | |
59 | 59 | |
60 | 60 | $this->addJsVars( $subPage ); |
61 | | - if ( $wgResourceLoader ) { |
62 | | - $wgOut->addModules( 'ext.uploadWizard' ); |
63 | | - } else { |
64 | | - /* Doing resource loading the old-fashioned way for now until Resource Loader or something becomes the standard. |
65 | | - We anticipate that Resource Loader will be available sometime in late 2010 or early 2011, |
66 | | - so we define scripts in the hooks that Resource Loader will expect, over in UploadWizardHooks.php. |
67 | | - */ |
68 | | - $module = UploadWizardHooks::$modules['ext.uploadWizard']; |
69 | | - |
70 | | - //$scripts = array( |
71 | | - // jquery standard stuff -- can we load this from vector itself? |
72 | | - //"extensions/UploadWizard/resources/jquery.ui/ui/ui.core.js", |
73 | | - //); |
74 | | - |
75 | | - // in ResourceLoader, these will probably have names rather than explicit script paths |
76 | | - $dependencies = array( |
77 | | - 'extensions/UploadWizard/resources/jquery.ui/ui/ui.datepicker.js', |
78 | | - 'extensions/UploadWizard/resources/jquery.ui/ui/ui.progressbar.js' |
79 | | - ); |
80 | | - |
81 | | - $scripts = array_merge( $dependencies, $module['scripts'] ); |
82 | | - |
83 | | - if ( $langCode !== 'en' ) { |
84 | | - $scripts[] = $module['languageScripts'][$langCode]; |
85 | | - } |
| 61 | + $wgOut->addModules( 'ext.uploadWizard' ); |
86 | 62 | |
87 | | - foreach ( $scripts as $script ) { |
88 | | - $wgOut->addScriptFile( $wgScriptPath . "/" . $script ); |
89 | | - } |
90 | | - |
91 | | - // after scripts, get the i18n.php stuff |
92 | | - $wgOut->addInlineScript( UploadWizardMessages::getMessagesJs( 'UploadWizard', $wgLang ) ); |
93 | | - |
94 | | - // TODO RTL |
95 | | - foreach ( $module['styles'] as $style ) { |
96 | | - $wgOut->addStyle( "/" . $style, '', '', 'ltr' ); |
97 | | - } |
98 | | - |
99 | | - } |
100 | | - |
101 | 63 | // where the uploadwizard will go |
102 | 64 | // TODO import more from UploadWizard's createInterface call. |
103 | 65 | $wgOut->addHTML( |