equal
deleted
inserted
replaced
1 // TODO: Migrate Timeupdate functions to Extract |
1 // TODO: Migrate Timeupdate functions to Extract |
2 import annotationStyles from "./Annotation.module.css"; |
2 import annotationStyles from "./Annotation.module.css"; |
|
3 |
|
4 import jQuery from "jquery"; |
3 |
5 |
4 // Annotation class |
6 // Annotation class |
5 const Annotation = function (ns) { |
7 const Annotation = function (ns) { |
6 return class extends ns.Widgets.Widget { |
8 return class extends ns.Widgets.Widget { |
7 constructor(player, config) { |
9 constructor(player, config) { |
130 "Ldt-Annotation-EmptyBlock" |
132 "Ldt-Annotation-EmptyBlock" |
131 ); |
133 ); |
132 _tags.forEach(function (_tag) { |
134 _tags.forEach(function (_tag) { |
133 var _trimmedTitle = _tag.title.replace(/(^\s+|\s+$)/g, ""); |
135 var _trimmedTitle = _tag.title.replace(/(^\s+|\s+$)/g, ""); |
134 if (_trimmedTitle) { |
136 if (_trimmedTitle) { |
135 var _el = IriSP.jQuery( |
137 var _el = jQuery( |
136 '<li class="Ldt-Annotation-TagLabel"></li>' |
138 '<li class="Ldt-Annotation-TagLabel"></li>' |
137 ).append(IriSP.jQuery("<span>").text(_trimmedTitle)); |
139 ).append(jQuery("<span>").text(_trimmedTitle)); |
138 _el.click(function () { |
140 _el.on("click",function () { |
139 if (_this.search_on_tag_click) { |
141 if (_this.search_on_tag_click) { |
140 _this.source.getAnnotations().search(_trimmedTitle); |
142 _this.source.getAnnotations().search(_trimmedTitle); |
141 } |
143 } |
142 _tag.trigger("click"); |
144 _tag.trigger("click"); |
143 }); |
145 }); |