ve.dm.MWImageNode#describeChanges: Ignore borderImage noise from the model

Also follow-up 335b56728a by adding the visualeditor-changedesc-align
i18n which was missed.

Change-Id: I801f66c0028f71cf2cdbcb8f1675ba1f5a3cde31
This commit is contained in:
James D. Forrester 2017-03-22 17:28:41 -07:00
parent 048aaa7fb4
commit c70526f0a2
2 changed files with 8 additions and 0 deletions

View file

@ -1789,6 +1789,7 @@
"diffMatchPatch"
],
"messages": [
"visualeditor-changedesc-align",
"visualeditor-changedesc-changed",
"visualeditor-changedesc-image-size",
"visualeditor-changedesc-language",

View file

@ -91,6 +91,10 @@ ve.dm.MWImageNode.static.describeChanges = function ( attributeChanges, attribut
}
for ( key in attributeChanges ) {
if ( customKeys.indexOf( key ) === -1 ) {
if ( key === 'borderImage' && !attributeChanges.borderImage.from && !attributeChanges.borderImage.to ) {
// Skip noise from the data model
continue;
}
change = this.describeChange( key, attributeChanges[ key ] );
descriptions.push( change );
}
@ -101,6 +105,9 @@ 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 )
);