Index: trunk/extensions/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php |
— | — | @@ -153,13 +153,17 @@ |
154 | 154 | $img_url = MV_StreamImage::getStreamImageURL( $mvd_page->stream_id, $mvd_page->start_time, $mvDefaultVideoPlaybackRes, true ); |
155 | 155 | } |
156 | 156 | $oe_class = ''; |
| 157 | + //color annnotative layers seperatly: |
| 158 | + $oe_class.=' ' . htmlspecialchars( strtolower( $mvd_page->mvd_type ) ); |
| 159 | + //preset classes for rendering on page load (will repaint but whatever) |
157 | 160 | if ( $this->oddEvenToggle ) { |
158 | 161 | $this->oddEvenToggle = false; |
159 | | - $oe_class = ' even'; |
| 162 | + $oe_class .= ' even'; |
160 | 163 | } else { |
161 | 164 | $this->oddEvenToggle = true; |
162 | | - $oe_class = ' odd'; |
| 165 | + $oe_class .= ' odd'; |
163 | 166 | } |
| 167 | + |
164 | 168 | // style=\"background:#".$this->getMvdBgColor($mvd_page)."\" " |
165 | 169 | $wgOut->addHTML( '<fieldset class="mv_fd_mvd' . htmlspecialchars( $oe_class ) . '" id="mv_fd_mvd_' . htmlspecialchars( $mvd_page->id ) . '" ' . |
166 | 170 | 'name="' . htmlspecialchars( $mvd_page->wiki_title ) . '" ' . |
Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | mv_addLoadEvent(mv_pre_setup_search); |
3 | | - |
| 3 | +var mvSearchSetupFlag =false; |
4 | 4 | var maxFilters = 8; |
5 | 5 | var mv_search_action=''; |
6 | 6 | function mv_pre_setup_search(req_mode){ |
— | — | @@ -10,6 +10,11 @@ |
11 | 11 | }); |
12 | 12 | } |
13 | 13 | function mv_setup_search(req_mode){ |
| 14 | + if(!mvSearchSetupFlag) |
| 15 | + mv_do_setup_search(req_mode); |
| 16 | + mvSearchSetupFlag=true; |
| 17 | +} |
| 18 | +function mv_do_setup_search(req_mode){ |
14 | 19 | js_log('f:mv_setup_search: '); |
15 | 20 | add_highlight_function(); |
16 | 21 | //look for existing auto completes: |
Index: trunk/extensions/MetavidWiki/skins/mv_custom.css |
— | — | @@ -9,6 +9,11 @@ |
10 | 10 | * |
11 | 11 | * extended styles for metavid extension |
12 | 12 | */ |
| 13 | +/*annotative layers */ |
| 14 | +.anno_en{ |
| 15 | + background:#DDD; |
| 16 | +} |
| 17 | + |
13 | 18 | .mvd_page_image{ |
14 | 19 | float:left; |
15 | 20 | padding-right:5px; |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -96,9 +96,11 @@ |
97 | 97 | //js_log(this.href); |
98 | 98 | //js_log(res); |
99 | 99 | //replace with: |
| 100 | + //check if we are instance of smwb-title (if so reduce font size) |
| 101 | + var fsize = ( $j(this).parents().is(".smwb-title") )? '50%':'100%'; |
100 | 102 | //TEMP: |
101 | 103 | $j(this).replaceWith('<div id="mvd_link_'+i+'" ' + |
102 | | - 'style="vertical-align: bottom;margin:.5em;border:solid thin black;width:300px;height:60px;">' + |
| 104 | + 'style="display:inline;font-size:'+fsize+';vertical-align: bottom;margin:.5em;border:solid thin black;width:300px;height:60px;">' + |
103 | 105 | get_mvdrw_img(i) + |
104 | 106 | '</div>'); |
105 | 107 | $j('#mv_mvd_ex_'+i).click(function(){ |
— | — | @@ -123,21 +125,23 @@ |
124 | 126 | var stream_desc = gMvd[i]['sn'].substr(0,1).toUpperCase() + gMvd[i]['sn'].substr(1).replace('_', ' ')+' '+ gMvd[i]['st'] + ' to '+ gMvd[i]['et']; |
125 | 127 | //@@todo localize javascript msg |
126 | 128 | var wiki_link = '<span title="Original Wiki Page" id="mv_pglink_'+i+'" style="cursor:pointer;width:16px;height:16px;float:left;background:url(\''+wgScriptPath+'/extensions/MetavidWiki/skins/images/run_mediawiki.png\');"/>'; |
127 | | - var expand_link = '<span title="Expand Clip" id="mv_mvd_ex_'+i+'" style="cursor:pointer;width:16px;height:16px;float:left;background:url(\''+wgScriptPath+'/extensions/MetavidWiki/skins/images/closed.png\');"/>'; |
| 129 | + var expand_link = '<span title="Play Inline" id="mv_mvd_ex_'+i+'" style="cursor:pointer;width:16px;height:16px;float:left;background:url(\''+wgScriptPath+'/extensions/MetavidWiki/skins/images/closed.png\');"/>'; |
128 | 130 | var img_url = wgScript+'?action=ajax&rs=mv_frame_server&stream_name='+gMvd[i]['sn']+'&t='+gMvd[i]['st']+'&size=icon'; |
129 | 131 | return '<img id="mvd_link_im_'+i+'" onclick="mv_ext('+i+')" ' + |
130 | 132 | 'style="cursor:pointer;float:left;height:'+size['h']+'px;width:'+size['w']+'px;" src="'+img_url+'">'+expand_link+wiki_link+' '+ |
131 | 133 | '<a title="'+stream_desc+'" href="'+stream_link+'">'+stream_desc+'</a><br>'; |
132 | 134 | } |
133 | 135 | function mv_ext(inx){ |
134 | | - js_log('f:inx'); |
| 136 | + js_log('f:inx:'+inx); |
135 | 137 | //grow the window to 300+240 540 |
136 | 138 | js_log('i: is '+ inx); |
137 | 139 | $j('#mvd_link_'+inx).animate({width:'440px','height':'370px'},1000); |
138 | | - $j('#mvd_link_im_'+inx).animate({width:'320px','height':'240px'},1000,function(){ |
| 140 | + $j('#mvd_link_im_'+inx).animate({width:'400px','height':'300px'},1000,function(){ |
139 | 141 | //do mv_embed swap |
140 | | - $j('#mvd_link_im_'+inx).replaceWith('<video autoplay="true" id="mvd_vid_'+inx +'"></video>'); |
141 | | - $j('#mvd_vid_'+inx).attr('roe', base_roe_url + gMvd[inx]['sn']+'&t='+gMvd[inx]['st']+'/'+gMvd[inx]['et']); |
| 142 | + $j('#mvd_link_im_'+inx).replaceWith('<div style="height:300px;width:400px;">' + |
| 143 | + '<video roe="'+base_roe_url + gMvd[inx]['sn']+'&t='+gMvd[inx]['st']+'/'+gMvd[inx]['et']+'" ' + |
| 144 | + 'autoplay="true" id="mvd_vid_'+inx +'"></video>' + |
| 145 | + '</div>'); |
142 | 146 | init_mv_embed(true); |
143 | 147 | }); |
144 | 148 | $j('#mv_mvd_ex_'+inx).css('background', 'url(\''+wgScriptPath+'/extensions/MetavidWiki/skins/images/opened.png\')'); |
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | mvJsLoader.doLoad({ |
70 | 70 | '$j.ui.draggable.prototype.plugins.drag':'jquery/plugins/ui.draggable.ext.js' |
71 | 71 | },function(){ |
72 | | - mv_init_interface.init(); |
| 72 | + mv_stream_interface.init(); |
73 | 73 | }); |
74 | 74 | }); |
75 | 75 | }); |
— | — | @@ -79,13 +79,16 @@ |
80 | 80 | * re sizes the mv_overlay component and mv_tools component |
81 | 81 | * to take up the full page space. |
82 | 82 | */ |
83 | | -var mv_init_interface = { |
| 83 | +var mv_stream_interface = { |
84 | 84 | cur_mvd_id:'base', |
85 | 85 | interfaceLoaded:false, |
86 | 86 | init:function(){ |
87 | 87 | //don't call multiple times: |
88 | 88 | if(this.interfaceLoaded)return; |
89 | | - js_log('mv_init_interface call'); |
| 89 | + //set interfaceLoaded flag: |
| 90 | + this.interfaceLoaded=true; |
| 91 | + |
| 92 | + js_log('f:mv_stream_interface.init call'); |
90 | 93 | //add_custom_effects(); |
91 | 94 | //set up the init values for mouse over restore: |
92 | 95 | org_vid_title = $j('#mv_stream_time').html(); |
— | — | @@ -137,6 +140,9 @@ |
138 | 141 | //add all the hover hooks: |
139 | 142 | this.addHoverHooks(); |
140 | 143 | |
| 144 | + //add odd even classes (for non-annoative layers |
| 145 | + this.oddEvenPaint(); |
| 146 | + |
141 | 147 | //add edit/navigate hook |
142 | 148 | var st_input_mode=false; |
143 | 149 | $j('#mv_stream_time').click(function(){ |
— | — | @@ -182,9 +188,16 @@ |
183 | 189 | //unlock the interface updates once everything is setup: |
184 | 190 | mv_lock_vid_updates=false; |
185 | 191 | js_log('done with mv_init_inerface'); |
186 | | - //$j('#embed_vid').get(0).stop(); |
187 | | - this.interfaceLoaded=true; |
| 192 | + //$j('#embed_vid').get(0).stop(); |
188 | 193 | }, |
| 194 | + oddEvenPaint:function(){ |
| 195 | + //remove existing class: |
| 196 | + $j('.mv_fd_mvd').removeClass("odd").removeClass("even"); |
| 197 | + $j('.mv_fd_mvd:odd').addClass("odd"); |
| 198 | + $j('.mv_fd_mvd:even').addClass("even"); |
| 199 | + //remove odd/even class for annoative layer: |
| 200 | + $j('.anno_en').removeClass("odd").removeClass("even"); |
| 201 | + }, |
189 | 202 | addHoverHooks:function(selector){ |
190 | 203 | this_stream=this; |
191 | 204 | if(!selector){ |
— | — | @@ -226,7 +239,7 @@ |
227 | 240 | if( vid_elm.isPlaying() ){ |
228 | 241 | if(!vid_elm.onClipDone_disp){ |
229 | 242 | this.delay_cur_mvd_id= mvd_id; |
230 | | - setTimeout("mv_init_interface.delayDoVidMvdUpdate()", 250); |
| 243 | + setTimeout("mv_stream_interface.delayDoVidMvdUpdate()", 250); |
231 | 244 | } |
232 | 245 | }else{ |
233 | 246 | this.cur_mvd_id=this.delay_cur_mvd_id=mvd_id; |
— | — | @@ -241,13 +254,13 @@ |
242 | 255 | de_highlight_tl_ts(mvd_id); |
243 | 256 | de_highlight_fd(mvd_id); |
244 | 257 | js_log('calling interface restore: '); |
245 | | - setTimeout('mv_init_interface.doRestore()',500); |
| 258 | + setTimeout('mv_stream_interface.doRestore()',500); |
246 | 259 | //activiate over on time restore |
247 | 260 | /*$j('#mv_stream_time').hoverIntent({ |
248 | 261 | interval:200, //polling interval |
249 | 262 | timeout:200, //delay before onMouseOut |
250 | 263 | over:function(){ |
251 | | - mv_init_interface.doRestore(); |
| 264 | + mv_stream_interface.doRestore(); |
252 | 265 | }, |
253 | 266 | out:function(){ |
254 | 267 | |
— | — | @@ -257,7 +270,7 @@ |
258 | 271 | //delay video updates until we are not playing the clip and clipEnd is not displayed |
259 | 272 | delayDoVidMvdUpdate:function(){ |
260 | 273 | if($j('#embed_vid').get(0).isPlaying()){ |
261 | | - setTimeout("mv_init_interface.delayDoVidMvdUpdate()", 250); |
| 274 | + setTimeout("mv_stream_interface.delayDoVidMvdUpdate()", 250); |
262 | 275 | }else{ |
263 | 276 | //only restore if the onClipDone_disp is false |
264 | 277 | if( !$j('#embed_vid').get(0).onClipDone_disp){ |
— | — | @@ -277,7 +290,7 @@ |
278 | 291 | if( vid_elm.isPlaying()){ |
279 | 292 | js_log('vid elm is playing delay restore:') |
280 | 293 | if(!vid_elm.userSlide) //dont' restore if userSlide is true |
281 | | - setTimeout("mv_init_interface.doRestore()", 500); |
| 294 | + setTimeout("mv_stream_interface.doRestore()", 500); |
282 | 295 | }else{ |
283 | 296 | //only restore if onClipDone_disp is false |
284 | 297 | if(!vid_elm.onClipDone_disp){ |
— | — | @@ -342,7 +355,7 @@ |
343 | 356 | /*function mv_doShowVideoDownload(){ |
344 | 357 | js_log('f:mv_doShowVideoDownload'); |
345 | 358 | //restores orginal state before showing download links: |
346 | | - mv_init_interface.doRestore(); |
| 359 | + mv_stream_interface.doRestore(); |
347 | 360 | return $j('#embed_vid').get(0).org_showVideoDownload(); |
348 | 361 | }*/ |
349 | 362 | /* the mvdObject |
— | — | @@ -639,6 +652,8 @@ |
640 | 653 | js_log('insert to end: ' + insertTitle.start_time + "\n" + node_html); |
641 | 654 | $j('#selectionsBox').append(node_html); |
642 | 655 | } |
| 656 | + //repaint row colors: |
| 657 | + mv_stream_interface.oddEvenPaint(); |
643 | 658 | } |
644 | 659 | |
645 | 660 | function get_titleObject(titleKey){ |
— | — | @@ -664,7 +679,7 @@ |
665 | 680 | if (request.status != 200) result= "<div class='error'> " + request.status + " " + request.statusText + ": " + result + "</div>"; |
666 | 681 | $j('#mv_fcontent_'+mvd_id).html( result ); |
667 | 682 | //dirty hack to avoid re-write of article->delete(); |
668 | | - update_delete_submit(titleKey, mvd_id); |
| 683 | + update_delete_submit(titleKey, mvd_id); |
669 | 684 | } |
670 | 685 | } |
671 | 686 | function update_delete_submit(titleKey, mvd_id){ |
— | — | @@ -709,10 +724,12 @@ |
710 | 725 | eval(request.responseText); |
711 | 726 | js_log('status: ' + mv_result['status']); |
712 | 727 | if(mv_result['status']=='ok'){ |
713 | | - js_log(" status ok should remove: "); |
| 728 | + js_log(" status ok should remove: "+mvd_id); |
714 | 729 | //delete success remove mvd: |
715 | 730 | $j('#mv_fd_mvd_'+mvd_id).remove(); |
716 | 731 | $j('#mv_tl_mvd_'+mvd_id).remove(); |
| 732 | + //repaint colors: |
| 733 | + mv_stream_interface.oddEvenPaint(); |
717 | 734 | }else if(mv_result['status']=='error'){ |
718 | 735 | $j(setHtmlId).html( mv_result['error_txt'] ); |
719 | 736 | update_delete_submit(titleKey, mvd_id); |
— | — | @@ -802,7 +819,7 @@ |
803 | 820 | $j('#mv_time_line').append(mv_result['tl_mvd']); |
804 | 821 | mv_add_new_fd_mvd(mv_result['titleKey'], mv_result['fd_mvd']); |
805 | 822 | |
806 | | - mv_init_interface.addHoverHooks('#mv_fd_mvd_'+mv_result['mvd_id']+',#mv_tl_mvd_'+mv_result['mvd_id']); |
| 823 | + mv_stream_interface.addHoverHooks('#mv_fd_mvd_'+mv_result['mvd_id']+',#mv_tl_mvd_'+mv_result['mvd_id']); |
807 | 824 | //scroll to the new mvd: |
808 | 825 | scroll_to_pos(mv_result['mvd_id']); |
809 | 826 | } |
— | — | @@ -827,7 +844,7 @@ |
828 | 845 | //(use the titleKey returned from ajax request (in case it got clean or whatever) |
829 | 846 | mv_add_new_fd_mvd(mv_result['titleKey'], mv_result['fd_mvd']); |
830 | 847 | |
831 | | - mv_init_interface.addHoverHooks('#mv_fd_mvd_'+mvd_id); |
| 848 | + mv_stream_interface.addHoverHooks('#mv_fd_mvd_'+mvd_id); |
832 | 849 | //add tails |
833 | 850 | //mv_add_mvd_tails(mv_result['titleKey']); |
834 | 851 | //scroll to the new location (it should have keept its id (cuz its just a move) |
— | — | @@ -888,9 +905,9 @@ |
889 | 906 | mv_lock_vid_updates=true; |
890 | 907 | //update the src if nessesary and no mvd provided: |
891 | 908 | if(!mvd_id){ |
892 | | - if(mv_init_interface.cur_mvd_id!=mv_init_interface.delay_cur_mvd_id){ |
893 | | - mv_init_interface.cur_mvd_id =mv_init_interface.delay_cur_mvd_id; |
894 | | - do_video_mvd_update(mv_init_interface.cur_mvd_id); |
| 909 | + if(mv_stream_interface.cur_mvd_id!=mv_stream_interface.delay_cur_mvd_id){ |
| 910 | + mv_stream_interface.cur_mvd_id =mv_stream_interface.delay_cur_mvd_id; |
| 911 | + do_video_mvd_update(mv_stream_interface.cur_mvd_id); |
895 | 912 | } |
896 | 913 | } |
897 | 914 | //update the embed video actual play time |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/embedLibs/mv_flashEmbed.js |
— | — | @@ -271,9 +271,9 @@ |
272 | 272 | |
273 | 273 | function locateFlashEmbed(clip) |
274 | 274 | { |
275 | | - for(var i in global_ogg_list) |
| 275 | + for(var i in global_player_list) |
276 | 276 | { |
277 | | - var embed = document.getElementById(global_ogg_list[i]); |
| 277 | + var embed = document.getElementById(global_player_list[i]); |
278 | 278 | if(embed.media_element.selected_source.src.match(clip.fileName)) |
279 | 279 | { |
280 | 280 | //js_log('found flash embed'); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | var mv_restrict_roe_time_source = true; |
43 | 43 | |
44 | 44 | |
45 | | -var global_ogg_list = new Array(); |
| 45 | +var global_player_list = new Array(); |
46 | 46 | var global_req_cb = new Array();//the global request callback array |
47 | 47 | var _global = this; |
48 | 48 | var mv_init_done=false; |
— | — | @@ -236,10 +236,11 @@ |
237 | 237 | //js_log('f:check_init_done'); |
238 | 238 | //check if all videos are "ready to play" |
239 | 239 | var is_ready=true; |
240 | | - for(var i in global_ogg_list) |
241 | | - is_ready = ( $j('#'+global_ogg_list[i]).get(0).ready_to_play ) ? is_ready : false; |
| 240 | + for(var i in global_player_list) |
| 241 | + is_ready = ( $j('#'+global_player_list[i]).get(0).ready_to_play ) ? is_ready : false; |
| 242 | + |
242 | 243 | if(!is_ready){ |
243 | | - //js_log('some ' + global_ogg_list + ' not ready'); |
| 244 | + //js_log('some ' + global_player_list + ' not ready'); |
244 | 245 | setTimeout( 'mvEmbed.check_init_done()', 250 ); |
245 | 246 | }else{ |
246 | 247 | //call the callback: |
— | — | @@ -302,8 +303,7 @@ |
303 | 304 | this.loading_callbacks.push(callback); |
304 | 305 | |
305 | 306 | js_log('plugin not loaded, queing callback'); |
306 | | - js_log('requesting plugin: ' + plugin_path); |
307 | | - |
| 307 | + js_log('requesting plugin: ' + plugin_path); |
308 | 308 | |
309 | 309 | /*$j.getScript(plugin_path, function(){ |
310 | 310 | js_log(_this.id + ' plugin loaded'); |
— | — | @@ -313,10 +313,12 @@ |
314 | 314 | _this.loading_callbacks = null; |
315 | 315 | });*/ |
316 | 316 | |
317 | | - eval('var lib = {"'+this.library+'Embed":\'embedLibs/mv_'+this.library+'Embed.js\'}'); |
| 317 | + eval('var lib = {"'+this.library+'Embed":\'embedLibs/mv_'+this.library+'Embed.js\'}'); |
| 318 | + //js_log('DO LOAD: '+this.library); |
318 | 319 | mvJsLoader.doLoad(lib,function(){ |
319 | | - js_log(_this.id + ' plugin loaded'); |
320 | | - _this.loaded = true; |
| 320 | + //js_log( 'type of lib: ' + eval( 'typeof ' + this.library + 'Embed' ) ); |
| 321 | + //js_log(_this.id + ' plugin loaded'); |
| 322 | + _this.loaded = true; |
321 | 323 | for(var i in _this.loading_callbacks) |
322 | 324 | _this.loading_callbacks[i](); |
323 | 325 | _this.loading_callbacks = null; |
— | — | @@ -424,9 +426,9 @@ |
425 | 427 | } |
426 | 428 | if(selected_player) |
427 | 429 | { |
428 | | - for(var i in global_ogg_list) |
| 430 | + for(var i in global_player_list) |
429 | 431 | { |
430 | | - var embed = $j('#'+global_ogg_list[i]).get(0); |
| 432 | + var embed = $j('#'+global_player_list[i]).get(0); |
431 | 433 | if(embed.media_element.selected_source && (embed.media_element.selected_source.mime_type == mime_type)) |
432 | 434 | { |
433 | 435 | embed.selectPlayer(selected_player); |
— | — | @@ -791,17 +793,26 @@ |
792 | 794 | var mvJsLoader = { |
793 | 795 | libreq:{}, |
794 | 796 | libs:{}, |
| 797 | + //to keep consistancy across threads: |
| 798 | + ptime:0, |
| 799 | + ctime:0, |
| 800 | + |
795 | 801 | load_time:0, |
796 | | - doLoad:function(libs,callback){ |
797 | | - this.callback= (callback) ? callback:this.callback; |
| 802 | + callbacks:new Array(), |
| 803 | + doLoad:function(libs,callback){ |
| 804 | + this.ctime++; |
| 805 | + //stack callbacks |
| 806 | + if(callback){ |
| 807 | + //js_log('add callback: '+callback); |
| 808 | + this.callbacks.push(callback); |
| 809 | + } |
798 | 810 | //merge any new requested libs |
799 | 811 | if(libs){ |
800 | | - for(i in libs) |
| 812 | + for(var i in libs) |
801 | 813 | this.libs[i]=libs[i]; |
802 | 814 | } |
803 | 815 | var loading=0; |
804 | 816 | var i=null; |
805 | | - //js_log("doLoad_ load set to 0 on libs:"+ libs); |
806 | 817 | for(var i in this.libs){ |
807 | 818 | //if(i=='vlcEmbed')alert('got called with '+i+' ' + typeof(vlcEmbed)); |
808 | 819 | //itor the objPath (to avoid 'has no properties' errors) |
— | — | @@ -809,9 +820,11 @@ |
810 | 821 | var cur_path =''; |
811 | 822 | var cur_load=0; |
812 | 823 | for(var p in objPath){ |
813 | | - cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p]; |
814 | | - //if(i=='vlcEmbed')alert("looking at path: "+ cur_path); |
815 | | - //js_log("eval: " + eval('typeof ('+cur_path+');')); |
| 824 | + cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p]; |
| 825 | + if(i=='flashEmbed'){ |
| 826 | + js_log("eval: " + eval('typeof ('+cur_path+');')); |
| 827 | + js_log("cur_load = loading=1"); |
| 828 | + } |
816 | 829 | if(eval('typeof '+cur_path)=='undefined'){ |
817 | 830 | cur_load = loading=1; |
818 | 831 | break; |
— | — | @@ -821,8 +834,7 @@ |
822 | 835 | break; |
823 | 836 | } |
824 | 837 | } |
825 | | - if(cur_load==1){ |
826 | | - //js_log('missing lib:'+i + ' do load:'+mv_embed_path+libs[i]); |
| 838 | + if(cur_load==1){ |
827 | 839 | if(!this.libreq[i])loadExternalJs(mv_embed_path + this.libs[i]); |
828 | 840 | this.libreq[i]=1; |
829 | 841 | } |
— | — | @@ -834,8 +846,26 @@ |
835 | 847 | setTimeout('mvJsLoader.doLoad()',25); |
836 | 848 | } |
837 | 849 | }else{ |
838 | | - this.callback(); |
| 850 | + //only do callback if we are in the same range: |
| 851 | + var cb_count=0; |
| 852 | + for(var i in this.callbacks) |
| 853 | + cb_count++; |
| 854 | + //js_log('REST LIBS: loading is: '+ loading + ' run callbacks: '+cb_count); |
| 855 | + //reset the libs |
| 856 | + this.libs={}; |
| 857 | + //js_log('done loading do call: ' + this.callbacks[0] ); |
| 858 | + while(this.callbacks.length !=0 ){ |
| 859 | + if(this.ptime== ( this.ctime-1) ){ //enforce thread consistancy |
| 860 | + this.callbacks.pop()(); |
| 861 | + //func = this.callbacks.pop(); |
| 862 | + //js_log(' run: '+this.ctime+ ' p: ' + this.ptime + ' ' +loading+ ' :'+ func); |
| 863 | + //func(); |
| 864 | + }else{ |
| 865 | + break; |
| 866 | + } |
| 867 | + } |
839 | 868 | } |
| 869 | + this.ptime=this.ctime; |
840 | 870 | } |
841 | 871 | } |
842 | 872 | |
— | — | @@ -847,7 +877,7 @@ |
848 | 878 | * and >= 1.1.4 not working: http://pastie.caboo.se/92595 |
849 | 879 | * $j(document).ready( function(){ */ |
850 | 880 | function init_mv_embed(force){ |
851 | | - //js_log('mv_init'); |
| 881 | + js_log('f:init_mv_embed'); |
852 | 882 | if(!force && mv_init_done){ |
853 | 883 | js_log("mv_init_done do nothing..."); |
854 | 884 | return false; |
— | — | @@ -941,6 +971,43 @@ |
942 | 972 | function mv_embed(){ |
943 | 973 | //get mv_embed location if it has not been set |
944 | 974 | js_log('mv_embed ' + mvEmbed.Version); |
| 975 | + |
| 976 | + var loadPlaylistLib=false; |
| 977 | + //jquery version: |
| 978 | + $j('video,playlist').each(function(){ |
| 979 | + js_log( "LOOP ON: " +this.id + ' tag: '+ this.tagName); |
| 980 | + |
| 981 | + elm_id = $j(this).attr("id"); |
| 982 | + if(!elm_id || elm_id==''){ |
| 983 | + elm_id = 'v'+ global_player_list.length; |
| 984 | + $j(this).attr("id", elm_id); |
| 985 | + } |
| 986 | + //store a global reference to the id |
| 987 | + global_player_list.push(elm_id); |
| 988 | + //add loading: |
| 989 | + $j(this).after('<div id="pre_loading_div_'+elm_id + '">'+ |
| 990 | + getMsg('loading_txt')+'</div>' ); |
| 991 | + //if video doSwap |
| 992 | + if(this.tagName=='VIDEO'){ |
| 993 | + var videoInterface = new embedVideo(this); |
| 994 | + swapEmbedVideoElement(this, videoInterface); |
| 995 | + } |
| 996 | + //if playlist set do load playlist |
| 997 | + if(this.tagName=='PLAYLIST') |
| 998 | + loadPlaylistLib=true; |
| 999 | + }); |
| 1000 | + if(loadPlaylistLib){ |
| 1001 | + js_log('f:load Playlist Lib:'); |
| 1002 | + mvJsLoader.doLoad({'mvPlayList':'mv_playlist.js'},function(){ |
| 1003 | + $j('playlist').each(function(){ |
| 1004 | + //create new playlist interface: |
| 1005 | + var playlistInterface = new mvPlayList( this ); |
| 1006 | + swapEmbedVideoElement(this, playlistInterface); |
| 1007 | + }); |
| 1008 | + }); |
| 1009 | + } |
| 1010 | + |
| 1011 | + /* |
945 | 1012 | //send a request to load the given type |
946 | 1013 | //js_log('detected: '+ embedTypes.getPlayerType() ); |
947 | 1014 | video_elements = document.getElementsByTagName("video"); |
— | — | @@ -951,9 +1018,11 @@ |
952 | 1019 | vid_id = $j(video_elements[i]).attr("id"); |
953 | 1020 | //set id if empty: |
954 | 1021 | if(!vid_id || vid_id==''){ |
955 | | - video_elements[i].id= 'v'+ global_ogg_list.length; |
| 1022 | + video_elements[i].id= 'v'+ global_player_list.length; |
956 | 1023 | } |
957 | | - |
| 1024 | + //store a global reference to the id |
| 1025 | + global_player_list.push(vid_id); |
| 1026 | + |
958 | 1027 | //create and swap in the video interface: |
959 | 1028 | var videoInterface = new embedVideo(video_elements[i]); |
960 | 1029 | //swap in: |
— | — | @@ -970,9 +1039,23 @@ |
971 | 1040 | } |
972 | 1041 | //if there are no playlist elements do not load the playlist-js |
973 | 1042 | playlist_elements = document.getElementsByTagName("playlist"); |
974 | | - if( playlist_elements.length > 0) { |
| 1043 | + if( playlist_elements.length > 0) { |
| 1044 | + for(var i = 0; i < playlist_elements.length; i++) { |
| 1045 | + var pl_id = $j(playlist_elements[i]).attr("id"); |
| 1046 | + if(!pl_id || pl_id==''){ |
| 1047 | + pl_id = 'v'+ global_player_list.length; |
| 1048 | + $j(playlist_elements[i]).attr("id", pl_id); |
| 1049 | + } |
| 1050 | + //add loading: |
| 1051 | + $j(playlist_elements[i]).after('<div id="pre_loading_div_'+pl_id + '">'+ |
| 1052 | + getMsg('loading_txt')+'</div>' ); |
| 1053 | + |
| 1054 | + //store a global reference to the id |
| 1055 | + global_player_list.push(pl_id); |
| 1056 | + } |
975 | 1057 | do_playlist_functions(); |
976 | 1058 | } |
| 1059 | + * */ |
977 | 1060 | } |
978 | 1061 | |
979 | 1062 | function mv_do_sequence(initObj){ |
— | — | @@ -998,24 +1081,13 @@ |
999 | 1082 | }); |
1000 | 1083 | } |
1001 | 1084 | |
1002 | | -var pl_load_time=0; |
1003 | | -function do_playlist_functions(){ |
| 1085 | +/*var pl_load_time=0; |
| 1086 | +function do_playlist_functions(){ |
| 1087 | + js_log('f:do_playlist_functions:'); |
1004 | 1088 | mvJsLoader.doLoad({'mvPlayList':'mv_playlist.js'},function(){ |
1005 | 1089 | playlist_elements = document.getElementsByTagName("playlist"); |
1006 | 1090 | js_log('loded pl js ' +playlist_elements.length ); |
1007 | | - for(var i = 0; i < playlist_elements.length; i++) { |
1008 | | - var pl_id = $j(playlist_elements[i]).attr('id'); |
1009 | | - if(!pl_id || pl_id==''){ |
1010 | | - playlist_elements[i].id = 'v'+ global_ogg_list.length; |
1011 | | - } |
1012 | | - //add loading: |
1013 | | - parent_elm = playlist_elements[i].parentNode; |
1014 | | - load_div = document.createElement('div'); |
1015 | | - load_div.setAttribute("id", 'pre_loading_div_'+pl_id); |
1016 | | - load_div.innerHTML=getMsg('loading_txt'); |
1017 | | - parent_elm.appendChild(load_div); |
1018 | | - js_log('load div: '+load_div.innerHTML); |
1019 | | - |
| 1091 | + for(var i = 0; i < playlist_elements.length; i++) { |
1020 | 1092 | //create new playlist interface: |
1021 | 1093 | var playlistInterface = new mvPlayList( playlist_elements[i] ); |
1022 | 1094 | if(swapEmbedVideoElement(playlist_elements[i], playlistInterface) ){ |
— | — | @@ -1023,7 +1095,7 @@ |
1024 | 1096 | } |
1025 | 1097 | } |
1026 | 1098 | }); |
1027 | | -} |
| 1099 | +}*/ |
1028 | 1100 | |
1029 | 1101 | /* |
1030 | 1102 | * swapEmbedVideoElement |
— | — | @@ -1083,12 +1155,8 @@ |
1084 | 1156 | //now run the getHTML on the new embedVideo Obj: |
1085 | 1157 | embed_video.getHTML(); |
1086 | 1158 | */ |
1087 | | - //js_log('html set:' + document.getElementById(embed_video.id).innerHTML); |
1088 | | - //store a reference to the id |
1089 | | - //(for single instance plugins that need to keep track of other instances on the page) |
1090 | | - global_ogg_list.push(embed_video.id); |
1091 | | - |
1092 | | - js_log('done with child: ' + embed_video.id + ' len:'+global_ogg_list.length); |
| 1159 | + //js_log('html set:' + document.getElementById(embed_video.id).innerHTML); |
| 1160 | + js_log('done with child: ' + embed_video.id + ' len:'+global_player_list.length); |
1093 | 1161 | return true; |
1094 | 1162 | } |
1095 | 1163 | /* |
— | — | @@ -1235,7 +1303,7 @@ |
1236 | 1304 | if($j('#mmbody_'+this.pe.id).length==0)this.show(); |
1237 | 1305 | $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){ |
1238 | 1306 | if(!inserted){ |
1239 | | - js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
| 1307 | + //js_log( ntp2seconds($j(this).attr('start')) + ' > ' + text_clip_start_time); |
1240 | 1308 | if( ntp2seconds($j(this).attr('start')) > text_clip_start_time){ |
1241 | 1309 | inserted=true; |
1242 | 1310 | $j(this).before(insertHTML); |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_playlist.js |
— | — | @@ -5,7 +5,6 @@ |
6 | 6 | * part of mv_embed: |
7 | 7 | * http://metavid.ucsc.edu/wiki/index.php/Mv_embed |
8 | 8 | */ |
9 | | - js_log('load mv_playlist'); |
10 | 9 | var mv_default_playlist_attributes = { |
11 | 10 | //playlist attributes : |
12 | 11 | "id":null, |