MediaWiki:Gadget-OngletPurge.js
From Translate NVC
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');
}
}
});