| author | durandn |
| Fri, 03 Jul 2015 17:01:35 +0200 | |
| changeset 1041 | 423a8c6f9c4d |
| child 1046 | eb77616c245f |
| permissions | -rw-r--r-- |
|
1041
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
1 |
/* Widget that displays the last annotation that was posted, optionally for current segment, optionally for a given username */ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
2 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
3 |
IriSP.Widgets.LatestAnnotation = function(player, config){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
4 |
IriSP.Widgets.Widget.call(this, player, config); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
5 |
}; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
6 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
7 |
IriSP.Widgets.LatestAnnotation.prototype = new IriSP.Widgets.Widget(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
8 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
9 |
IriSP.Widgets.LatestAnnotation.prototype.defaults = { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
10 |
from_user: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
11 |
filter_by_segment: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
12 |
segments_annotation_type: "chap", |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
13 |
hide_without_segment: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
14 |
annotation_type: "contribution", |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
15 |
/* |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
16 |
* Set to a username if you only want to display annotations from a given user |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
17 |
*/ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
18 |
show_only_annotation_from_user: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
19 |
empty_message: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
20 |
starts_hidden: false, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
21 |
}; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
22 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
23 |
IriSP.Widgets.LatestAnnotation.prototype.template = |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
24 |
"<div class='Ldt-LatestAnnotation'>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
25 |
+ "</div>"; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
26 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
27 |
IriSP.Widgets.LatestAnnotation.prototype.annotationTemplate = |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
28 |
"<div class='Ldt-LatestAnnotation-Box'>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
29 |
+ " <div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-CreationDate'>{{{annotation_created}}}</div>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
30 |
+ " <div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Title'>{{{annotation_creator}}}{{#annotation_title}}: {{{annotation_title}}}{{/annotation_title}}</div>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
31 |
+ " <div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-Content'>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
32 |
+ "{{{annotation_content}}}" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
33 |
+ " </div>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
34 |
+ "</div>" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
35 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
36 |
IriSP.Widgets.LatestAnnotation.prototype.draw = function(){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
37 |
var _this = this; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
38 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
39 |
this.renderTemplate(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
40 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
41 |
this.annotationContainer_$ = this.$.find('.Ldt-LatestAnnotation'); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
42 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
43 |
this.onMediaEvent("timeupdate", "refresh"); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
44 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
45 |
if (this.starts_hidden){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
46 |
this.visible = true; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
47 |
this.hide(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
48 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
49 |
else{ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
50 |
this.visible = false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
51 |
this.show(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
52 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
53 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
54 |
this.refresh(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
55 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
56 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
57 |
IriSP.Widgets.LatestAnnotation.prototype.messages = { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
58 |
fr : { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
59 |
empty : "Aucune annotation à afficher" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
60 |
}, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
61 |
en: { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
62 |
empty: "No annotation to display" |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
63 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
64 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
65 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
66 |
IriSP.Widgets.LatestAnnotation.prototype.refresh = function(){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
67 |
var _currentTime = this.media.getCurrentTime() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
68 |
var _segmentsAnnotations = this.source.getAnnotationsByTypeTitle(this.segments_annotation_type) |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
69 |
var _currentSegments = _segmentsAnnotations.filter(function(_segment){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
70 |
return (_currentTime >= _segment.begin && _currentTime <= _segment.end) |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
71 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
72 |
if (this.hide_without_segment){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
73 |
if (_currentSegments.length == 0){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
74 |
if (this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
75 |
this.hide() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
76 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
77 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
78 |
else { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
79 |
if (!this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
80 |
this.show() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
81 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
82 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
83 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
84 |
if (this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
85 |
var _list = this.getWidgetAnnotations(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
86 |
if(this.filter_by_segment){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
87 |
if (_currentSegments.length == 0) { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
88 |
_list = _list.filter(function(_annotation){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
89 |
return false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
90 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
91 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
92 |
else { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
93 |
_list = _list.filter(function(_annotation){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
94 |
_annotationTime = (_annotation.begin+_annotation.end)/2; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
95 |
return (_currentSegments[0].begin <= _annotationTime && _currentSegments[0].end >= _annotationTime); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
96 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
97 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
98 |
_list.sortBy(function(_annotation){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
99 |
return _annotation.created; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
100 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
101 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
102 |
var _latestAnnotation = false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
103 |
var _html=""; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
104 |
if (_list.length != 0){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
105 |
_latestAnnotation = _list.pop(); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
106 |
_html = Mustache.to_html(this.annotationTemplate, { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
107 |
annotation_created: _latestAnnotation.created.toLocaleDateString()+", "+_latestAnnotation.created.toLocaleTimeString(), |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
108 |
annotation_creator: _latestAnnotation.creator, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
109 |
annotation_title: _latestAnnotation.title, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
110 |
annotation_content: _latestAnnotation.description, |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
111 |
}); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
112 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
113 |
else { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
114 |
var _empty_message = this.l10n.empty |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
115 |
if (this.empty_message) { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
116 |
_empty_message = this.empty_message |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
117 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
118 |
_html = "<div class='Ldt-LatestAnnotation-Element Ldt-LatestAnnotation-NoAnnotation'>"+_empty_message+"</div>"; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
119 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
120 |
this.annotationContainer_$.html(_html); |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
121 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
122 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
123 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
124 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
125 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
126 |
IriSP.Widgets.LatestAnnotation.prototype.hide = function() { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
127 |
if (this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
128 |
this.visible = false; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
129 |
this.annotationContainer_$.hide() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
130 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
131 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
132 |
|
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
133 |
IriSP.Widgets.LatestAnnotation.prototype.show = function() { |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
134 |
if(!this.visible){ |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
135 |
this.visible = true; |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
136 |
this.annotationContainer_$.show() |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
137 |
} |
|
423a8c6f9c4d
New widget LastAnnotation that currently displays last annotation posted (can be configured to work for currently viewed segment)
durandn
parents:
diff
changeset
|
138 |
} |