mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
MWImageNode: getHashObject -> getHashObjectForRendering
The latter was introduced for this very purpose: defining which attributes affect the rendering (in this case the thumbnail URL). getHashObject should be reserved for making full semantic comparisons. Bonus: Don't distinguish between block/inline images for URL caching purposes. Change-Id: I6e6d2547a0d110f07c4d18b8179c168d8c251059
This commit is contained in:
parent
3d93d195c7
commit
d17121d1f3
|
@ -76,9 +76,14 @@ ve.dm.MWImageNode.static.getRdfa = function ( mediaClass, frameType ) {
|
|||
}[ frameType ];
|
||||
};
|
||||
|
||||
ve.dm.MWImageNode.static.getHashObject = function ( dataElement ) {
|
||||
/**
|
||||
* @inheritdoc ve.dm.GeneratedContentNode
|
||||
*/
|
||||
ve.dm.MWImageNode.static.getHashObjectForRendering = function ( dataElement ) {
|
||||
// "Rendering" is just the URL of the thumbnail, so we only
|
||||
// care about src & dimensions
|
||||
return {
|
||||
type: dataElement.type,
|
||||
type: 'mwImage',
|
||||
resource: dataElement.attributes.resource,
|
||||
width: dataElement.attributes.width,
|
||||
height: dataElement.attributes.height
|
||||
|
|
|
@ -280,7 +280,7 @@ ve.dm.mwExample.MWBlockImage = {
|
|||
{ type: '/mwBlockImage' }
|
||||
],
|
||||
storeItems: {
|
||||
heedc6ea02e1424e1: ve.ce.minImgDataUri
|
||||
h5ca4c84da870e58f: ve.ce.minImgDataUri
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -308,7 +308,7 @@ ve.dm.mwExample.MWInlineImage = {
|
|||
}
|
||||
},
|
||||
storeItems: {
|
||||
h9e4c46abce8374a6: 'http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png'
|
||||
hbb0aeb2b8e907b74: 'http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png'
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue