×
Create a new article
Write your page title here:
We currently have 3,036 articles on YumeWiki. Type your article name above or click on one of the titles below and start writing!



YumeWiki
3,036Articles

MediaWiki:Cosmos.js: Difference between revisions

No edit summary
(Undo revision 427435 by YouArentDistorted (talk))
Tag: Undo
 
(4 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 prefixedTitle = $cosmosTitleText.text();
        var replacementText = nsNumber % 2 === 0 ? '' : 'Talk:';
        var unprefixedTitle = prefixedTitle.replace(`${nsName}:`, replacementText);
       
        $('#cosmos-title-text').text(unprefixedTitle);
    }
    removePrefixFromCustomNamespaces();
}());

Latest revision as of 07:16, 23 February 2023

/* All JavaScript here will be loaded for users of the Cosmos skin */