全站通知:

MediaWiki:Main.js

来自监狱建筑师WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer或Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:Ctrl-F5
console.log('============== Main.js =================');

// 1. set Logo 
logos = document.querySelectorAll('img.pic-logo');
logos[0].src = "https://patchwiki.biligame.com/images/prisonarchitect/c/c9/fx94ov6b5xbh97bcavkv2wu5p3v1fs2.png";
logos[1].src = "https://patchwiki.biligame.com/images/prisonarchitect/c/c9/fx94ov6b5xbh97bcavkv2wu5p3v1fs2.png";

/* --编辑摘要-- */
//参考Wikipedia:MediaWiki:Common.js/edit.js
if (mw.config.get('wgAction') == "edit" || mw.config.get('wgAction') == "submit" || mw.config.get('wgCanonicalSpecialPageName') == 'Search') { 
( function( $, mw ) { $( function() {
    if ( $( '#editform input[name=wpSection]' ).val() === 'new' ) {
        if ( $( '#no-new-title' ).length ) {
            $( '#wpSummary' ).attr( 'disabled', true );
        }
        return;
    }
    $( '#wpSummaryLabel .mw-summary-preset' ).on( 'click', '.mw-summary-preset-item a', function( e ) {
        e.preventDefault();
        var $this = $( this ), summary = $( '#wpSummary' ).val();
        var $item = $this.parent( '.mw-summary-preset-item' );
        summary = summary.replace( /\s+$/g, '' );
        if ( summary != '' ) {
            summary += ' ';
        }
        summary += $item.attr( 'title' ) || $this.text();
        $this.replaceWith( $this.contents() );
        $( '#wpSummary' ).val( summary ).focus();
    } );
} ); } )( jQuery, mediaWiki );
}