Dianliang233(讨论 | 贡献) 无编辑摘要 |
Dianliang233(讨论 | 贡献) 无编辑摘要 |
||
第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | /* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */ | ||
document.getElementById('skin-citizen-search-trigger').addEventListener('click', function() { | try { | ||
document.getElementById('skin-citizen-search-trigger').addEventListener('click', function() { | |||
var event = new Event('input',{ | var event = new Event('input',{ | ||
bubbles: !0, | bubbles: !0, | ||
第9行: | 第10行: | ||
checkbox.dispatchEvent(event); | checkbox.dispatchEvent(event); | ||
}); | }); | ||
} | |||
if (mw.config.get('wgPageName') === "小可_·_Wiki") { | if (mw.config.get('wgPageName') === "小可_·_Wiki") { | ||
第20行: | 第22行: | ||
}) | }) | ||
} | } | ||
/** 顶部公告 **/ | |||
/* From wjghj.cn under CC BY-NC-SA 4.0*/ | |||
function siteNoticeScroll(obj,interval) { | |||
$(obj).animate({ | |||
height: 'show', | |||
paddingTop: 'show', | |||
marginTop: 'show', | |||
paddingBottom: 'show', | |||
marginBottom: 'show', | |||
}); | |||
setInterval(function() { | |||
$(obj).find('ul:first').animate({ | |||
marginTop: '-25px' | |||
}, | |||
300, | |||
function() { | |||
$(this).css({ | |||
marginTop: '0px', | |||
}).find('li:first').appendTo(this); | |||
}); | |||
}, | |||
interval); | |||
} | |||
siteNoticeScroll('.siteNoticeScroll',5000); |
2021年6月13日 (日) 02:35的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
try {
document.getElementById('skin-citizen-search-trigger').addEventListener('click', function() {
var event = new Event('input',{
bubbles: !0,
composed: !0
})
, checkbox = document.getElementById('search-checkbox');
checkbox.checked = !0;
checkbox.dispatchEvent(event);
});
}
if (mw.config.get('wgPageName') === "小可_·_Wiki") {
$.ajax('https://api.github.com/repos/Teahouse-Studios/bot/commits').then(function (res) {
var hash = res[0].sha
var shortHash = hash.slice(0, 6)
$('.commit-hash:not(commit-hash-short)').text(hash)
$('.commit-hash.commit-hash-short').text(shortHash)
}).catch(function () {
$('.commit-hash').text('???')
})
}
/** 顶部公告 **/
/* From wjghj.cn under CC BY-NC-SA 4.0*/
function siteNoticeScroll(obj,interval) {
$(obj).animate({
height: 'show',
paddingTop: 'show',
marginTop: 'show',
paddingBottom: 'show',
marginBottom: 'show',
});
setInterval(function() {
$(obj).find('ul:first').animate({
marginTop: '-25px'
},
300,
function() {
$(this).css({
marginTop: '0px',
}).find('li:first').appendTo(this);
});
},
interval);
}
siteNoticeScroll('.siteNoticeScroll',5000);