MediaWiki:Gadget-OngletPurge.js

From Translate NVC
Revision as of 18:02, 21 December 2011 by Dieudo (talk | contribs) (Annulation des modifications 1094 de Dieudo (discussion))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: After saving, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/**
 * OngletPurge
 *
 * Onglet permettant de réaliser une purge du cache
 *
 * Auteur : ??
 * Dernière révision : 23/09/2011
 */
 
$j(document).ready(function() {
  if(mw.config.get('wgNamespaceNumber') >= 0 && (mw.config.get('wgAction') === 'view' || mw.config.get('wgAction') === 'purge')) {
    mw.util.addPortletLink(
      'p-cactions',
      mw.config.get('wgScript') + '?action=purge&title=' + mw.util.wikiUrlencode(mw.config.get('wgPageName')),
      'Purger',
      'ca-purge',
      'Purger le cache de la page'
    );
    if(mw.config.get('wgNamespaceNumber') == 104) {
      $('li#ca-purge a').click(function() {
        var img = new Image();
        img.src = $('img#ProofReadImage').attr('scr') + '?action=purge';
        alert($('img#ProofReadImage').attr('scr'));
        //location.href = mw.config.get('wgScript') + '?action=purge&title=' + mw.util.wikiUrlencode(mw.config.get('wgPageName'));
      });
    }
    if(mw.config.get(wgAction) === 'purge') {
      $('#ca-purge').addClass('selected');
    }
  }
});