MediaWiki:Common.js:修订间差异

勤求古训,博采众方
删除的内容 添加的内容
撤销鹿野耕云讨论)的版本26693
标签撤销
无编辑摘要
第21行: 第21行:
s.parentNode.insertBefore(hm, s);
s.parentNode.insertBefore(hm, s);
})();
})();



if ( $.inArray( mw.config.get( 'wgCanonicalSpecialPageName' ), ['Upload']) != -1 ) {
$( 'legend:nth(1)' ).wrapInner( '<a href="#" />' )
.click( function( e ) {
e.preventDefault(); // avoid jumping to the top (href=#)
$( '#mw-htmlform-description' ).toggle( 'fast' );
} )
$( '#mw-htmlform-description' ).delay( 500 ).hide( 'slow' ); // Hide by default, but delayed for to give other elements time to expand first

$( 'legend:nth(2)' ).wrapInner( '<a href="#" />' )
.click( function( e ) {
e.preventDefault(); // avoid jumping to the top (href=#)
$( '#mw-htmlform-options' ).toggle( 'fast' );
} )
$( '#mw-htmlform-options' ).hide( ); // Hide by default
}

2022年12月12日 (一) 17:43的版本

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

/* 随系统切换暗黑模式。 */
window.wpDarkModeAutoToggle = true;

/* UTC时钟使用本地时区。 */
window.LiveClockTimeZone = 'Asia/Shanghai';

/* 优化 */
if (location.pathname === '/') {
	history.replaceState({}, document.title, 'Index');
}


/* 百度统计代码 */
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?1d1f417946fa19c604c8a03880f407ed";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();



if ( $.inArray( mw.config.get( 'wgCanonicalSpecialPageName' ), ['Upload']) != -1 ) {
 
    $( 'legend:nth(1)' ).wrapInner( '<a href="#" />' )
        .click( function( e ) {
            e.preventDefault(); // avoid jumping to the top (href=#)
            $( '#mw-htmlform-description' ).toggle( 'fast' );
        } )
    $( '#mw-htmlform-description' ).delay( 500 ).hide( 'slow' );  // Hide by default, but delayed for to give other elements time to expand first

    $( 'legend:nth(2)' ).wrapInner( '<a href="#" />' )
        .click( function( e ) {
            e.preventDefault(); // avoid jumping to the top (href=#)
            $( '#mw-htmlform-options' ).toggle( 'fast' );
        } )
    $( '#mw-htmlform-options' ).hide( );  // Hide by default
}