--- a/src/js/serializers/ldt_annotate.js Sun Nov 12 22:07:33 2017 +0100
+++ b/src/js/serializers/ldt_annotate.js Wed Sep 04 17:32:50 2024 +0200
@@ -1,10 +1,7 @@
/* ldt_annotate serializer: Used when Putting annotations on the platform */
+import _ from "lodash";
-if (typeof IriSP.serializers === "undefined") {
- IriSP.serializers = {};
-}
-
-IriSP.serializers.ldt_annotate = {
+const ldt_annotate = function(IriSP) { return {
serializeAnnotation : function(_data, _source) {
var _annType = _data.getAnnotationType();
return {
@@ -45,7 +42,7 @@
_source.getAnnotationTypes().push(_anntype);
}
_ann.setAnnotationType(_anntype.id);
- var _tagIds = IriSP._(_anndata.tags).map(function(_title) {
+ var _tagIds = _(_anndata.tags).map(function(_title) {
var _tags = _source.getTags(true).searchByTitle(_title, true);
if (_tags.length) {
var _tag = _tags[0];
@@ -80,6 +77,8 @@
_source.addList('annotation', new IriSP.Model.List(_source.directory));
this.deserializeAnnotation(_data, _source);
}
-};
+}};
+
+export default ldt_annotate;
/* End ldt_annotate serializer */