MediaWiki:Common.js:修订间差异
外观
Maintenance script(留言 | 贡献) 强制刷新 |
Maintenance script(留言 | 贡献) 去外观按钮 |
||
| 第5行: | 第5行: | ||
$( '#bodyContent a, #content a' ).attr( 'target', '_blank' ); | $( '#bodyContent a, #content a' ).attr( 'target', '_blank' ); | ||
} | } | ||
/* 去掉外观设置按钮 */ | |||
$( '#vector-appearance, .vector-appearance, [aria-label="外观"], [aria-label="Appearance"]' ).remove(); | |||
/* 持续监控,JS动态加载的也去掉 */ | |||
var obs = new MutationObserver( function() { | |||
$( '#vector-appearance, .vector-appearance' ).remove(); | |||
} ); | |||
obs.observe( document.body, { childList: true, subtree: true } ); | |||
} ); | |||
2026年10月11日 (日) 02:49的版本
/* 内容区链接在新窗口打开(仅桌面端) */
$( function () {
var isMobile = /Android|iPhone|iPad|iPod|Mobile/i.test( navigator.userAgent ) || window.innerWidth <= 720;
if ( !isMobile ) {
$( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
}
/* 去掉外观设置按钮 */
$( '#vector-appearance, .vector-appearance, [aria-label="外观"], [aria-label="Appearance"]' ).remove();
/* 持续监控,JS动态加载的也去掉 */
var obs = new MutationObserver( function() {
$( '#vector-appearance, .vector-appearance' ).remove();
} );
obs.observe( document.body, { childList: true, subtree: true } );
} );