src/widgets/Annotation.js
author ymh <ymh.work@gmail.com>
Thu, 17 Oct 2024 00:58:24 +0200
changeset 1073 687133dc13cf
parent 1072 ac1eacb3aa33
permissions -rw-r--r--
Add VideojsPlayer for handling youtube and vimeo
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
924
64c2eaafe5e2 Modifications for LDT-Platform
veltr
parents: 923
diff changeset
     1
// TODO: Migrate Timeupdate functions to Extract
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
     2
import annotationStyles from "./Annotation.module.css";
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
     3
1073
687133dc13cf Add VideojsPlayer for handling youtube and vimeo
ymh <ymh.work@gmail.com>
parents: 1072
diff changeset
     4
import jQuery from "jquery";
687133dc13cf Add VideojsPlayer for handling youtube and vimeo
ymh <ymh.work@gmail.com>
parents: 1072
diff changeset
     5
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
     6
// Annotation class
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
     7
const Annotation = function (ns) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
     8
  return class extends ns.Widgets.Widget {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
     9
    constructor(player, config) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    10
      super(player, config);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    11
      this.lastAnnotation = false;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    12
      this.minimized = this.start_minimized || false;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    13
      this.bounds = [0, 0];
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    14
    }
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    15
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    16
    static messages =  {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    17
      fr: {
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    18
        watching: "Je regarde ",
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    19
        on_site: " sur ",
1002
a86208b60c91 Bugfixes and changes for MDComposer
veltr
parents: 996
diff changeset
    20
        tags_: "Mots-clés\u00a0:",
a86208b60c91 Bugfixes and changes for MDComposer
veltr
parents: 996
diff changeset
    21
        description_: "Description\u00a0:",
1009
ddbe31de8ad1 Added Creator to the Annotation Widget
veltr
parents: 1007
diff changeset
    22
        creator_: "Créé par\u00a0:",
1002
a86208b60c91 Bugfixes and changes for MDComposer
veltr
parents: 996
diff changeset
    23
        excerpt_from: "Extrait de\u00a0:",
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    24
        untitled: "Segment sans titre",
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    25
      },
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    26
      en: {
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    27
        watching: "I'm watching ",
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    28
        on_site: " on ",
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
    29
        tags_: "Keywords:",
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
    30
        description_: "Description:",
1009
ddbe31de8ad1 Added Creator to the Annotation Widget
veltr
parents: 1007
diff changeset
    31
        creator_: "Created by\u00a0:",
982
cfcbac34d020 Added Multi Segments Widget
veltr
parents: 965
diff changeset
    32
        excerpt_from: "Excerpt from:",
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    33
        untitled: "Untitled segment",
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    34
      },
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    35
    };
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    36
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    37
    static template =
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    38
      '{{#show_arrow}}<div class="Ldt-Annotation-Arrow"></div>{{/show_arrow}}' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    39
      '<div class="Ldt-Annotation-Widget {{^show_arrow}}Ldt-Annotation-ShowTop{{/show_arrow}}">' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    40
      '<div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}">' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    41
      '<div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    42
      '{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    43
      '<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<a class="Ldt-Annotation-Title" href="#"></a> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    44
      '(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    45
      '<h3 class="Ldt-Annotation-MashupOrigin Ldt-Annotation-HiddenWhenEmpty">{{l10n.excerpt_from}} <span class="Ldt-Annotation-MashupMedia"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    46
      '(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    47
      '<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Creator-Block"><div class="Ldt-Annotation-Label">{{l10n.creator_}}</div>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    48
      '{{#show_creator}}<p class="Ldt-Annotation-Labelled Ldt-Annotation-Creator"></p></div>{{/show_creator}}' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    49
      '{{#show_description}}<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Description-Block"><div class="Ldt-Annotation-Label">{{l10n.description_}}</div>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    50
      '<p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>{{/show_description}}' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    51
      '<div class="Ldt-Annotation-Tags-Block Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Cleared">' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    52
      '<div class="Ldt-Annotation-Label">{{l10n.tags_}}</div><ul class="Ldt-Annotation-Labelled Ldt-Annotation-Tags"></ul>' +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    53
      "</div></div></div></div>";
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    54
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    55
    static defaults = {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    56
      annotation_type: "chap",
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    57
      start_minimized: false,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    58
      show_arrow: true,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    59
      show_creator: true,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    60
      show_description: true,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    61
      arrow_position: 0.5,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    62
      site_name: "Lignes de Temps",
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    63
      search_on_tag_click: true,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    64
      show_social: true,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    65
      show_annotation_type: false,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    66
    };
