src/widgets/Annotation.js
changeset 993 a7efd386872a
parent 988 eefd336335f9
child 994 d18d6b9e1078
equal deleted inserted replaced
992:566b590aaf8f 993:a7efd386872a
    32     '{{#show_arrow}}<div class="Ldt-Annotation-Arrow"></div>{{/show_arrow}}'
    32     '{{#show_arrow}}<div class="Ldt-Annotation-Arrow"></div>{{/show_arrow}}'
    33     + '<div class="Ldt-Annotation-Widget {{^show_arrow}}Ldt-Annotation-ShowTop{{/show_arrow}}">'
    33     + '<div class="Ldt-Annotation-Widget {{^show_arrow}}Ldt-Annotation-ShowTop{{/show_arrow}}">'
    34     + '<div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}">'
    34     + '<div class="Ldt-Annotation-Inner Ldt-Annotation-Empty{{#start_minimized}} Ldt-Annotation-Minimized{{/start_minimized}}">'
    35     + '<div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>'
    35     + '<div class="Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-MaxMinButton"></div>'
    36     + '{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}'
    36     + '{{#show_social}}<div class="Ldt-Annotation-Social Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty"></div>{{/show_social}}'
    37     + '<h3 class="Ldt-Annotation-HiddenWhenEmpty">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<span class="Ldt-Annotation-Title"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">'
    37     + '<h3 class="Ldt-Annotation-HiddenWhenEmpty" draggable="true">{{#show_annotation_type}}<span class="Ldt-Annotation-Type"></span> » {{/show_annotation_type}}<span class="Ldt-Annotation-Title"></span> <span class="Ldt-Annotation-Time Ldt-Annotation-HiddenWhenMinimized">'
    38     + '(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3>'
    38     + '(<span class="Ldt-Annotation-Begin"></span> - <span class="Ldt-Annotation-End"></span>)</span></h3>'
    39     + '<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">'
    39     + '<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">'
    40     + '(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3>'
    40     + '(<span class="Ldt-Annotation-MashupBegin"></span> - <span class="Ldt-Annotation-MashupEnd"></span>)</span></h3>'
    41     + '<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Description-Block"><div class="Ldt-Annotation-Label">{{l10n.description_}}</div>'
    41     + '<div class="Ldt-Annotation-Cleared Ldt-Annotation-HiddenWhenMinimized Ldt-Annotation-HiddenWhenEmpty Ldt-Annotation-Description-Block"><div class="Ldt-Annotation-Label">{{l10n.description_}}</div>'
    42     + '<p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>'
    42     + '<p class="Ldt-Annotation-Labelled Ldt-Annotation-Description"></p></div>'
   165         });
   165         });
   166     });
   166     });
   167     this.source.getAnnotations().on("found", highlightTitleAndDescription);
   167     this.source.getAnnotations().on("found", highlightTitleAndDescription);
   168     this.source.getAnnotations().on("not-found", highlightTitleAndDescription);
   168     this.source.getAnnotations().on("not-found", highlightTitleAndDescription);
   169     this.source.getAnnotations().on("search-cleared", highlightTitleAndDescription);
   169     this.source.getAnnotations().on("search-cleared", highlightTitleAndDescription);
       
   170     this.$.find("[draggable]").on("dragstart", function(e) {
       
   171     	var url = (typeof currentAnnotation.url !== "undefined" 
       
   172                 ? currentAnnotation.url
       
   173                 : (document.location.href.replace(/#.*$/,'') + '#id='  + currentAnnotation.id));
       
   174     	e.originalEvent.dataTransfer.setData("text/x-iri-title",currentAnnotation.title);
       
   175     	e.originalEvent.dataTransfer.setData("text/x-iri-description",currentAnnotation.description);
       
   176     	e.originalEvent.dataTransfer.setData("text/x-iri-uri",url);
       
   177     });
   170 }
   178 }
   171 
   179 
   172 IriSP.Widgets.Annotation.prototype.sendBounds = function() {
   180 IriSP.Widgets.Annotation.prototype.sendBounds = function() {
   173     this.player.trigger("Annotation.boundsChanged",this.bounds);
   181     this.player.trigger("Annotation.boundsChanged",this.bounds);
   174 }
   182 }