Use better align change descriptions

Adds support for align=none.

Also don't show changes from class names.

Change-Id: Ia00a51dd52af73183e98c8a87f4c60ee5380d81f
Depends-On: Ic668454c4b4b069dab46a608530c85a5bb7e7ad8
This commit is contained in:
Ed Sanders 2018-05-14 12:55:31 +01:00 committed by Jforrester
parent 1184f9acf1
commit 7254fbe2cf
2 changed files with 19 additions and 8 deletions

View file

@ -983,6 +983,11 @@
"visualeditor",
"visualeditor-aliencontextitem-title",
"visualeditor-aliennode-tooltip",
"visualeditor-align-desc-center",
"visualeditor-align-desc-default",
"visualeditor-align-desc-left",
"visualeditor-align-desc-none",
"visualeditor-align-desc-right",
"visualeditor-align-widget-center",
"visualeditor-align-widget-default",
"visualeditor-align-widget-left",

View file

@ -147,14 +147,20 @@ ve.dm.MWImageNode.static.describeChanges = function ( attributeChanges, attribut
};
ve.dm.MWImageNode.static.describeChange = function ( key, change ) {
if ( key === 'align' ) {
return ve.msg( 'visualeditor-changedesc-align',
// Messages used:
// visualeditor-align-widget-left, visualeditor-align-widget-right,
// visualeditor-align-widget-center, visualeditor-align-widget-default
ve.msg( 'visualeditor-align-widget-' + change.from ),
ve.msg( 'visualeditor-align-widget-' + change.to )
);
switch ( key ) {
case 'align':
return ve.msg( 'visualeditor-changedesc-align',
// Messages used:
// visualeditor-align-desc-left, visualeditor-align-desc-right,
// visualeditor-align-desc-center, visualeditor-align-desc-default,
// visualeditor-align-desc-none
ve.msg( 'visualeditor-align-desc-' + change.from ),
ve.msg( 'visualeditor-align-desc-' + change.to )
);
case 'originalClasses':
case 'unrecognizedClasses':
return;
// TODO: Handle valign
}
// Parent method
return ve.dm.Node.static.describeChange.apply( this, arguments );