876
03967b6ada7c ArrowWidget, AnnotationWidget
veltr
parents:
diff changeset
    67
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    68
    draw() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    69
      var _this = this,
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
    70
        currentAnnotation;
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    71
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    72
      function timeupdate(_time) {
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
    73
        var _list = _this.getWidgetAnnotationsAtTime();
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
    74
        if (!_list.length) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    75
          _this.$.find(".Ldt-Annotation-Inner").addClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    76
            "Ldt-Annotation-Empty"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    77
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    78
          if (_this.arrow) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    79
            _this.arrow.moveToTime(_time);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    80
          }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    81
          _this.bounds = [_time, _time];
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    82
          _this.sendBounds();
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
    83
        }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    84
      }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    85
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    86
      function highlightTitleAndDescription() {
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
    87
        if (!currentAnnotation) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    88
          return;
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
    89
        }
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
    90
        var title = currentAnnotation.title,
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    91
          description = currentAnnotation.description.replace(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    92
            /(^\s+|\s+$)/g,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    93
            ""
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    94
          ),
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    95
          rx = currentAnnotation.found
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    96
            ? _this.source.getAnnotations().regexp || false
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    97
            : false;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    98
        _this.$.find(".Ldt-Annotation-Title").html(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
    99
          IriSP.textFieldHtml(title, rx) || "(" + _this.l10n.untitled + ")"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   100
        );
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
   101
        if (description) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   102
          _this.$.find(".Ldt-Annotation-Description-Block").removeClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   103
            "Ldt-Annotation-EmptyBlock"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   104
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   105
          _this.$.find(".Ldt-Annotation-Description").html(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   106
            IriSP.textFieldHtml(description, rx)
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   107
          );
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
   108
        } else {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   109
          _this.$.find(".Ldt-Annotation-Description-Block").addClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   110
            "Ldt-Annotation-EmptyBlock"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   111
          );
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
   112
        }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   113
      }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   114
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   115
      function drawAnnotation(_annotation) {
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
   116
        currentAnnotation = _annotation;
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   117
        var _url =
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   118
            typeof _annotation.url !== "undefined"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   119
              ? _annotation.url
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   120
              : document.location.href.replace(/#.*$/, "") +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   121
                "#id=" +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   122
                _annotation.id,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   123
          _text =
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   124
            _this.l10n.watching +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   125
            _annotation.title +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   126
            (_this.site_name ? _this.l10n.on_site + _this.site_name : ""),
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   127
          _tags = _annotation.getTags(),
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   128
          _tagblock = _this.$.find(".Ldt-Annotation-Tags");
985
9859c4bae904 Corrected repeating tags bugs
veltr
parents: 983
diff changeset
   129
        _tagblock.empty();
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   130
        if (_tags.length) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   131
          _this.$.find(".Ldt-Annotation-Tags-Block").removeClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   132
            "Ldt-Annotation-EmptyBlock"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   133
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   134
          _tags.forEach(function (_tag) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   135
            var _trimmedTitle = _tag.title.replace(/(^\s+|\s+$)/g, "");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   136
            if (_trimmedTitle) {
1073
687133dc13cf Add VideojsPlayer for handling youtube and vimeo
ymh <ymh.work@gmail.com>
parents: 1072
diff changeset
   137
              var _el = jQuery(
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   138
                '<li class="Ldt-Annotation-TagLabel"></li>'
1073
687133dc13cf Add VideojsPlayer for handling youtube and vimeo
ymh <ymh.work@gmail.com>
parents: 1072
diff changeset
   139
              ).append(jQuery("<span>").text(_trimmedTitle));
687133dc13cf Add VideojsPlayer for handling youtube and vimeo
ymh <ymh.work@gmail.com>
parents: 1072
diff changeset
   140
              _el.on("click",function () {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   141
                if (_this.search_on_tag_click) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   142
                  _this.source.getAnnotations().search(_trimmedTitle);
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   143
                }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   144
                _tag.trigger("click");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   145
              });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   146
              _tagblock.append(_el);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   147
            }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   148
          });
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   149
        } else {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   150
          _this.$.find(".Ldt-Annotation-Tags-Block").addClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   151
            "Ldt-Annotation-EmptyBlock"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   152
          );
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   153
        }
