mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Merge "Use accesskey=s on the save buttons"
This commit is contained in:
commit
0d2ea63596
|
@ -143,6 +143,7 @@ $wgResourceModules += array(
|
|||
'messages' => array(
|
||||
'accesskey-ca-editsource',
|
||||
'accesskey-ca-ve-edit',
|
||||
'accesskey-save',
|
||||
'pipe-separator',
|
||||
'tooltip-ca-createsource',
|
||||
'tooltip-ca-editsource',
|
||||
|
|
|
@ -216,6 +216,9 @@ ve.init.mw.ViewPageTarget.prototype.deactivate = function ( override ) {
|
|||
) {
|
||||
this.deactivating = true;
|
||||
// User interface changes
|
||||
if ( ve.msg( 'accesskey-save' ) !== '-' && ve.msg( 'accesskey-save' ) !== '' ) {
|
||||
this.elementsThatHadOurAccessKey.attr( 'accesskey', ve.msg( 'accesskey-save' ) );
|
||||
}
|
||||
this.restorePage();
|
||||
this.hideSpinner();
|
||||
this.showTableOfContents();
|
||||
|
@ -1002,6 +1005,13 @@ ve.init.mw.ViewPageTarget.prototype.setupToolbarButtons = function () {
|
|||
// TODO (mattflaschen, 2013-06-27): it would be useful to do this in a more general way, such
|
||||
// as in the ButtonWidget constructor.
|
||||
this.toolbarSaveButton.$element.addClass( 've-ui-toolbar-saveButton' );
|
||||
|
||||
if ( ve.msg( 'accesskey-save' ) !== '-' && ve.msg( 'accesskey-save' ) !== '' ) {
|
||||
// FlaggedRevs tries to use this - it's useless on VE pages because all that stuff gets hidden, but it will still conflict so get rid of it
|
||||
this.elementsThatHadOurAccessKey = $( '[accesskey="' + ve.msg( 'accesskey-save' ) + '"]' ).removeAttr( 'accesskey' );
|
||||
this.toolbarSaveButton.$button.attr( 'accesskey', ve.msg( 'accesskey-save' ) );
|
||||
}
|
||||
|
||||
this.updateToolbarSaveButtonState();
|
||||
|
||||
this.toolbarCancelButton.connect( this, { 'click': 'onToolbarCancelButtonClick' } );
|
||||
|
|
|
@ -360,6 +360,9 @@ ve.ui.MWSaveDialog.prototype.initialize = function () {
|
|||
),
|
||||
'flags': ['constructive']
|
||||
} );
|
||||
if ( ve.msg( 'accesskey-save' ) !== '-' && ve.msg( 'accesskey-save' ) !== '' ) {
|
||||
this.saveButton.$button.attr( 'accesskey', ve.msg( 'accesskey-save' ) );
|
||||
}
|
||||
this.saveButton.connect( this, { 'click': [ 'emit', 'save' ] } );
|
||||
|
||||
// Review button for "save" panel
|
||||
|
|
Loading…
Reference in a new issue