MediaWiki:Gadget-Purgecache.js:修订间差异
imported>=海豚= 无编辑摘要 |
小 →top:bad link repair, replaced: hmoegirl.com → hmoegirl.info |
||
| (未显示1个用户的7个中间版本) | |||
| 第14行: | 第14行: | ||
} else { | } else { | ||
containerNode = $('<a/>'); | containerNode = $('<a/>'); | ||
var statusNode = $('<span/>').text(' | var statusNode = $('<span/>').text('清除页面缓存'), | ||
runningStatus = false; | runningStatus = false; | ||
containerNode.attr("href", 'javascript:void(0);'); | containerNode.attr("href", 'javascript:void(0);'); | ||
| 第20行: | 第20行: | ||
containerNode.on('click', function() { | containerNode.on('click', function() { | ||
if (runningStatus) return; | if (runningStatus) return; | ||
statusNode.text(' | statusNode.text('正在清除页面缓存...'); | ||
statusNode.prepend('<img src="https:// | statusNode.prepend('<img src="https://www.hmoegirl.info/images/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">'); | ||
runningStatus = true; | runningStatus = true; | ||
var api = new mw.Api(), | var api = new mw.Api(), | ||
| 第33行: | 第33行: | ||
setTimeout(function() { | setTimeout(function() { | ||
api.post(opt).then(function() { | api.post(opt).then(function() { | ||
statusNode.text(' | statusNode.text('清除页面缓存成功!'); | ||
setTimeout(location.reload.bind(location), 1000); | setTimeout(location.reload.bind(location), 1000); | ||
}, function() { | }, function() { | ||
statusNode.text(' | statusNode.text('清除页面缓存失败,点击可重试!'); | ||
runningStatus = false; | runningStatus = false; | ||
setTimeout(function() { | setTimeout(function() { | ||
if (!runningStatus) statusNode.text(' | if (!runningStatus) statusNode.text('清除页面缓存'); | ||
}, 5000); | }, 5000); | ||
}); | }); | ||
}, 370); | }, 370); | ||
}, function() { | }, function() { | ||
statusNode.text(' | statusNode.text('清除页面缓存失败,点击可重试!'); | ||
runningStatus = false; | runningStatus = false; | ||
setTimeout(function() { | setTimeout(function() { | ||
if (!runningStatus) statusNode.text(' | if (!runningStatus) statusNode.text('清除页面缓存'); | ||
}, 5000); | }, 5000); | ||
}); | }); | ||