<script type="text/javascript">var titles = "";var hasInput = "";</script>
<div class="form-group" style="max-width:500px;display:none">
<label for="titles">标题</label>
<input id="titles" name="titles" class="form-control" placeholder="英文逗号或顿号分割"></input>
</div>
<script>
if(hasInput !== "") setTimeout(function(){$("#titles").parent().show();$("#titles").val(titles)}, 1000)
function purge(){
window.titleArray = titles.replace(", ", ",").split(",")
if(hasInput !== "") window.titleArray = $("#titles").val().replace(/、/g, ",").replace(/, /, ",").split(",")
window.pageIndex = 0
new mw.Api().post({
"action": "purge",
"format": "json",
"titles": titleArray.join("|")
}).then( getPage )
}
function getPage(){
if(pageIndex >= titleArray.length) return alert("刷新完毕")
$.get(mw.config.get("wgCookiePath") + titleArray[pageIndex++])
setTimeout(getPage, 100)
}
</script>