Skip to content

Commit

Permalink
Switch siteinfo query to formatversion=2
Browse files Browse the repository at this point in the history
  • Loading branch information
ricordisamoa committed Jan 11, 2020
1 parent 27c8dbc commit efe5d99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* DEep WiKi INspector (DEWKIN)
* Copyright (C) 2013-2019 Ricordisamoa
* Copyright (C) 2013-2020 Ricordisamoa
*
* https://meta.wikimedia.org/wiki/User:Ricordisamoa
* https://tools.wmflabs.org/ricordisamoa/
Expand Down Expand Up @@ -395,6 +395,7 @@ DataGetter.prototype = {
namespaces: function () {
return this.localApi.get( {
action: 'query',
formatversion: '2',
meta: 'siteinfo',
siprop: 'namespaces'
} )
Expand Down Expand Up @@ -1229,7 +1230,7 @@ Inspector.prototype.onSubmit = function ( event ) {
*/
Inspector.prototype.namespaceName = function ( number ) {
return this.namespaces[ number ] ?
this.namespaces[ number ][ '*' ].replace( /^(Talk)?$/, 'Article $1' ).trim() :
this.namespaces[ number ].name.replace( /^(Talk)?$/, 'Article $1' ).trim() :
( 'ns-' + number );
};

Expand Down

0 comments on commit efe5d99

Please sign in to comment.