|
|
(2 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| /* All JavaScript here will be loaded for users of the Cosmos skin */ | | /* All JavaScript here will be loaded for users of the Cosmos skin */ |
| (function() {
| |
| function removePrefixFromCustomNamespaces() {
| |
| var nsNumber = mw.config.get('wgNamespaceNumber');
| |
| if (nsNumber < 3000) {
| |
| return;
| |
| }
| |
| var nsName = mw.config.get('wgCanonicalNamespace').split('_').join(' ');
| |
| var $cosmosTitleText = $('#cosmos-title-text');
| |
| var currentTitle = document.title;
| |
| var prefixedTitle = $cosmosTitleText.text();
| |
| var replacementText = nsNumber % 2 === 0 ? '' : 'Talk:';
| |
| var unprefixedTitle = prefixedTitle.replace(nsName + ':', replacementText);
| |
|
| |
| $('#cosmos-title-text').text(unprefixedTitle);
| |
| document.title = currentTitle.replace(nsName + ':', replacementText);
| |
| }
| |
| removePrefixFromCustomNamespaces();
| |
| }());
| |