jenkins-bot has submitted this change and it was merged. Change subject: Remove parameter format: 'json' for mw.Api methods ......................................................................
Remove parameter format: 'json' for mw.Api methods format=json is default and added by the mw.Api methods. Change-Id: I14df641ca42ac0c645ce4f7719655bc4bb245a6b --- M modules/publish/ext.cx.wikibase.link.js M modules/source/ext.cx.source.filter.js M modules/source/ext.cx.source.selector.js M modules/tools/ext.cx.tools.categories.js M modules/tools/ext.cx.tools.images.js M modules/tools/ext.cx.tools.link.js M modules/tools/ext.cx.tools.template.js M modules/tools/ext.cx.tools.validator.js M modules/translation/ext.cx.translation.loader.js M tests/qunit/base/ext.cx.sitemapper.test.js 10 files changed, 16 insertions(+), 31 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/publish/ext.cx.wikibase.link.js b/modules/publish/ext.cx.wikibase.link.js index f6dc54a..e899d8a 100644 --- a/modules/publish/ext.cx.wikibase.link.js +++ b/modules/publish/ext.cx.wikibase.link.js @@ -29,8 +29,7 @@ sourceApi.get( { action: 'query', meta: 'siteinfo', - siprop: 'general', - format: 'json' + siprop: 'general' }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" diff --git a/modules/source/ext.cx.source.filter.js b/modules/source/ext.cx.source.filter.js index 6d4c373..06c4d01 100644 --- a/modules/source/ext.cx.source.filter.js +++ b/modules/source/ext.cx.source.filter.js @@ -24,8 +24,7 @@ return api.get( { action: 'cxconfiguration', from: sourceLanguage, - to: targetLanguage, - format: 'json' + to: targetLanguage } ); } diff --git a/modules/source/ext.cx.source.selector.js b/modules/source/ext.cx.source.selector.js index d9e0699..b240cdd 100644 --- a/modules/source/ext.cx.source.selector.js +++ b/modules/source/ext.cx.source.selector.js @@ -640,8 +640,7 @@ action: 'opensearch', search: input, namespace: 0, - suggest: true, - format: 'json' + suggest: true }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" diff --git a/modules/tools/ext.cx.tools.categories.js b/modules/tools/ext.cx.tools.categories.js index 0360b9c..a2f50d3 100644 --- a/modules/tools/ext.cx.tools.categories.js +++ b/modules/tools/ext.cx.tools.categories.js @@ -509,8 +509,7 @@ clshow: '!hidden', cllimit: 100, indexpageids: true, - titles: title, - format: 'json' + titles: title }, { dataType: 'jsonp', cache: true @@ -576,8 +575,7 @@ prop: 'langlinks', lllang: this.siteMapper.getWikiDomainCode( language ), lllimit: 100, - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', cache: true diff --git a/modules/tools/ext.cx.tools.images.js b/modules/tools/ext.cx.tools.images.js index e68396b..d7cfed9 100644 --- a/modules/tools/ext.cx.tools.images.js +++ b/modules/tools/ext.cx.tools.images.js @@ -34,8 +34,7 @@ request = mw.cx.siteMapper.getApi( targetLanguage ).get( { action: 'query', meta: 'siteinfo', - siprop: 'namespaces', - format: 'json' + siprop: 'namespaces' }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" diff --git a/modules/tools/ext.cx.tools.link.js b/modules/tools/ext.cx.tools.link.js index 2a1d861..5ea1427 100644 --- a/modules/tools/ext.cx.tools.link.js +++ b/modules/tools/ext.cx.tools.link.js @@ -37,8 +37,7 @@ prop: 'pageimages', piprop: 'thumbnail', pithumbsize: 150, - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" @@ -83,8 +82,7 @@ prop: 'langlinks', lllimit: titles.length, // TODO: Default is 10 and max is 500. Do we need more than 500? lllang: mw.cx.siteMapper.getWikiDomainCode( language ), - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" diff --git a/modules/tools/ext.cx.tools.template.js b/modules/tools/ext.cx.tools.template.js index 784cc63..bf0956d 100644 --- a/modules/tools/ext.cx.tools.template.js +++ b/modules/tools/ext.cx.tools.template.js @@ -89,8 +89,7 @@ return self.siteMapper.getApi( self.targetLanguage ).get( { action: 'templatedata', titles: targetName, - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" @@ -190,8 +189,7 @@ request = this.siteMapper.getApi( language ).get( { action: 'query', meta: 'siteinfo', - siprop: 'namespaces', - format: 'json' + siprop: 'namespaces' }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" @@ -424,8 +422,7 @@ titles: 'Template:' + this.templateTitle, prop: 'langlinks', lllang: this.siteMapper.getWikiDomainCode( this.targetLanguage ), - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" diff --git a/modules/tools/ext.cx.tools.validator.js b/modules/tools/ext.cx.tools.validator.js index c5bf9ca..b20b9da 100644 --- a/modules/tools/ext.cx.tools.validator.js +++ b/modules/tools/ext.cx.tools.validator.js @@ -32,8 +32,7 @@ action: 'query', titles: title, redirects: 1, - indexpageids: 1, - format: 'json' + indexpageids: 1 }, { dataType: 'jsonp', // This prevents warnings about the unrecognized parameter "_" @@ -74,8 +73,7 @@ titles: sourceTitle, lllang: mw.cx.siteMapper.getWikiDomainCode( targetLanguage ), lllimit: 1, - redirects: true, - format: 'json' + redirects: true }, { dataType: 'jsonp', cache: true diff --git a/modules/translation/ext.cx.translation.loader.js b/modules/translation/ext.cx.translation.loader.js index 661d21f..231d604 100644 --- a/modules/translation/ext.cx.translation.loader.js +++ b/modules/translation/ext.cx.translation.loader.js @@ -68,8 +68,7 @@ list: 'contenttranslation', sourcetitle: mw.cx.sourceTitle, from: mw.cx.sourceLanguage, - to: mw.cx.targetLanguage, - format: 'json' + to: mw.cx.targetLanguage } ).then( function ( response ) { return response.query && response.query.contenttranslation.translation; } ); @@ -89,8 +88,7 @@ return api.get( { action: 'query', list: 'contenttranslation', - translationid: mw.cx.translationId, - format: 'json' + translationid: mw.cx.translationId } ).then( function ( response ) { self.translation = response.query.contenttranslation.translation; self.translationUnits = self.translation.translationUnits; diff --git a/tests/qunit/base/ext.cx.sitemapper.test.js b/tests/qunit/base/ext.cx.sitemapper.test.js index b88deb4..f386d30 100644 --- a/tests/qunit/base/ext.cx.sitemapper.test.js +++ b/tests/qunit/base/ext.cx.sitemapper.test.js @@ -57,7 +57,7 @@ QUnit.expect( 2 ); - this.siteMapper.getApi( 'he' ).get( { action: 'testaction', format: 'json' } ); + this.siteMapper.getApi( 'he' ).get( { action: 'testaction' } ); assert.strictEqual( server.requests.length, 1 ); assert.strictEqual( server.requests[ 0 ].url, -- To view, visit https://gerrit.wikimedia.org/r/309238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I14df641ca42ac0c645ce4f7719655bc4bb245a6b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Fomafix <foma...@googlemail.com> Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits