“MediaWiki:Common.js”的版本间的差异
		
		
		
		
		
		跳到导航
		跳到搜索
		
				
		
		
	
|  (创建页面,内容为“→这里的任何JavaScript将为所有用户在每次页面载入时加载。:  $(self.document).ready(function () {     function Event_Break() { return false; }…”) | |||
| 第15行: | 第15行: | ||
|      }).bind('selectStart', Event_Break).bind('contextmenu', Event_Break); |      }).bind('selectStart', Event_Break).bind('contextmenu', Event_Break); | ||
| }); | }); | ||
| // 官方文档:添加MediaWiki:Common.js: | |||
| 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); | |||
2021年11月3日 (三) 00:08的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
$(self.document).ready(function () {
    function Event_Break() { return false; }
    $(
        'button, .No_Select'
    ).attr('unSelectable', 'on').css({
        '-moz-user-select':         '-moz-none',
        '-khtml-user-select':       'none',
        '-webkit-user-select':      'none',
        '-o-user-select':           'none',
        '-ms-user-select':          'none',
        'user-select':              'none',
        '-webkit-touch-callout':    'none'
    }).bind('selectStart', Event_Break).bind('contextmenu', Event_Break);
});
// 官方文档:添加MediaWiki:Common.js:
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);