MediaWiki:Common.js:修订间差异
(创建页面,内容为“→这里的任何JavaScript将为所有用户在每次页面加载时加载。: // 确保一定生效 setTimeout(function(){ // 模板按钮的click事件初始化 Array.from(document.getElementsByClassName('template-btn-container')).forEach(function(element) { element.addEventListener('click', function(e) { e.stopPropagation(); var temp = this, link = this.getAttribute('data-link') || ''; if(link.indexOf('http:') ||…”) |
(没有差异)
|
2024年5月13日 (一) 10:26的版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
// 确保一定生效
setTimeout(function(){
// 模板按钮的click事件初始化
Array.from(document.getElementsByClassName('template-btn-container')).forEach(function(element) {
element.addEventListener('click', function(e) {
e.stopPropagation();
var temp = this, link = this.getAttribute('data-link') || '';
if(link.indexOf('http:') || link.indexOf('https:')){
window.open(link, '_blank');
}else{
window.ope
n('http://10.160.16.71:6690/index.php/' + link, '_blank');
}
});
});
console.log('js init~')
}, 300)