JGonera has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/113067

Change subject: Hygiene: Use accept attribute in uploads file input tag
......................................................................

Hygiene: Use accept attribute in uploads file input tag

This change removes irrelevant options in the Android dialog that asks
for the app that should handle the file input. Previously Android would
display all apps, including the ones that can't be used to select images
(e.g. music related).

Tested on Android Browser 4.1 and 4.2 and it works fine, you can use
camera. We don't support uploads on Android < 4.

Change-Id: I61e056823ff3e82209de483d6d974fef3fcf672c
---
M javascripts/modules/uploads/PhotoUploaderButton.js
M templates/uploads/LeadPhotoUploaderButton.html
2 files changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/67/113067/1

diff --git a/javascripts/modules/uploads/PhotoUploaderButton.js 
b/javascripts/modules/uploads/PhotoUploaderButton.js
index 63f26d2..45b34ca 100644
--- a/javascripts/modules/uploads/PhotoUploaderButton.js
+++ b/javascripts/modules/uploads/PhotoUploaderButton.js
@@ -98,8 +98,6 @@
                        }
 
                        $input.
-                               // accept must be set via attr otherwise cannot 
use camera on Android
-                               attr( 'accept', 'image/*;' ).
                                on( 'change', function() {
                                        handleFile( $input[0].files[0] );
                                        // clear so that change event is fired 
again when user selects the same file
diff --git a/templates/uploads/LeadPhotoUploaderButton.html 
b/templates/uploads/LeadPhotoUploaderButton.html
index f472d87..01a4429 100644
--- a/templates/uploads/LeadPhotoUploaderButton.html
+++ b/templates/uploads/LeadPhotoUploaderButton.html
@@ -1 +1 @@
-<input name="file" type="file">{{buttonCaption}}
+<input name="file" type="file" accept="image/*">{{buttonCaption}}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61e056823ff3e82209de483d6d974fef3fcf672c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera <[email protected]>

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

Reply via email to