MediaWiki:Common.js:修订间差异

MediaWiki系统消息页面
无编辑摘要
标签已被回退
(测试)
标签手工回退
 
第11行: 第11行:


mw.hook('wikipage.content').add(waitForMathJax);
mw.hook('wikipage.content').add(waitForMathJax);
{
const scrollTextLists = document.querySelectorAll('.scroll-text-list>ul');
setInterval(function() {
for (var i = 0; i < scrollTextLists.length; ++i) {
(function() {
var list = scrollTextLists[i];
if (list.children.length < 2) {
return;
}
var repeat = 5;
var scrollBehavior = setInterval(function() {
if (repeat === 0) {
list.appendChild(list.firstElementChild);
list.style.marginTop = '0px';
clearInterval(scrollBehavior);
return;
}
--repeat
list.style.marginTop = (repeat - 5) * 5 + 'px';
}, 40)
})();
}
}, 10000);
}

2023年8月5日 (六) 14:51的最新版本

/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */

/* SimpleMathJax支持预览设置 */
function waitForMathJax($content) {
  if (typeof MathJax === 'undefined') {
    setTimeout(function () { waitForMathJax($content); }, 1000);
  } else {
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, $content[0]]).execute();
  }
}

mw.hook('wikipage.content').add(waitForMathJax);