MediaWiki:Gadget-Purge.js: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
m (update deprecated wg variables to mw.config)
(load mediawiki.util)
 
Line 5: Line 5:
$( function() {
$( function() {
     if ( !$( '#ca-purge' ).length && mw.config.get( 'wgIsArticle' ) ) {
     if ( !$( '#ca-purge' ).length && mw.config.get( 'wgIsArticle' ) ) {
      mw.loader.using(['mediawiki.util']).then(function() {
         mw.util.addPortletLink(
         mw.util.addPortletLink(
             'p-cactions',
             'p-cactions',
Line 13: Line 14:
             '*'
             '*'
         );
         );
      });
     }
     }
});
});
//
//

Latest revision as of 19:20, June 20, 2020

// --------------------------------------------------------
// addPurge
// adds a "purge" tab (after "watch")
// --------------------------------------------------------
$( function() {
    if ( !$( '#ca-purge' ).length && mw.config.get( 'wgIsArticle' ) ) {
      mw.loader.using(['mediawiki.util']).then(function() {
        mw.util.addPortletLink(
            'p-cactions',
            mw.util.getUrl( mw.config.get( 'wgPageName' ) ) + '?action=purge',
            mw.config.get( 'skin' ) == 'vector' ? 'Purge' : '*',
            'ca-purge',
            'Purge the server cache of this page',
            '*'
        );
      });
    }
});
//