跳转到内容

MediaWiki:Common.js:修订间差异

来自中文精神分析知识库
Maintenance script​(留言 | 贡献)
强制刷新
Maintenance script​(留言 | 贡献)
去外观按钮
第5行: 第5行:
         $( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
         $( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
     }
     }
} );// v2
    /* 去掉外观设置按钮 */
    $( '#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 } );
} );