MediaWiki:Common.js/edit.js
跳至導覽
跳至搜尋
注意:在您發布之後,您可能需要清除瀏覽器快取才能看到變更。
- Firefox或Safari:按住Shift時點擊重新整理,或按Ctrl-F5或Ctrl-R(Mac則為⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac則為⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl時點擊重新整理,或按Ctrl-F5
- Opera:按Ctrl-F5。
( 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 );
} );
} ); } )( jQuery, mediaWiki );