Catrope has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/98112


Change subject: Add abstract getAnnotation() method to AnnotationInspector
......................................................................

Add abstract getAnnotation() method to AnnotationInspector

It was relied on, and all subclasses had one, but for some reason
it wasn't defined as an abstract method.

Change-Id: I6d48f8ee666bd339be87744840c6edb4abb56dbf
---
M modules/ve/ui/inspectors/ve.ui.AnnotationInspector.js
1 file changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/12/98112/1

diff --git a/modules/ve/ui/inspectors/ve.ui.AnnotationInspector.js 
b/modules/ve/ui/inspectors/ve.ui.AnnotationInspector.js
index 773e01f..e9b11b2 100644
--- a/modules/ve/ui/inspectors/ve.ui.AnnotationInspector.js
+++ b/modules/ve/ui/inspectors/ve.ui.AnnotationInspector.js
@@ -45,6 +45,23 @@
 /* Methods */
 
 /**
+ * Get the annotation object to apply.
+ *
+ * This method is called when the inspector is closing, and should return the 
annotation to apply
+ * to the text. If this method returns a falsey value like null, no annotation 
will be applied,
+ * but existing annotations won't be removed either.
+ *
+ * @abstract
+ * @returns {ve.dm.Annotation} Annotation to apply
+ * @throws {Error} If not overridden in subclass
+ */
+ve.ui.AnnotationInspector.prototype.getAnnotation = function () {
+       throw new Error(
+               've.ui.AnnotationInspector.getAnnotation not implemented in 
subclass'
+       );
+};
+
+/**
  * Get an annotation object from text.
  *
  * @method

-- 
To view, visit https://gerrit.wikimedia.org/r/98112
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6d48f8ee666bd339be87744840c6edb4abb56dbf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to