jenkins-bot has submitted this change and it was merged.

Change subject: Move & improve iOS 5 Safari's lack of upload fix
......................................................................


Move & improve iOS 5 Safari's lack of upload fix

The entire contents of the upload step used to be replaced,
but it should probably only replace the upload button, instead
of also wiping out the flickr upload.

Change-Id: I9e4d23d5d44b0819f0c476651a8cadf89d756902
---
M resources/mw.UploadWizard.js
M resources/ui/steps/uw.ui.Upload.js
2 files changed, 10 insertions(+), 11 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index d25fdca..a25807f 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -94,17 +94,6 @@
                                .on( 'flickr-ui-init', function () {
                                        wizard.flickrInterfaceInit();
                                        uw.eventFlowLogger.logEvent( 
'flickr-upload-button-clicked' );
-                               } )
-
-                               .on( 'load', function () {
-                                       // Check for iOS 5 Safari's lack of 
file uploads (T34328#364508).
-                                       // While this looks extremely unlikely 
to be right, it actually is. Blame Apple.
-                                       if ( $( '<input type="file">' ).prop( 
'disabled' ) ) {
-                                               $( '#mwe-upwiz-stepdiv-file' 
).replaceWith(
-                                                       $( '<span>' ).msg( 
'mwe-upwiz-file-upload-notcapable' )
-                                               );
-                                               $( '#mwe-upwiz-add-file' 
).hide();
-                                       }
                                } );
 
                        this.steps.deeds = new uw.controller.Deed( this.api, 
this.config );
diff --git a/resources/ui/steps/uw.ui.Upload.js 
b/resources/ui/steps/uw.ui.Upload.js
index f3e8351..b876e20 100644
--- a/resources/ui/steps/uw.ui.Upload.js
+++ b/resources/ui/steps/uw.ui.Upload.js
@@ -147,6 +147,16 @@
                var $fileInputCtrl = $( '<input type="file" multiple 
name="file" class="mwe-upwiz-file-input" />' ),
                        ui = this;
 
+               // Check for iOS 5 Safari's lack of file uploads 
(T34328#364508).
+               // While this looks extremely unlikely to be right, it actually 
is. Blame Apple.
+               if ( $fileInputCtrl.prop( 'disabled' ) ) {
+                       $element.replaceWith(
+                               $( '<span>' ).msg( 
'mwe-upwiz-file-upload-notcapable' )
+                       );
+
+                       return;
+               }
+
                $element.find( '.mwe-upwiz-file-input' ).remove();
                $element.append( $fileInputCtrl );
 

-- 
To view, visit https://gerrit.wikimedia.org/r/318181
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9e4d23d5d44b0819f0c476651a8cadf89d756902
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to