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

Change subject: Enable photo upload progress bar 1/2
......................................................................


Enable photo upload progress bar 1/2

In theory this should work after bug 41731 has been resolved.
We should try this on a live wiki to confirm as we cannot test locally
Note the origin now has to appear in the api url not as a parameter

Change-Id: I934c1132f4fd83acc487195a46f8d9555b40273f
---
M javascripts/modules/uploads/PhotoApi.js
1 file changed, 3 insertions(+), 2 deletions(-)

Approvals:
  JGonera: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/javascripts/modules/uploads/PhotoApi.js 
b/javascripts/modules/uploads/PhotoApi.js
index 52e2fae..bbd2406 100644
--- a/javascripts/modules/uploads/PhotoApi.js
+++ b/javascripts/modules/uploads/PhotoApi.js
@@ -124,6 +124,7 @@
 
                        function doUpload( token, caToken ) {
                                var formData = new FormData(),
+                                       uploadUrl = apiUrl + 
'?useformat=mobile&r=' + Math.random(),
                                        ext = options.file.name.slice( 
options.file.name.lastIndexOf( '.' ) + 1 ),
                                        request;
 
@@ -133,7 +134,7 @@
                                formData.append( 'format', 'json' );
                                // add origin only when doing CORS
                                if ( endpoint ) {
-                                       formData.append( 'origin', 
M.getOrigin() );
+                                       uploadUrl += '&origin=' + M.getOrigin();
                                        if ( caToken ) {
                                                formData.append( 
'centralauthtoken', caToken );
                                        }
@@ -153,7 +154,7 @@
                                request = self.post( formData, {
                                        // iOS seems to ignore the cache 
parameter so sending r parameter
                                        // send useformat=mobile for sites 
where endpoint is a desktop url so that they are mobile edit tagged
-                                       url: apiUrl + '?useformat=mobile&r=' + 
Math.random(),
+                                       url: uploadUrl,
                                        xhrFields: { 'withCredentials': true },
                                        cache: false,
                                        contentType: false,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I934c1132f4fd83acc487195a46f8d9555b40273f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to