r114400 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114399‎ | r114400 | r114401 >
Date:20:21, 21 March 2012
Author:catrope
Status:ok
Tags:
Comment:
Revert r112166, r112229, r112248, r113584, r113591, r114349: unreviewed revisions in UploadWizard.

All of these revisions are tagged with 'gerritmigration' and will be resubmitted into Gerrit after the Gerrit switchover. See also http://lists.wikimedia.org/pipermail/wikitech-l/2012-March/059124.html
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.config.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizard.config.php
@@ -75,21 +75,6 @@
7676 // The maximum length of the id field.
7777 'idFieldMaxLength' => 25,
7878
79 - // Initial value for the id field.
80 - 'idFieldInitialValue' => '',
81 -
82 - // Initial value for the description field.
83 - 'defaultDescription' => '',
84 -
85 - // Initial value for the latitude field.
86 - 'defaultLat' => '',
87 -
88 - // Initial value for the longitude field.
89 - 'defaultLon' => '',
90 -
91 - // Initial value for the altitude field.
92 - 'defaultAlt' => '',
93 -
9479 // 'licenses' is a list of licenses you could possibly use elsewhere, for instance in
9580 // licensesOwnWork or licensesThirdParty.
9681 // It just describes what licenses go with what wikitext, and how to display them in
Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php
@@ -53,32 +53,11 @@
5454 $this->outputHeader();
5555
5656 // if query string includes 'skiptutorial=true' set config variable to true
57 - $skipTutorial = $wgRequest->getCheck( 'skiptutorial' );
58 - if ( $skipTutorial ) {
59 - $skip = in_array( $skipTutorial, array( '1', 'true' ) );
 57+ if ( $wgRequest->getCheck( 'skiptutorial' ) ) {
 58+ $skip = in_array( $wgRequest->getText( 'skiptutorial' ), array( '1', 'true' ) );
6059 UploadWizardConfig::setUrlSetting( 'skipTutorial', $skip );
6160 }
62 -
63 - $categories = $wgRequest->getText( 'categories' );
64 - if ( $categories ) {
65 - UploadWizardConfig::setUrlSetting( 'defaultCategories', explode( '|', $categories ) );
66 - }
67 -
68 - $ulrArgs = array(
69 - 'id' => 'idFieldInitialValue',
70 - 'description' => 'defaultDescription',
71 - 'lat' => 'defaultLat',
72 - 'lon' => 'defaultLon',
73 - 'alt' => 'defaultAlt',
74 - );
75 -
76 - foreach ( $ulrArgs as $arg => $setting ) {
77 - $value = $wgRequest->getText( $arg );
78 - if ( $value ) {
79 - UploadWizardConfig::setUrlSetting( $setting, $value );
80 - }
81 - }
82 -
 61+
8362 $this->handleCampaign();
8463
8564 $out = $this->getOutput();
@@ -94,7 +73,6 @@
9574 $this->addJsVars( $subPage );
9675
9776 // dependencies (css, js)
98 - $out->addModuleStyles( 'ext.uploadWizard' );
9977 $out->addModules( 'ext.uploadWizard' );
10078
10179 // where the uploadwizard will go
Index: trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php
@@ -180,9 +180,6 @@
181181 'idFieldMaxLength' => array(
182182 'type' => 'int',
183183 ),
184 - 'idFieldInitialValue' => array(
185 - 'type' => 'text',
186 - ),
187184 'ownWorkOption' => array(
188185 'type' => 'radio',
189186 'options' => array(
@@ -214,18 +211,6 @@
215212 'thanksLabelPage' => array(
216213 'type' => 'text'
217214 ),
218 - 'defaultLat' => array(
219 - 'type' => 'text'
220 - ),
221 - 'defaultLon' => array(
222 - 'type' => 'text'
223 - ),
224 - 'defaultAlt' => array(
225 - 'type' => 'text'
226 - ),
227 - 'defaultDescription' => array(
228 - 'type' => 'text'
229 - ),
230215 );
231216
232217 foreach ( $globalConfig['licenses'] as $licenseName => $licenseDate ) {
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -323,14 +323,9 @@
324324 'mwe-upwiz-campaign-conf-idField' => 'ID field wikitext. Example: <nowiki>{{Rijksmonument|$1}}</nowiki>. Blank to not display field:',
325325 'mwe-upwiz-campaign-conf-idFieldLabel' => 'ID field label text:',
326326 'mwe-upwiz-campaign-conf-idFieldLabelPage' => 'Page name with text for the ID field label. $1 is replaced with the language code:',
327 - 'mwe-upwiz-campaign-conf-idFieldInitialValue' => 'Initial value for the ID field.',
328327 'mwe-upwiz-campaign-conf-headerLabelPage' => 'Page containing text to display above the UploadWizard interface. $1 is replaced with the language code:',
329328 'mwe-upwiz-campaign-conf-thanksLabelPage' => 'Page containing text to display on top of the "Use" page. $1 is replaced with the language code:',
330329 'mwe-upwiz-campaign-conf-idFieldMaxLength' => 'Maximum length of the text in the ID field',
331 - 'mwe-upwiz-campaign-conf-defaultLat' => 'Default latitude',
332 - 'mwe-upwiz-campaign-conf-defaultLon' => 'Default longitude',
333 - 'mwe-upwiz-campaign-conf-defaultAlt' => 'Default altitude',
334 - 'mwe-upwiz-campaign-conf-defaultDescription' => 'Default description',
335330
336331 // Coolcats
337332 'mw-coolcats-confirm-new-title' => 'Confirm new category',
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -460,45 +460,28 @@
461461 * @param selector jquery-compatible selector, for a single element
462462 */
463463 moveFileInputToCover: function( selector ) {
464 - var _this = this;
465 - var update = function() {
466 - var $covered = $j( selector );
 464+ var $covered = $j( selector );
467465
468 - _this.fileCtrlContainer
469 - .css( $covered.position() )
470 - .css( 'marginTop', $covered.css( 'marginTop' ) )
471 - .css( 'marginRight', $covered.css( 'marginRight' ) )
472 - .css( 'marginBottom', $covered.css( 'marginBottom' ) )
473 - .css( 'marginLeft', $covered.css( 'marginLeft' ) )
474 - .width( $covered.outerWidth() )
475 - .height( $covered.outerHeight() );
 466+ this.fileCtrlContainer
 467+ .css( $covered.position() )
 468+ .css( 'marginTop', $covered.css( 'marginTop' ) )
 469+ .css( 'marginRight', $covered.css( 'marginRight' ) )
 470+ .css( 'marginBottom', $covered.css( 'marginBottom' ) )
 471+ .css( 'marginLeft', $covered.css( 'marginLeft' ) )
 472+ .width( $covered.outerWidth() )
 473+ .height( $covered.outerHeight() );
476474
477 - _this.fileCtrlContainer.css( { 'z-index': 1 } );
 475+ this.fileCtrlContainer.css( { 'z-index': 1 } );
478476
479 - // shift the file input over with negative margins,
480 - // internal to the overflow-containing div, so the div shows all button
481 - // and none of the textfield-like input
482 - _this.$fileInputCtrl.css( {
483 - 'margin-left': '-' + ~~( _this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px',
484 - 'margin-top' : '-' + ~~( _this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px'
485 - } );
486 - }
 477+ // shift the file input over with negative margins,
 478+ // internal to the overflow-containing div, so the div shows all button
 479+ // and none of the textfield-like input
 480+ this.$fileInputCtrl.css( {
 481+ 'margin-left': '-' + ~~( this.$fileInputCtrl.width() - $covered.outerWidth() - 10 ) + 'px',
 482+ 'margin-top' : '-' + ~~( this.$fileInputCtrl.height() - $covered.outerHeight() - 10 ) + 'px'
 483+ } );
487484
488 - if (this.moveFileInputInterval) {
489 - window.clearInterval(this.moveFileInputInterval);
490 - }
491 - this.moveFileInputInterval = window.setInterval(function() {
492 - update();
493 - }, 500);
494 - update();
495 - },
496485
497 - hideFileInput: function() {
498 - if (this.moveFileInputInterval) {
499 - window.clearInterval(this.moveFileInputInterval);
500 - }
501 - this.moveFileInputInterval = null;
502 - // Should we actually hide it?
503486 },
504487
505488 /**
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -746,7 +746,6 @@
747747 } else {
748748 $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', true );
749749 $j( _this.uploadToAdd.ui.div ).hide();
750 - _this.uploadToAdd.ui.hideFileInput();
751750 }
752751
753752
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDescription.js
@@ -4,7 +4,7 @@
55 * @param languageCode -- string
66 * @param firstRequired -- boolean -- the first description is required and should be validated and displayed a bit differently
77 */
8 -mw.UploadWizardDescription = function( languageCode, required, initialValue ) {
 8+mw.UploadWizardDescription = function( languageCode, required ) {
99 var _this = this;
1010 mw.UploadWizardDescription.prototype.count++;
1111 _this.id = 'description' + mw.UploadWizardDescription.prototype.count;
@@ -37,10 +37,6 @@
3838 .attr( 'title', gM( 'mwe-upwiz-tooltip-description' ) )
3939 .growTextArea();
4040
41 - if ( initialValue !== undefined ) {
42 - _this.input.val( initialValue );
43 - }
44 -
4541 // descriptions
4642 _this.div = $j('<div class="mwe-upwiz-details-descriptions-container ui-helper-clearfix"></div>' )
4743 .append( errorLabelDiv, fieldnameDiv, _this.languageMenu, _this.input );
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -170,11 +170,7 @@
171171 _this.latInput = $j( '<input type="text" id="' + latId + '" name="' + latId + '" class="mwe-loc-lat" size="10"/>' );
172172 _this.lonInput = $j( '<input type="text" id="' + lonId + '" name="' + lonId + '" class="mwe-loc-lon" size="10"/>' );
173173 _this.altInput = $j( '<input type="text" id="' + altId + '" name="' + altId + '" class="mwe-loc-alt" size="10"/>' );
174 -
175 - _this.latInput.val( mw.UploadWizard.config.defaultLat );
176 - _this.lonInput.val( mw.UploadWizard.config.defaultLon );
177 - _this.altInput.val( mw.UploadWizard.config.defaultAlt );
178 -
 174+
179175 var latDiv = $j( '<div class="mwe-location-lat"></div>' )
180176 .append( $j ( '<div class="mwe-location-lat-label"></div>' ).append( gM( 'mwe-upwiz-location-lat' ) ) )
181177 .append( _this.latInput );
@@ -221,9 +217,7 @@
222218 'name': idFieldId,
223219 'class': 'mwe-idfield',
224220 'maxlength': mw.UploadWizard.config.idFieldMaxLength
225 - } );
226 -
227 - _this.idFieldInput.val( mw.UploadWizard.config.idFieldInitialValue );
 221+ } );
228222
229223 _this.$form.append(
230224 $j( '<div class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' + idFieldId + '" generated="true"/></div>' ),
@@ -335,13 +329,7 @@
336330
337331 mw.UploadWizardUtil.makeToggler( moreDetailsCtrlDiv, moreDetailsDiv );
338332
339 - _this.addDescription(
340 - !mw.UploadWizard.config.idField,
341 - mw.config.get( 'wgUserLanguage' ),
342 - false,
343 - mw.UploadWizard.config.defaultDescription
344 - );
345 -
 333+ _this.addDescription( !mw.UploadWizard.config.idField, mw.config.get( 'wgUserLanguage' ), false );
346334 $j( containerDiv ).append( _this.div );
347335
348336 if ( mw.config.get( 'UploadWizardConfig' ).useTitleBlacklistApi ) {
@@ -554,7 +542,7 @@
555543 /**
556544 * Add a new description
557545 */
558 - addDescription: function( required, languageCode, allowRemove, initialValue ) {
 546+ addDescription: function( required, languageCode, allowRemove ) {
559547 var _this = this;
560548 if ( required === undefined ) {
561549 required = false;
@@ -568,7 +556,7 @@
569557 allowRemove = true;
570558 }
571559
572 - var description = new mw.UploadWizardDescription( languageCode, required, initialValue );
 560+ var description = new mw.UploadWizardDescription( languageCode, required );
573561
574562 if ( !required && allowRemove ) {
575563 $j( description.div ).append(

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112166Semi-wild stab at bug 34601: 'drop media file to donate here' sometimes silen...brion23:50, 22 February 2012
r112229May or may not help with bug 34601 UW mispositioned file control - still can'...brion19:28, 23 February 2012
r112248Another stab at bug 34601: UploadWizard positioning issues with hidden file i...brion22:04, 23 February 2012
r113584adressing (part of) bug 33341jeroendedauw20:06, 11 March 2012
r113591adderss bug 33341jeroendedauw21:40, 11 March 2012
r114349Simplify parameter checking -- 3 local text variables and 7 function calls is...demon05:32, 21 March 2012

Status & tagging log