src/widgets/Segments.js
changeset 993 a7efd386872a
parent 990 6a90c96f0b4c
child 994 d18d6b9e1078
equal deleted inserted replaced
992:566b590aaf8f 993:a7efd386872a
    20     '<div class="Ldt-Segments-List"></div>'
    20     '<div class="Ldt-Segments-List"></div>'
    21     + '<div class="Ldt-Segments-Position"></div>'
    21     + '<div class="Ldt-Segments-Position"></div>'
    22     + '<div class="Ldt-Segments-Tooltip"></div>';
    22     + '<div class="Ldt-Segments-Tooltip"></div>';
    23 
    23 
    24 IriSP.Widgets.Segments.prototype.annotationTemplate =
    24 IriSP.Widgets.Segments.prototype.annotationTemplate =
    25     '<div class="Ldt-Segments-Segment Ldt-TraceMe" trace-info="segment-id:{{id}}, media-id:{{media_id}}, from:{{from}}, to:{{to}}" segment-text="{{text}}"'
    25     '<div class="Ldt-Segments-Segment Ldt-TraceMe" draggable="true" trace-info="segment-id:{{id}}, media-id:{{media_id}}, from:{{from}}, to:{{to}}" segment-text="{{text}}"'
    26     + 'style="top:{{top}}px; height:{{height}}px; left:{{left}}px; width:{{width}}px; background:{{medcolor}}" data-base-color="{{color}}" data-low-color="{{lowcolor}}" data-medium-color="{{medcolor}}"></div>'
    26     + 'style="top:{{top}}px; height:{{height}}px; left:{{left}}px; width:{{width}}px; background:{{medcolor}}" data-base-color="{{color}}" data-low-color="{{lowcolor}}" data-medium-color="{{medcolor}}"></div>'
    27 
    27 
    28 
    28 
    29 IriSP.Widgets.Segments.prototype.draw = function() {
    29 IriSP.Widgets.Segments.prototype.draw = function() {
    30     this.onMediaEvent("timeupdate", "onTimeupdate");
    30     this.onMediaEvent("timeupdate", "onTimeupdate");
    96                 _annotation.trigger("unselect");
    96                 _annotation.trigger("unselect");
    97             })
    97             })
    98             .click(function() {
    98             .click(function() {
    99                 _annotation.trigger("click");
    99                 _annotation.trigger("click");
   100             })
   100             })
       
   101             .on("dragstart", function(e) {
       
   102 	    	var url = (typeof _annotation.url !== "undefined" 
       
   103 	                ? _annotation.url
       
   104 	                : (document.location.href.replace(/#.*$/,'') + '#id='  + _annotation.id));
       
   105 	        	e.originalEvent.dataTransfer.setData("text/x-iri-title",_annotation.title);
       
   106 	        	e.originalEvent.dataTransfer.setData("text/x-iri-description",_annotation.description);
       
   107 	        	e.originalEvent.dataTransfer.setData("text/x-iri-uri",url);
       
   108 	        })
   101             .appendTo(list_$)
   109             .appendTo(list_$)
   102         _annotation.on("select", function() {
   110         _annotation.on("select", function() {
   103             _this.$segments.each(function() {
   111             _this.$segments.each(function() {
   104                 var _segment = IriSP.jQuery(this);
   112                 var _segment = IriSP.jQuery(this);
   105                 _segment.css({
   113                 _segment.css({