r75893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75892‎ | r75893 | r75894 >
Date:01:09, 3 November 2010
Author:neilk
Status:ok
Tags:
Comment:
reverting these changes so they are separate from r75982 (didn't mean to commit these yet)
Modified paths:
  • /branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /branches/uploadwizard/extensions/UploadWizard/UploadWizardHooks.php (modified) (history)
  • /branches/uploadwizard/extensions/UploadWizard/UploadWizardMessages.php (modified) (history)
  • /branches/uploadwizard/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js (modified) (history)

Diff [purge]

Index: branches/uploadwizard/extensions/UploadWizard/UploadWizardHooks.php
@@ -1,62 +1,40 @@
22 <?php
33
4 -/**
5 - * Contains list of related resources and hooks which anticipate the use of Resource Loader, whenever that is released
6 - */
74 class UploadWizardHooks {
85
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(
169 'ext.uploadWizard' => array(
1710 'scripts' => array(
18 -
19 - // jquery interface helpers
2011 'extensions/UploadWizard/resources/jquery/jquery.tipsy.js',
2112 'extensions/UploadWizard/resources/jquery/jquery.tipsyPlus.js',
2213 'extensions/UploadWizard/resources/jquery/jquery.morphCrossfade.js',
2314 'extensions/UploadWizard/resources/jquery/jquery.validate.js',
2415 'extensions/UploadWizard/resources/jquery/jquery.arrowSteps.js',
 16+ 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js',
2517 'extensions/UploadWizard/resources/jquery/jquery.autocomplete.js',
2618 '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',
3320 'extensions/UploadWizard/resources/mw.Log.js',
3421 'extensions/UploadWizard/resources/mw.Utilities.js',
3522 'extensions/UploadWizard/resources/mw.UtilitiesTime.js',
3623 'extensions/UploadWizard/resources/mw.Uri.js',
3724 'extensions/UploadWizard/resources/mw.Api.js',
3825 'extensions/UploadWizard/resources/mw.Api.edit.js',
39 - 'extensions/UploadWizard/resources/mw.Title.js',
40 -
41 - // message parsing
4226 'extensions/UploadWizard/resources/language/mw.Language.js',
4327 'extensions/UploadWizard/resources/language/mw.Parser.js',
4428 'extensions/UploadWizard/resources/mw.LanguageUpWiz.js',
45 -
46 - // workhorse libraries
4729 'extensions/UploadWizard/resources/mw.IframeTransport.js',
4830 'extensions/UploadWizard/resources/mw.ApiUploadHandler.js',
4931 'extensions/UploadWizard/resources/mw.DestinationChecker.js',
50 - 'extensions/UploadWizard/resources/mw.UploadWizardUtil.js',
51 -
52 - // interface libraries
5332 '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',
5635 'extensions/UploadWizard/resources/mw.UploadWizardDeed.js',
5736 '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',
6139 ),
6240 'languageScripts' => array(
6341 'am' => 'extensions/UploadWizard/resources/languages/classes/LanguageAm.js',
@@ -103,26 +81,154 @@
10482 'ti' => 'extensions/UploadWizard/resources/languages/classes/LanguageTi.js',
10583 'tl' => 'extensions/UploadWizard/resources/languages/classes/LanguageTl.js',
10684 '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',
10886 ),
10987 'styles' => array(
11088 'extensions/UploadWizard/resources/jquery/jquery.tipsy.css',
11189 'extensions/UploadWizard/resources/uploadWizard.css',
11290 'extensions/UploadWizard/resources/jquery/jquery.arrowSteps.css',
113 - 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.css'
 91+ 'extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.css',
11492 ),
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',
117223 ),
118224 'dependencies' => array(
119 - // see SpecialUploadWizard.php
120 - // see SpecialUploadWizard.php
 225+ 'jquery.ui.datepicker',
 226+ 'jquery.ui.progressbar',
121227 ),
122 - 'group' => 'ext.uploadWizard'
 228+ 'group' => 'ext.uploadWizard',
123229 ),
124230 'ext.uploadWizard.tests' => array(
125231 'scripts' => array(
126 - 'extensions/UploadWizard/resources/mw.MockUploadHandler.js'
 232+ 'extensions/UploadWizard/resources/mw.MockUploadHandler.js',
127233 ),
128234 ),
129235 );
Index: branches/uploadwizard/extensions/UploadWizard/UploadWizardMessages.php
@@ -8,8 +8,17 @@
99 * @ingroup Upload
1010 */
1111
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.
1320
 21+*/
 22+
1423 class UploadWizardMessages {
1524
1625 /**
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 - */
72 ( function ( $j ) { $j.fn.mwCoolCats = function( options ) {
83
94 var defaults = {
Index: branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php
@@ -57,46 +57,8 @@
5858
5959
6060 $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' );
8662
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 -
10163 // where the uploadwizard will go
10264 // TODO import more from UploadWizard's createInterface call.
10365 $wgOut->addHTML(

Status & tagging log