Nikerabbit has uploaded a new change for review.

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

Change subject: ext.cx.sitemapper: use mediawiki.ForeignApi
......................................................................

ext.cx.sitemapper: use mediawiki.ForeignApi

This is almost a no-op currently, as jsonp is used by the callers.
The change is that origin parameter is passed. Callers will be
updated in a follow-up commit.

Bug: T146248
Change-Id: I5f4df841bcb5fe71770db04af9998cf4ec0e5364
---
M extension.json
M modules/base/ext.cx.sitemapper.js
2 files changed, 5 insertions(+), 8 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/52/312252/1

diff --git a/extension.json b/extension.json
index 66b839a..1e55396 100644
--- a/extension.json
+++ b/extension.json
@@ -316,9 +316,9 @@
                        ],
                        "dependencies": [
                                "ext.cx.model",
-                               "mediawiki.Uri",
-                               "mediawiki.api",
-                               "mediawiki.Title"
+                               "mediawiki.ForeignApi",
+                               "mediawiki.Title",
+                               "mediawiki.Uri"
                        ],
                        "targets": [
                                "desktop",
diff --git a/modules/base/ext.cx.sitemapper.js 
b/modules/base/ext.cx.sitemapper.js
index c67e50d..974c69e 100644
--- a/modules/base/ext.cx.sitemapper.js
+++ b/modules/base/ext.cx.sitemapper.js
@@ -50,6 +50,7 @@
         * Get the API for a remote wiki.
         *
         * @param {string} language Language code
+        * @return {mw.Api}
         */
        mw.cx.SiteMapper.prototype.getApi = function ( language ) {
                var url, domain;
@@ -57,11 +58,7 @@
                domain = this.getWikiDomainCode( language );
                url = this.config.api.replace( '$1', domain );
 
-               return new mw.Api( {
-                       ajax: {
-                               url: url
-                       }
-               } );
+               return new mw.ForeignApi( url, { anonymous: true } );
        };
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f4df841bcb5fe71770db04af9998cf4ec0e5364
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to