r112256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112255‎ | r112256 | r112257 >
Date:22:32, 23 February 2012
Author:reedy
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/UploadWizard (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/UploadWizard/UploadWizard.i18n.php
@@ -212,17 +212,17 @@
213213 'mwe-upwiz-license-fal' => 'Free Art License',
214214 'mwe-upwiz-license-own-pd' => 'All rights waived with Creative Commons Zero license (like public domain)',
215215 'mwe-upwiz-license-pd-old-100' => 'Author died more than 100 years ago',
216 - 'mwe-upwiz-license-pd-old' => 'Author died more than 70 years ago',
217 - 'mwe-upwiz-license-pd-art' => 'Faithful reproduction of a painting that is in the public domain',
218 - 'mwe-upwiz-license-pd-us' => 'First published in the United States before 1923',
219 - 'mwe-upwiz-license-pd-usgov' => 'Original work of the US Federal Government',
220 - 'mwe-upwiz-license-pd-usgov-nasa' => 'Original work of NASA',
221 - 'mwe-upwiz-license-pd-usgov-military-navy' => 'Original work of the US Military Navy',
222 - 'mwe-upwiz-license-pd-ineligible' => 'Too simple to be copyrighted',
223 - 'mwe-upwiz-license-pd-ineligible-help' => 'Be careful with this one. The image has to be very simple, like a green circle or red square',
224 - 'mwe-upwiz-license-pd-textlogo' => 'Logo with only simple text (wordmark)',
225 - 'mwe-upwiz-license-copyrighted-free-use' => 'Copyrighted, but may be used for any purpose, including commercially',
226 - 'mwe-upwiz-license-attribution' => 'May be used for any purpose, including commercially, if the copyright holder is properly attributed',
 216+ 'mwe-upwiz-license-pd-old' => 'Author died more than 70 years ago',
 217+ 'mwe-upwiz-license-pd-art' => 'Faithful reproduction of a painting that is in the public domain',
 218+ 'mwe-upwiz-license-pd-us' => 'First published in the United States before 1923',
 219+ 'mwe-upwiz-license-pd-usgov' => 'Original work of the US Federal Government',
 220+ 'mwe-upwiz-license-pd-usgov-nasa' => 'Original work of NASA',
 221+ 'mwe-upwiz-license-pd-usgov-military-navy' => 'Original work of the US Military Navy',
 222+ 'mwe-upwiz-license-pd-ineligible' => 'Too simple to be copyrighted',
 223+ 'mwe-upwiz-license-pd-ineligible-help' => 'Be careful with this one. The image has to be very simple, like a green circle or red square',
 224+ 'mwe-upwiz-license-pd-textlogo' => 'Logo with only simple text (wordmark)',
 225+ 'mwe-upwiz-license-copyrighted-free-use' => 'Copyrighted, but may be used for any purpose, including commercially',
 226+ 'mwe-upwiz-license-attribution' => 'May be used for any purpose, including commercially, if the copyright holder is properly attributed',
227227 'mwe-upwiz-license-gfdl' => 'GNU Free Documentation License',
228228 'mwe-upwiz-license-cc-by-sa-3.0-gfdl' => 'Copyleft, attribution required (GFDL, CC-BY-SA-3.0)',
229229
@@ -335,6 +335,9 @@
336336 'mwe-upwiz-prefs-def-license-def' => 'Use whatever the default is',
337337 'mwe-upwiz-prefs-license-own' => 'Own work - $1',
338338 'mwe-upwiz-prefs-license-thirdparty' => "Someone else's work - $1",
 339+
 340+ // See for example.
 341+ 'languageHandler.js' => '', # Do not translate this message.
339342 );
340343
341344 /** Message documentation (Message documentation)
Index: branches/wmf/1.19wmf1/extensions/UploadWizard/resources/mw.UploadWizardUploadInterface.js
@@ -460,28 +460,45 @@
461461 * @param selector jquery-compatible selector, for a single element
462462 */
463463 moveFileInputToCover: function( selector ) {
464 - var $covered = $j( selector );
 464+ var _this = this;
 465+ var update = function() {
 466+ var $covered = $j( selector );
465467
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() );
 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() );
474476
475 - this.fileCtrlContainer.css( { 'z-index': 1 } );
 477+ _this.fileCtrlContainer.css( { 'z-index': 1 } );
476478
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 - } );
 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+ }
484487
 488+ if (this.moveFileInputInterval) {
 489+ window.clearInterval(this.moveFileInputInterval);
 490+ }
 491+ this.moveFileInputInterval = window.setInterval(function() {
 492+ update();
 493+ }, 500);
 494+ update();
 495+ },
485496
 497+ hideFileInput: function() {
 498+ if (this.moveFileInputInterval) {
 499+ window.clearInterval(this.moveFileInputInterval);
 500+ }
 501+ this.moveFileInputInterval = null;
 502+ // Should we actually hide it?
486503 },
487504
488505 /**
Index: branches/wmf/1.19wmf1/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -51,7 +51,7 @@
5252
5353 // load list of languages so we'll have it ready when description interfaces are created
5454 // XXX replace this code once any of the following bugs are fixed: 25845, 27535, 27561
55 - var languageHandlerUrl = mw.util.wikiScript() + '?' + $.param( { 'title': 'MediaWiki:LanguageHandler.js', 'action': 'raw', 'ctype': 'text/javascript' } );
 55+ var languageHandlerUrl = mw.config.get( 'wgServer' ) + mw.util.wikiScript() + '?' + $.param( { 'title': 'MediaWiki:LanguageHandler.js', 'action': 'raw', 'ctype': 'text/javascript' } );
5656 mw.loader.load( languageHandlerUrl );
5757
5858 // remove first spinner
@@ -414,10 +414,6 @@
415415
416416 // we explicitly move the file input to cover the upload button
417417 upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
418 - // do it again in case the layout didn't update immediately
419 - setTimeout(function() {
420 - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
421 - }, 50);
422418
423419 // we bind to the ui div since unbind doesn't work for non-DOM objects
424420
@@ -750,6 +746,7 @@
751747 } else {
752748 $j( '#mwe-upwiz-add-file' ).button( 'option', 'disabled', true );
753749 $j( _this.uploadToAdd.ui.div ).hide();
 750+ _this.uploadToAdd.ui.hideFileInput();
754751 }
755752
756753
Property changes on: branches/wmf/1.19wmf1/extensions/UploadWizard
___________________________________________________________________
Modified: svn:mergeinfo
757754 Merged /trunk/extensions/UploadWizard:r112248,112250,112253

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r112248Another stab at bug 34601: UploadWizard positioning issues with hidden file i...brion22:04, 23 February 2012
r112250Follow-up r85935: Add key for JavaScript customisation page....siebrand22:14, 23 February 2012
r112253* (bug 34652) Fix regression in UploadWizard custom language list...brion22:26, 23 February 2012

Status & tagging log