MediaWiki:Common.js: Difference between revisions

From Redbrick Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
     if (cats && cats.indexOf('Archive') !== -1) {
     if (cats && cats.indexOf('Archive') !== -1) {
         $('.mw-parser-output').prepend(
         $('.mw-parser-output').prepend(
             '<div class="category-notice">This article is archived. It is either extremely out of date or no longer relevant. </div>'
             '<div class="category-notice">{| class="" style="padding: 0.5em; border-color: #AAAAAA #AAAAAA #AAAAAA #f00; border-style: solid; border-width: 1px 1px 1px 10px; margin: 0 10%;"
|'''IMPORTANT:''' This article is archived. It is either extremely out of date or no longer relevant.  
|}
</div>'
         );
         );
     }
     }
});
});

Revision as of 22:16, 21 April 2026

/* Any JavaScript here will be loaded for all users on every page load. */
/* Display banner on archived pages */
mw.hook('wikipage.content').add(function() {
    var cats = mw.config.get('wgCategories');
    if (cats && cats.indexOf('Archive') !== -1) {
        $('.mw-parser-output').prepend(
            '<div class="category-notice">{| class="" style="padding: 0.5em; border-color: #AAAAAA #AAAAAA #AAAAAA #f00; border-style: solid; border-width: 1px 1px 1px 10px; margin: 0 10%;"
|'''IMPORTANT:''' This article is archived. It is either extremely out of date or no longer relevant. 
|}
</div>'
        );
    }
});