1 Rkns.Ldt = {} |
1 Rkns.Ldt = {} |
2 |
2 |
3 Rkns.Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin); |
3 Rkns.Ldt.ProjectBin = Rkns.Utils.inherit(Rkns._BaseBin); |
4 |
4 |
5 Rkns.Ldt.ProjectBin.prototype.tagTemplate = Rkns._.template( |
5 Rkns.Ldt.ProjectBin.prototype.tagTemplate = Rkns._.template( |
6 '<li class="Rk-Bin-Item" data-image="<%-static_url%>img/ldt-tag.png" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/search/?search=<%=encodedtitle%>&field=all" data-title="<%-title%>" data-description="Tag \'<%-title%>\'">' |
6 '<li class="Rk-Bin-Item" draggable="true" data-image="<%-static_url%>img/ldt-tag.png" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/search/?search=<%=encodedtitle%>&field=all" data-title="<%-title%>" data-description="Tag \'<%-title%>\'">' |
7 + '<img class="Rk-Ldt-Tag-Icon" src="<%-static_url%>img/ldt-tag.png" /><h4><%=htitle%></h4><div class="Rk-Clear"></div></li>' |
7 + '<img class="Rk-Ldt-Tag-Icon" src="<%-static_url%>img/ldt-tag.png" /><h4><%=htitle%></h4><div class="Rk-Clear"></div></li>' |
8 ); |
8 ); |
9 |
9 |
10 Rkns.Ldt.ProjectBin.prototype.annotationTemplate = Rkns._.template( |
10 Rkns.Ldt.ProjectBin.prototype.annotationTemplate = Rkns._.template( |
11 '<li class="Rk-Bin-Item" data-image="<%=image%>" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/player/<%=mediaid%>/#id=<%=annotationid%>" data-title="<%-title%>" data-description="<%-description%>">' |
11 '<li class="Rk-Bin-Item" draggable="true" data-image="<%=image%>" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/player/<%=mediaid%>/#id=<%=annotationid%>" data-title="<%-title%>" data-description="<%-description%>">' |
12 + '<img class="Rk-Ldt-Annotation-Icon" src="<%=image%>"/><h4><%=htitle%></h4><p><%=hdescription%></p><p>Start: <%=start%>, End: <%=end%>, Duration: <%=duration%></p><div class="Rk-Clear"></div></li>' |
12 + '<img class="Rk-Ldt-Annotation-Icon" src="<%=image%>"/><h4><%=htitle%></h4><p><%=hdescription%></p><p>Start: <%=start%>, End: <%=end%>, Duration: <%=duration%></p><div class="Rk-Clear"></div></li>' |
13 ); |
13 ); |
14 |
14 |
15 Rkns.Ldt.ProjectBin.prototype._init = function(_renkan, _opts) { |
15 Rkns.Ldt.ProjectBin.prototype._init = function(_renkan, _opts) { |
16 this.renkan = _renkan; |
16 this.renkan = _renkan; |
147 } |
147 } |
148 |
148 |
149 Rkns.Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin); |
149 Rkns.Ldt.ResultsBin = Rkns.Utils.inherit(Rkns._BaseBin); |
150 |
150 |
151 Rkns.Ldt.ResultsBin.prototype.segmentTemplate = Rkns._.template( |
151 Rkns.Ldt.ResultsBin.prototype.segmentTemplate = Rkns._.template( |
152 '<li class="Rk-Bin-Item" data-image="<%=image%>" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/player/<%=mediaid%>/<%=projectid%>/<%=cuttingid%>/#id=<%=annotationid%>" data-title="<%-title%>" data-description="<%-description%>">' |
152 '<li class="Rk-Bin-Item" draggable="true" data-image="<%=image%>" data-uri="<%=ldt_platform%>ldtplatform/ldt/front/player/<%=mediaid%>/#id=<%=annotationid%>" data-title="<%-title%>" data-description="<%-description%>">' |
153 + '<img class="Rk-Ldt-Annotation-Icon" src="<%=image%>"/><h4><%=htitle%></h4><p><%=hdescription%></p><p>Start: <%=start%>, End: <%=end%>, Duration: <%=duration%></p><div class="Rk-Clear"></div></li>' |
153 + '<img class="Rk-Ldt-Annotation-Icon" src="<%=image%>"/><h4><%=htitle%></h4><p><%=hdescription%></p><p>Start: <%=start%>, End: <%=end%>, Duration: <%=duration%></p><div class="Rk-Clear"></div></li>' |
154 ); |
154 ); |
155 |
155 |
156 Rkns.Ldt.ResultsBin.prototype._init = function(_renkan, _opts) { |
156 Rkns.Ldt.ResultsBin.prototype._init = function(_renkan, _opts) { |
157 this.renkan = _renkan; |
157 this.renkan = _renkan; |
166 Rkns.Ldt.ResultsBin.prototype.render = function(searchstr) { |
166 Rkns.Ldt.ResultsBin.prototype.render = function(searchstr) { |
167 if (searchstr) { |
167 if (searchstr) { |
168 var rxbase = searchstr.replace(/(\W)/g,'\\$1'), |
168 var rxbase = searchstr.replace(/(\W)/g,'\\$1'), |
169 _rgxp = new RegExp('('+rxbase+')','gi'), |
169 _rgxp = new RegExp('('+rxbase+')','gi'), |
170 rxtest = new RegExp(rxbase,'i') |
170 rxtest = new RegExp(rxbase,'i') |
|
171 } else { |
|
172 var rxbase = this.search.replace(/(\W)/g,'\\$1'), |
|
173 _rgxp = new RegExp('('+rxbase+')','gi'); |
171 } |
174 } |
172 function highlight(_text) { |
175 function highlight(_text) { |
173 return searchstr ? _text.replace(_rgxp, "<span class='searchmatch'>$1</span>") : _text; |
176 return _text.replace(_rgxp, "<span class='searchmatch'>$1</span>"); |
174 } |
177 } |
175 function convertTC(_ms) { |
178 function convertTC(_ms) { |
176 function pad(_n) { |
179 function pad(_n) { |
177 var _res = _n.toString(); |
180 var _res = _n.toString(); |
178 while (_res.length < 2) { |
181 while (_res.length < 2) { |
218 hdescription: highlight(_description), |
221 hdescription: highlight(_description), |
219 start: convertTC(_begin), |
222 start: convertTC(_begin), |
220 end: convertTC(_end), |
223 end: convertTC(_end), |
221 duration: convertTC(_duration), |
224 duration: convertTC(_duration), |
222 mediaid: _segment.iri_id, |
225 mediaid: _segment.iri_id, |
223 projectid: _segment.project_id, |
226 //projectid: _segment.project_id, |
224 cuttingid: _segment.cutting_id, |
227 //cuttingid: _segment.cutting_id, |
225 annotationid: _segment.element_id, |
228 annotationid: _segment.element_id, |
226 image: _img |
229 image: _img |
227 }); |
230 }); |
228 }); |
231 }); |
229 |
232 |