983
97fef7a4b189 updated search
veltr
parents: 982
diff changeset
   154
        highlightTitleAndDescription();
1009
ddbe31de8ad1 Added Creator to the Annotation Widget
veltr
parents: 1007
diff changeset
   155
        if (_this.show_creator) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   156
          _this.$.find(".Ldt-Annotation-Creator").text(_annotation.creator);
1009
ddbe31de8ad1 Added Creator to the Annotation Widget
veltr
parents: 1007
diff changeset
   157
        }
982
cfcbac34d020 Added Multi Segments Widget
veltr
parents: 965
diff changeset
   158
        if (_this.show_annotation_type) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   159
          _this.$.find(".Ldt-Annotation-Type").text(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   160
            _annotation.getAnnotationType().title
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   161
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   162
          _this.$.find(".Ldt-Annotation-Type").attr(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   163
            "title",
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   164
            _annotation.getAnnotationType().description
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   165
          );
982
cfcbac34d020 Added Multi Segments Widget
veltr
parents: 965
diff changeset
   166
        }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   167
        _this.$.find(".Ldt-Annotation-Begin").text(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   168
          _annotation.begin.toString()
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   169
        );
982
cfcbac34d020 Added Multi Segments Widget
veltr
parents: 965
diff changeset
   170
        _this.$.find(".Ldt-Annotation-End").text(_annotation.end.toString());
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   171
        if (_annotation.elementType === "mashedAnnotation") {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   172
          _this.$.find(".Ldt-Annotation-Inner").addClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   173
            "Ldt-Annotation-isMashup"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   174
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   175
          _this.$.find(".Ldt-Annotation-MashupMedia").text(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   176
            _annotation.getMedia().title
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   177
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   178
          _this.$.find(".Ldt-Annotation-MashupBegin").text(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   179
            _annotation.annotation.begin.toString()
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   180
          );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   181
          _this.$.find(".Ldt-Annotation-MashupEnd").text(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   182
            _annotation.annotation.end.toString()
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   183
          );
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   184
        } else {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   185
          _this.$.find(".Ldt-Annotation-Inner").removeClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   186
            "Ldt-Annotation-isMashup"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   187
          );
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   188
        }
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   189
        if (typeof _this.socialWidget !== "undefined") {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   190
          _this.socialWidget.updateUrls(_url, _text);
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   191
        } else {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   192
          setTimeout(function () {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   193
            if (typeof _this.socialWidget !== "undefined") {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   194
              _this.socialWidget.updateUrls(_url, _text);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   195
            }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   196
          }, 800);
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   197
        }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   198
        _this.$.find(".Ldt-Annotation-Inner").removeClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   199
          "Ldt-Annotation-Empty"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   200
        );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   201
        _this.bounds = [_annotation.begin, _annotation.end];
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   202
        if (_this.arrow) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   203
          _this.arrow.moveToTime(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   204
            (1 - _this.arrow_position) * _annotation.begin +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   205
              _this.arrow_position * _annotation.end
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   206
          );
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   207
        }
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   208
        _this.sendBounds();
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   209
      }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   210
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   211
      this.renderTemplate();
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   212
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   213
      this.$.find(".Ldt-Annotation-Title").click(function () {
1007
639129cf95bc Corrections on Jwplayer
veltr
parents: 1004
diff changeset
   214
        if (currentAnnotation) {
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   215
          _this.media.setCurrentTime(currentAnnotation.begin);
1007
639129cf95bc Corrections on Jwplayer
veltr
parents: 1004
diff changeset
   216
        }
639129cf95bc Corrections on Jwplayer
veltr
parents: 1004
diff changeset
   217
        return false;
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   218
      });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   219
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   220
      if (this.show_social) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   221
        this.insertSubwidget(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   222
          this.$.find(".Ldt-Annotation-Social"),
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   223
          { type: "Social" },
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   224
          "socialWidget"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   225
        );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   226
      }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   227
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   228
      if (this.show_arrow) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   229
        this.insertSubwidget(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   230
          this.$.find(".Ldt-Annotation-Arrow"),
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   231
          { type: "Arrow", width: this.width },
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   232
          "arrow"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   233
        );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   234
      }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   235
      this.onMediaEvent("timeupdate", timeupdate);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   236
      this.onMdpEvent("Annotation.hide", "hide");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   237
      this.onMdpEvent("Annotation.show", "show");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   238
      this.onMdpEvent("Annotation.minimize", "minimize");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   239
      this.onMdpEvent("Annotation.maximize", "maximize");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   240
      this.onMdpEvent("Annotation.getBounds", "sendBounds");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   241
      this.$.find(".Ldt-Annotation-MaxMinButton").click(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   242
        this.functionWrapper("toggleSize")
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   243
      );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   244
      this.$.on("resize", function () {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   245
        _this.width = _this.$.parent().width();
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   246
        _this.$.css({ width: _this.width });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   247
      });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   248
      this.getWidgetAnnotations().forEach(function (_a) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   249
        _a.on("enter", function () {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   250
          drawAnnotation(_a);
965
eadb7290c325 Improvements in widget communication
veltr
parents: 964
diff changeset
   251
        });
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   252
      });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   253
      this.source.getAnnotations().on("found", highlightTitleAndDescription);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   254
      this.source
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   255
        .getAnnotations()
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   256
        .on("not-found", highlightTitleAndDescription);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   257
      this.source
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   258
        .getAnnotations()
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   259
        .on("search-cleared", highlightTitleAndDescription);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   260
      IriSP.attachDndData(this.$.find("h3"), function () {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   261
        return {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   262
          title: currentAnnotation.title,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   263
          description: currentAnnotation.description,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   264
          image: currentAnnotation.thumbnail,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   265
          uri:
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   266
            typeof currentAnnotation.url !== "undefined"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   267
              ? currentAnnotation.url
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   268
              : document.location.href.replace(/#.*$/, "") +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   269
                "#id=" +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   270
                currentAnnotation.id,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   271
          text:
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   272
            "[" +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   273
            currentAnnotation.begin.toString() +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   274
            "] " +
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   275
            currentAnnotation.title,
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   276
        };
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   277
      });
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   278
    }
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
   279
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   280
    sendBounds() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   281
      this.player.trigger("Annotation.boundsChanged", this.bounds);
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   282
    }
