"मीडियाविकि:Gadget-defaultsummaries.js": अवतरणों में अंतर

Content deleted Content added
No edit summary
Update the gadget
 
पंक्ति 11:
*/
 
/* global mediaWikimw, ve */
 
/* eslint-disable no-jquery/no-global-selector */
( function ( $, mw ) { // Wrap with anonymous function
 
( function ( $, mw ) { // Wrap with anonymous function
var $summaryBox = $( '#wpSummary' ),
minorSummaries = [
Line 64 ⟶ 66:
}
 
function insertSummaryOptionsgetSummaryDropdowns( $insertBeforeThis, dropdownWidth ) {
// For convenience, add a dropdown box with some canned edit
// summaries to the form.
Line 75 ⟶ 77:
} );
 
dropdown.$element.css( 'width', dropdownWidth );
dropdown.menu.on( 'select', onSummarySelect );
 
minorDropdown.$element.css( 'width', dropdownWidth );
minorDropdown.menu.on( 'select', onSummarySelect );
 
Line 91 ⟶ 90:
}
}
return dropdown.$element.cssadd( 'width', dropdownWidthminorDropdown.$element );
 
$insertBeforeThis.before( dropdown.$element );
$insertBeforeThis.before( minorDropdown.$element );
}
// VisualEditor
mw.hook( 've.saveDialog.stateChanged' ).add( function () {
var target, $saveOptions, $dropdowns;
// .ve-init-mw-viewPageTarget-saveDialog-checkboxes
if ( $( 'body' ).data( 'wppresent' ) ) {
return; }
}
$( 'body' ).data( 'wppresent', 'true' );
 
Line 108 ⟶ 107:
return;
}
$dropdowns = getSummaryDropdowns();
insertSummaryOptions( $saveOptions );
$saveOptions.before( $dropdowns );
} );
// WikiEditor
$.when( mw.loader.using( 'oojs-ui-core' ), $.ready ).then( function () {
var $dropdowns,
$editCheckboxes = $( '.editCheckboxes' );
 
// If we failed to find the editCheckboxes class
Line 118 ⟶ 119:
return;
}
$dropdowns = getSummaryDropdowns();
insertSummaryOptions( $editCheckboxes, '48%' );
$dropdowns.css( {
width: '48%',
'padding-bottom': '1em'
} );
$editCheckboxes.before( $dropdowns );
} );
}() );
}( jQuery, mediaWiki ) ); // End wrap with anonymous function