“File:最常见的单孔处女膜.jpeg”与“MediaWiki:Gadget-Purgecache.js”:页面之间的差异
(页面间差异)
跳到导航
跳到搜索
imported>DavidYin (最常见的单孔处女膜) |
imported>=海豚= (创建页面,内容为“// <pre> $(function(){ mw.loader.using("moment").then(function() { var li = $('<li/>').appendTo("#p-personal > ul"), textNode = $('<span/>'),…”) |
||
第1行: | 第1行: | ||
== | // <pre> | ||
$(function(){ | |||
mw.loader.using("moment").then(function() { | |||
var li = $('<li/>').appendTo("#p-personal > ul"), | |||
textNode = $('<span/>'), | |||
containerNode; | |||
if (mw.config.get('wgNamespaceNumber') === -1) { | |||
containerNode = $('<span/>'); | |||
containerNode.css({ | |||
'cursor': 'default', | |||
'user-select': 'none' | |||
}); | |||
containerNode.append('特殊页面(').append(textNode).append(')'); | |||
} else { | |||
containerNode = $('<a/>'); | |||
var statusNode = $('<span/>').text('强制刷新页面'), | |||
runningStatus = false; | |||
containerNode.attr("href", 'javascript:void(0);'); | |||
containerNode.append(statusNode).append('(').append(textNode).append(')'); | |||
containerNode.on('click', function() { | |||
if (runningStatus) return; | |||
statusNode.text('正在强制刷新页面……'); | |||
statusNode.prepend('<img src="https://static.mengniang.org/common/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">'); | |||
runningStatus = true; | |||
var api = new mw.Api(), | |||
opt = { | |||
action: 'purge', | |||
format: 'json', | |||
forcelinkupdate: true, | |||
titles: mw.config.get('wgPageName') | |||
}; | |||
api.post(opt).then(function() { | |||
setTimeout(function() { | |||
api.post(opt).then(function() { | |||
statusNode.text('强制刷新页面成功!'); | |||
setTimeout(location.reload.bind(location), 1000); | |||
}, function() { | |||
statusNode.text('强制刷新页面失败,点击可重试!'); | |||
runningStatus = false; | |||
setTimeout(function() { | |||
if (!runningStatus) statusNode.text('强制刷新页面'); | |||
}, 5000); | |||
}); | |||
}, 370); | |||
}, function() { | |||
statusNode.text('强制刷新页面失败,点击可重试!'); | |||
runningStatus = false; | |||
setTimeout(function() { | |||
if (!runningStatus) statusNode.text('强制刷新页面'); | |||
}, 5000); | |||
}); | |||
}); | |||
} | |||
li.append(containerNode); | |||
textNode.text(moment().format('A h[:]mm[:]ss')); | |||
var date = new Date(); | |||
var now = date.getTime(); | |||
date.setMilliseconds(0); | |||
date.setSeconds(date.getSeconds() + 1); | |||
setTimeout(function() { | |||
setInterval(function() { | |||
textNode.text(moment().format('A h[:]mm[:]ss')); | |||
}, 1e3); | |||
textNode.text(moment().format('A h[:]mm[:]ss')); | |||
}, date.getTime() - now); | |||
}); | |||
}); | |||
// </pre> |
2020年3月12日 (四) 18:03的版本
// <pre>
$(function(){
mw.loader.using("moment").then(function() {
var li = $('<li/>').appendTo("#p-personal > ul"),
textNode = $('<span/>'),
containerNode;
if (mw.config.get('wgNamespaceNumber') === -1) {
containerNode = $('<span/>');
containerNode.css({
'cursor': 'default',
'user-select': 'none'
});
containerNode.append('特殊页面(').append(textNode).append(')');
} else {
containerNode = $('<a/>');
var statusNode = $('<span/>').text('强制刷新页面'),
runningStatus = false;
containerNode.attr("href", 'javascript:void(0);');
containerNode.append(statusNode).append('(').append(textNode).append(')');
containerNode.on('click', function() {
if (runningStatus) return;
statusNode.text('正在强制刷新页面……');
statusNode.prepend('<img src="https://static.mengniang.org/common/d/d1/Windows_10_loading.gif" style="height: 1em; margin-top: -.25em;">');
runningStatus = true;
var api = new mw.Api(),
opt = {
action: 'purge',
format: 'json',
forcelinkupdate: true,
titles: mw.config.get('wgPageName')
};
api.post(opt).then(function() {
setTimeout(function() {
api.post(opt).then(function() {
statusNode.text('强制刷新页面成功!');
setTimeout(location.reload.bind(location), 1000);
}, function() {
statusNode.text('强制刷新页面失败,点击可重试!');
runningStatus = false;
setTimeout(function() {
if (!runningStatus) statusNode.text('强制刷新页面');
}, 5000);
});
}, 370);
}, function() {
statusNode.text('强制刷新页面失败,点击可重试!');
runningStatus = false;
setTimeout(function() {
if (!runningStatus) statusNode.text('强制刷新页面');
}, 5000);
});
});
}
li.append(containerNode);
textNode.text(moment().format('A h[:]mm[:]ss'));
var date = new Date();
var now = date.getTime();
date.setMilliseconds(0);
date.setSeconds(date.getSeconds() + 1);
setTimeout(function() {
setInterval(function() {
textNode.text(moment().format('A h[:]mm[:]ss'));
}, 1e3);
textNode.text(moment().format('A h[:]mm[:]ss'));
}, date.getTime() - now);
});
});
// </pre>
文件历史
点击某个日期/时间查看对应时刻的文件。
日期/时间 | 缩略图 | 大小 | 用户 | 备注 | |
---|---|---|---|---|---|
当前 | 2022年11月20日 (日) 09:12 | 1,210 × 1,600(631 KB) | Maintenance script(讨论 | 贡献) | == 摘要 == Importing file |
您不可以覆盖此文件。
文件用途
以下页面使用本文件: