미디어위키:Gadget-purgeNow.js: 두 판 사이의 차이
보이기
imported>Senouis 1월1일 hsl0님 요청 |
imported>Hsl0 편집 요약 없음 |
||
10번째 줄: | 10번째 줄: | ||
}); | }); | ||
$('.purgelink a').click(function(event) { | $('.purgelink a, #ca-purge a').click(function(event) { | ||
event.preventDefault(); | event.preventDefault(); | ||
24번째 줄: | 24번째 줄: | ||
}).then(function() { | }).then(function() { | ||
location.reload(); | location.reload(); | ||
}, function() { | |||
location.href = event.currentTarget.href; | |||
}); | }); | ||
2022년 7월 6일 (수) 05:10 판
/**
* 즉시 갱신 ([[틀:갱신]])
* 제작자: [[사용자:hsl0]]
**/
function purgeNow() {
if(document.querySelector('.purgepage')) $.post('/w/api.php', {
action: 'purge',
titles: mw.config.get('wgPageName'),
format: 'none'
});
$('.purgelink a, #ca-purge a').click(function(event) {
event.preventDefault();
mw.notify('페이지를 갱신하는 중입니다...', {
type: 'pending',
autoHide: false
});
$.post('/w/api.php', {
action: 'purge',
titles: mw.config.get('wgPageName'),
format: 'none'
}).then(function() {
location.reload();
}, function() {
location.href = event.currentTarget.href;
});
return false;
});
}
$(purgeNow);