MediaWiki:Common.js:修订间差异
无编辑摘要 |
无编辑摘要 |
||
| 第19行: | 第19行: | ||
}) | }) | ||
console.log('js init~') | console.log('js init~') | ||
}, 300) | }, 300) | ||
2024年5月14日 (二) 15:25的版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
// 加载bootstrap
mw.loader.load("https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-grid.min.css", "text/css");
//mw.loader.load("https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js", "text/javascript");
// 确保一定生效
setTimeout(function(){
var tempBtns = $('.template-btn-container');
// 模板 - 按钮的click事件初始化
tempBtns.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.open('/index.php/' + link, '_blank');
}
})
console.log('js init~')
}, 300)