880
4c7b33bf2795 Started work on CreateAnnotation and Mediafragment
veltr
parents: 876
diff changeset
   283
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   284
    drawAnnotation(_annotation) {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   285
      this.lastAnnotation = _annotation.id;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   286
    }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   287
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   288
    hide() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   289
      this.$.slideUp();
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   290
    }
880
4c7b33bf2795 Started work on CreateAnnotation and Mediafragment
veltr
parents: 876
diff changeset
   291
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   292
    show() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   293
      this.$.slideDown();
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   294
    }
880
4c7b33bf2795 Started work on CreateAnnotation and Mediafragment
veltr
parents: 876
diff changeset
   295
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   296
    toggleSize() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   297
      if (this.minimized) {
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
   298
        this.maximize();
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   299
      } else {
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
   300
        this.minimize();
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   301
      }
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
   302
    }
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   303
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   304
    minimize() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   305
      this.minimized = true;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   306
      this.$.find(".Ldt-Annotation-Inner").addClass("Ldt-Annotation-Minimized");
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   307
    }
923
b3ee7d1b472a UI improvements
veltr
parents: 922
diff changeset
   308
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   309
    maximize() {
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   310
      this.minimized = false;
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   311
      this.$.find(".Ldt-Annotation-Inner").removeClass(
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   312
        "Ldt-Annotation-Minimized"
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   313
      );
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   314
    }
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   315
  };
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   316
}
880
4c7b33bf2795 Started work on CreateAnnotation and Mediafragment
veltr
parents: 876
diff changeset
   317
1072
ac1eacb3aa33 Migrate source and build to vite.js
ymh <ymh.work@gmail.com>
parents: 1068
diff changeset
   318
export { Annotation , annotationStyles };