打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

MediaWiki:Common.js:修订间差异

MediaWiki界面页面
更多语言
Admin留言 | 贡献
创建页面,内容为“这里的任何JavaScript将为所有用户在每次页面加载时加载。:​ mw.loader.using( "mediawiki.util" ).then( function () { var link = document.getElementById( "authorpages-link" ); if ( !link ) { return; } // Try the standard footer id used by many skins. var lastmod = document.getElementById( "footer-info-lastmod" ); if ( lastmod ) { // Move the link right after the last-modified block. var wra…”
(没有差异)

2025年11月22日 (六) 23:44的版本

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

mw.loader.using( "mediawiki.util" ).then( function () {
    var link = document.getElementById( "authorpages-link" );
    if ( !link ) {
        return;
    }

    // Try the standard footer id used by many skins.
    var lastmod = document.getElementById( "footer-info-lastmod" );

    if ( lastmod ) {
        // Move the link right after the last-modified block.
        var wrapper = document.createElement( "div" );
        wrapper.id = "authorpages-under-lastmod";
        wrapper.appendChild( link );
        lastmod.parentNode.insertBefore( wrapper, lastmod.nextSibling );
        return;
    }

    // Fallback for Citizen: try to find a footer / page-info area.
    var footer = document.querySelector( ".citizen-page-info" ) || document.querySelector( "footer" );
    if ( !footer ) {
        return;
    }

    // Try to find a text node containing "Last modified" or "last edited".
    var nodes = footer.childNodes;
    for ( var i = 0; i < nodes.length; i++ ) {
        var node = nodes[ i ];
        if ( node.nodeType === Node.TEXT_NODE &&
            /(Last modified|last edited)/i.test( node.textContent ) ) {

            var span = document.createElement( "div" );
            span.id = "authorpages-under-lastmod";
            span.appendChild( link );
            footer.insertBefore( span, node.nextSibling );
            break;
        }
    }
} );