미디어위키:Gadget-purgeNow-beta.js: 두 판 사이의 차이
보이기
imported>Hsl0 편집 요약 없음 |
imported>Hsl0 편집 요약 없음 |
||
25번째 줄: | 25번째 줄: | ||
location.reload(); | location.reload(); | ||
}, function() { | }, function() { | ||
location.href = event. | location.href = event.currentTarget.href; | ||
}); | }); | ||
2022년 7월 1일 (금) 04:42 기준 최신판
/**
* 즉시 갱신 ([[틀:갱신]])
* 제작자: [[사용자: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);