azatoth/twinkle — Issue #71: Use mw.config.get( 'wgNamespaceIds' ) instead of defining var Namespace directly in the code
Author: mybugs
Created: 2011-10-25 20:57:33+00:00
State: open

Currently, the values of variable Namespace are defined directly on source code:
https://github.com/azatoth/twinkle/blob/2d5caddb7f70054457538fece23fcd9bb3aacdd7/morebits.js#L982

I think it would be helpfull to reuse the values which MediaWiki provides through mw.config.get( 'wgNamespaceIds' ), for better compatibility with other wikis. For English Wikipedia, the current value of mw.config.get( 'wgNamespaceIds' ) is:
{
'': 0,
book: 108,
book_talk: 109,
category: 14,
category_talk: 15,
file: 6,
file_talk: 7,
help: 12,
help_talk: 13,
image: 6,
image_talk: 7,
media: -2,
mediawiki: 8,
mediawiki_talk: 9,
portal: 100,
portal_talk: 101,
project: 4,
project_talk: 5,
special: -1,
talk: 1,
template: 10,
template_talk: 11,
user: 2,
user_talk: 3,
wikipedia: 4,
wikipedia_talk: 5,
wp: 4,
wt: 5
}

so, it is likely that Twinkle could use the default MW variable instead of creating its own copy.