Index: trunk/extensions/MetavidWiki/includes/articlepages/MV_SequencePage.php |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | $talkTitle = $this->mTitle->getTalkPage(); |
83 | 83 | $metaData = array( |
84 | 84 | 'title' => $this->mTitle->getText(), |
85 | | - 'interface_url' => $wgServer . $wgScript, |
| 85 | + 'interface_url' => str_replace('index.php', 'api.php', $wgServer . $wgScript), //api link (might be a better way to grab that) |
86 | 86 | 'linkback' => $this->mTitle->getFullURL(), |
87 | 87 | 'mTitle' => $this->mTitle->getPrefixedDBKey(), |
88 | 88 | 'mTalk' => $talkTitle->getPrefixedDBKey() |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | } |
46 | 46 | if( vidIdList.length > 0){ |
47 | 47 | load_mv_embed( function(){ |
48 | | - mvJsLoader.loadBaseLibs(function(){ |
| 48 | + mvJsLoader.embedVideoCheck(function(){ |
49 | 49 | //do utilty rewrite of oggHanlder content: |
50 | 50 | rewrite_for_oggHanlder( vidIdList ); |
51 | 51 | }); |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | //alert("!!upload hook"); |
87 | 87 | load_mv_embed( function(){ |
88 | 88 | //load jQuery and what not |
89 | | - mvJsLoader.loadBaseLibs(function(){ |
| 89 | + mvJsLoader.jQueryCheck(function(){ |
90 | 90 | mvJsLoader.doLoad( { |
91 | 91 | 'mvFirefogg' : 'libAddMedia/mvFirefogg.js', |
92 | 92 | 'mvUploader' : 'libAddMedia/mvUploader.js' |
Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | var mv_search_action=''; |
6 | 6 | function mv_pre_setup_search(req_mode){ |
7 | 7 | //make sure we have jQuery and any base required libs: |
8 | | - mvJsLoader.loadBaseLibs(function(){ |
| 8 | + mvJsLoader.jQueryCheck(function(){ |
9 | 9 | mv_setup_search(req_mode); |
10 | 10 | }); |
11 | 11 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | function mv_setup_allpage(){ |
20 | 20 | js_log("mv embed done loading now setup 'all page'"); |
21 | 21 | //make sure we have jQuery and any base required libs: |
22 | | - mvJsLoader.loadBaseLibs(function(){ |
| 22 | + mvJsLoader.jQueryCheck(function(){ |
23 | 23 | js_log('allpage_ did jquery check'); |
24 | 24 | mvJsLoader.doLoad( { |
25 | 25 | '$j.fn.autocomplete':'jquery/plugins/jquery.autocomplete.js', |
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | function mv_load_interface_libs(){ |
56 | 56 | js_log('f:mv_load_interface_libs'); |
57 | 57 | //make sure the mv_embed stuff is loaded |
58 | | - mvJsLoader.loadBaseLibs(function(){ |
| 58 | + mvJsLoader.jQueryCheck(function(){ |
59 | 59 | js_log('load stream js'); |
60 | 60 | //load some additional plugins/components: |
61 | 61 | //:hoverIntent |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/testing_page.php |
— | — | @@ -17,7 +17,16 @@ |
18 | 18 | <h3>testing embed</h3> |
19 | 19 | <table border="1" cellpadding="6" width="600"> |
20 | 20 | <tr> |
21 | | - <td valign="top"><video id="vogg" src="http://tinyvid.tv/file/27wsh8kw4vmwi.ogg"></video></td> |
| 21 | + <td valign="top"> |
| 22 | + <video id="embed_vid" |
| 23 | +thumbnail="http://metavid.org/wiki/index.php?action=ajax&rs=mv_frame_server&stream_id=501&t=0:01:32&size=400x300" |
| 24 | +roe="http://metavid.org/wiki/index.php?title=Special:MvExportStream&stream_name=House_proceeding_01-28-08&feed_format=roe&t=0:01:32/0:03:20" |
| 25 | +style="width:400px;height:300px" |
| 26 | +controls="true" embed_link="true" > |
| 27 | + <source type="video/x-flv" src="http://mvbox2.cse.ucsc.edu/mvFlvServer.php/house_proceeding_01-28-08.flv?t=0:01:32/0:03:20"></source> |
| 28 | + <source type="video/ogg" src="http://metavidstorage01.ucsc.edu/media/house_proceeding_01-28-08.ogg?t=0:01:32/0:03:20"></source> |
| 29 | +</video> |
| 30 | +</td> |
22 | 31 | <td valign="top"><b>Test embed</b><br /> |
23 | 32 | </td> |
24 | 33 | </tr> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -932,23 +932,26 @@ |
933 | 933 | }); |
934 | 934 | } |
935 | 935 | if( mediaType == 'video' || mediaType == 'audio'){ |
936 | | - js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) ); |
937 | | - $j('#clip_edit_disp').append( |
938 | | - rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) |
939 | | - ); |
940 | | - //rewrite by id handldes getting any libs we are missing: |
941 | | - rewrite_by_id('embed_vid',function(){ |
942 | | - //grab any information that we got from the ROE xml or parsed from the media file |
943 | | - rObj = rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' ); |
944 | | - //add the re-sizable to the doLoad request: |
945 | | - clibs['$j.ui.resizable'] ='jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js'; |
946 | | - clibs['$j.fn.hoverIntent'] ='jquery/plugins/jquery.hoverIntent.js'; |
947 | | - mvJsLoader.doLoad(clibs, function(){ |
948 | | - //make sure the rsd_edit_img is hidden: |
949 | | - $j('#rsd_edit_img').hide(); |
950 | | - //run the image clip tools |
951 | | - _this.cEdit = new mvClipEdit( mvClipInit ); |
952 | | - }); |
| 936 | + //make sure we have the embedVideo libs: |
| 937 | + mvJsLoader.embedVideoCheck(function(){ |
| 938 | + js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) ); |
| 939 | + $j('#clip_edit_disp').append( |
| 940 | + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) |
| 941 | + ); |
| 942 | + //rewrite by id handldes getting any libs we are missing: |
| 943 | + rewrite_by_id('embed_vid',function(){ |
| 944 | + //grab any information that we got from the ROE xml or parsed from the media file |
| 945 | + rObj = rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' ); |
| 946 | + //add the re-sizable to the doLoad request: |
| 947 | + clibs['$j.ui.resizable'] ='jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js'; |
| 948 | + clibs['$j.fn.hoverIntent'] ='jquery/plugins/jquery.hoverIntent.js'; |
| 949 | + mvJsLoader.doLoad(clibs, function(){ |
| 950 | + //make sure the rsd_edit_img is hidden: |
| 951 | + $j('#rsd_edit_img').hide(); |
| 952 | + //run the image clip tools |
| 953 | + _this.cEdit = new mvClipEdit( mvClipInit ); |
| 954 | + }); |
| 955 | + }); |
953 | 956 | }); |
954 | 957 | } |
955 | 958 | }, |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -143,66 +143,6 @@ |
144 | 144 | mv_get_loading_img('top:30px;left:30px') + |
145 | 145 | '</div>'); |
146 | 146 | } |
147 | | -//library to load core mv_embed libraries |
148 | | -var mvBaseLoader = { |
149 | | - calledloadBaseLibs:false, |
150 | | - callbacks:new Array(), |
151 | | - done:false, |
152 | | - load:function( callback){ |
153 | | - //if we are done loading the libs just jump directly to the callback |
154 | | - if(this.done==true){ |
155 | | - callback(); |
156 | | - return ; |
157 | | - } |
158 | | - //queue the callback: |
159 | | - if(callback) |
160 | | - mvBaseLoader.addLoadEvent(callback); |
161 | | - //run if not already running: |
162 | | - if( ! mvBaseLoader.calledloadBaseLibs ){ |
163 | | - js_log("called loadBaseLibs"); |
164 | | - //only call load base libs once |
165 | | - mvBaseLoader.calledloadBaseLibs=true; |
166 | | - //issue a style sheet request can come in whenever: |
167 | | - if(!styleSheetPresent( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css')) |
168 | | - loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css'); |
169 | | - |
170 | | - //two loading stages, first get jQuery |
171 | | - var _this = this; |
172 | | - mvJsLoader.doLoad({ |
173 | | - 'window.jQuery' :'jquery/jquery-1.2.6.js' |
174 | | - },function(){ |
175 | | - //once jQuery is loaded set up no conflict & load plugins: |
176 | | - _global['$j'] = jQuery.noConflict(); |
177 | | - //set up ajax to not send dynamic urls for loading scripts |
178 | | - $j.ajaxSetup({ |
179 | | - cache: true |
180 | | - }); |
181 | | - js_log('jquery loaded'); |
182 | | - //load the jQuery dependent plugins: |
183 | | - mvJsLoader.doLoad({ |
184 | | - 'embedVideo' : 'libEmbedVideo/mv_baseEmbed.js', |
185 | | - '$j.ui.mouse' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js', |
186 | | - '$j.ui.droppable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
187 | | - '$j.ui.draggable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
188 | | - },function(){ |
189 | | - js_log('plugins loaded: '); |
190 | | - mvBaseLoader.done = true; |
191 | | - // run queued functions from (addLoadEvent) |
192 | | - mvBaseLoader.runQuededFunctions(); |
193 | | - }); |
194 | | - }); |
195 | | - } |
196 | | - }, |
197 | | - runQuededFunctions:function(){ |
198 | | - js_log('runQuededFunctions::'); |
199 | | - while( mvBaseLoader.callbacks.length ){ |
200 | | - mvBaseLoader.callbacks.shift()(); |
201 | | - } |
202 | | - }, |
203 | | - addLoadEvent:function(fn){ |
204 | | - mvBaseLoader.callbacks.push(fn); |
205 | | - } |
206 | | -} |
207 | 147 | |
208 | 148 | /** |
209 | 149 | * mvJsLoader class handles initialization and js file loads |
— | — | @@ -210,6 +150,8 @@ |
211 | 151 | var mvJsLoader = { |
212 | 152 | libreq:{}, |
213 | 153 | libs:{}, |
| 154 | + //base lib flags: |
| 155 | + onReadyEvents:new Array(), |
214 | 156 | //to keep consistency across threads: |
215 | 157 | ptime:0, |
216 | 158 | ctime:0, |
— | — | @@ -319,9 +261,51 @@ |
320 | 262 | this.cur_path = cur_path; |
321 | 263 | return true; |
322 | 264 | }, |
323 | | - loadBaseLibs:function( callback ){ |
324 | | - mvBaseLoader.load( callback); |
325 | | - } |
| 265 | + /** |
| 266 | + * checks for jQuery and adds the $j noConflict var |
| 267 | + */ |
| 268 | + jQueryCheck:function(callback){ |
| 269 | + var _this = this; |
| 270 | + _this.doLoad({ |
| 271 | + 'window.jQuery' :'jquery/jquery-1.2.6.js' |
| 272 | + },function(){ |
| 273 | + _global['$j'] = jQuery.noConflict(); |
| 274 | + //set up ajax to not send dynamic urls for loading scripts (we control that with the scriptLoader) |
| 275 | + $j.ajaxSetup({ |
| 276 | + cache: true |
| 277 | + }); |
| 278 | + js_log('jquery loaded'); |
| 279 | + //run the callback |
| 280 | + callback(); |
| 281 | + }); |
| 282 | + }, |
| 283 | + embedVideoCheck:function( callback ){ |
| 284 | + var _this = this; |
| 285 | + //issue a style sheet request (no load checks on style sheets): |
| 286 | + if(!styleSheetPresent( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css')) |
| 287 | + loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css'); |
| 288 | + //make sure we have jQuery |
| 289 | + _this.jQueryCheck(function(){ |
| 290 | + _this.doLoad({ |
| 291 | + 'embedVideo' : 'libEmbedVideo/mv_baseEmbed.js', |
| 292 | + '$j.ui.mouse' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js', |
| 293 | + '$j.ui.droppable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
| 294 | + '$j.ui.draggable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
| 295 | + },function(){ |
| 296 | + js_log('embedVideo libs ready run callback:: '); |
| 297 | + callback(); |
| 298 | + }); |
| 299 | + }); |
| 300 | + }, |
| 301 | + addLoadEvent:function(fn){ |
| 302 | + this.onReadyEvents.push(fn); |
| 303 | + }, |
| 304 | + runQuededFunctions:function(){ |
| 305 | + js_log('runQuededFunctions:: onReadyEvents'); |
| 306 | + while( this.onReadyEvents.length ){ |
| 307 | + this.onReadyEvents.shift()(); |
| 308 | + } |
| 309 | + } |
326 | 310 | } |
327 | 311 | |
328 | 312 | |
— | — | @@ -369,7 +353,7 @@ |
370 | 354 | document.getElementsByTagName("playlist").length!=0){ |
371 | 355 | js_log('we have vids to process'); |
372 | 356 | //load libs and proccess: |
373 | | - mvJsLoader.loadBaseLibs(function(){ |
| 357 | + mvJsLoader.embedVideoCheck(function(){ |
374 | 358 | //run any queded global events: |
375 | 359 | mv_embed( function(){ |
376 | 360 | while(mvLoadEvent.length){ |
— | — | @@ -390,7 +374,7 @@ |
391 | 375 | function rewrite_by_id( vid_id, ready_callback ){ |
392 | 376 | js_log('f:rewrite_by_id: ' + vid_id); |
393 | 377 | //force a recheck of the dom for playlist or video element: |
394 | | - mvJsLoader.loadBaseLibs(function(){ |
| 378 | + mvJsLoader.embedVideoCheck(function(){ |
395 | 379 | mv_embed(ready_callback, vid_id ); |
396 | 380 | }); |
397 | 381 | } |
— | — | @@ -546,7 +530,7 @@ |
547 | 531 | if(method=='style'){ |
548 | 532 | embed_video.setAttribute('style', videoInterface[method]); |
549 | 533 | }else if(method=='class'){ |
550 | | - if(embedTypes.msie) |
| 534 | + if( $j.browser.msie ) |
551 | 535 | embed_video.setAttribute("className", videoInterface['class']); |
552 | 536 | else |
553 | 537 | embed_video.setAttribute("class", videoInterface['class']); |
— | — | @@ -603,8 +587,13 @@ |
604 | 588 | /* init remote search */ |
605 | 589 | function mv_do_remote_search(initObj){ |
606 | 590 | js_log(':::::mv_do_remote_search::::'); |
| 591 | + |
| 592 | + //issue a load skin request: |
| 593 | + if(!styleSheetPresent( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css')) |
| 594 | + loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css'); |
| 595 | + |
607 | 596 | //insure we have the basic libs (jquery etc) : |
608 | | - mvJsLoader.loadBaseLibs(function(){ |
| 597 | + mvJsLoader.jQueryCheck(function(){ |
609 | 598 | //load search specifc extra stuff |
610 | 599 | mvJsLoader.doLoad({ |
611 | 600 | 'remoteSearchDriver':'libAddMedia/remoteSearchDriver.js' |
— | — | @@ -623,7 +612,7 @@ |
624 | 613 | if(!styleSheetPresent(mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css')) |
625 | 614 | loadExternalCss(mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css'); |
626 | 615 | //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page) |
627 | | - mvJsLoader.loadBaseLibs(function(){ |
| 616 | + mvJsLoader.embedVideoCheck(function(){ |
628 | 617 | //load playlist object and drag,drop,resize,hoverintent,libs |
629 | 618 | mvJsLoader.doLoad({ |
630 | 619 | 'mvPlayList':'libSequencer/mvPlayList.js', |
— | — | @@ -722,6 +711,7 @@ |
723 | 712 | } |
724 | 713 | |
725 | 714 | //addLoadEvent for adding functions to be run when the page DOM is done loading |
| 715 | +//@@todo depricate in favor of: |
726 | 716 | function mv_addLoadEvent(func) { |
727 | 717 | mvLoadEvent.push(func); |
728 | 718 | } |
— | — | @@ -858,7 +848,7 @@ |
859 | 849 | //js_log('load string:'+"\n"+ response['pay_load']); |
860 | 850 | //debugger; |
861 | 851 | //attempt to parse as xml for IE |
862 | | - if( embedTypes.msie ){ |
| 852 | + if( $j.browser.msie ){ |
863 | 853 | var xmldata=new ActiveXObject("Microsoft.XMLDOM"); |
864 | 854 | xmldata.async="false"; |
865 | 855 | xmldata.loadXML(response['pay_load']); |
— | — | @@ -1035,7 +1025,7 @@ |
1036 | 1026 | log_elm.value+=string+"\n"; |
1037 | 1027 | }*/ |
1038 | 1028 | } |
1039 | | - //return false; |
| 1029 | + return false; |
1040 | 1030 | } |
1041 | 1031 | |
1042 | 1032 | function js_error(string){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedVideo/mv_baseEmbed.js |
— | — | @@ -2365,13 +2365,15 @@ |
2366 | 2366 | { |
2367 | 2367 | //do another test for safari: |
2368 | 2368 | if( this.safari ){ |
2369 | | - var dummyvid = document.createElement("video"); |
2370 | | - if (dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably") |
2371 | | - { |
2372 | | - this.players.addPlayer( videoElementPlayer ); |
2373 | | - } else { |
2374 | | - /* could add some user nagging to install the xiph qt */ |
2375 | | - } |
| 2369 | + /*var dummyvid = document.createElement("video"); |
| 2370 | + try{ |
| 2371 | + if (dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably") |
| 2372 | + { |
| 2373 | + this.players.addPlayer( videoElementPlayer ); |
| 2374 | + } else { |
| 2375 | + could add some user nagging to install the xiph qt |
| 2376 | + } |
| 2377 | + }*/ |
2376 | 2378 | }else{ |
2377 | 2379 | this.players.addPlayer( videoElementPlayer ); |
2378 | 2380 | } |