https://bugzilla.wikimedia.org/show_bug.cgi?id=53128

Matthew Flaschen <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Matthew Flaschen <[email protected]> ---
You should probably start by making a config variable for the API URL.  Check
out how MobileFrontend does it
(https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FMobileFrontend.git/a4372c2b5402db3d406f176d4235d726d5cc9d99/MobileFrontend.php#L163).

You can export that to JavaScript with
https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars .

Then, pass that to the UploadWizard config.  

However, you will need to deal with CORS
(https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS).  In the
past, such cross-domain AJAX requests never worked.  Now, they can, but only if
CORS is configured.  You will need to change UploadWizard to deal with this,
since it does the actual uploading.

MobileFrontend shows how to handle CORS as well (look at PhotoApi.js).

However, you will not be able to change the production (actual Wikimedia
Commons) CORS config to allow access from
http://pronunciationrecording.instance-proxy.wmflabs.org/

You might be able to get permission to test against
https://commons.wikimedia.beta.wmflabs.org/w/api.php (Beta Commons) (ccing
Antoine for this).  Otherwise, you'll need to set up your own destination wiki
to test with (separate from
http://pronunciationrecording.instance-proxy.wmflabs.org/).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to