Actions

MediaWiki

Common.js: Difference between revisions

Project Rebearth wiki

No edit summary
Add namespace-aware tagline swap (italics + Lore icon)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
(function () {
(function () {
     if (mw.config.get('wgPageName') === 'Project_Rebearth:Changelog_editor') {
     if (mw.config.get('wgPageName') === 'Project_Rebearth:Changelog_editor') {
         mw.loader.load('/w/index.php?title=MediaWiki:ChangelogEditor.css&action=raw&ctype=text/css', 'text/css');
         mw.loader.load('/index.php?title=MediaWiki:ChangelogEditor.css&action=raw&ctype=text/css', 'text/css');
         mw.loader.load('/w/index.php?title=MediaWiki:ChangelogEditor.js&action=raw&ctype=text/javascript');
         mw.loader.load('/index.php?title=MediaWiki:ChangelogEditor.js&action=raw&ctype=text/javascript');
     }
     }
})();
})();
// Tagline: italic "Project Rebearth" on non-Lore pages; icon + italic on Lore namespace
$(function () {
    var $tag = $('#tagline');
    if (!$tag.length) return;
    if (mw.config.get('wgCanonicalNamespace') === 'Lore') {
        $tag.html(
            '<a href="/index.php/Lore" title="Lore">' +
                '<img src="/index.php/Special:FilePath/LoreIcon.png" ' +
                    'class="iconimg" alt="Lore icon" ' +
                    'style="height:15px;vertical-align:-3px;">' +
            '</a> <i>Project Rebearth</i> lore'
        );
    } else {
        $tag.html('<i>Project Rebearth</i> wiki');
    }
});

Latest revision as of 09:58, 19 April 2026

(function () {
    if (mw.config.get('wgPageName') === 'Project_Rebearth:Changelog_editor') {
        mw.loader.load('/index.php?title=MediaWiki:ChangelogEditor.css&action=raw&ctype=text/css', 'text/css');
        mw.loader.load('/index.php?title=MediaWiki:ChangelogEditor.js&action=raw&ctype=text/javascript');
    }
})();


// Tagline: italic "Project Rebearth" on non-Lore pages; icon + italic on Lore namespace
$(function () {
    var $tag = $('#tagline');
    if (!$tag.length) return;
    if (mw.config.get('wgCanonicalNamespace') === 'Lore') {
        $tag.html(
            '<a href="/index.php/Lore" title="Lore">' +
                '<img src="/index.php/Special:FilePath/LoreIcon.png" ' +
                    'class="iconimg" alt="Lore icon" ' +
                    'style="height:15px;vertical-align:-3px;">' +
            '</a> <i>Project Rebearth</i> lore'
        );
    } else {
        $tag.html('<i>Project Rebearth</i> wiki');
    }
});