Difference between revisions of "MediaWiki:Gadget-OngletPurge.js"

From Translate NVC
Jump to: navigation, search
(Annulation des modifications 1094 de Dieudo (discussion))
 
m (1 revision: Gadgets)
 
(No difference)

Latest revision as of 10:22, 2 June 2014

/**
 * 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');
    }
  }
});