Index: trunk/extensions/MetavidWiki/MV_LocalSettings.php |
— | — | @@ -1,4 +1,5 @@ |
2 | 2 | <? |
| 3 | +//@@todo depreciate put all settings into LocalSettings.php |
3 | 4 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
4 | 5 | // include the default settings: |
5 | 6 | include_once( dirname( __FILE__ ) . '/includes/MV_DefaultSettings.php' ); |
Index: trunk/extensions/MetavidWiki/includes/MV_MagicWords.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | // list of valid arguments and their default value: |
21 | 21 | var $params = array ( 'format' => 'ul_list', 'num_results' => 5, |
22 | 22 | 'time_range' => 'last_week', 'class' => '', |
23 | | - 'person' => '', 'bill' => '' ); |
| 23 | + 'person' => '', 'bill' => '', 'display_cat'=>'' ); |
24 | 24 | |
25 | 25 | function __construct( $arg_list ) { |
26 | 26 | // print_r($arg_list); |
— | — | @@ -209,38 +209,42 @@ |
210 | 210 | $ptitle = Title::MakeTitle( NS_MAIN, $mvd_row->Speech_by ); |
211 | 211 | $mvd_out_html .= '<span class="keywords">' . |
212 | 212 | $sk->makeKnownLinkObj( $ptitle, $ptitle->getText() ) . |
213 | | - '</span>'; |
| 213 | + '</span><br>'; |
214 | 214 | } |
215 | 215 | } |
216 | 216 | if ( isset( $mvd_row->Bill ) ) { |
217 | 217 | if ( trim( $mvd_row->Bill ) != '' ) { |
218 | 218 | $btitle = Title::MakeTitle( NS_MAIN, $mvd_row->Bill ); |
219 | | - $mvd_out_html .= '<br><span class="keywords">Bill:' . |
| 219 | + $mvd_out_html .= '<span class="keywords">Bill: ' . |
220 | 220 | $sk->makeKnownLinkObj( $btitle ) . ' |
221 | | - </span>'; |
| 221 | + </span><br>'; |
222 | 222 | } |
223 | 223 | } |
224 | 224 | global $wgContLang; |
225 | 225 | $mvdNStxt = $wgContLang->getNsText(MV_NS_MVD); |
226 | | - //grab categories: |
227 | | - /*$cl_res = $dbr->select('categorylinks', 'cl_to', |
228 | | - array('cl_sortkey'=>$mvdNStxt.':'.str_replace('_',' ',$mvd_row->wiki_title)), |
229 | | - 'getTopClips::Categories', |
230 | | - 'LIMIT 0, 5'); |
231 | | - if($dbr->numRows($cl_res)!=0){ |
232 | | - $o.='<span class="keywords">Categories: '; |
233 | | - $coma=''; |
234 | | - while($cl_row= $dbr->fetchObject($cl_res) ){ |
235 | | - $cTitle = Title::MakeTitle(NS_CATEGORY, $cl_row->cl_to); |
236 | | - $mvd_out_html.=$coma.$sk->makeKnownLinkObj($cTitle, $cTitle->getText()); |
237 | | - $coma=', '; |
238 | | - } |
239 | | - $mvd_out_html.='</span>'; |
240 | | - }*/ |
| 226 | + |
| 227 | + //grab categories if no bill or speech |
| 228 | + if( $this->params['display_cat'] || $mvd_out_html=='' ){ |
| 229 | + $dbr = wfGetDB( DB_READ ); |
| 230 | + $cl_res = $dbr->select('categorylinks', 'cl_to', |
| 231 | + array('cl_sortkey'=>$mvdNStxt.':'.str_replace('_',' ',$mvd_row->wiki_title)), |
| 232 | + 'getTopClips::Categories', |
| 233 | + 'LIMIT 0, 5'); |
| 234 | + if($dbr->numRows($cl_res)!=0){ |
| 235 | + $mvd_out_html .='<span class="keywords">Categories: '; |
| 236 | + $coma=''; |
| 237 | + while($cl_row= $dbr->fetchObject($cl_res) ){ |
| 238 | + $cTitle = Title::MakeTitle(NS_CATEGORY, $cl_row->cl_to); |
| 239 | + $mvd_out_html.=$coma.$sk->makeKnownLinkObj($cTitle, $cTitle->getText()); |
| 240 | + $coma=', '; |
| 241 | + } |
| 242 | + $mvd_out_html.='</span><br>'; |
| 243 | + } |
| 244 | + } |
241 | 245 | }else{ |
242 | | - //return false if we have not meta |
243 | | - if( isset($opt['remove_no_meta']) && $opt['remove_no_meta']) |
244 | | - return false; |
| 246 | + //we have not meta |
| 247 | + //if( isset($opt['remove_no_meta']) && $opt['remove_no_meta']) |
| 248 | + //return false; |
245 | 249 | } |
246 | 250 | |
247 | 251 | |
Index: trunk/extensions/MetavidWiki/includes/MV_DefaultSettings.php |
— | — | @@ -22,8 +22,10 @@ |
23 | 23 | |
24 | 24 | |
25 | 25 | //script loader settings: |
| 26 | +$mvgJSDebug=false; |
26 | 27 | $wgEnableScriptLoader = true; //if the script loader is on at all |
27 | 28 | $wgEnableScriptLoaderJsFile = true; //if you can use the script loader with js files (rather than only js classes) |
| 29 | +$wgEnableScriptMinify = true; |
28 | 30 | |
29 | 31 | |
30 | 32 | |
— | — | @@ -31,8 +33,8 @@ |
32 | 34 | // (causes the inclution of jquery into every page.. can slow things down a bit) |
33 | 35 | $mvEnableAutoComplete = true; |
34 | 36 | |
35 | | -$mvgJSDebug=false; |
36 | 37 | |
| 38 | + |
37 | 39 | // if you want mvd links to be rewritten client side as inline movie clips and link to the stream page |
38 | 40 | $mvEnableJSMVDrewrite = true; |
39 | 41 | |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -558,7 +558,7 @@ |
559 | 559 | if ( !$mvTitle->doesStreamExist() )return ; |
560 | 560 | |
561 | 561 | // @@todo this should be cached |
562 | | - $thumb_ref = $mvTitle->getStreamImageURL( '320x240', null, '', true ); |
| 562 | + $thumb_ref = $mvTitle->getFullStreamImageURL( '320x240', null, '', true ); |
563 | 563 | if ( $desc_html == '' ) { |
564 | 564 | $article = new Article( $wikiTitle ); |
565 | 565 | $wgOut->clearHTML(); |
— | — | @@ -590,13 +590,21 @@ |
591 | 591 | <?php echo $desc_xml?> |
592 | 592 | </description> |
593 | 593 | <?php |
594 | | -global $mvDefaultVideoQualityKey, $mvVidQualityMsgKeyType; |
595 | | -//check a few different types: |
596 | | -$stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoQualityKey); |
597 | | -if($stream_url !== false && isset( $mvVidQualityMsgKeyType[ $mvDefaultVideoQualityKey ]) ) { |
598 | | - echo '<enclosure name="'. wfMsg($mvDefaultVideoQualityKey) .'" type="video/ogg" url="'. mvRSSFeed::xmlEncode( $ogg_stream_url ) .'"/>'; |
| 594 | +global $mvDefaultVideoQualityKey, $mvVidQualityMsgKeyType, $mvDefaultVideoHighQualityKey; |
| 595 | +//check a few different types in order of prefrence: |
| 596 | +if( $stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoHighQualityKey) ){ |
| 597 | + $mk = $mvDefaultVideoHighQualityKey; |
| 598 | +}else if( $stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoQualityKey) ) { |
| 599 | + $mk = $mvDefaultVideoQualityKey; |
| 600 | +}else if( $stream_url = $mvTitle->getWebStreamURL($mvDefaultFlashQualityKey) ) { |
| 601 | + $mk = $mvDefaultFlashQualityKey; |
599 | 602 | } |
| 603 | +if($stream_url) { |
| 604 | + echo '<enclosure name="'. wfMsg($mk) .'" type="video/ogg" '. |
| 605 | + 'url="'. mvRSSFeed::xmlEncode( $stream_url ).'"/>'; |
| 606 | +} |
600 | 607 | ?> |
| 608 | + |
601 | 609 | <comments> |
602 | 610 | <?php echo mvRSSFeed::xmlEncode( $talkpage->getFullUrl() )?> |
603 | 611 | </comments> |
Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | global $mvVersion, $mvNamespace, $mvgIP, $wgHooks, $wgExtensionCredits, $mvMasterStore, |
48 | 48 | $wgParser, $mvArticlePath, $mvgScriptPath, $wgServer, $wgExtensionFunctions, $markerList,$wgVersion, |
49 | 49 | $wgAjaxExportList, $mvEnableAutoComplete, $mvEnableJSMVDrewrite, |
50 | | - $wgAutoloadClasses, $wgSpecialPages, $wgMediaHandlers, $wgJsAutoloadLocalClasses, |
| 50 | + $wgAutoloadClasses, $wgSpecialPages, $wgMediaHandlers, $wgJSAutoloadClasses, |
51 | 51 | $wgAPIModules; |
52 | 52 | |
53 | 53 | |
— | — | @@ -100,34 +100,51 @@ |
101 | 101 | /**********************************************/ |
102 | 102 | $mv_jspath = $mvgIP . '/skins/'; |
103 | 103 | $mvjsp = $mv_jspath . 'mv_embed/'; |
| 104 | + //core: |
| 105 | + $wgJSAutoloadClasses['window.jQuery'] = $mvjsp . 'jquery/jquery-1.2.6.js'; |
| 106 | + $wgJSAutoloadClasses['mv_embed'] = $mvjsp . 'mv_embed.js'; |
104 | 107 | |
| 108 | + $wgJSAutoloadClasses['mv_allpages'] = $mv_jspath . 'mv_allpages.js'; |
| 109 | + $wgJSAutoloadClasses['mv_search'] = $mv_jspath . 'mv_search.js'; |
| 110 | + $wgJSAutoloadClasses['mv_stream'] = $mv_jspath . 'mv_stream.js'; |
| 111 | + |
| 112 | + //$wgJSAutoloadClasses[''] |
| 113 | + $wgJSAutoloadClasses['j.ui.mouse'] = $mvjsp . 'jquery/jquery.ui-1.5.2/ui/ui.core.js'; |
| 114 | + $wgJSAutoloadClasses['j.ui.droppable'] = $mvjsp . 'jquery/jquery.ui-1.5.2/ui/ui.droppable.js'; |
| 115 | + $wgJSAutoloadClasses['j.ui.draggable'] = $mvjsp . 'jquery/jquery.ui-1.5.2/ui/ui.draggable.js'; |
| 116 | + $wgJSAutoloadClasses['j.ui.sortable'] = $mvjsp . 'jquery/jquery.ui-1.5.2/ui/ui.sortable.js'; |
| 117 | + $wgJSAutoloadClasses['j.ui.resizable'] = $mvjsp . 'jquery/jquery.ui-1.5.2/ui/ui.resizable.js'; |
| 118 | + $wgJSAutoloadClasses['j.contextMenu'] = $mvjsp . 'jquery/plugins/jquery.contextMenu.js'; |
| 119 | + $wgJSAutoloadClasses['j.fn.autocomplete'] = $mvjsp . 'jquery/plugins/jquery.autocomplete.js'; |
| 120 | + $wgJSAutoloadClasses['j.fn.hoverIntent'] = $mvjsp . 'jquery/plugins/jquery.hoverIntent.js'; |
| 121 | + |
105 | 122 | //libAddMedia: |
106 | | - $wgJsAutoloadLocalClasses['upFirefogg'] = $mvjsp . 'libAddMedia/firefogg.js'; |
107 | | - $wgJsAutoloadLocalClasses['mvUploader'] = $mvjsp . 'libAddMedia/mvUploader.js'; |
108 | | - $wgJsAutoloadLocalClasses['remoteSearchDriver'] = $mvjsp . 'libAddMedia/remoteSearchDriver.js'; |
109 | | - $wgJsAutoloadLocalClasses['mediaWikiSearch'] = $mvjsp . 'libAddMedia/searchLibs/mediaWikiSearch.js'; |
110 | | - $wgJsAutoloadLocalClasses['metavidSearch'] = $mvjsp . 'libAddMedia/searchLibs/metavidSearch.js'; |
111 | | - $wgJsAutoloadLocalClasses['solrArchiveSearch'] = $mvjsp . 'libAddMedia/searchLibs/solrArchiveSearch.js'; |
| 123 | + $wgJSAutoloadClasses['upFirefogg'] = $mvjsp . 'libAddMedia/firefogg.js'; |
| 124 | + $wgJSAutoloadClasses['mvUploader'] = $mvjsp . 'libAddMedia/mvUploader.js'; |
| 125 | + $wgJSAutoloadClasses['remoteSearchDriver'] = $mvjsp . 'libAddMedia/remoteSearchDriver.js'; |
| 126 | + $wgJSAutoloadClasses['mediaWikiSearch'] = $mvjsp . 'libAddMedia/searchLibs/mediaWikiSearch.js'; |
| 127 | + $wgJSAutoloadClasses['metavidSearch'] = $mvjsp . 'libAddMedia/searchLibs/metavidSearch.js'; |
| 128 | + $wgJSAutoloadClasses['solrArchiveSearch'] = $mvjsp . 'libAddMedia/searchLibs/solrArchiveSearch.js'; |
112 | 129 | |
113 | 130 | //libClipEdit: |
114 | | - $wgJsAutoloadLocalClasses['mvClipEdit'] = $mvjsp . 'libClipEdit/mvClipEdit.js'; |
| 131 | + $wgJSAutoloadClasses['mvClipEdit'] = $mvjsp . 'libClipEdit/mvClipEdit.js'; |
115 | 132 | |
116 | 133 | //libEmbedObj: |
117 | | - $wgJsAutoloadLocalClasses['mv_baseEmbed'] = $mvjsp . 'libEmbedObj/mv_baseEmbed.js'; |
118 | | - $wgJsAutoloadLocalClasses['mv_flashEmbed'] = $mvjsp . 'libEmbedObj/mv_flashEmbed.js'; |
119 | | - $wgJsAutoloadLocalClasses['mv_genericEmbed'] = $mvjsp . 'libEmbedObj/mv_genericEmbed.js'; |
120 | | - $wgJsAutoloadLocalClasses['mv_htmlEmbed'] = $mvjsp . 'libEmbedObj/mv_htmlEmbed.js'; |
121 | | - $wgJsAutoloadLocalClasses['mv_javaEmbed'] = $mvjsp . 'libEmbedObj/mv_javaEmbed.js'; |
122 | | - $wgJsAutoloadLocalClasses['mv_nativeEmbed'] = $mvjsp . 'libEmbedObj/mv_nativeEmbed.js'; |
123 | | - $wgJsAutoloadLocalClasses['mv_quicktimeEmbed'] = $mvjsp . 'libEmbedObj/mv_quicktimeEmbed.js'; |
124 | | - $wgJsAutoloadLocalClasses['mv_vlcEmbed'] = $mvjsp . 'libEmbedObj/mv_vlcEmbed.js'; |
| 134 | + $wgJSAutoloadClasses['embedVideo'] = $mvjsp . 'libEmbedObj/mv_baseEmbed.js'; |
| 135 | + $wgJSAutoloadClasses['flashEmbed'] = $mvjsp . 'libEmbedObj/mv_flashEmbed.js'; |
| 136 | + $wgJSAutoloadClasses['genericEmbed'] = $mvjsp . 'libEmbedObj/mv_genericEmbed.js'; |
| 137 | + $wgJSAutoloadClasses['htmlEmbed'] = $mvjsp . 'libEmbedObj/mv_htmlEmbed.js'; |
| 138 | + $wgJSAutoloadClasses['javaEmbed'] = $mvjsp . 'libEmbedObj/mv_javaEmbed.js'; |
| 139 | + $wgJSAutoloadClasses['nativeEmbed'] = $mvjsp . 'libEmbedObj/mv_nativeEmbed.js'; |
| 140 | + $wgJSAutoloadClasses['quicktimeEmbed'] = $mvjsp . 'libEmbedObj/mv_quicktimeEmbed.js'; |
| 141 | + $wgJSAutoloadClasses['vlcEmbed'] = $mvjsp . 'libEmbedObj/mv_vlcEmbed.js'; |
125 | 142 | |
126 | 143 | //libSequencer: |
127 | | - $wgJsAutoloadLocalClasses['mvPlayList'] = $mvjsp . 'libSequencer/mvPlayList.js'; |
128 | | - $wgJsAutoloadLocalClasses['mvSequencer'] = $mvjsp . 'libSequencer/mvSequencer.js'; |
| 144 | + $wgJSAutoloadClasses['mvPlayList'] = $mvjsp . 'libSequencer/mvPlayList.js'; |
| 145 | + $wgJSAutoloadClasses['mvSequencer'] = $mvjsp . 'libSequencer/mvSequencer.js'; |
129 | 146 | |
130 | 147 | //libTimedText: |
131 | | - $wgJsAutoloadLocalClasses['mvTextInterface'] = $mvjsp . 'libTimedText/mvTextInterface.js'; |
| 148 | + $wgJSAutoloadClasses['mvTextInterface'] = $mvjsp . 'libTimedText/mvTextInterface.js'; |
132 | 149 | |
133 | 150 | |
134 | 151 | /**********************************************/ |
— | — | @@ -324,28 +341,38 @@ |
325 | 342 | * enables linkback and autocomplete for search |
326 | 343 | */ |
327 | 344 | function mvfAutoAllPageHeader() { |
328 | | - global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle, $mvgJSDebug; |
| 345 | + global $mvgScriptPath, $wgJsMimeType, $wgOut, $mvExtraHeader, $wgTitle, $mvgJSDebug, $wgEnableScriptLoader; |
329 | 346 | $mvgScriptPath = htmlspecialchars( $mvgScriptPath ); |
330 | 347 | $wgJsMimeType = htmlspecialchars( $wgJsMimeType ) ; |
331 | 348 | //set the unquie request value |
332 | 349 | if( $mvgJSDebug ){ |
333 | 350 | $unique_req_param = time(); |
334 | 351 | }else{ |
| 352 | + //@@could just read from the svn version file info |
335 | 353 | $unique_req_param = MV_VERSION; |
336 | 354 | } |
337 | 355 | |
338 | 356 | /* (moved to on_dom ready) but here as well*/ |
339 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js?{$unique_req_param}\"></script>" ); |
340 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js?{$unique_req_param}\"></script>" ); |
341 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js?{$unique_req_param}\"></script>" ); |
342 | | - |
343 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js?{$unique_req_param}\"></script>" ); |
344 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_allpages.js?{$unique_req_param}\"></script>" ); |
345 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js?{$unique_req_param}\"></script>" ); |
| 357 | + if( $wgEnableScriptLoader ){ |
| 358 | + $debug_param = ($mvgJSDebug)?'&debug=true':false; |
| 359 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mvwScriptLoader.php?" . |
| 360 | + "class=window.jQuery,j.fn.autocomplete,j.fn.hoverIntent,mv_embed,mv_allpages,mv_search" . |
| 361 | + '&urid=' .$unique_req_param . |
| 362 | + $debug_param . "\"></script>" |
| 363 | + ); |
| 364 | + }else{ |
| 365 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js?{$unique_req_param}\"></script>" ); |
| 366 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js?{$unique_req_param}\"></script>" ); |
| 367 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js?{$unique_req_param}\"></script>" ); |
| 368 | + |
| 369 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js?{$unique_req_param}\"></script>" ); |
| 370 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_allpages.js?{$unique_req_param}\"></script>" ); |
| 371 | + $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js?{$unique_req_param}\"></script>" ); |
| 372 | + } |
346 | 373 | |
347 | 374 | //temp for testing: |
348 | | - if( $mvgJSDebug ) |
349 | | - $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/add_media_wizard.js?{$unique_req_param}\"></script>" ); |
| 375 | + //if( $mvgJSDebug ) |
| 376 | + // $wgOut->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/add_media_wizard.js?{$unique_req_param}\"></script>" ); |
350 | 377 | |
351 | 378 | $mvCssUrl = $mvgScriptPath . '/skins/mv_custom.css'; |
352 | 379 | $wgOut->addLink( array( |
Index: trunk/extensions/MetavidWiki/skins/mv_common.js |
— | — | @@ -1,27 +0,0 @@ |
2 | | -/*@@TODO should be set by mediaWiki so it uses wfMsg */ |
3 | | - |
4 | | -/* |
5 | | -* adds adjustment hooks |
6 | | -* @mvd_id set to the mvd_id |
7 | | -*/ |
8 | | - |
9 | | - |
10 | | -//alert(typeof js_log); |
11 | | -//logging: |
12 | | -function js_log(string){ |
13 | | - if( window.console ){ |
14 | | - console.log(string); |
15 | | - }else{ |
16 | | - /* |
17 | | - * IE and non-firebug debug append text box: |
18 | | - */ |
19 | | - /* var log_elm = document.getElementById('mv_js_log'); |
20 | | - if(!log_elm){ |
21 | | - document.write('<textarea id="mv_js_log" cols="80" rows="6"></textarea>'); |
22 | | - var log_elm = document.getElementById('mv_js_log'); |
23 | | - } |
24 | | - if(log_elm){ |
25 | | - log_elm.value+=string+"\n"; |
26 | | - }*/ |
27 | | - } |
28 | | -} |
Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js |
— | — | @@ -42,8 +42,10 @@ |
43 | 43 | //alert("!!upload hook"); |
44 | 44 | load_mv_embed( function(){ |
45 | 45 | //load jQuery and what not (we need to refactor the loading system for mv_embed) |
46 | | - mvEmbed.load_libs(function(){ |
47 | | - mvJsLoader.doLoad({'mvUploader' : 'libAddMedia/mvUploader.js'},function(){ |
| 46 | + mvJsLoader.loadBaseLibs(function(){ |
| 47 | + mvJsLoader.doLoad( { |
| 48 | + 'mvUploader' : 'libAddMedia/mvUploader.js' |
| 49 | + },function(){ |
48 | 50 | mvUp = new mvUploader(); |
49 | 51 | }); |
50 | 52 | }); |
Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -4,8 +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.doLoad(mvEmbed.lib_jquery, function(){ |
9 | | - _global['$j'] = jQuery.noConflict(); |
| 8 | + mvJsLoader.loadBaseLibs(function(){ |
10 | 9 | mv_setup_search(req_mode); |
11 | 10 | }); |
12 | 11 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -16,26 +16,23 @@ |
17 | 17 | |
18 | 18 | var gMvd={}; |
19 | 19 | function mv_setup_allpage(){ |
20 | | - js_log("mv embed done loading now setup 'all page'"); |
21 | | - |
| 20 | + js_log("mv embed done loading now setup 'all page'"); |
22 | 21 | //make sure we have jQuery and any base required libs: |
23 | | - mvJsLoader.doLoad(mvEmbed.lib_jquery, function(){ |
24 | | - _global['$j'] = jQuery.noConflict(); |
25 | | - js_log('allpage_ did jquery check'); |
26 | | - |
27 | | - var reqLibs = {'$j.fn.autocomplete':'jquery/plugins/jquery.autocomplete.js', |
28 | | - '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js'}; |
29 | | - mvJsLoader.doLoad( |
30 | | - reqLibs, function(){ |
31 | | - //js_log('allpage_ auto and hover check'+mv_setup_allpage_flag); |
32 | | - if(!mv_setup_allpage_flag){ |
33 | | - mv_setup_search_ac(); |
34 | | - mv_do_mvd_link_rewrite(); |
35 | | - mv_page_specific_rewrites(); |
36 | | - //set the flag: |
37 | | - mv_setup_allpage_flag=true; |
38 | | - } |
39 | | - }); |
| 22 | + mvJsLoader.loadBaseLibs(function(){ |
| 23 | + js_log('allpage_ did jquery check'); |
| 24 | + mvJsLoader.doLoad( { |
| 25 | + '$j.fn.autocomplete':'jquery/plugins/jquery.autocomplete.js', |
| 26 | + '$j.fn.hoverIntent':'jquery/plugins/jquery.hoverIntent.js' |
| 27 | + }, function(){ |
| 28 | + //js_log('allpage_ auto and hover check'+mv_setup_allpage_flag); |
| 29 | + if( !mv_setup_allpage_flag ){ |
| 30 | + mv_setup_search_ac(); |
| 31 | + mv_do_mvd_link_rewrite(); |
| 32 | + mv_page_specific_rewrites(); |
| 33 | + //set the flag: |
| 34 | + mv_setup_allpage_flag=true; |
| 35 | + } |
| 36 | + }); |
40 | 37 | }); |
41 | 38 | } |
42 | 39 | function mv_do_sequence_edit_swap(mode){ |
Index: trunk/extensions/MetavidWiki/skins/mv_stream.js |
— | — | @@ -54,13 +54,13 @@ |
55 | 55 | function mv_load_interface_libs(){ |
56 | 56 | js_log('f:mv_load_interface_libs'); |
57 | 57 | //we will need mv_embed stuff: |
58 | | - mvEmbed.load_libs(function(){ |
| 58 | + mvJsLoader.loadBaseLibs(function(){ |
59 | 59 | js_log('load stream js'); |
60 | 60 | //load some additional plugins/components: |
61 | 61 | //:hoverIntent |
62 | 62 | //http://cherne.net/brian/resources/jquery.hoverIntent.html |
63 | 63 | mvJsLoader.doLoad({ |
64 | | - '$j.autocomplete' : 'jquery/plugins/jquery.autocomplete.js', |
| 64 | + '$j.fn.autocomplete' : 'jquery/plugins/jquery.autocomplete.js', |
65 | 65 | '$j.fn.hoverIntent' : 'jquery/plugins/jquery.hoverIntent.js', |
66 | 66 | '$j.ui.resizable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js', |
67 | 67 | 'mvClipEdit' : 'libClipEdit/mvClipEdit.js' |
— | — | @@ -68,8 +68,12 @@ |
69 | 69 | //now extend draggable |
70 | 70 | mvJsLoader.doLoad({ |
71 | 71 | '$j.ui.draggable.prototype.plugins.drag':'jquery/plugins/ui.draggable.ext.js' |
72 | | - },function(){ |
73 | | - mv_stream_interface.init(); |
| 72 | + },function(){ |
| 73 | + //make sure mv_embed has done video re-write: |
| 74 | + mv_embed( function(){ |
| 75 | + mv_stream_interface.init(); |
| 76 | + }); |
| 77 | + |
74 | 78 | }); |
75 | 79 | }); |
76 | 80 | }); |
— | — | @@ -95,7 +99,7 @@ |
96 | 100 | //add_custom_effects(); |
97 | 101 | //set up the init values for mouse over restore: |
98 | 102 | org_vid_title = $j('#mv_stream_time').html(); |
99 | | - if( $j('#embed_vid').length==0 || !$j('#embed_vid').get(0).ready_to_play){ |
| 103 | + if( $j('#embed_vid').length==0 || !$j('#embed_vid').get(0).ready_to_play ){ |
100 | 104 | //no embed video present stop init |
101 | 105 | js_log('no clip ready to play'); |
102 | 106 | return false; |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -22,8 +22,12 @@ |
23 | 23 | } |
24 | 24 | |
25 | 25 | //used to grab fresh copies of scripts. (should be changed on commit) |
26 | | -var MV_EMBED_VERSION = '1.0r10'; |
| 26 | +var MV_EMBED_VERSION = '1.0r11'; |
27 | 27 | |
| 28 | +//if we should use the scriptLoader |
| 29 | +//( lets you group requests, minimize javascript, and use mediaWiki localization infastructure) |
| 30 | +var MV_USE_SCRIPT_LOADER = true; |
| 31 | + |
28 | 32 | //the name of the player skin (default is mvpcf) |
29 | 33 | var mv_skin_name = 'mvpcf'; |
30 | 34 | |
— | — | @@ -68,52 +72,48 @@ |
69 | 73 | } |
70 | 74 | |
71 | 75 | //all default msg in [English] should be overwritten by the CMS language msg system. |
72 | | -loadGM( { |
73 | | - 'loading_txt':'loading <blink>...</blink>', |
74 | | - 'loading_plugin' : 'loading plugin<blink>...</blink>', |
75 | | - 'select_playback' : 'Set Playback Preference', |
76 | | - 'link_back' : 'Link Back', |
77 | | - 'error_load_lib' : 'mv_embed: Unable to load required javascript libraries\n'+ |
78 | | - 'insert script via DOM has failed, try reloading? ', |
| 76 | +loadGM({ |
| 77 | + "loading_txt":"loading <blink>...</blink>", |
| 78 | + "loading_plugin" : "loading plugin<blink>...</blink>", |
| 79 | + "select_playback" : "Set Playback Preference", |
| 80 | + "link_back" : "Link Back", |
| 81 | + "error_load_lib" : "mv_embed: Unable to load required javascript libraries\n insert script via DOM has failed, try reloading? ", |
79 | 82 | |
80 | | - 'error_swap_vid' : 'Error:mv_embed was unable to swap the video tag for the mv_embed interface', |
| 83 | + "error_swap_vid" : "Error:mv_embed was unable to swap the video tag for the mv_embed interface", |
81 | 84 | |
82 | | - 'download_segment' : 'Download Selection:', |
83 | | - 'download_full' : 'Download Full Video File:', |
84 | | - 'download_clip' : 'Download the Clip', |
85 | | - 'download_text' : 'Download Text (<a style="color:white" title="cmml" href="http://wiki.xiph.org/index.php/CMML">cmml</a> xml):', |
| 85 | + "download_segment" : "Download Selection:", |
| 86 | + "download_full" : "Download Full Video File:", |
| 87 | + "download_clip" : "Download the Clip", |
| 88 | + "download_text" : "Download Text (<a style=\"color:white\" title=\"cmml\" href=\"http://wiki.xiph.org/index.php/CMML\">cmml</a> xml):", |
86 | 89 | |
87 | | - 'clip_linkback' : 'Clip Source Page', |
88 | | - //plugin names: |
89 | | - 'ogg-player-vlc-mozilla' : 'VLC Plugin', |
90 | | - 'ogg-player-videoElement' : 'Native Ogg Video Support', |
91 | | - 'ogg-player-vlc-activex' : 'VLC ActiveX', |
92 | | - 'ogg-player-oggPlay' : 'Annodex OggPlay Plugin', |
93 | | - 'ogg-player-oggPlugin' : 'Generic Ogg Plugin', |
94 | | - 'ogg-player-quicktime-mozilla' : 'Quicktime Plugin', |
95 | | - 'ogg-player-quicktime-activex' : 'Quicktime ActiveX', |
96 | | - 'ogg-player-cortado' : 'Java Cortado', |
97 | | - 'ogg-player-flowplayer' : 'Flowplayer', |
98 | | - 'ogg-player-selected' : ' (selected)', |
99 | | - 'generic_missing_plugin' : 'You browser does not appear to support playback type: <b>$1</b><br>' + |
100 | | - 'visit the <a href="http://metavid.org/wiki/Client_Playback">Playback Methods</a> page to download a player<br>', |
| 90 | + "clip_linkback" : "Clip Source Page", |
| 91 | + |
| 92 | + "ogg-player-vlc-mozilla" : "VLC Plugin", |
| 93 | + "ogg-player-videoElement" : "Native Ogg Video Support", |
| 94 | + "ogg-player-vlc-activex" : "VLC ActiveX", |
| 95 | + "ogg-player-oggPlay" : "Annodex OggPlay Plugin", |
| 96 | + "ogg-player-oggPlugin" : "Generic Ogg Plugin", |
| 97 | + "ogg-player-quicktime-mozilla" : "Quicktime Plugin", |
| 98 | + "ogg-player-quicktime-activex" : "Quicktime ActiveX", |
| 99 | + "ogg-player-cortado" : "Java Cortado", |
| 100 | + "ogg-player-flowplayer" : "Flowplayer", |
| 101 | + "ogg-player-selected" : " (selected)", |
| 102 | + "generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://metavid.org/wiki/Client_Playback\">Playback Methods</a> page to download a player<br>", |
101 | 103 | |
102 | | - 'add_to_end_of_sequence' : 'Add to End of Sequence', |
| 104 | + "add_to_end_of_sequence" : "Add to End of Sequence", |
103 | 105 | |
104 | | - 'missing_video_stream' : 'The video file for this stream is missing', |
| 106 | + "missing_video_stream" : "The video file for this stream is missing", |
105 | 107 | |
106 | | - 'select_transcript_set' : 'Select Text Layers', |
107 | | - 'auto_scroll' : 'auto scroll', |
108 | | - 'close' : 'close', |
109 | | - 'improve_transcript' : 'Improve Transcript', |
| 108 | + "select_transcript_set" : "Select Text Layers", |
| 109 | + "auto_scroll" : "auto scroll", |
| 110 | + "close" : "close", |
| 111 | + "improve_transcript" : "Improve Transcript", |
110 | 112 | |
111 | | - 'next_clip_msg' : 'Play Next Clip', |
112 | | - 'prev_clip_msg' : 'Play Previous Clip', |
113 | | - 'current_clip_msg' : 'Continue Playing this Clip', |
114 | | - |
115 | | - 'seek_to' : 'Seek to' |
116 | | - } |
117 | | -); |
| 113 | + "next_clip_msg" : "Play Next Clip", |
| 114 | + "prev_clip_msg" : "Play Previous Clip", |
| 115 | + "current_clip_msg" : "Continue Playing this Clip", |
| 116 | + "seek_to" : "Seek to" |
| 117 | +}); |
118 | 118 | |
119 | 119 | //get a language message |
120 | 120 | function gM( key , args ) { |
— | — | @@ -144,114 +144,170 @@ |
145 | 145 | '</div>'); |
146 | 146 | } |
147 | 147 | |
148 | | -/*********** INITIALIZATION CODE ************* |
149 | | - * the mvEmbed object drives basic loading of libs |
150 | | - * its load_libs function will be called if mv_embed is to be used on a given page |
151 | | - *********************************************/ |
152 | | -var mvEmbed = { |
153 | | - Version: MV_EMBED_VERSION, |
154 | | - loaded:false, |
155 | | - load_time:0, |
156 | | - flist:Array(), |
157 | | - load_callback:false, |
158 | | - loading:false, |
159 | | - libs_loaded:false, |
160 | | - //plugin libs var names and paths: |
161 | | - lib_base:{ |
162 | | - 'window.jQuery' :'jquery/jquery-1.2.6.js', |
163 | | - 'embedVideo' :'libEmbedObj/mv_baseEmbed.js' |
164 | | - }, |
165 | | - lib_plugins:{ |
166 | | - '$j.ui.mouse' :'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js' //load the core ui |
167 | | - }, |
168 | | - // not used: |
169 | | - //'$j.timer.global':'jquery/plugins/jquery.timers.js', |
170 | | - lib_controlui:{ |
171 | | - '$j.ui.droppable':'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
172 | | - '$j.ui.draggable':'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
173 | | - }, |
174 | | - /* @@todo move to single packaged jquery ui library: |
175 | | - , //include draggable |
176 | | - '$j.ui.resizable':'jquery/jquery.ui-1.5.2/ui/minified/ui.resizable.min.js' |
177 | | - '$j.ui.progressbar':'jquery/jquery-ui-personalized-1.6rc1.debug.js' |
178 | | - */ |
179 | | - pc:null, //used to store pointer to parent clip (when in playlist mode) |
180 | | - load_libs:function( callback , target_id){ |
181 | | - //js_log('f:load_libs: '+callback); |
182 | | - if( callback )this.load_callback = callback; |
183 | | - |
184 | | - //if libs are already loaded jump directly to the callback |
185 | | - if(this.libs_loaded){ |
186 | | - mvEmbed.init( target_id ); |
187 | | - return true; |
188 | | - } |
189 | | - //two loading stages, first get jQuery |
190 | | - var _this = this; |
191 | | - mvJsLoader.doLoad(this.lib_base,function(){ |
192 | | - js_log("type of " + typeof window.jQuery); |
193 | | - //once jQuery is loaded set up no conflict & load plugins: |
194 | | - _global['$j'] = jQuery.noConflict(); |
195 | | - //set up ajax to not send dynamic urls for loading scripts |
196 | | - $j.ajaxSetup({ |
197 | | - cache: true |
198 | | - }); |
199 | | - js_log('jquery loaded'); |
200 | | - mvJsLoader.doLoad(_this.lib_plugins, function(){ |
201 | | - //load control ui after ui.core loaded |
202 | | - mvJsLoader.doLoad(_this.lib_controlui, function(){ |
203 | | - js_log('plugins loaded'); |
204 | | - mvEmbed.libs_loaded=true; |
205 | | - mvEmbed.init(); |
| 148 | +/** |
| 149 | + * mvJsLoader class handles initialization and js file loads |
| 150 | + */ |
| 151 | +var mvJsLoader = { |
| 152 | + libreq:{}, |
| 153 | + libs:{}, |
| 154 | + //to keep consistency across threads: |
| 155 | + ptime:0, |
| 156 | + ctime:0, |
| 157 | + load_error:false,//load error flag (false by default) |
| 158 | + calledloadBaseLibs:false,//flag for base load lib |
| 159 | + load_time:0, |
| 160 | + callbacks:new Array(), |
| 161 | + |
| 162 | + flist:new Array(), |
| 163 | + loadBaseLibs : function( callback ){ |
| 164 | + //queue the callback: |
| 165 | + if(callback) |
| 166 | + mvJsLoader.addLoadEvent(callback); |
| 167 | + //run if not already running: |
| 168 | + if( ! mvJsLoader.calledloadBaseLibs ){ |
| 169 | + js_log("called loadBaseLibs"); |
| 170 | + //only call load base libs once |
| 171 | + mvJsLoader.calledloadBaseLibs=true; |
| 172 | + //issue a style sheet request can come in whenever: |
| 173 | + if(!styleSheetPresent(mv_embed_path+'skins/'+mv_skin_name+'/styles.css')) |
| 174 | + loadExternalCss(mv_embed_path+'skins/'+mv_skin_name+'/styles.css'); |
| 175 | + |
| 176 | + //two loading stages, first get jQuery |
| 177 | + var _this = this; |
| 178 | + mvJsLoader.doLoad({ |
| 179 | + 'window.jQuery' :'jquery/jquery-1.2.6.js', |
| 180 | + 'embedVideo' :'libEmbedObj/mv_baseEmbed.js' |
| 181 | + },function(){ |
| 182 | + //once jQuery is loaded set up no conflict & load plugins: |
| 183 | + _global['$j'] = jQuery.noConflict(); |
| 184 | + //set up ajax to not send dynamic urls for loading scripts |
| 185 | + $j.ajaxSetup({ |
| 186 | + cache: true |
206 | 187 | }); |
207 | | - }); |
208 | | - }); |
209 | | - }, |
210 | | - addLoadEvent:function(fn){ |
211 | | - this.flist.push(fn); |
212 | | - }, |
213 | | - init: function( target_id ){ |
214 | | - //load mv_embed skin stylesheet: |
215 | | - if(!styleSheetPresent(mv_embed_path+'skins/'+mv_skin_name+'/styles.css')) |
216 | | - loadExternalCss(mv_embed_path+'skins/'+mv_skin_name+'/styles.css'); |
217 | | - |
218 | | - mv_embed( target_id ); |
219 | | - |
220 | | - this.check_init_done(); |
221 | | - }, |
222 | | - /* |
223 | | - * should be cleaned up ... the embedType loading should be part of load_libs above: |
224 | | - */ |
225 | | - check_init_done:function(){ |
226 | | - //check if all videos are "ready to play" |
227 | | - var is_ready=true; |
228 | | - |
229 | | - for(var i=0; i < global_player_list.length; i++){ |
230 | | - if( $j('#'+global_player_list[i]).length !=0){ |
231 | | - var cur_vid = $j('#'+global_player_list[i]).get(0); |
232 | | - is_ready = ( cur_vid.ready_to_play ) ? is_ready : false; |
233 | | - if( !is_ready && cur_vid.load_error ){ |
234 | | - is_ready=true; |
235 | | - $j(cur_vid).html( cur_vid.load_error ); |
236 | | - } |
237 | | - } |
238 | | - } |
239 | | - //js_log('f:check_init_done '+ is_ready + ' ' + cur_vid.load_error + ' rtp: '+ cur_vid.ready_to_play); |
240 | | - if( !is_ready ){ |
241 | | - //js_log('some ' + global_player_list + ' not ready'); |
242 | | - setTimeout( 'mvEmbed.check_init_done()', 50 ); |
243 | | - }else{ |
244 | | - //call the callback: |
245 | | - if(typeof this.load_callback == 'function') |
246 | | - if(this.load_callback)this.load_callback(); |
247 | | - |
248 | | - //js_log('run queue functions:' + mvEmbed.flist); |
249 | | - while (mvEmbed.flist.length){ |
250 | | - mvEmbed.flist.shift()(); |
251 | | - } |
252 | | - } |
253 | | - } |
| 188 | + js_log('jquery loaded'); |
| 189 | + //load the jQuery dependent plugins: |
| 190 | + mvJsLoader.doLoad({ |
| 191 | + '$j.ui.mouse' :'jquery/jquery.ui-1.5.2/ui/minified/ui.core.min.js', |
| 192 | + '$j.ui.droppable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.droppable.min.js', |
| 193 | + '$j.ui.draggable' : 'jquery/jquery.ui-1.5.2/ui/minified/ui.draggable.min.js' |
| 194 | + },function(){ |
| 195 | + js_log('plugins loaded'); |
| 196 | + // run queued functions |
| 197 | + while (mvJsLoader.flist.length){ |
| 198 | + mvJsLoader.flist.shift()(); |
| 199 | + } |
| 200 | + }); |
| 201 | + }); |
| 202 | + } |
| 203 | + }, |
| 204 | + addLoadEvent:function(fn){ |
| 205 | + this.flist.push(fn); |
| 206 | + }, |
| 207 | + doLoad:function(libs, callback){ |
| 208 | + this.ctime++; |
| 209 | + if(libs){ //setup this.libs: |
| 210 | + |
| 211 | + //first check if we already have this lib loaded |
| 212 | + var all_libs_loaded=true; |
| 213 | + for(var i in libs){ |
| 214 | + //check if the lib is already loaded: |
| 215 | + if( ! this.checkObjPath( i ) ){ |
| 216 | + all_libs_loaded=false; |
| 217 | + } |
| 218 | + } |
| 219 | + if( all_libs_loaded ){ |
| 220 | + //jump directly to the call back; do not pass go do not issue load request |
| 221 | + callback(); |
| 222 | + return ; |
| 223 | + } |
| 224 | + |
| 225 | + //check if we should use the script loader to combine all the requests into one: |
| 226 | + if( MV_USE_SCRIPT_LOADER ){ |
| 227 | + var class_set = ''; |
| 228 | + var last_class = ''; |
| 229 | + var coma = ''; |
| 230 | + for( var i in libs ){ |
| 231 | + //only add if not included yet: |
| 232 | + if( ! this.checkObjPath( i ) ){ |
| 233 | + class_set+=coma + i ; |
| 234 | + last_class=i; |
| 235 | + coma=','; |
| 236 | + } |
| 237 | + } |
| 238 | + this.libs[ last_class ] = 'mvwScriptLoader.php?class=' + class_set + |
| 239 | + '&urid='+ mv_embed_urid; |
| 240 | + }else{ |
| 241 | + //do many requests: |
| 242 | + for(var i in libs){ //for in loop oky on object |
| 243 | + //js_log('add lib: '+i + ' = ' + libs[i]); |
| 244 | + this.libs[i]=libs[i]; |
| 245 | + } |
| 246 | + } |
| 247 | + } |
| 248 | + if( callback ){ |
| 249 | + this.callbacks.push(callback); |
| 250 | + } |
| 251 | + if( mvJsLoader.checkLoading() ){ |
| 252 | + if( this.load_time++ > 2000){ //time out after ~50seconds |
| 253 | + js_error( gM('error_load_lib') + this.cur_path ); |
| 254 | + this.load_error=true; |
| 255 | + }else{ |
| 256 | + setTimeout( 'mvJsLoader.doLoad()', 25 ); |
| 257 | + } |
| 258 | + }else{ |
| 259 | + //only do callback if we are in the same instance (weird concurency issue) |
| 260 | + var cb_count=0; |
| 261 | + for(var i=0; i < this.callbacks.length; i++) |
| 262 | + cb_count++; |
| 263 | + //js_log('REST LIBS: loading is: '+ loading + ' run callbacks: '+cb_count +' p:'+ this.ptime +' c:'+ this.ctime); |
| 264 | + //reset the libs |
| 265 | + this.libs={}; |
| 266 | + //js_log('done loading do call: ' + this.callbacks[0] ); |
| 267 | + while( this.callbacks.length !=0 ){ |
| 268 | + if( this.ptime== ( this.ctime-1) ){ //enforce thread consistency |
| 269 | + this.callbacks.pop()(); |
| 270 | + //func = this.callbacks.pop(); |
| 271 | + //js_log(' run: '+this.ctime+ ' p: ' + this.ptime + ' ' +loading+ ' :'+ func); |
| 272 | + //func(); |
| 273 | + }else{ |
| 274 | + //re-issue doLoad ( ptime will be set to ctime so we should catch up) |
| 275 | + setTimeout('mvJsLoader.doLoad()',25); |
| 276 | + break; |
| 277 | + } |
| 278 | + } |
| 279 | + } |
| 280 | + this.ptime=this.ctime; |
| 281 | + }, |
| 282 | + checkLoading:function(){ |
| 283 | + var loading=0; |
| 284 | + var i=null; |
| 285 | + for(var i in this.libs){ //for in loop oky on object |
| 286 | + if( ! this.checkObjPath( i ) ){ |
| 287 | + if(!this.libreq[i]) loadExternalJs( mv_embed_path + this.libs[i] ); |
| 288 | + this.libreq[i]=1; |
| 289 | + loading=1; |
| 290 | + } |
| 291 | + } |
| 292 | + return loading; |
| 293 | + }, |
| 294 | + checkObjPath:function( libVar ){ |
| 295 | + var objPath = libVar.split('.') |
| 296 | + var cur_path =''; |
| 297 | + for(var p=0; p < objPath.length; p++){ |
| 298 | + cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p]; |
| 299 | + eval( 'var ptest = typeof ( '+ cur_path + ' ); '); |
| 300 | + if( ptest == 'undefined'){ |
| 301 | + return false; |
| 302 | + } |
| 303 | + } |
| 304 | + this.cur_path = cur_path; |
| 305 | + return true; |
| 306 | + } |
254 | 307 | } |
255 | 308 | |
| 309 | + |
| 310 | + |
| 311 | + |
256 | 312 | /** |
257 | 313 | * mediaPlayer represents a media player plugin. |
258 | 314 | * @param {String} id id used for the plugin. |
— | — | @@ -649,87 +705,6 @@ |
650 | 706 | |
651 | 707 | //load an external JS (similar to jquery .require plugin) |
652 | 708 | //but checks for object availability rather than load state |
653 | | -var mvJsLoader = { |
654 | | - libreq:{}, |
655 | | - libs:{}, |
656 | | - //to keep consistency across threads: |
657 | | - ptime:0, |
658 | | - ctime:0, |
659 | | - load_error:false,//load error flag (false by default) |
660 | | - |
661 | | - load_time:0, |
662 | | - callbacks:new Array(), |
663 | | - doLoad:function(libs,callback){ |
664 | | - this.ctime++; |
665 | | - //js_log('doLoad: '+this.ctime); |
666 | | - //stack callbacks |
667 | | - if(callback){ |
668 | | - this.callbacks.push(callback); |
669 | | - } |
670 | | - //merge any new requested libs |
671 | | - if(libs){ |
672 | | - for(var i in libs){ //for in loop oky on object |
673 | | - //js_log('add lib: '+i + ' = ' + libs[i]); |
674 | | - this.libs[i]=libs[i]; |
675 | | - } |
676 | | - } |
677 | | - var loading=0; |
678 | | - var i=null; |
679 | | - for(var i in this.libs){ //for in loop oky on object |
680 | | - //if(i=='vlcEmbed')alert('got called with '+i+' ' + typeof(vlcEmbed)); |
681 | | - //itor the objPath (to avoid 'has no properties' errors) |
682 | | - var objPath = i.split('.'); |
683 | | - var cur_path =''; |
684 | | - var cur_load=0; |
685 | | - for(var p=0; p < objPath.length; p++){ |
686 | | - cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p]; |
687 | | - if(eval('typeof '+cur_path)=='undefined'){ |
688 | | - cur_load = loading=1; |
689 | | - //js_log("cur_load = loading=1"); |
690 | | - break; |
691 | | - } |
692 | | - //if we have made the full comparison break out: |
693 | | - if(cur_path==i){ |
694 | | - break; |
695 | | - } |
696 | | - } |
697 | | - if(cur_load==1){ |
698 | | - if(!this.libreq[i])loadExternalJs(mv_embed_path + this.libs[i]); |
699 | | - this.libreq[i]=1; |
700 | | - } |
701 | | - } |
702 | | - if(loading){ |
703 | | - if( this.load_time++ > 2000){ //time out after ~50seconds |
704 | | - js_error( gM('error_load_lib') + cur_path); |
705 | | - this.load_error=true; |
706 | | - }else{ |
707 | | - setTimeout('mvJsLoader.doLoad()',25); |
708 | | - } |
709 | | - }else{ |
710 | | - //only do callback if we are in the same range: |
711 | | - var cb_count=0; |
712 | | - for(var i=0; i < this.callbacks.length; i++) |
713 | | - cb_count++; |
714 | | - //js_log('REST LIBS: loading is: '+ loading + ' run callbacks: '+cb_count +' p:'+ this.ptime +' c:'+ this.ctime); |
715 | | - //reset the libs |
716 | | - this.libs={}; |
717 | | - //js_log('done loading do call: ' + this.callbacks[0] ); |
718 | | - while( this.callbacks.length !=0 ){ |
719 | | - if( this.ptime== ( this.ctime-1) ){ //enforce thread consistency |
720 | | - this.callbacks.pop()(); |
721 | | - //func = this.callbacks.pop(); |
722 | | - //js_log(' run: '+this.ctime+ ' p: ' + this.ptime + ' ' +loading+ ' :'+ func); |
723 | | - //func(); |
724 | | - }else{ |
725 | | - //re-issue doLoad ( ptime will be set to ctime so we should catch up) |
726 | | - setTimeout('mvJsLoader.doLoad()',25); |
727 | | - break; |
728 | | - } |
729 | | - } |
730 | | - } |
731 | | - this.ptime=this.ctime; |
732 | | - } |
733 | | -} |
734 | 709 | |
735 | 710 | /*********** INITIALIZATION CODE ************* |
736 | 711 | * this will get called when DOM is ready |
— | — | @@ -740,7 +715,7 @@ |
741 | 716 | * $j(document).ready( function(){ */ |
742 | 717 | function init_mv_embed(force){ |
743 | 718 | js_log('f:init_mv_embed'); |
744 | | - if(!force && mv_init_done ){ |
| 719 | + if( !force && mv_init_done ){ |
745 | 720 | js_log("mv_init_done do nothing..."); |
746 | 721 | return false; |
747 | 722 | } |
— | — | @@ -749,13 +724,15 @@ |
750 | 725 | if(document.getElementsByTagName("video").length!=0 || |
751 | 726 | document.getElementsByTagName("playlist").length!=0){ |
752 | 727 | js_log('we have vids to process'); |
753 | | - //load libs |
754 | | - mvEmbed.load_libs(); |
| 728 | + //load libs and proccess: |
| 729 | + mvJsLoader.loadBaseLibs(function(){ |
| 730 | + mv_embed(); |
| 731 | + }); |
755 | 732 | }else{ |
756 | 733 | js_log('no video or playlist on the page... (done)'); |
757 | 734 | //run any queued functions: |
758 | | - while (mvEmbed.flist.length){ |
759 | | - mvEmbed.flist.shift()(); |
| 735 | + while (mvJsLoader.flist.length){ |
| 736 | + mvJsLoader.flist.shift()(); |
760 | 737 | } |
761 | 738 | } |
762 | 739 | } |
— | — | @@ -765,7 +742,9 @@ |
766 | 743 | function rewrite_by_id( vid_id, ready_callback ){ |
767 | 744 | js_log('f:rewrite_by_id: ' + vid_id); |
768 | 745 | //force a recheck of the dom for playlist or video element: |
769 | | - mvEmbed.load_libs( ready_callback, vid_id ); |
| 746 | + mvJsLoader.loadBaseLibs(function(){ |
| 747 | + mv_embed(ready_callback, vid_id ); |
| 748 | + }); |
770 | 749 | } |
771 | 750 | |
772 | 751 | |
— | — | @@ -795,81 +774,165 @@ |
796 | 775 | /* |
797 | 776 | * Converts all occurrences of <video> tag into video object |
798 | 777 | */ |
799 | | -function mv_embed( force_id ){ |
800 | | - //get mv_embed location if it has not been set |
801 | | - js_log('mv_embed ' + mvEmbed.Version); |
802 | | - |
803 | | - var loadPlaylistLib=false; |
804 | | - //set up the jQuery selector: |
805 | | - var j_selector = 'video,audio,playlist'; |
806 | | - if( force_id !=null ) |
807 | | - var j_selector = '#'+force_id; |
808 | | - |
809 | | - js_log('SELECTOR: '+ j_selector); |
810 | | - |
811 | | - //process selected elements: |
812 | | - $j(j_selector).each(function(){ |
813 | | - js_log( "Do SWAP: " + $j(this).attr("id") + ' tag: '+ this.tagName.toLowerCase() ); |
814 | | - |
815 | | - if( $j(this).attr("id") == '' ){ |
816 | | - $j(this).attr("id", 'v'+ global_player_list.length); |
817 | | - } |
818 | | - //stre a global reference to the id |
819 | | - global_player_list.push( $j(this).attr("id") ); |
820 | | - //add loading: (pre-loading div) |
821 | | - /*$j(this).after('<div id="pre_loading_div_'+elm_id + '">'+ |
822 | | - gM('loading_txt')+'</div>' ); |
823 | | - */ |
824 | | - |
825 | | - //if video doSwap |
826 | | - switch( this.tagName.toLowerCase()){ |
827 | | - case 'video': |
828 | | - var videoInterface = new embedVideo(this); |
829 | | - swapEmbedVideoElement( this, videoInterface ); |
830 | | - break; |
831 | | - case 'audio': |
832 | | - var videoInterface = new embedVideo(this); |
833 | | - videoInterface.type ='audio'; |
834 | | - swapEmbedVideoElement( this, videoInterface ); |
835 | | - break; |
836 | | - case 'playlist': |
837 | | - loadPlaylistLib=true; |
838 | | - break; |
839 | | - } |
840 | | - }); |
841 | | - if(loadPlaylistLib){ |
842 | | - js_log('f:load Playlist Lib:'); |
843 | | - mvJsLoader.doLoad({'mvPlayList':'libSequencer/mvPlayList.js'},function(){ |
844 | | - $j('playlist').each(function(){ |
845 | | - //check if we are in sequence mode load sequence libs (if not already loaded) |
846 | | - if( $j(this).attr('sequencer')=="true" ){ |
847 | | - var pl_element = this; |
848 | | - //load the mv_sequencer and the json util lib: |
849 | | - mvJsLoader.doLoad({ |
850 | | - 'mvSeqPlayList':'libSequencer/mvSequencer.js' |
851 | | - },function(){ |
852 | | - var seqObj = new mvSeqPlayList( pl_element ); |
853 | | - swapEmbedVideoElement( pl_element, seqObj ); |
854 | | - } |
855 | | - ); |
856 | | - }else{ |
857 | | - //create new playlist interface: |
858 | | - var plObj = new mvPlayList( this ); |
859 | | - swapEmbedVideoElement(this, plObj); |
860 | | - var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height; |
861 | | - //move into a blocking display container with height + controls + title height: |
862 | | - $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
863 | | - } |
| 778 | +function mv_embed(swap_done_callback, force_id){ |
| 779 | + mvEmbed.init( swap_done_callback, force_id ); |
| 780 | +} |
| 781 | +mvEmbed = { |
| 782 | + flist:new Array(), |
| 783 | + init:function( swap_done_callback, force_id ){ |
| 784 | + if(swap_done_callback) |
| 785 | + mvEmbed.flist.push( swap_done_callback ); |
| 786 | + //get mv_embed location if it has not been set |
| 787 | + js_log('mv_embed ' + MV_EMBED_VERSION); |
| 788 | + |
| 789 | + this.swap_done_callback = swap_done_callback; |
| 790 | + |
| 791 | + var loadPlaylistLib=false; |
| 792 | + //set up the jQuery selector: |
| 793 | + if( force_id == null && force_id != '' ){ |
| 794 | + var j_selector = 'video,audio,playlist'; |
| 795 | + }else{ |
| 796 | + var j_selector = '#'+force_id; |
| 797 | + } |
| 798 | + |
| 799 | + js_log('SELECTOR: '+ j_selector); |
| 800 | + |
| 801 | + //process selected elements: |
| 802 | + $j(j_selector).each(function(){ |
| 803 | + js_log( "Do SWAP: " + $j(this).attr("id") + ' tag: '+ this.tagName.toLowerCase() ); |
| 804 | + |
| 805 | + if( $j(this).attr("id") == '' ){ |
| 806 | + $j(this).attr("id", 'v'+ global_player_list.length); |
| 807 | + } |
| 808 | + //stre a global reference to the id |
| 809 | + global_player_list.push( $j(this).attr("id") ); |
| 810 | + //add loading: (pre-loading div) |
| 811 | + /*$j(this).after('<div id="pre_loading_div_'+elm_id + '">'+ |
| 812 | + gM('loading_txt')+'</div>' ); |
| 813 | + */ |
| 814 | + |
| 815 | + //if video doSwap |
| 816 | + switch( this.tagName.toLowerCase()){ |
| 817 | + case 'video': |
| 818 | + var videoInterface = new embedVideo(this); |
| 819 | + mvEmbed.swapEmbedVideoElement( this, videoInterface ); |
| 820 | + break; |
| 821 | + case 'audio': |
| 822 | + var videoInterface = new embedVideo(this); |
| 823 | + videoInterface.type ='audio'; |
| 824 | + mvEmbed.swapEmbedVideoElement( this, videoInterface ); |
| 825 | + break; |
| 826 | + case 'playlist': |
| 827 | + loadPlaylistLib=true; |
| 828 | + break; |
| 829 | + } |
| 830 | + }); |
| 831 | + if(loadPlaylistLib){ |
| 832 | + mvJsLoader.doLoad({ 'mvPlayList' : 'libSequencer/mvPlayList.js' },function(){ |
| 833 | + $j('playlist').each(function(){ |
| 834 | + //check if we are in sequence mode load sequence libs (if not already loaded) |
| 835 | + if( $j(this).attr('sequencer')=="true" ){ |
| 836 | + var pl_element = this; |
| 837 | + //load the mv_sequencer and the json util lib: |
| 838 | + mvJsLoader.doLoad({ |
| 839 | + 'mvSeqPlayList':'libSequencer/mvSequencer.js' |
| 840 | + },function(){ |
| 841 | + var seqObj = new mvSeqPlayList( pl_element ); |
| 842 | + mvEmbed.swapEmbedVideoElement( pl_element, seqObj ); |
| 843 | + } |
| 844 | + ); |
| 845 | + }else{ |
| 846 | + //create new playlist interface: |
| 847 | + var plObj = new mvPlayList( this ); |
| 848 | + mvEmbed.swapEmbedVideoElement(this, plObj); |
| 849 | + var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height; |
| 850 | + //move into a blocking display container with height + controls + title height: |
| 851 | + $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>'); |
| 852 | + } |
| 853 | + }); |
864 | 854 | }); |
| 855 | + } |
| 856 | + this.checkClipsReady(); |
| 857 | + }, |
| 858 | + /* |
| 859 | + * swapEmbedVideoElement |
| 860 | + * takes a video element as input and swaps it out with |
| 861 | + * an embed video interface based on the video_elements attributes |
| 862 | + */ |
| 863 | + swapEmbedVideoElement:function(video_element, videoInterface){ |
| 864 | + js_log('do swap ' + videoInterface.id + ' for ' + video_element); |
| 865 | + embed_video = document.createElement('div'); |
| 866 | + //make sure our div has a hight/width set: |
| 867 | + |
| 868 | + $j(embed_video).css({ |
| 869 | + 'width':videoInterface.width, |
| 870 | + 'height':videoInterface.height |
865 | 871 | }); |
866 | | - } |
| 872 | + //inherit the video interface |
| 873 | + for(var method in videoInterface){ //for in loop oky in Element context |
| 874 | + if(method!='readyState'){ //readyState crashes IE |
| 875 | + if(method=='style'){ |
| 876 | + embed_video.setAttribute('style', videoInterface[method]); |
| 877 | + }else if(method=='class'){ |
| 878 | + if(embedTypes.msie) |
| 879 | + embed_video.setAttribute("className", videoInterface['class']); |
| 880 | + else |
| 881 | + embed_video.setAttribute("class", videoInterface['class']); |
| 882 | + }else{ |
| 883 | + //normal inherit: |
| 884 | + embed_video[method]=videoInterface[method]; |
| 885 | + } |
| 886 | + } |
| 887 | + //string -> boolean: |
| 888 | + if(embed_video[method]=="false")embed_video[method]=false; |
| 889 | + if(embed_video[method]=="true")embed_video[method]=true; |
| 890 | + } |
| 891 | + ///js_log('did vI style'); |
| 892 | + //now swap out the video element for the embed_video obj: |
| 893 | + $j(video_element).after(embed_video).remove(); |
| 894 | + //js_log('did swap'); |
| 895 | + $j('#'+embed_video.id).get(0).on_dom_swap(); |
| 896 | + //remove loading: |
| 897 | + $j('#pre_loading_div_'+embed_video.id).remove(); |
| 898 | + // now that "embed_video" is stable, do more initialization (if we are ready) |
| 899 | + if($j('#'+embed_video.id).get(0).loading_external_data==false && |
| 900 | + $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){ |
| 901 | + //load and set ready state since source are available: |
| 902 | + $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
| 903 | + } |
| 904 | + js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
| 905 | + return true; |
| 906 | + }, |
| 907 | + //this should not be needed. |
| 908 | + checkClipsReady : function(){ |
| 909 | + var is_ready=true; |
| 910 | + for(var i=0; i < global_player_list.length; i++){ |
| 911 | + if( $j('#'+global_player_list[i]).length !=0){ |
| 912 | + var cur_vid = $j('#'+global_player_list[i]).get(0); |
| 913 | + is_ready = ( cur_vid.ready_to_play ) ? is_ready : false; |
| 914 | + if( !is_ready && cur_vid.load_error ){ |
| 915 | + is_ready=true; |
| 916 | + $j(cur_vid).html( cur_vid.load_error ); |
| 917 | + } |
| 918 | + } |
| 919 | + } |
| 920 | + if( is_ready ){ |
| 921 | + mvEmbed.allClipsReady = true; |
| 922 | + // run queued functions |
| 923 | + js_log('run queded functions:'); |
| 924 | + while (mvEmbed.flist.length){ |
| 925 | + mvEmbed.flist.shift()(); |
| 926 | + } |
| 927 | + }else{ |
| 928 | + setTimeout( 'mvEmbed.checkClipsReady()', 25 ); |
| 929 | + } |
| 930 | + } |
867 | 931 | } |
868 | | - |
869 | 932 | /* init remote search */ |
870 | 933 | function mv_do_remote_search(initObj){ |
871 | 934 | js_log(':::::mv_do_remote_search::::'); |
872 | 935 | //insure we have the basic libs (jquery etc) : |
873 | | - mvEmbed.load_libs(function(){ |
| 936 | + mvJsLoader.loadBaseLibs(function(){ |
874 | 937 | //load search specifc extra stuff |
875 | 938 | mvJsLoader.doLoad({ |
876 | 939 | 'mvBaseRemoteSearch':'libAddMedia/remoteSearchDriver.js' |
— | — | @@ -888,7 +951,7 @@ |
889 | 952 | if(!styleSheetPresent(mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css')) |
890 | 953 | loadExternalCss(mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css'); |
891 | 954 | //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page) |
892 | | - mvEmbed.load_libs(function(){ |
| 955 | + mvJsLoader.loadBaseLibs(function(){ |
893 | 956 | //load playlist object and drag,drop,resize,hoverintent,libs |
894 | 957 | mvJsLoader.doLoad({ |
895 | 958 | 'mvPlayList':'libSequencer/mvPlayList.js', |
— | — | @@ -917,58 +980,7 @@ |
918 | 981 | }); |
919 | 982 | }); |
920 | 983 | } |
921 | | - |
922 | | - |
923 | 984 | /* |
924 | | -* swapEmbedVideoElement |
925 | | -* takes a video element as input and swaps it out with |
926 | | -* an embed video interface based on the video_elements attributes |
927 | | -*/ |
928 | | -function swapEmbedVideoElement(video_element, videoInterface){ |
929 | | - js_log('do swap ' + videoInterface.id + ' for ' + video_element); |
930 | | - embed_video = document.createElement('div'); |
931 | | - //make sure our div has a hight/width set: |
932 | | - |
933 | | - $j(embed_video).css({ |
934 | | - 'width':videoInterface.width, |
935 | | - 'height':videoInterface.height |
936 | | - }); |
937 | | - //inherit the video interface |
938 | | - for(var method in videoInterface){ //for in loop oky in Element context |
939 | | - if(method!='readyState'){ //readyState crashes IE |
940 | | - if(method=='style'){ |
941 | | - embed_video.setAttribute('style', videoInterface[method]); |
942 | | - }else if(method=='class'){ |
943 | | - if(embedTypes.msie) |
944 | | - embed_video.setAttribute("className", videoInterface['class']); |
945 | | - else |
946 | | - embed_video.setAttribute("class", videoInterface['class']); |
947 | | - }else{ |
948 | | - //normal inherit: |
949 | | - embed_video[method]=videoInterface[method]; |
950 | | - } |
951 | | - } |
952 | | - //string -> boolean: |
953 | | - if(embed_video[method]=="false")embed_video[method]=false; |
954 | | - if(embed_video[method]=="true")embed_video[method]=true; |
955 | | - } |
956 | | - ///js_log('did vI style'); |
957 | | - //now swap out the video element for the embed_video obj: |
958 | | - $j(video_element).after(embed_video).remove(); |
959 | | - //js_log('did swap'); |
960 | | - $j('#'+embed_video.id).get(0).on_dom_swap(); |
961 | | - //remove loading: |
962 | | - $j('#pre_loading_div_'+embed_video.id).remove(); |
963 | | - // now that "embed_video" is stable, do more initialization (if we are ready) |
964 | | - if($j('#'+embed_video.id).get(0).loading_external_data==false && |
965 | | - $j('#'+embed_video.id).get(0).init_with_sources_loadedDone==false){ |
966 | | - //load and set ready state since source are available: |
967 | | - $j('#'+embed_video.id).get(0).init_with_sources_loaded(); |
968 | | - } |
969 | | - js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length); |
970 | | - return true; |
971 | | -} |
972 | | -/* |
973 | 985 | * utility functions: |
974 | 986 | */ |
975 | 987 | //simple url re-writer for standard temporal and size request urls: |
— | — | @@ -1026,7 +1038,7 @@ |
1027 | 1039 | |
1028 | 1040 | //addLoadEvent for adding functions to be run when the page DOM is done loading |
1029 | 1041 | function mv_addLoadEvent(func) { |
1030 | | - mvEmbed.addLoadEvent(func); |
| 1042 | + mvJsLoader.addLoadEvent(func); |
1031 | 1043 | } |
1032 | 1044 | |
1033 | 1045 | //does a remote or local api request based on request url |
— | — | @@ -1193,18 +1205,19 @@ |
1194 | 1206 | function getMvEmbedURL(){ |
1195 | 1207 | js_elements = document.getElementsByTagName("script"); |
1196 | 1208 | for(var i=0;i<js_elements.length; i++){ |
1197 | | - if( js_elements[i].src.indexOf('mv_embed.js') !=-1){ |
| 1209 | + if( js_elements[i].src.indexOf('mv_embed') !=-1){ |
1198 | 1210 | return js_elements[i].src; |
1199 | 1211 | } |
1200 | 1212 | } |
1201 | 1213 | return false; |
1202 | 1214 | } |
1203 | | -//gets a unique id from the mv_embed url else returns the version number |
| 1215 | +//gets a unique request id to ensure fresh javascript |
1204 | 1216 | function getMvUniqueReqId(){ |
1205 | 1217 | var mv_embed_url = getMvEmbedURL(); |
1206 | | - if( mv_embed_url.indexOf('?')!=-1 ){ |
1207 | | - return mv_embed_url.substr( mv_embed_url.indexOf('?')+1 ); |
1208 | | - } |
| 1218 | + var urid = parseUri( mv_embed_url).queryKey['urid'] |
| 1219 | + if( urid ) |
| 1220 | + return urid; |
| 1221 | + //else just return the mv_embed version; |
1209 | 1222 | return MV_EMBED_VERSION; |
1210 | 1223 | } |
1211 | 1224 | /* |
— | — | @@ -1212,7 +1225,11 @@ |
1213 | 1226 | */ |
1214 | 1227 | function getMvEmbedPath(){ |
1215 | 1228 | var mv_embed_url = getMvEmbedURL(); |
1216 | | - mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mv_embed.js')); |
| 1229 | + if(mv_embed_url.indexOf('mv_embed.js') !== -1){ |
| 1230 | + mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mv_embed.js')); |
| 1231 | + }else{ |
| 1232 | + mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mvwScriptLoader.php')); |
| 1233 | + } |
1217 | 1234 | //absolute the url (if relative) (if we don't have mv_embed path) |
1218 | 1235 | if(mv_embed_path.indexOf('://')==-1){ |
1219 | 1236 | var pURL = parseUri( document.URL ); |
— | — | @@ -1258,7 +1275,7 @@ |
1259 | 1276 | */ |
1260 | 1277 | /*var log_elm = document.getElementById('mv_js_log'); |
1261 | 1278 | if(!log_elm){ |
1262 | | - document.write('<div style="position:absolute;z-index:500;top:0px;left:0px;right:0px;height:50px;"><textarea id="mv_js_log" cols="80" rows="2"></textarea></div>'); |
| 1279 | + document.write('<div style="position:absolute;z-index:500;top:0px;left:0px;right:0px;height:50px;"><textarea id="mv_js_log" cols="120" rows="10"></textarea></div>'); |
1263 | 1280 | var log_elm = document.getElementById('mv_js_log'); |
1264 | 1281 | } |
1265 | 1282 | if(log_elm){ |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_flashEmbed.js |
— | — | @@ -1588,8 +1588,7 @@ |
1589 | 1589 | postEmbedJS: function() |
1590 | 1590 | { |
1591 | 1591 | var _this = this; |
1592 | | - js_log('embedFlow: uri:'+ _this.media_element.selected_source.getURI(this.seek_time_sec) |
1593 | | - +"\n"+ mv_embed_path + 'flowplayer/flowplayer-3.0.1.swf' ) ; |
| 1592 | + js_log('embedFlow: uri:'+ _this.media_element.selected_source.getURI(this.seek_time_sec) + "\n"+ mv_embed_path + 'flowplayer/flowplayer-3.0.1.swf' ) ; |
1594 | 1593 | var flowConfig = { |
1595 | 1594 | clip: { |
1596 | 1595 | url: _this.media_element.selected_source.getURI(this.seek_time_sec), |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js |
— | — | @@ -843,7 +843,7 @@ |
844 | 844 | do_request(this.roe, function(data) |
845 | 845 | { |
846 | 846 | //continue |
847 | | - _this.media_element.addROE(data); |
| 847 | + _this.media_element.addROE( data ); |
848 | 848 | js_log('added_roe::' + _this.media_element.sources.length); |
849 | 849 | |
850 | 850 | js_log('set loading_external_data=false'); |
— | — | @@ -1698,20 +1698,20 @@ |
1699 | 1699 | out+='</blockquote></span>'; |
1700 | 1700 | this.displayHTML(out); |
1701 | 1701 | }, |
1702 | | - /*download list is exessivly complicated ... rewrite for clarity: */ |
| 1702 | + /*download list is too complicated ... rewrite for clarity: */ |
1703 | 1703 | showVideoDownload:function(){ |
1704 | | - //load the roe if avaliable (to populate out download options: |
1705 | | - js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData); |
| 1704 | + //load the roe if available (to populate out download options: |
| 1705 | + //js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData); |
1706 | 1706 | if(this.roe && this.media_element.addedROEData==false){ |
1707 | 1707 | var _this = this; |
1708 | 1708 | this.displayHTML(gM('loading_txt')); |
1709 | 1709 | do_request(this.roe, function(data) |
1710 | 1710 | { |
1711 | 1711 | _this.media_element.addROE(data); |
1712 | | - $j('#mv_disp_inner_'+_this.id).html(_this.getShowVideoDownload()); |
| 1712 | + $j('#mv_disp_inner_'+_this.id).html( _this.getShowVideoDownload() ); |
1713 | 1713 | }); |
1714 | 1714 | }else{ |
1715 | | - this.displayHTML(this.getShowVideoDownload()); |
| 1715 | + this.displayHTML( this.getShowVideoDownload() ); |
1716 | 1716 | } |
1717 | 1717 | }, |
1718 | 1718 | getShowVideoDownload:function(){ |
Property changes on: trunk/extensions/MetavidWiki/skins/mv_embed/libEmbedObj/mv_baseEmbed.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/mvwScriptLoader.php |
— | — | @@ -22,17 +22,24 @@ |
23 | 23 | * http://www.gnu.org/copyleft/gpl.html |
24 | 24 | */ |
25 | 25 | |
| 26 | +/* |
| 27 | + * mvwScriptLoader: |
| 28 | + * |
| 29 | + * some documentation goes here |
| 30 | + * |
| 31 | + */ |
| 32 | + |
| 33 | + |
| 34 | + |
26 | 35 | //set the initial javascript classes: (for loading javascript via class name) |
27 | | -// also works via direct file calls |
28 | | -//can be extended via |
29 | | -global $wgJsAutoloadLocalClasses; |
30 | | -$wgJsAutoloadLocalClasses = array( |
| 36 | +global $wgJSAutoloadClasses; |
| 37 | +$wgJSAutoloadClasses = array( |
31 | 38 | |
32 | 39 | ); |
33 | 40 | |
34 | 41 | //include WebStart.php (this can be simplified once we move mvwScriptLoader to the root dir: |
35 | 42 | $root_path = dirname(__FILE__) . '/../../../../'; |
36 | | -chdir($root_path); |
| 43 | +chdir( $root_path ); |
37 | 44 | require_once('includes/WebStart.php'); |
38 | 45 | |
39 | 46 | wfProfileIn('mvwScriptLoader.php'); |
— | — | @@ -51,65 +58,246 @@ |
52 | 59 | } |
53 | 60 | //Verify the script loader is on: |
54 | 61 | if (!$wgEnableScriptLoader) { |
55 | | - echo 'MediaWiki API is not enabled for this site. Add the following line to your LocalSettings.php'; |
56 | | - echo '<pre><b>$wgEnableAPI=true;</b></pre>'; |
| 62 | + echo 'ScriptLoader is not enabled for this site. To enable add the following line to your LocalSettings.php'; |
| 63 | + echo '<pre><b>$wgEnableScriptLoader=true;</b></pre>'; |
57 | 64 | die(1); |
58 | 65 | } |
59 | 66 | //run the main action: |
60 | | -do_return_js(); |
61 | | -function do_return_js(){ |
62 | | - global $wgJsAutoloadLocalClasses, $wgEnableScriptLoaderJsFile, $wgRequest, $IP; |
63 | | - $jsFileList = array(); |
64 | | - //check for the requested classes |
65 | | - if( $wgRequest->getVal('class') ){ |
66 | | - $reqClassList = explode(',', $wgRequest->getVal('class')); |
67 | | - //clean the class list and populate jsFileList |
68 | | - foreach($reqClassList as $reqClass){ |
69 | | - $reqClass = ereg_replace("[^A-Za-z0-9_\-]", "", $reqClass ); |
70 | | - if( isset( $wgJsAutoloadLocalClasses[$reqClass] ) ){ |
71 | | - $jsFileList[ $reqClass ] = $wgJsAutoloadLocalClasses[ $reqClass ]; |
| 67 | +$myScriptLoader = new jsScriptLoader(); |
| 68 | +$myScriptLoader->doScriptLoader(); |
| 69 | + |
| 70 | +class jsScriptLoader{ |
| 71 | + var $jsFileList = array(); |
| 72 | + var $jsout = ''; |
| 73 | + var $rKey = ''; // the request key |
| 74 | + var $error_msg =''; |
| 75 | + var $debug = false; |
| 76 | + |
| 77 | + function doScriptLoader(){ |
| 78 | + global $wgJSAutoloadClasses, $wgEnableScriptLoaderJsFile, $wgRequest, $IP, |
| 79 | + $wgEnableScriptMinify, $wgUseFileCache; |
| 80 | + |
| 81 | + //process the request |
| 82 | + $this->procRequestVars(); |
| 83 | + |
| 84 | + $wgUseFileCache=false; |
| 85 | + //if cache is on and file is present grab it from there: |
| 86 | + if( $wgUseFileCache && !$this->debug ) { |
| 87 | + //setup file cache obj: |
| 88 | + $this->sFileCache = new simpleFileCache( $this->rKey ); |
| 89 | + if( $this->sFileCache->isFileCached() ){ |
| 90 | + $this->outputjsHeaders(); |
| 91 | + $this->sFileCache->loadFromFileCache(); |
72 | 92 | } |
| 93 | + } |
| 94 | + //build the output: |
| 95 | + |
| 96 | + //swap in the appropriate language per js_file |
| 97 | + foreach($this->jsFileList as $file_name){ |
| 98 | + if( trim( $file_name ) != '') |
| 99 | + $this->jsout .= $this->doProccessJsFile( $file_name ); |
73 | 100 | } |
| 101 | + |
| 102 | + //check if we should minify : |
| 103 | + if( $wgEnableScriptMinify && !$this->debug){ |
| 104 | + //do the minification and output |
| 105 | + require_once ( dirname(__FILE__) . '/jsmin.php'); |
| 106 | + $this->jsout = JSMin::minify( $this->jsout); |
| 107 | + } |
| 108 | + //save to the file cache: |
| 109 | + if( $wgUseFileCache && !$this->debug) { |
| 110 | + $this->sFileCache->saveToFileCache($this->jsout); |
| 111 | + } |
| 112 | + |
| 113 | + $this->outputjsHeaders(); |
| 114 | + if( $this->error_msg != '') |
| 115 | + echo 'alert(\'' . str_replace("\n", '\'+"\n"+'."\n'", $this->error_msg ). '\');'; |
| 116 | + |
| 117 | + echo trim($this->jsout); |
| 118 | + |
74 | 119 | } |
| 120 | + function outputJsHeaders(){ |
| 121 | + global $wgJsMimeType; |
| 122 | + //output js mime type: |
| 123 | + header( 'Content-type: '.$wgJsMimeType); |
| 124 | + //cache forever: |
| 125 | + //(the point is we never have to re validate since we should always change the request url based on the svn version) |
| 126 | + $one_year = 60*60*24*365; |
| 127 | + //header("Expires: " . gmdate( "D, d M Y H:i:s", time() + $one_year ) . " GM"); |
| 128 | + } |
| 129 | + /* |
| 130 | + * updates the proc Request |
| 131 | + */ |
| 132 | + function procRequestVars(){ |
| 133 | + global $wgRequest, $wgContLanguageCode, $wgEnableScriptMinify, $wgJSAutoloadClasses; |
| 134 | + |
| 135 | + //set debug flag: |
| 136 | + if($wgRequest->getVal('debug') || $wgEnableScriptDebug==true) |
| 137 | + $this->debug = true; |
| 138 | + |
| 139 | + //check for the requested classes |
| 140 | + if( $wgRequest->getVal('class') ){ |
| 141 | + $reqClassList = explode(',', $wgRequest->getVal('class')); |
| 142 | + //clean the class list and populate jsFileList |
| 143 | + foreach($reqClassList as $reqClass){ |
| 144 | + if(trim($reqClass)!=''){ |
| 145 | + $reqClass = ereg_replace("[^A-Za-z0-9_\-\.]", "", $reqClass ); |
| 146 | + if( isset( $wgJSAutoloadClasses[$reqClass] ) ){ |
| 147 | + $this->jsFileList[ $reqClass ] = $wgJSAutoloadClasses[ $reqClass ]; |
| 148 | + $this->rKey.=$reqClass; |
| 149 | + }else{ |
| 150 | + $this->error_msg.= 'Requested class: '.$reqClass.' not found'."\n"; |
| 151 | + } |
| 152 | + } |
| 153 | + } |
| 154 | + } |
| 155 | + //check for requested files if enabled: |
| 156 | + if( $wgEnableScriptLoaderJsFile ){ |
| 157 | + if( $wgRequest->getVal('files')){ |
| 158 | + $reqFileList = explode(',', $wgRequest->getVal('files')); |
| 159 | + //clean the file list and populate jsFileList |
| 160 | + foreach($reqFileList as $reqFile){ |
| 161 | + //no jumping dirs: |
| 162 | + $reqFile = str_replace('../','',$reqFile); |
| 163 | + //only allow alphanumeric underscores periods and ending with .js |
| 164 | + $reqFile = ereg_replace("[^A-Za-z0-9_\-\/\.]", "", $reqFile ); |
| 165 | + if( substr($reqFile, -3)=='.js'){ |
| 166 | + if( is_file( $IP . $reqFile) && !in_array($reqFile, $jsFileList ) ){ |
| 167 | + $this->jsFileList[] = $IP . $reqFile; |
| 168 | + $this->rKey.=$reqFile; |
| 169 | + }else{ |
| 170 | + $this->error_msg.= 'Requested File: '.$reqFile.' not found'."\n"; |
| 171 | + } |
| 172 | + } |
| 173 | + } |
| 174 | + } |
| 175 | + } |
| 176 | + //check for a unique request id (should be tied to the svn version for "fresh" copies of things |
| 177 | + if( $wgRequest->getVal('urid') ) { |
| 178 | + $this->urid = $wgRequest->getVal('urid'); |
| 179 | + }else{ |
| 180 | + //just give it the current version number: |
| 181 | + global $IP; |
| 182 | + $this->urid = SpecialVersion::getSvnRevision( $IP ); |
| 183 | + } |
| 184 | + //add the language code to the rKey: |
| 185 | + $this->rKey .= '_' . $wgContLanguageCode; |
| 186 | + |
| 187 | + //add the unique rid to the rKey |
| 188 | + $this->rKey .= $this->urid; |
| 189 | + |
| 190 | + //add a min flag: |
| 191 | + if($wgEnableScriptMinify){ |
| 192 | + $this->rKey.='_min'; |
| 193 | + } |
| 194 | + } |
| 195 | + function doProccessJsFile( $file_name ){ |
| 196 | + $str = file_get_contents($file_name); |
| 197 | + $this->cur_file = $file_name; |
| 198 | + //strip out js_log debug lines not much luck with this regExp yet: |
| 199 | + //if( !$this->debug ) |
| 200 | + // $str = preg_replace('/\n\s*js_log\s*\([^\)]([^;]|\n])*;/', "\n", $str); |
| 201 | + //die('<pre>'.$str); |
| 202 | + |
| 203 | + // do language swap |
| 204 | + $str = preg_replace_callback('/loadGM\s*\(\s*{(.*)}\s*\)\s*/siU', //@@todo fix: will break down if someone does }) in their msg text |
| 205 | + array($this, 'languageMsgReplace'), |
| 206 | + $str); |
75 | 207 | |
76 | | - //check for requested files if enabled: |
77 | | - if( $wgEnableScriptLoaderJsFile ){ |
78 | | - if( $wgRequest->getVal('files')){ |
79 | | - $reqFileList = explode(',', $wgRequest->getVal('files')); |
80 | | - //clean the file list and populate jsFileList |
81 | | - foreach($reqFileList as $reqFile){ |
82 | | - //no jumping dirs: |
83 | | - $reqFile = str_replace('../','',$reqFile); |
84 | | - //only allow alphanumeric underscores periods and ending with .js |
85 | | - $reqFile = ereg_replace("[^A-Za-z0-9_\-\/\.]", "", $reqFile ); |
86 | | - if( substr($reqFile, -3)=='.js'){ |
87 | | - if( is_file( $IP . $reqFile) && !in_array($reqFile, $jsFileList ) ){ |
88 | | - $jsFileList[] = $IP . $reqFile; |
89 | | - } |
90 | | - } |
| 208 | + return $str; |
| 209 | + } |
| 210 | + function languageMsgReplace($jvar){ |
| 211 | + if(!isset($jvar[1])) |
| 212 | + return ; |
| 213 | + |
| 214 | + $jmsg = json_decode( '{' . $jvar[1] . '}', true ); |
| 215 | + //do the language lookup: |
| 216 | + if($jmsg){ |
| 217 | + foreach($jmsg as $msgKey => $default_en_value){ |
| 218 | + $jmsg[$msgKey] = wfMsgNoTrans( $msgKey ); |
91 | 219 | } |
| 220 | + //return the updated loadGM json |
| 221 | + return 'loadGM( '. json_encode( $jmsg ) . ')'; |
| 222 | + }else{ |
| 223 | + $this->error_msg.= "Could not parse JSON language msg in File:\n" . |
| 224 | + $this->cur_file ."\n"; |
92 | 225 | } |
93 | | - } |
94 | | - //swap in the appropriate language per file: |
95 | | - $js_file_string = ''; |
96 | | - foreach($jsFileList as $file_name){ |
97 | | - $js_file_string+= do_proccess_js_file($file_name); |
| 226 | + //could not parse json (throw error?) |
| 227 | + return $jvar[0]; |
98 | 228 | } |
| 229 | +} |
| 230 | +//a simple version of HTMLFileCache (@@todo abstract shared pieces) |
| 231 | +class simpleFileCache{ |
| 232 | + var $mFileCache; |
| 233 | + public function __construct( &$rKey ) { |
| 234 | + $this->rKey = $rKey; |
| 235 | + $this->fileCacheName(); // init name |
| 236 | + } |
| 237 | + public function fileCacheName() { |
| 238 | + if( !$this->mFileCache ) { |
| 239 | + global $wgFileCacheDirectory, $wgRequest; |
| 240 | + |
| 241 | + $hash = md5( $this->rKey ); |
| 242 | + # Avoid extension confusion |
| 243 | + $key = str_replace( '.', '%2E', urlencode( $this->rKey ) ); |
99 | 244 | |
100 | | - print "<pre>"; |
101 | | - print_r( $jsFileList ); |
102 | | -} |
| 245 | + $hash1 = substr( $hash, 0, 1 ); |
| 246 | + $hash2 = substr( $hash, 0, 2 ); |
| 247 | + $this->mFileCache = "{$wgFileCacheDirectory}/{$subdir}{$hash1}/{$hash2}/{$this->rKey}.js"; |
103 | 248 | |
104 | | -function do_proccess_js_file($file){ |
105 | | - $file_string = file_get_contents($file); |
106 | | - //print $file_string; |
107 | | - //do language swap |
108 | | - preg_replace_callback("/loadGM\(\s*\{([^}]*)/", 'language_msg_replace', $file_string); |
| 249 | + if( $this->useGzip() ) |
| 250 | + $this->mFileCache .= '.gz'; |
| 251 | + |
| 252 | + wfDebug( " fileCacheName() - {$this->mFileCache}\n" ); |
| 253 | + } |
| 254 | + return $this->mFileCache; |
| 255 | + } |
| 256 | + public function isFileCached() { |
| 257 | + return file_exists( $this->fileCacheName() ); |
| 258 | + } |
| 259 | + public function loadFromFileCache(){ |
| 260 | + global $wgJsMimeType; |
| 261 | + if( $wgUseGzip ) { |
| 262 | + if( wfClientAcceptsGzip() ) { |
| 263 | + header( 'Content-Encoding: gzip' ); |
| 264 | + readfile( $filename ); |
| 265 | + } else { |
| 266 | + /* Send uncompressed */ |
| 267 | + readgzfile( $filename ); |
| 268 | + return; |
| 269 | + } |
| 270 | + } |
| 271 | + } |
| 272 | + public function saveToFileCache( $text ) { |
| 273 | + global $wgUseFileCache; |
| 274 | + if( !$wgUseFileCache ) { |
| 275 | + return $text; // return to output |
| 276 | + } |
| 277 | + if( strcmp($text,'') == 0 ) return ''; |
| 278 | + |
| 279 | + wfDebug(" simpleSaveToFileCache()\n", false); |
| 280 | + |
| 281 | + $this->checkCacheDirs(); |
| 282 | + |
| 283 | + $f = fopen( $this->fileCacheName(), 'w' ); |
| 284 | + if($f) { |
| 285 | + $now = wfTimestampNow(); |
| 286 | + $text = '//cached at: ' . $now . " :: " . $this->rKey . " \n" . $text ; |
| 287 | + if( $this->useGzip() ) { |
| 288 | + $text = gzencode( $text); |
| 289 | + } |
| 290 | + fwrite( $f, $text ); |
| 291 | + fclose( $f ); |
| 292 | + } |
| 293 | + return $text; |
| 294 | + } |
| 295 | + protected function checkCacheDirs() { |
| 296 | + $filename = $this->fileCacheName(); |
| 297 | + $mydir2 = substr($filename,0,strrpos($filename,'/')); # subdirectory level 2 |
| 298 | + $mydir1 = substr($mydir2,0,strrpos($mydir2,'/')); # subdirectory level 1 |
| 299 | + |
| 300 | + wfMkdirParents( $mydir1 ); |
| 301 | + wfMkdirParents( $mydir2 ); |
| 302 | + } |
109 | 303 | } |
110 | | -function language_msg_replace($match){ |
111 | | - print "CB: "; |
112 | | - print_r($match); |
113 | | -} |
114 | | -//do the minification and output |
115 | | -require_once ( dirname(__FILE__) . '/jsmin.php'); |
116 | 304 | ?> |
\ No newline at end of file |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/example_usage/sampleEditor.html |
— | — | @@ -6,13 +6,7 @@ |
7 | 7 | <script type="text/javascript" src="mv_embed.js"></script> |
8 | 8 | <script type="text/javascript"> |
9 | 9 | //set up the sequencer (once the page is ready): |
10 | | - mv_addLoadEvent(setup_sequencer); |
11 | | - function setup_sequencer(){ |
12 | | - mv_do_sequence({ |
13 | | - sequence_container_id:'sequence_container', |
14 | | - inline_playlist_id:'inline_pl_empty' |
15 | | - }); |
16 | | - } |
| 10 | + |
17 | 11 | </script> |
18 | 12 | <style> |
19 | 13 | .ui-resizable-handle { position: absolute; background: #ddd; display: none; } |
— | — | @@ -23,35 +17,6 @@ |
24 | 18 | </head> |
25 | 19 | <body> |
26 | 20 | <h3>sample editor</h3> |
27 | | - |
28 | | -<div id="sequence_container" style="position:relative;width:800px;height:600px;border:solid black;"> |
29 | | -loading editor <blink>...</blink> |
30 | | -</div> |
31 | | -<div id="inline_pl_empty"> |
32 | | -</div> |
33 | | -<div id="inline_pl_txt"> |
34 | | -<!-- |
35 | | -#playlist attr: |
36 | | -|title=Inline Playlist |
37 | | -|linkback=http://metavid.ucsc.edu/wiki/index.php/Mv_embed |
38 | | - |
39 | | -#mvclip special for metavid clips can be refreces with a single key attribute |
40 | | -|mvClip=senate_proceeding_12-07-06?t=04:46:27/04:46:58 |
41 | | -|title=I fancy Pencils |
42 | | - |
43 | | -#new clips are start with |mvclip or |clip_src (everything after will apply to that clip) |
44 | | -|mvClip=house_proceeding_02-05-07_00?t=0:02:00/0:02:30 |
45 | | -|desc=budget is like swiss cheese |
46 | | -but smells like limburger |
47 | | - |
48 | | -#more verbose arbitrary clip listing: (be mindfull of cross site data policy of java for cortado playback) |
49 | | -|srcClip=http://128.114.20.23/media/house_proceeding_04-05-06_3.ogg.anx?t=01:35:47/01:35:58 |
50 | | -|image=http://metavid.ucsc.edu/image_media/house_proceeding_04-05-06_3?t=01:35:47&size=320x240 |
51 | | -|desc=Jeb Hensarling uses the <b>dictionary</b> |
52 | | - |
53 | | -|mvClip=house_proceeding_02-05-07_00?t=0:12:00/0:12:30 |
54 | | -|desc=no desc here |
55 | | -</div> |
| 21 | +needs update to new sequence editor system |
56 | 22 | </body> |
57 | 23 | </html> |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -8,15 +8,15 @@ |
9 | 9 | and archive.org |
10 | 10 | */ |
11 | 11 | |
12 | | -loadGM( { 'mv_media_search' : 'Media Search', |
13 | | - 'rsd_box_layout' : 'Box layout', |
14 | | - 'rsd_list_layout' : 'List Layout', |
15 | | - 'rsd_results_desc' : 'Results some ', |
16 | | - 'rsd_results_next' : 'next ', |
17 | | - 'rsd_results_prev' : 'previous ', |
18 | | - 'upload' : 'Upload', |
19 | | - 'rsd_layout' : 'Layout:', |
20 | | - 'rsd_resource_edit' : 'Edit Resource:' |
| 12 | +loadGM( { "mv_media_search" : "Media Search why test test", |
| 13 | + "rsd_box_layout" : "Box layout", |
| 14 | + "rsd_list_layout" : "List Layout", |
| 15 | + "rsd_results_desc" : "Results some ", |
| 16 | + "rsd_results_next" : "next ", |
| 17 | + "rsd_results_prev" : "previous ", |
| 18 | + "upload" : "Upload", |
| 19 | + "rsd_layout" : "Layout:", |
| 20 | + "rsd_resource_edit" : "Edit Resource:" |
21 | 21 | }); |
22 | 22 | |
23 | 23 | var default_remote_search_options = { |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | //specific to sequence profile |
37 | 37 | 'p_seq':null, |
38 | 38 | 'cFileNS':'Image', //what is the cannonical namespace for images |
39 | | - //@@todo (should be able to get that from the api in the future) |
| 39 | + //@@todo (should get that from the api or inpage vars) |
40 | 40 | |
41 | 41 | 'enable_uploads':false // if we want to enable an uploads tab: |
42 | 42 | } |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libAddMedia/mvUploader.js |
— | — | @@ -4,18 +4,15 @@ |
5 | 5 | */ |
6 | 6 | |
7 | 7 | loadGM( { |
8 | | - 'upload-enable-converter' : 'Enable video converter (to upload source video not yet converted to theora format)'+ |
9 | | - ' <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">more info</a>', |
10 | | - 'upload-fogg_not_installed': 'If you want to upload video consider installing <a href="http://firefogg.org">firefogg.org</a>, '+ |
11 | | - '<a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">more info</a>', |
12 | | - 'upload-in-progress':'Doing Transcode & Upload (do not close this window)', |
13 | | - 'upload-transcoded-status': 'Transcoded', |
14 | | - 'uploaded-status':'Uploaded', |
15 | | - 'upload-select-file': 'Select File...', |
16 | | - 'wgfogg_wrong_version': 'You have firefogg installed but its outdated, <a href="http://firefogg.org">please upgrade</a> ', |
17 | | - 'wgfogg_waring_ogg_upload': 'You have selected an ogg file for conversion to ogg (this is probably unnessesary). Maybe disable the video converter?' |
18 | | - } |
19 | | -); |
| 8 | + "upload-enable-converter" : "Enable video converter (to upload source video not yet converted to theora format) <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>", |
| 9 | + "upload-fogg_not_installed": "If you want to upload video consider installing <a href=\"http://firefogg.org\">firefogg.org</a>, <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">more info</a>", |
| 10 | + "upload-in-progress":"Doing Transcode & Upload (do not close this window)", |
| 11 | + "upload-transcoded-status": "Transcoded", |
| 12 | + "uploaded-status": "Uploaded", |
| 13 | + "upload-select-file": "Select File...", |
| 14 | + "wgfogg_wrong_version": "You have firefogg installed but its outdated, <a href=\"http://firefogg.org\">please upgrade</a> ", |
| 15 | + "wgfogg_waring_ogg_upload": "You have selected an ogg file for conversion to ogg (this is probably unnessesary). Maybe disable the video converter?" |
| 16 | +}); |
20 | 17 | |
21 | 18 | var default_upload_options = { |
22 | 19 | 'target_div':'', |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libSequencer/mvSequencer.js |
— | — | @@ -18,47 +18,47 @@ |
19 | 19 | */ |
20 | 20 | |
21 | 21 | loadGM( { |
22 | | - 'menu_clipedit' : 'Edit Selected Resource', |
23 | | - 'menu_cliplib' : 'Add Resource', |
24 | | - 'menu_transition' : 'Transitions Effects', |
25 | | - 'menu_resource_overview' : 'Resource Overview', |
26 | | - 'menu_options' : 'Options', |
| 22 | + "menu_clipedit" : "Edit Selected Resource", |
| 23 | + "menu_cliplib" : "Add Resource", |
| 24 | + "menu_transition" : "Transitions Effects", |
| 25 | + "menu_resource_overview" : "Resource Overview", |
| 26 | + "menu_options" : "Options", |
27 | 27 | |
28 | | - 'loading_timeline' : 'Loading TimeLine <blink>...</blink>', |
29 | | - 'loading_user_rights' : 'Loading user rights <blink>...</blink>', |
| 28 | + "loading_timeline" : "Loading TimeLine <blink>...</blink>", |
| 29 | + "loading_user_rights" : "Loading user rights <blink>...</blink>", |
30 | 30 | |
31 | | - 'no_edit_permissions' : 'You don\'t have permissions to save changes to this sequence', |
| 31 | + "no_edit_permissions" : "You don\'t have permissions to save changes to this sequence", |
32 | 32 | |
33 | 33 | |
34 | | - 'edit_clip' : 'Edit Clip', |
35 | | - 'edit_save' : 'Save Changes', |
36 | | - 'edit_cancel' : 'Cancel Edit', |
37 | | - 'edit_cancel_confirm' : 'Are you sure you want to cancel your edit, changes will be lost', |
| 34 | + "edit_clip" : "Edit Clip", |
| 35 | + "edit_save" : "Save Changes", |
| 36 | + "edit_cancel" : "Cancel Edit", |
| 37 | + "edit_cancel_confirm" : "Are you sure you want to cancel your edit, changes will be lost", |
38 | 38 | |
39 | | - 'zoom_in' : 'Zoom In', |
40 | | - 'zoom_out' : 'Zoom Out', |
41 | | - 'cut_clip' : 'Cut Clips', |
42 | | - 'expand_track' : 'Expand Track', |
43 | | - 'colapse_track' : 'Collapse Track', |
44 | | - 'play_clip' : 'Play From Playline Position', |
45 | | - 'pixle2sec' : 'pixles to seconds', |
46 | | - 'rmclip' : 'Remove Clip', |
47 | | - 'clip_in' : 'clip in', |
48 | | - 'clip_out' : 'clip out', |
| 39 | + "zoom_in" : "Zoom In", |
| 40 | + "zoom_out" : "Zoom Out", |
| 41 | + "cut_clip" : "Cut Clips", |
| 42 | + "expand_track" : "Expand Track", |
| 43 | + "colapse_track" : "Collapse Track", |
| 44 | + "play_clip" : "Play From Playline Position", |
| 45 | + "pixle2sec" : "pixles to seconds", |
| 46 | + "rmclip" : "Remove Clip", |
| 47 | + "clip_in" : "clip in", |
| 48 | + "clip_out" : "clip out", |
49 | 49 | |
50 | 50 | //menu items display helper: |
51 | | - 'mv_welcome_to_sequencer' : '<h3>Welcome to the sequencer demo</h3>'+ |
52 | | - 'very <b>limited</b> functionality right now. Not much documentation yet either', |
| 51 | + "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3>"+ |
| 52 | + "very <b>limited</b> functionality right now. Not much documentation yet either", |
53 | 53 | |
54 | | - 'no_selected_resource' : '<h3>No Resource selected</h3> Select a Clip to enable resource editing', |
55 | | - 'error_edit_multiple' : '<h3>Multiple Resources Selected</h3> Select a single clip to edit it', |
| 54 | + "no_selected_resource" : "<h3>No Resource selected</h3> Select a Clip to enable resource editing", |
| 55 | + "error_edit_multiple" : "<h3>Multiple Resources Selected</h3> Select a single clip to edit it", |
56 | 56 | |
57 | | - 'mv_editor_options' : 'Editor options', |
58 | | - 'mv_editor_mode' : 'Editor mode', |
59 | | - 'mv_simple_editor_desc' : 'simple editor (iMovie style)', |
60 | | - 'mv_advanced_editor_desc' : 'advanced editor (Final Cut style)', |
61 | | - 'mv_other_options' : 'Other Options', |
62 | | - 'mv_contextmenu_opt' : 'Enable Context Menus' |
| 57 | + "mv_editor_options" : "Editor options", |
| 58 | + "mv_editor_mode" : "Editor mode", |
| 59 | + "mv_simple_editor_desc" : "simple editor (iMovie style)", |
| 60 | + "mv_advanced_editor_desc" : "advanced editor (Final Cut style)", |
| 61 | + "mv_other_options" : "Other Options", |
| 62 | + "mv_contextmenu_opt" : "Enable Context Menus" |
63 | 63 | }); |
64 | 64 | |
65 | 65 | //used to set default values and validate the passed init object |
Index: trunk/extensions/MetavidWiki/skins/mv_embed/libClipEdit/mvClipEdit.js |
— | — | @@ -7,25 +7,25 @@ |
8 | 8 | */ |
9 | 9 | //set gMsg object: |
10 | 10 | loadGM( { |
11 | | - 'mv_crop':'Crop Image', |
12 | | - 'mv_apply_crop':'Apply Crop to Image', |
13 | | - 'mv_reset_crop':'Rest Crop', |
14 | | - 'mv_insert_image_page':'Insert Into page', |
15 | | - 'mv_preview_insert':'Preview Insert', |
16 | | - 'mv_cancel_image_insert':'Cancel Image Insert', |
| 11 | + "mv_crop":"Crop Image", |
| 12 | + "mv_apply_crop":"Apply Crop to Image", |
| 13 | + "mv_reset_crop":"Rest Crop", |
| 14 | + "mv_insert_image_page":"Insert Into page", |
| 15 | + "mv_preview_insert":"Preview Insert", |
| 16 | + "mv_cancel_image_insert":"Cancel Image Insert", |
17 | 17 | |
18 | | - 'sc_fileopts':'Clip Detail Edit', |
19 | | - 'sc_inoutpoints':'Set In-Out points', |
20 | | - 'sc_panzoom':'Pan Zoom Crop', |
21 | | - 'sc_overlays':'Overlays', |
22 | | - 'sc_audio':'Audio Control', |
23 | | - 'sc_duration':'Duration', |
| 18 | + "sc_fileopts":"Clip Detail Edit", |
| 19 | + "sc_inoutpoints":"Set In-Out points", |
| 20 | + "sc_panzoom":"Pan Zoom Crop", |
| 21 | + "sc_overlays":"Overlays", |
| 22 | + "sc_audio":"Audio Control", |
| 23 | + "sc_duration":"Duration", |
24 | 24 | |
25 | | - 'mv_template_properties':'Template Properties', |
26 | | - 'mv_custom_title':'Custom Title', |
27 | | - 'mv_edit_properties':'Edit Properties', |
28 | | - 'mv_other_properties':'Other Properties', |
29 | | - 'mv_resource_page':'Resource Page' |
| 25 | + "mv_template_properties":"Template Properties", |
| 26 | + "mv_custom_title":"Custom Title", |
| 27 | + "mv_edit_properties":"Edit Properties", |
| 28 | + "mv_other_properties":"Other Properties", |
| 29 | + "mv_resource_page":"Resource Page" |
30 | 30 | }); |
31 | 31 | |
32 | 32 | var default_clipedit_values = { |