r41157 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41156‎ | r41157 | r41158 >
Date:15:32, 22 September 2008
Author:dale
Status:old
Tags:
Comment:
fixed onClipDone links
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js (modified) (history)
  • /trunk/extensions/MetavidWiki/skins/mv_stream.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_stream.js
@@ -309,19 +309,21 @@
310310 if(previus_scroll2Time_time!=sec_time){
311311 var scroll_mvd_id = null;
312312 //init pMvd_id
313 - var pMvd_id=$j('.mv_fd_mvd:first').attr("id").split('_').pop();
314 - $j('.mv_fd_mvd').each(function(){
315 - var curTitle = get_titleObject($j(this).attr('name'));
316 - if( curTitle.start_time >= sec_time ){
317 - //js_log('found mvd pos: ' + curTitle.start_time + ' for sec time: ' + sec_time);
318 - if(previus_scrollMvd_id != pMvd_id){
319 - scroll_to_pos( pMvd_id ) ;
320 - previus_scrollMvd_id = pMvd_id;
321 - }
322 - return false;//break out of for loop:
323 - }
324 - pMvd_id = $j(this).attr("id").split('_').pop();
325 - });
 313+ if($j('.mv_fd_mvd:first')){
 314+ var pMvd_id=$j('.mv_fd_mvd:first').attr("id").split('_').pop();
 315+ $j('.mv_fd_mvd').each(function(){
 316+ var curTitle = get_titleObject($j(this).attr('name'));
 317+ if( curTitle.start_time >= sec_time ){
 318+ //js_log('found mvd pos: ' + curTitle.start_time + ' for sec time: ' + sec_time);
 319+ if(previus_scrollMvd_id != pMvd_id){
 320+ scroll_to_pos( pMvd_id ) ;
 321+ previus_scrollMvd_id = pMvd_id;
 322+ }
 323+ return false;//break out of for loop:
 324+ }
 325+ pMvd_id = $j(this).attr("id").split('_').pop();
 326+ });
 327+ }
326328 }
327329 }
328330 /*function mv_doShowVideoDownload(){
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js
@@ -2182,6 +2182,7 @@
21832183 }
21842184 }else{
21852185 js_log('no annotative track found');
 2186+ $j('#liks_info_'+this.id).html('no metadata found for next, prev links');
21862187 }
21872188 //query current request time +|- 60s to get prev next speech links.
21882189 },
@@ -2196,21 +2197,31 @@
21972198
21982199 var s_sec = ntp2seconds(curTime[0]);
21992200 var e_sec = ntp2seconds(curTime[1]);
2200 -
 2201+ js_log('showNextPrevLinks: req time: '+ s_sec + ' to ' + e_sec);
22012202 //now we have all the data in anno_data_cache
 2203+ var current_done=false;
22022204 for(var clip_id in this.anno_data_cache){
22032205 var clip = this.anno_data_cache[clip_id];
22042206 //js_log('on clip:'+ clip_id);
22052207 //set prev_link (if cur_link is still empty)
2206 - if( s_sec < clip.start_time_sec && e_sec < clip.start_time_sec && link.prev=='')
 2208+ if( s_sec > clip.end_time_sec){
22072209 link.prev = clip_id;
 2210+ js_log('showNextPrevLinks: ' + s_sec + ' < ' + clip.end_time_sec + ' set prev');
 2211+ }
22082212
2209 - //clip is not done e_sec < clip
2210 - if( s_sec > clip.start_time_sec && e_sec < clip.end_time_sec )
 2213+ if(e_sec==clip.end_time_sec && s_sec== clip.start_time_sec)
 2214+ current_done = true;
 2215+ //current clip is not done:
 2216+ if( e_sec < clip.end_time_sec && link.current=='' && !current_done){
22112217 link.current = clip_id;
2212 -
2213 - if( e_sec > clip.start_time_sec && link.next=='')
 2218+ js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current');
 2219+ }
 2220+
 2221+ //set end clip (first clip where start time is > end_time of req
 2222+ if( e_sec < clip.start_time_sec && link.next==''){
22142223 link.next = clip_id;
 2224+ js_log('showNextPrevLinks: '+ e_sec + ' < '+ clip.start_time_sec + ' && ' + link.next );
 2225+ }
22152226 }
22162227 var html='';
22172228 for(var link_type in link){
@@ -2219,7 +2230,7 @@
22202231 var clip = this.anno_data_cache[link_id];
22212232 var title_msg='';
22222233 for(var j in clip['meta']){
2223 - title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" \n";
 2234+ title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" <br>";
22242235 }
22252236 var time_req = clip.time_req;
22262237 if(link_type=='current') //if current start from end of current clip play to end of current meta: