મીડિયાવિકિ:Gadget-PurgeTab.js
નોંધ: પાનું પ્રકાશિત કર્યા પછી, તમારે તમારા બ્રાઉઝરની કૅશ બાયપાસ કરવાની આવશ્યકતા પડી શકે છે.
- ફાયરફોક્સ / સફારી: શીફ્ટ દબાવેલી રાખીને રિલોડ પર ક્લિક કરો, અથવા તો Ctrl-F5 કે Ctrl-R દબાવો (મેક પર ⌘-R)
- ગુગલ ક્રોમ: Ctrl-Shift-R દબાવો (મેક પર ⌘-Shift-R)
- ઈન્ટરનેટ એક્સપ્લોરર/એજ: Ctrl દબાવેલી રાખીને રિફ્રેશ પર ક્લિક કરો, અથવા Ctrl-F5 દબાવો
- Opera: Ctrl-F5 દબાવો
jQuery(document).ready(function () {
if (!mw.config.get('wgArticleId'))
return;
var link;
link = mw.util.addPortletLink(
'p-cactions', mw.util.getUrl(mw.config.get('wgPageName'), { 'action': 'purge' }),
(mw.user.options.get( 'skin' ) == 'vector' ) ? "Purge" : "*",
'ca-purge', "Purge cache for this page", '*'
);
link = mw.util.addPortletLink(
// not sure if raw link is valid for extra params Using wikiScript instead of getUrl
'p-cactions', mw.util.wikiScript('api') + '?action=purge&titles=' + mw.config.get('wgPageName') + '&forcerecursivelinkupdate=1&redirects=1',
(mw.user.options.get( 'skin' ) == 'vector' ) ? "Hard purge" : "**",
'ca-purge-forcerecursivelinkupdate', "Purge with forced recursive-link table update", ','
);
link.addEventListener('click', function (ev) {
mw.loader.using( 'mediawiki.api' ).done(function() {
( new mw.Api() ).post({
action: 'purge',
pageids: mw.config.get('wgArticleId'),
forcerecursivelinkupdate: 1,
redirects: 1
}).then(function () {
location.reload();
}, function (code, details) {
var mesg;
switch (code) {
case 'http':
mesg = 'HTTP error: ' + details.xhr.statusText;
break;
case 'ok-but-empty':
mesg = 'Received empty response.';
break;
default:
mesg = details.error.info;
}
mw.notify('<b>Hard purge failed</b>: ' + mesg);
console.error(arguments);
} );
} );
ev.preventDefault();
}, false);
link = mw.util.addPortletLink(
'p-cactions', 'javascript:void window.warranty',
(mw.user.options.get( 'skin' ) == 'vector' ) ? "Null edit" : "***",
'ca-nulledit', "Null edit", '0'
);
link.addEventListener('click', function (ev) {
mw.loader.using( 'mediawiki.api' ).done( function() {
( new mw.Api() ).post({
action: 'edit',
pageid: mw.config.get('wgArticleId'),
appendtext: '',
watchlist: 'nochange',
nocreate: '1',
token: mw.user.tokens.get('csrfToken')
}).then(function () {
location.reload();
}, function (code, details) {
var mesg;
switch (code) {
case 'http':
mesg = 'HTTP error: ' + details.xhr.statusText;
break;
case 'ok-but-empty':
mesg = 'Received empty response.';
break;
default:
mesg = details.error.info;
}
mw.notify('<b>Null edit failed</b>: ' + mesg);
console.error(arguments);
} );
} );
ev.preventDefault();
}, false);
} );