MediaWiki:Gadget-noteTAvector.js:修订间差异

勤求古训,博采众方
删除的内容 添加的内容
创建页面,内容为“noteTAvector = ( function() { $( function() { $( 'body.skin-vector .mw-indicator[id^=mw-indicator-noteTA-]' ) .addClass( 'vector-menu' ) .addClass( 'vector-menu-tabs' ) .addClass( 'vectorTabs' ) .removeAttr( 'style' ) .css( 'float', 'left' ) .empty() .each( function() { $( '<a href="#"><span style="padding:1px 3px; background: #d3e3f4; color:#000000;height:85%;">汉</span><span style="paddi…”
 
无编辑摘要
 
第3行: 第3行:
.addClass( 'vector-menu' )
.addClass( 'vector-menu' )
.addClass( 'vector-menu-tabs' )
.addClass( 'vector-menu-tabs' )
.addClass( 'vectorTabs' )
//.addClass( 'vectorTabs' )
.addClass( 'vector-menu-tabs-legacy' )
.removeAttr( 'style' )
.removeAttr( 'style' )
.css( 'float', 'left' )
.css( 'float', 'left' )

2022年12月7日 (三) 20:07的最新版本

noteTAvector = ( function() { $( function() {
    $( 'body.skin-vector .mw-indicator[id^=mw-indicator-noteTA-]' )
        .addClass( 'vector-menu' )
        .addClass( 'vector-menu-tabs' )
        //.addClass( 'vectorTabs' )
        .addClass( 'vector-menu-tabs-legacy' )        
        .removeAttr( 'style' )
        .css( 'float', 'left' )
        .empty()
        .each( function() {
            $( '<a href="#"><span style="padding:1px 3px; background: #d3e3f4; color:#000000;height:85%;">汉</span><span style="padding:1px 3px; background: #e9e9e9; color:#434343;height:85%;">漢</span></a>' )
                .click( function( e ) {
                    e.preventDefault();
                } )
                .wrap( '<ul><li><span></span></li></ul>' )
                .parent().parent().parent().appendTo( this );
        } )
        .insertAfter( '#p-variants' );
} ); } );

mw.hook('wikipage.content').add( function ( $content ) {
    //if ( $( '#p-variants' ).next().hasClass('vectorTabs') ) return;
    $( '#p-variants' ).next().remove(); // Will blink duing load preview, but this will avoid the icon won't removed if the TA template is removed, and avoid repeated click event listener from noteTAViewer.
    setTimeout("noteTAvector();", 1);
});