| author | veltr |
| Tue, 03 Apr 2012 20:30:12 +0200 | |
| branch | popcorn-port |
| changeset 841 | 8da49ff273e0 |
| parent 840 | ac66e2240e1e |
| child 842 | 4ae2247a59f4 |
| permissions | -rw-r--r-- |
| 585 | 1 |
IriSP.AnnotationsListWidget = function(Popcorn, config, Serializer) { |
2 |
IriSP.Widget.call(this, Popcorn, config, Serializer); |
|
|
605
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
3 |
this.__counter = 0; |
|
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
4 |
this.__oldList = []; |
| 833 | 5 |
|
6 |
this.checkOption('ajax_mode'); |
|
7 |
this.checkOption('project_url'); |
|
8 |
this.checkOption('default_thumbnail'); |
|
9 |
this.checkOption("cinecast_version", false); |
|
| 841 | 10 |
this.checkOption("ajax_url"); |
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
11 |
this.searchRe = null; |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
12 |
this._ajax_cache = []; |
| 833 | 13 |
var _this = this; |
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
14 |
|
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
15 |
this._Popcorn.listen("IriSP.search", function(searchString) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
16 |
_this.searchHandler(searchString); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
17 |
}); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
18 |
this._Popcorn.listen("IriSP.search.closed", function() { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
19 |
_this.searchHandler(false); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
20 |
}); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
21 |
this._Popcorn.listen("IriSP.search.cleared", function() { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
22 |
_this.searchHandler(false); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
23 |
}); |
| 585 | 24 |
}; |
25 |
||
26 |
||
27 |
IriSP.AnnotationsListWidget.prototype = new IriSP.Widget(); |
|
28 |
||
29 |
IriSP.AnnotationsListWidget.prototype.clear = function() { |
|
30 |
}; |
|
31 |
||
| 588 | 32 |
IriSP.AnnotationsListWidget.prototype.clearWidget = function() { |
| 585 | 33 |
}; |
34 |
||
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
35 |
IriSP.AnnotationsListWidget.prototype.searchHandler = function(searchString) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
36 |
this.searchRe = (searchString && searchString.length) ? IriSP.regexpFromText(searchString) : null; |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
37 |
if (this.ajax_mode) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
38 |
var _this = this, |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
39 |
_annotations = ( |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
40 |
this.searchRe === null |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
41 |
? this._ajax_cache |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
42 |
: IriSP.underscore.filter(this._ajax_cache, function(_a) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
43 |
return (_this.searchRe.test(_a.desc) || _this.searchRe.test(_a.title)); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
44 |
}) |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
45 |
); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
46 |
this.do_redraw(_annotations); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
47 |
if (_annotations.length) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
48 |
this._Popcorn.trigger("IriSP.search.matchFound"); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
49 |
} else { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
50 |
this._Popcorn.trigger("IriSP.search.noMatchFound"); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
51 |
} |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
52 |
} else { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
53 |
this.drawList(); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
54 |
} |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
55 |
} |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
56 |
|
| 629 | 57 |
/** effectively redraw the widget - called by drawList */ |
58 |
IriSP.AnnotationsListWidget.prototype.do_redraw = function(list) { |
|
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
59 |
var _html = IriSP.templToHTML( |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
60 |
IriSP.annotationsListWidget_template, { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
61 |
annotations: list |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
62 |
}), |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
63 |
_this = this; |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
64 |
|
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
65 |
this.selector.html(_html); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
66 |
|
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
67 |
if (this.searchRe !== null) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
68 |
this.selector.find(".Ldt-AnnotationsList-Title a, .Ldt-AnnotationsList-Description") |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
69 |
.each(function() { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
70 |
var _$ = IriSP.jQuery(this); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
71 |
_$.html(_$.text().replace(_this.searchRe, '<span class="Ldt-AnnotationsList-highlight">$1</span>')) |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
72 |
}) |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
73 |
} |
| 629 | 74 |
}; |
75 |
||
| 833 | 76 |
IriSP.AnnotationsListWidget.prototype.transformAnnotation = function(a) { |
| 841 | 77 |
var _this = this; |
| 833 | 78 |
return { |
79 |
"id" : a.id, |
|
80 |
"title": this.cinecast_version ? IriSP.get_aliased(a.meta, ['creator_name', 'creator']) : a.content.title, |
|
81 |
"desc" : this.cinecast_version ? a.content.data : a.content.description, |
|
82 |
"begin": IriSP.msToTime(a.begin), |
|
83 |
"end" : IriSP.msToTime(a.end), |
|
84 |
"thumbnail" : (typeof a.meta == "object" && typeof a.meta.thumbnail == "string") ? a.meta.thumbnail : this.default_thumbnail, |
|
85 |
"url" : (typeof a.meta == "object" && typeof a.meta.url == "string") ? a.meta.url : null, |
|
| 841 | 86 |
"created_at" :(typeof a.meta == "object" && typeof a.meta.created == "string") ? Date.parse(a.meta.created.replace(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}\:\d{2}\:\d{2}).*$/,"$2/$3/$1 $4 UTC+0000")) : null, |
| 833 | 87 |
"tags": typeof a.tags == "object" |
88 |
? IriSP.underscore(a.tags) |
|
89 |
.chain() |
|
90 |
.map(function(_t) { |
|
91 |
if (typeof _t == "string") { |
|
92 |
return _t.replace(/^.*:/,'#'); |
|
93 |
} else { |
|
94 |
if (typeof _t['id-ref'] != "undefined") { |
|
95 |
var _f = IriSP.underscore.find(_this._serializer._data.tags, function(_tag) { |
|
| 840 | 96 |
return _tag.id == _t['id-ref']; |
| 833 | 97 |
}); |
98 |
if (typeof _f != "undefined") { |
|
99 |
return IriSP.get_aliased(_f.meta, ['dc:title', 'title']); |
|
100 |
} |
|
101 |
} |
|
102 |
} |
|
103 |
return null; |
|
104 |
}) |
|
105 |
.filter(function(_t) { |
|
106 |
return _t !== null && _t !== "" |
|
107 |
}) |
|
108 |
.value() |
|
109 |
: [] |
|
110 |
} |
|
111 |
} |
|
112 |
||
| 599 | 113 |
/** draw the annotation list */ |
|
607
0b94ae49efbd
added an option to force the redraw of a list, even if the cached lists are the
hamidouk
parents:
605
diff
changeset
|
114 |
IriSP.AnnotationsListWidget.prototype.drawList = function(force_redraw) { |
| 585 | 115 |
var _this = this; |
| 674 | 116 |
|
| 833 | 117 |
// var view_type = this._serializer.getContributions(); |
| 585 | 118 |
var annotations = this._serializer._data.annotations; |
| 602 | 119 |
var currentTime = this._Popcorn.currentTime(); |
| 585 | 120 |
var list = []; |
| 588 | 121 |
|
| 833 | 122 |
/* if (typeof(view_type) === "undefined") { |
| 585 | 123 |
return; |
| 833 | 124 |
} */ |
| 585 | 125 |
for (i = 0; i < annotations.length; i++) { |
| 833 | 126 |
var obj = this.transformAnnotation(annotations[i]); |
127 |
obj.iterator = i; |
|
128 |
obj.distance = Math.abs((annotations[i].end + annotations[i].begin) / 2000 - currentTime); |
|
| 835 | 129 |
if (!this.cinecast_version || annotations[i].type == "cinecast:UserAnnotation") { |
130 |
list.push(obj); |
|
131 |
} |
|
132 |
|
|
| 585 | 133 |
} |
|
607
0b94ae49efbd
added an option to force the redraw of a list, even if the cached lists are the
hamidouk
parents:
605
diff
changeset
|
134 |
|
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
135 |
if (this.searchRe !== null) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
136 |
list = list.filter(function(_a) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
137 |
return (_this.searchRe.test(_a.desc) || _this.searchRe.test(_a.title)); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
138 |
}); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
139 |
if (list.length) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
140 |
this._Popcorn.trigger("IriSP.search.matchFound"); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
141 |
} else { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
142 |
this._Popcorn.trigger("IriSP.search.noMatchFound"); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
143 |
} |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
144 |
} |
| 833 | 145 |
list = IriSP.underscore(list) |
146 |
.chain() |
|
147 |
.sortBy(function(_o) { |
|
148 |
return _o.distance; |
|
149 |
}) |
|
150 |
.first(10) |
|
151 |
.sortBy(function(_o) { |
|
| 841 | 152 |
return (_this.cinecast_version ? - _o.created_at : _o.iterator); |
| 833 | 153 |
}) |
154 |
.value(); |
|
|
605
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
155 |
var idList = IriSP.underscore.pluck(list, "id").sort(); |
| 642 | 156 |
|
|
605
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
157 |
|
| 833 | 158 |
if (!IriSP.underscore.isEqual(this.__oldList, idList) || typeof(force_redraw) !== "undefined") { |
| 629 | 159 |
this.do_redraw(list); |
| 833 | 160 |
this.__oldList = idList; |
|
607
0b94ae49efbd
added an option to force the redraw of a list, even if the cached lists are the
hamidouk
parents:
605
diff
changeset
|
161 |
} |
| 833 | 162 |
/* save for next call */ |
|
605
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
163 |
|
|
e1a6f73038b4
made the listWidget redraw at every timeupdate event (added a small optimization though,
hamidouk
parents:
603
diff
changeset
|
164 |
|
| 599 | 165 |
}; |
166 |
||
| 674 | 167 |
IriSP.AnnotationsListWidget.prototype.ajaxRedraw = function(timecode) { |
| 748 | 168 |
|
| 752 | 169 |
/* the seeked signal sometimes passes an argument - depending on if we're using |
170 |
our popcorn lookalike or the real thing - if it's the case, use it as it's |
|
171 |
more precise than currentTime which sometimes contains the place we where at */ |
|
172 |
if (IriSP.null_or_undefined(timecode) || typeof(timecode) != "number") { |
|
173 |
var tcode = this._Popcorn.currentTime(); |
|
174 |
} else { |
|
175 |
var tcode = timecode; |
|
176 |
} |
|
177 |
|
|
178 |
|
|
| 841 | 179 |
/* the platform gives us a special url - of the type : http://path/{{media}}/{{begin}}/{{end}} |
| 748 | 180 |
we double the braces using regexps and we feed it to mustache to build the correct url |
181 |
we have to do that because the platform only knows at run time what view it's displaying. |
|
182 |
*/ |
|
183 |
|
|
| 698 | 184 |
var media_id = this._serializer.currentMedia()["id"]; |
|
820
7968346b9689
Added compatibility with cinecast format (with get_aliased)
veltr
parents:
784
diff
changeset
|
185 |
var duration = this._serializer.getDuration(); |
| 698 | 186 |
|
| 752 | 187 |
var begin_timecode = (Math.floor(tcode) - 300) * 1000; |
| 698 | 188 |
if (begin_timecode < 0) |
189 |
begin_timecode = 0; |
|
190 |
|
|
| 752 | 191 |
var end_timecode = (Math.floor(tcode) + 300) * 1000; |
| 698 | 192 |
if (end_timecode > duration) |
193 |
end_timecode = duration; |
|
194 |
|
|
| 841 | 195 |
var templ = Mustache.to_html(this.ajax_url, {media: media_id, begin: begin_timecode, |
| 748 | 196 |
end: end_timecode}); |
197 |
||
| 698 | 198 |
/* we create on the fly a serializer to get the ajax */ |
199 |
var serializer = new IriSP.JSONSerializer(IriSP.__dataloader, templ); |
|
| 833 | 200 |
serializer.sync(IriSP.wrap(this, function(json) { this.processJson(json, serializer) })); |
| 674 | 201 |
}; |
202 |
||
| 698 | 203 |
/** process the received json - it's a bit hackish */ |
204 |
IriSP.AnnotationsListWidget.prototype.processJson = function(json, serializer) { |
|
205 |
/* FIXME: DRY the whole thing */ |
|
206 |
var annotations = serializer._data.annotations; |
|
207 |
if (IriSP.null_or_undefined(annotations)) |
|
208 |
return; |
|
209 |
|
|
| 784 | 210 |
/* |
211 |
commented in case we wanted to discriminate against some annotation types. |
|
| 698 | 212 |
var view_types = serializer.getIds("Contributions"); |
| 784 | 213 |
*/ |
| 698 | 214 |
var l = []; |
215 |
|
|
|
714
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
216 |
var media = this._serializer.currentMedia()["id"]; |
|
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
217 |
|
| 698 | 218 |
for (i = 0; i < annotations.length; i++) { |
| 833 | 219 |
var obj = this.transformAnnotation(annotations[i]) |
| 836 | 220 |
if (typeof obj.url == "undefined" || !obj.url) { |
221 |
/* only if the annotation isn't present in the document create an |
|
222 |
external link */ |
|
| 840 | 223 |
if (this.annotations_ids.indexOf(obj.id.toLowerCase()) == -1) { |
| 836 | 224 |
// braindead url; jacques didn't want to create a new one in the platform, |
225 |
// so we append the cutting id to the url. |
|
226 |
obj.url = this.project_url + "/" + media + "/" + |
|
227 |
annotations[i].meta.project + "/" + |
|
228 |
annotations[i].meta["id-ref"] + '#id=' + annotations[i].id; |
|
| 840 | 229 |
|
| 836 | 230 |
// obj.url = document.location.href.split("#")[0] + "/" + annotation.meta.project; |
231 |
} |
|
232 |
} |
|
| 716 | 233 |
l.push(obj); |
| 698 | 234 |
} |
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
235 |
this._ajax_cache = l; |
| 698 | 236 |
this.do_redraw(l); |
237 |
}; |
|
| 599 | 238 |
IriSP.AnnotationsListWidget.prototype.draw = function() { |
|
714
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
239 |
|
|
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
240 |
/* build a table of the annotations present in the document for faster |
|
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
241 |
lookup |
|
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
242 |
*/ |
| 840 | 243 |
this.annotations_ids = IriSP.underscore(this._serializer._data.annotations).map(function(_a) { |
244 |
return _a.id.toLowerCase(); |
|
245 |
}); |
|
|
714
9056928c46de
WIP - making links to only annotations which are not present in the opened
hamidouk
parents:
703
diff
changeset
|
246 |
|
| 833 | 247 |
var _this = this; |
| 674 | 248 |
|
|
838
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
249 |
if (!this.ajax_mode) { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
250 |
var _throttled = IriSP.underscore.throttle(function() { |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
251 |
_this.drawList(); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
252 |
}, 1500); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
253 |
_throttled(); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
254 |
this._Popcorn.listen("IriSP.createAnnotationWidget.addedAnnotation", _throttled); |
|
03b03865eb9b
Transferred i18n data to widgets, corrected slider bug, added search in annotationslist
veltr
parents:
836
diff
changeset
|
255 |
this._Popcorn.listen("timeupdate", _throttled); |
| 674 | 256 |
} else { |
|
729
7ba63d0315ad
load the widget when the video has finished loading.
hamidouk
parents:
716
diff
changeset
|
257 |
/* update the widget when the video has finished loading and when it's seeked and paused */ |
| 698 | 258 |
this._Popcorn.listen("seeked", IriSP.wrap(this, this.ajaxRedraw)); |
|
729
7ba63d0315ad
load the widget when the video has finished loading.
hamidouk
parents:
716
diff
changeset
|
259 |
this._Popcorn.listen("loadedmetadata", IriSP.wrap(this, this.ajaxRedraw)); |
| 698 | 260 |
this._Popcorn.listen("paused", IriSP.wrap(this, this.ajaxRedraw)); |
|
730
357fc047503b
redraw the widget after that an annotation has been added.
hamidouk
parents:
729
diff
changeset
|
261 |
|
|
357fc047503b
redraw the widget after that an annotation has been added.
hamidouk
parents:
729
diff
changeset
|
262 |
this._Popcorn.listen("IriSP.createAnnotationWidget.addedAnnotation", IriSP.wrap(this, this.ajaxRedraw)); |
| 674 | 263 |
} |
| 698 | 264 |
|
| 585 | 265 |
}; |