5 |
5 |
6 |
6 |
7 IriSP.AnnotationsWidget.prototype = new IriSP.Widget(); |
7 IriSP.AnnotationsWidget.prototype = new IriSP.Widget(); |
8 |
8 |
9 IriSP.AnnotationsWidget.prototype.clear = function() { |
9 IriSP.AnnotationsWidget.prototype.clear = function() { |
10 IriSP.jQuery("#Ldt-SaTitle").text(""); |
10 this.selector.find(".Ldt-SaTitle").text(""); |
11 IriSP.jQuery("#Ldt-SaDescription").text(""); |
11 this.selector.find(".Ldt-SaDescription").text(""); |
12 IriSP.jQuery("#Ldt-SaKeywordText").text(""); |
12 this.selector.find(".Ldt-SaKeywordText").text(""); |
13 }; |
13 }; |
14 |
14 |
15 IriSP.AnnotationsWidget.prototype.displayAnnotation = function(annotation) { |
15 IriSP.AnnotationsWidget.prototype.displayAnnotation = function(annotation) { |
16 var title = annotation.content.title; |
16 var title = annotation.content.title; |
17 var description = annotation.content.description; |
17 var description = annotation.content.description; |
18 var keywords = "" // FIXME; |
18 var keywords = "" // FIXME; |
19 var begin = +annotation.begin; |
19 var begin = +annotation.begin; |
20 var end = +annotation.end; |
20 var end = +annotation.end; |
21 var duration = +this._serializer.currentMedia().meta["dc:duration"]; |
21 var duration = +this._serializer.currentMedia().meta["dc:duration"]; |
22 |
22 |
23 IriSP.jQuery("#Ldt-SaTitle").text(title); |
23 this.selector.find(".Ldt-SaTitle").text(title); |
24 IriSP.jQuery("#Ldt-SaDescription").text(description); |
24 this.selector.find(".Ldt-SaDescription").text(description); |
25 IriSP.jQuery("#Ldt-SaKeywordText").text("Mots clefs : "+ keywords); |
|
26 var startPourcent = parseInt(Math.round((begin*1+(end*1-begin*1)/2) / (duration*1)) / 100); |
25 var startPourcent = parseInt(Math.round((begin*1+(end*1-begin*1)/2) / (duration*1)) / 100); |
27 IriSP.jQuery("#Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000); |
26 this.selector.find(".Ldt-Show-Arrow").animate({left:startPourcent+'%'},1000); |
28 //IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000); |
27 //IriSP.jQuery("#"+annotationTempo.id).animate({alpha:'100%'},1000); |
29 |
28 |
30 }; |
29 }; |
31 |
30 |
32 IriSP.AnnotationsWidget.prototype.clearWidget = function() { |
31 IriSP.AnnotationsWidget.prototype.clearWidget = function() { |
33 /* retract the pane between two annotations */ |
32 /* retract the pane between two annotations */ |
34 IriSP.jQuery("#Ldt-SaTitle").text(""); |
33 this.selector.find(".Ldt-SaTitle").text(""); |
35 IriSP.jQuery("#Ldt-SaDescription").text(""); |
34 this.selector.find(".Ldt-SaDescription").text(""); |
36 IriSP.jQuery("#Ldt-SaKeywordText").html(""); |
35 this.selector.find(".Ldt-SaKeywordText").html(""); |
37 IriSP.jQuery('#Ldt-ShowAnnotation').slideUp(); |
36 this.selector.find(".Ldt-ShowAnnotation").slideUp(); |
38 }; |
37 }; |
39 |
38 |
40 IriSP.AnnotationsWidget.prototype.draw = function() { |
39 IriSP.AnnotationsWidget.prototype.draw = function() { |
41 var _this = this; |
40 var _this = this; |
42 |
41 |
43 var annotationMarkup = Mustache.to_html(IriSP.annotationWidget_template, {"share_template" : IriSP.share_template}); |
42 var annotationMarkup = Mustache.to_html(IriSP.annotationWidget_template, {"share_template" : IriSP.share_template}); |
44 IriSP.jQuery("#Ldt-Ligne").append(annotationMarkup); |
43 this.selector.append(annotationMarkup); |
45 |
44 |
46 var annotations = this._serializer._data.annotations; |
45 var annotations = this._serializer._data.annotations; |
47 var i; |
46 var i; |
48 |
47 |
49 for (i in annotations) { |
48 for (i in annotations) { |