跳转到内容

MediaWiki:Common.js:修订间差异

来自中文精神分析知识库
Maintenance script​(留言 | 贡献)
移动端不新开标签
Maintenance script​(留言 | 贡献)
修移动端检测
第1行: 第1行:
/* 内容区链接在新窗口打开(仅桌面端,移动端不新开标签) */
/* 内容区链接在新窗口打开(仅桌面端) */
$( function () {
$( function () {
     if ( window.innerWidth > 720 ) {
     var isMobile = /Android|iPhone|iPad|iPod|Mobile/i.test( navigator.userAgent ) || window.innerWidth <= 720;
    if ( !isMobile ) {
         $( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
         $( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
     }
     }
} );
} );

2026年10月11日 (日) 00:43的版本

/* 内容区链接在新窗口打开(仅桌面端) */
$( function () {
    var isMobile = /Android|iPhone|iPad|iPod|Mobile/i.test( navigator.userAgent ) || window.innerWidth <= 720;
    if ( !isMobile ) {
        $( '#bodyContent a, #content a' ).attr( 'target', '_blank' );
    }
} );