Esanders has uploaded a new change for review.
https://gerrit.wikimedia.org/r/197353
Change subject: Simplify annotation hashes
......................................................................
Simplify annotation hashes
<b>foo</b> is the same as <b>bar</b> for our purposes, so ignore
all but the first node.
Change-Id: I65e72a7434f4a5ec0af1e17567da65b545ac6671
---
M src/dm/ve.dm.Annotation.js
1 file changed, 13 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor
refs/changes/53/197353/1
diff --git a/src/dm/ve.dm.Annotation.js b/src/dm/ve.dm.Annotation.js
index f15cc32..bd7636b 100644
--- a/src/dm/ve.dm.Annotation.js
+++ b/src/dm/ve.dm.Annotation.js
@@ -84,6 +84,19 @@
throw new Error( 've.dm.Annotation subclass must implement
toDomElements' );
};
+/**
+ * @ineritdoc
+ */
+ve.dm.Annotation.static.getHashObject = function ( dataElement ) {
+ return {
+ type: dataElement.type,
+ attributes: dataElement.attributes,
+ // For uniqueness we are only concerned with the first node
+ originalDomElements: dataElement.originalDomElements &&
+ dataElement.originalDomElements[0].cloneNode( false
).outerHTML
+ };
+};
+
/* Methods */
/**
--
To view, visit https://gerrit.wikimedia.org/r/197353
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65e72a7434f4a5ec0af1e17567da65b545ac6671
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits