Index: trunk/phase3/js2/mwEmbed/example_usage/media/sample_smil.xml |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +<smil xmlns="http://www.w3.org/2001/SMIL20/Language"> |
| 3 | + <head> |
| 4 | + <meta name="title" content="Simple Crossfading Example"/> |
| 5 | + |
| 6 | + <transition id="fromGreen" |
| 7 | + type="fade" |
| 8 | + subtype="fadeFromColor" |
| 9 | + fadeColor="#87CF87" |
| 10 | + dur="4s"/> |
| 11 | + |
| 12 | + <transition id="toGreen" |
| 13 | + type="fade" |
| 14 | + subtype="fadeToColor" |
| 15 | + fadeColor="#87CF87" |
| 16 | + dur="4s"/> |
| 17 | + |
| 18 | + <transition id="xFade" |
| 19 | + type="fade" |
| 20 | + subtype="crossfade" |
| 21 | + dur="4s"/> |
| 22 | + |
| 23 | + </head> |
| 24 | + <body> |
| 25 | + <seq> |
| 26 | + |
| 27 | + <video src="http://upload.wikimedia.org/wikipedia/commons/d/d3/Okapia_johnstoni5.ogg" |
| 28 | + region="video_region" |
| 29 | + transIn="fromGreen" |
| 30 | + transOut="xFade" |
| 31 | + type="video/ogg" |
| 32 | + fill="transition" |
| 33 | + dur="7s" |
| 34 | + poster="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Okapia_johnstoni5.ogg/mid-Okapia_johnstoni5.ogg.jpg"/> |
| 35 | + |
| 36 | + <video src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg" |
| 37 | + region="video_region" |
| 38 | + fill="transition" |
| 39 | + dur="10s" |
| 40 | + type="video/ogg" |
| 41 | + poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg"/> |
| 42 | + </seq> |
| 43 | + </body> |
| 44 | +</smil> |
| 45 | + |
| 46 | + |
Index: trunk/phase3/js2/mwEmbed/example_usage/Sequence_Editor.html |
— | — | @@ -0,0 +1,40 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>SMIL Sequence Editor example</title> |
| 7 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
| 8 | + <script type="text/javascript"> |
| 9 | + mwAddOnloadHook(function(){ |
| 10 | + $j('#seqcontainer').sequencer({ |
| 11 | + 'mv_pl_src':'media/sample_smil.xml', |
| 12 | + //set the add media wizard to only include commons: |
| 13 | + 'amw_conf':{ |
| 14 | + 'enabled_cps':['wiki_commons'] |
| 15 | + } |
| 16 | + }); |
| 17 | + }); |
| 18 | + </script> |
| 19 | +<style> |
| 20 | + body { |
| 21 | + font: x-small sans-serif; |
| 22 | + background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat; |
| 23 | + color: black; |
| 24 | + margin: 0; |
| 25 | + padding: 0; |
| 26 | + } |
| 27 | + img { |
| 28 | + border:medium none; |
| 29 | + } |
| 30 | +</style> |
| 31 | + |
| 32 | +</head> |
| 33 | +<body> |
| 34 | +<h3> Simple SMIL example</h3> |
| 35 | + <div id="seqcontainer" style="position:absolute;top:50px;bottom:10px;left:10px;right:10px;"> |
| 36 | + Loading sequence editor <blink>...</blink> |
| 37 | + </div> |
| 38 | + |
| 39 | + </body> |
| 40 | +</html> |
| 41 | + |
Index: trunk/phase3/js2/mwEmbed/example_usage/Player_RelatedVideos.html |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>Simple Video Tag Usage</title> |
| 7 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
| 8 | +</head> |
| 9 | +<body> |
| 10 | +<h3> Simple Video Relational Audio and Video the Commons </h3> |
| 11 | +This Example search primitive video in the Wikimedia Commons |
| 12 | +<span id="default_attr"> |
| 13 | +</span> <br /> |
| 14 | +<br /> |
| 15 | + <table border="1" cellpadding="6" width="600"> |
| 16 | + <tr> |
| 17 | + <td valign="top"> |
| 18 | + <video wikiTitleKey="File:B-36_bomber.ogg" durationHint="2" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg&size=400x300" src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"></video></td> |
| 19 | + <td valign="top"><b>Sample Relational Video And Audio</b><br /> |
| 20 | + <pre>The Example Code ::: </pre> |
| 21 | + <video wikiTitleKey="File:B-36_bomber.ogg" durationHint="2" |
| 22 | + poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg&size=400x300" |
| 23 | + src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"></video> |
| 24 | + </br> |
| 25 | + </td> |
| 26 | + </table> |
| 27 | + <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> |
| 28 | + </body> |
| 29 | +</html> |
| 30 | + |
Index: trunk/phase3/js2/mwEmbed/example_usage/Player_Simple_Themable.html |
— | — | @@ -0,0 +1,23 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>Sample Themed Player</title> |
| 7 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
| 8 | +</head> |
| 9 | +<script type="text/javascript"> |
| 10 | +</script> |
| 11 | +<body bgcolor="#FFF"> |
| 12 | +<h3> Sample Simple Themable Player:</h3> |
| 13 | +To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p> |
| 14 | +<div style="width:450px;float:left"> |
| 15 | +<video src="http://upload.wikimedia.org/wikipedia/commons/d/d3/Okapia_johnstoni5.ogg" |
| 16 | + thumbnail="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Okapia_johnstoni5.ogg/mid-Okapia_johnstoni5.ogg.jpg" durationHint="15"></video> |
| 17 | + </div> |
| 18 | +<div style="float:left"> |
| 19 | +<b>Source Code used:</b><br> |
| 20 | +<textarea cols="50" rows="7"><video src="http://upload.wikimedia.org/wikipedia/commons/d/d3/Okapia_johnstoni5.ogg" thumbnail="http://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Okapia_johnstoni5.ogg/mid-Okapia_johnstoni5.ogg.jpg" durationHint="15"></video></textarea> |
| 21 | +</div> |
| 22 | +</body> |
| 23 | +</html> |
| 24 | + |
Index: trunk/phase3/js2/mwEmbed/example_usage/Add_Media_Wizard.html |
— | — | @@ -0,0 +1,50 @@ |
| 2 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
| 3 | +"http://www.w3.org/TR/html4/loose.dtd"> |
| 4 | +<html> |
| 5 | +<head> |
| 6 | + <title>sample mv embed</title> |
| 7 | + <style type="text/css"> |
| 8 | + body{ |
| 9 | + font-size:80%; |
| 10 | + } |
| 11 | + img { |
| 12 | + border:medium none; |
| 13 | + } |
| 14 | + </style> |
| 15 | + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> |
| 16 | + <script type="text/javascript"> |
| 17 | + mwAddOnloadHook(function(){ |
| 18 | + $j('#add_media_link').addMediaWiz( { |
| 19 | + 'profile':'html_edit', |
| 20 | + 'target_textbox': '#wpTextbox1', |
| 21 | + 'target_render_area':'#inline_append', |
| 22 | + 'import_url_mode':'remote_link', |
| 23 | + //note selections in the textbox will take over the default query |
| 24 | + 'default_query': 'fish', |
| 25 | + |
| 26 | + //we only enabled commons |
| 27 | + //(since javascript includes from other servers would be problamatic ) in a default install |
| 28 | + //** but you can set this to 'all' to pull from multiple repositories |
| 29 | + 'enabled_cps':['wiki_commons'], |
| 30 | + |
| 31 | + //the local wiki api url: |
| 32 | + 'local_wiki_api_url': 'none' |
| 33 | + }); |
| 34 | + }); |
| 35 | + |
| 36 | + </script> |
| 37 | +</head> |
| 38 | +<body> |
| 39 | +<h3> Sample Add Media Wizard </h3> |
| 40 | + |
| 41 | +<a id="add_media_link" href="#">Add Media</a><br> |
| 42 | +<b>note</b> only commons is enabled by default. For more options see source code.<br><br> |
| 43 | +<table border="1" width="800"> |
| 44 | +<tr> |
| 45 | +<td valign="top" width="50%" id="inline_append">Asset Output</td> |
| 46 | +<td valign="top" width="50%" >Html Output:<textarea id="wpTextbox1" cols="60" rows="6" id="code_append" name="wpTextbox1" tabindex="3"/></textarea></td> |
| 47 | +</tr> |
| 48 | +</table> |
| 49 | +</body> |
| 50 | +</html> |
| 51 | + |
Index: trunk/phase3/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html |
— | — | @@ -0,0 +1,92 @@ |
| 2 | +<!DOCTYPE HTML> |
| 3 | +<html><head> |
| 4 | +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> |
| 5 | + <title>Firefogg - Make Ogg Video in your Browser</title> |
| 6 | + <script type="text/javascript" src="../jsScriptLoader.php?urid=18&class=mv_embed,window.jQuery,mvBaseUploadInterface,mvFirefogg,mvAdvFirefogg,$j.ui,$j.ui.progressbar,$j.ui.dialog,$j.cookie,$j.ui.accordion,$j.ui.slider,$j.ui.datepicker"></script> |
| 7 | + <!-- <script type="text/javascript" src="../mv_embed.js"></script> --> |
| 8 | +<style type="text/css" media="all">body { |
| 9 | + margin: 0; |
| 10 | + padding: 0; |
| 11 | + font-family: Vera Sans, sans-serif; |
| 12 | + font-size: 12px; |
| 13 | + color: #000; |
| 14 | + background: #fff; |
| 15 | +} |
| 16 | + |
| 17 | +a { |
| 18 | + color: #000; |
| 19 | +} |
| 20 | +img { |
| 21 | + border: 0; |
| 22 | +} |
| 23 | +h1, h2 { |
| 24 | + text-align: center; |
| 25 | +} |
| 26 | +h1 { |
| 27 | + font-size: 48px; |
| 28 | + letter-spacing: 0.25em; |
| 29 | + margin-bottom: 0; |
| 30 | + line-height: 0.8em; |
| 31 | +} |
| 32 | +h2 { |
| 33 | + margin-left: -11px; |
| 34 | + font-size: 12px; |
| 35 | + font-weight: normal; |
| 36 | + letter-spacing: 0.1em; |
| 37 | +} |
| 38 | + |
| 39 | +#main { |
| 40 | + margin-top: 10px; |
| 41 | +} |
| 42 | + |
| 43 | +.install { |
| 44 | + margin-left: auto; |
| 45 | + margin-right: auto; |
| 46 | + width: 180px; |
| 47 | + padding: 8px; |
| 48 | + background-color: #fe0000; |
| 49 | + font-size: 12px; |
| 50 | + font-weight: bold; |
| 51 | + text-align: center; |
| 52 | +} |
| 53 | + |
| 54 | +.install a { |
| 55 | + color: #000; |
| 56 | +} |
| 57 | + |
| 58 | +#nav { |
| 59 | + margin-left: -11px; |
| 60 | + text-align: center; |
| 61 | + padding-bottom: 20px; |
| 62 | +} |
| 63 | +</style> |
| 64 | +<style type="text/css" media="all"> |
| 65 | +.install{ |
| 66 | +display:none; |
| 67 | +} |
| 68 | +</style> |
| 69 | +<script type="text/javascript"> |
| 70 | +mwAddOnloadHook(function(){ |
| 71 | + $j('#firefogg_app').firefogg({ |
| 72 | + 'encoder_interface' : true, |
| 73 | + 'encode_local' : true |
| 74 | + },function(){ |
| 75 | + $j('#loadFogg').hide(); |
| 76 | + }); |
| 77 | +}); |
| 78 | +</script> |
| 79 | +</head><body> |
| 80 | +<div id="main"> |
| 81 | + <h1>Make Ogg Video</h1> |
| 82 | +<br> |
| 83 | + <br> |
| 84 | + <div style="margin-right:auto;margin-left:auto;width:500px;" id="loadFogg">Loading firefogg<blink>...</blink></div> |
| 85 | + <div style="margin-right:auto;margin-left:auto;width:500px;height:230px" id="firefogg_app"></div> |
| 86 | + |
| 87 | + <div style="height:295px"></div> |
| 88 | + <center><span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a>, <a href="http://www.mediawiki.org/wiki/Media_Projects_Overview#MwEmbed">MwEmbed</a> and <a href="http://jqueryui.com/">jquery.ui</a>. Supports |
| 89 | + custom themes via the <a href="http://jqueryui.com/themeroller/developertool/">ThemeRoller Dev Tool</a> |
| 90 | + </span> |
| 91 | + </center> |
| 92 | +</body></html> |
| 93 | + |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/seqRemoteSearchDriver.js |
— | — | @@ -17,7 +17,9 @@ |
18 | 18 | 'local_wiki_api_url': this_seq.getLocalApiUrl(), |
19 | 19 | 'instance_name' : this_seq.instance_name + '.mySearch', |
20 | 20 | 'default_query' : this.pSeq.plObj.title |
21 | | - } |
| 21 | + } |
| 22 | + if(typeof this_seq.amw_conf != 'undefined') |
| 23 | + $j.extend(iObj, this_seq.amw_conf); |
22 | 24 | //inherit the remoteSearchDriver properties:n |
23 | 25 | var tmpRSD = new remoteSearchDriver( iObj ); |
24 | 26 | for(var i in tmpRSD){ |
Index: trunk/phase3/js2/mwEmbed/libAddMedia/remoteSearchDriver.js |
— | — | @@ -73,9 +73,12 @@ |
74 | 74 | 'p_seq':null, |
75 | 75 | 'cFileNS':'File', //What is the canonical namespace prefix for images |
76 | 76 | //@@todo (should get that from the api or in-page vars) |
77 | | - |
78 | | - 'enable_upload_tab':true, // if we want to enable an uploads tab: |
79 | | - 'upload_api_target' : 'http://localhost/wiki_trunk/api.php' // can be local or the url of the upload api. |
| 77 | + |
| 78 | + 'upload_api_target': 'http://localhost/wiki_trunk/api.php', // can be local or the url of the upload api. |
| 79 | + |
| 80 | + 'enabled_cps':'all', //can be keyword 'all' or an array of enabled content provider keys |
| 81 | + |
| 82 | + 'disp_item':'wiki_commons' //sets the default display item: |
80 | 83 | } |
81 | 84 | |
82 | 85 | if(typeof wgServer == 'undefined') |
— | — | @@ -101,12 +104,7 @@ |
102 | 105 | 'advanced_search':{ |
103 | 106 | 'title': 'Advanced Options' |
104 | 107 | } |
105 | | - }, |
106 | | - /* |
107 | | - * sets the default display item: |
108 | | - * can be any content_providers key or 'all' |
109 | | - */ |
110 | | - disp_item : 'wiki_commons', |
| 108 | + }, |
111 | 109 | /** the default content providers list. |
112 | 110 | * |
113 | 111 | * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list: |
— | — | @@ -203,6 +201,12 @@ |
204 | 202 | 'remote_embed_ext': false, //if running the remoteEmbed extension no need to copy local |
205 | 203 | //syntax will be [remoteEmbed:roe_url link title] |
206 | 204 | 'tab_img':true |
| 205 | + }, |
| 206 | + //special cp "upload" |
| 207 | + 'upload':{ |
| 208 | + 'enabled':1, |
| 209 | + 'checked':1, |
| 210 | + 'title' :'Upload' |
207 | 211 | } |
208 | 212 | }, |
209 | 213 | //define the licenses |
— | — | @@ -310,7 +314,7 @@ |
311 | 315 | }; |
312 | 316 | }, |
313 | 317 | //some default layout values: |
314 | | - thumb_width : 80, |
| 318 | + thumb_width : 80, |
315 | 319 | image_edit_width : 400, |
316 | 320 | video_edit_width : 400, |
317 | 321 | insert_text_pos : 0, //insert at the start (will be overwritten by the user cursor pos) |
— | — | @@ -320,42 +324,29 @@ |
321 | 325 | cEdit : null, |
322 | 326 | dmodalCss : {}, |
323 | 327 | |
324 | | - init: function( iObj ){ |
| 328 | + init: function( options ){ |
325 | 329 | var _this = this; |
326 | 330 | js_log('remoteSearchDriver:init'); |
327 | | - for( var i in default_remote_search_options ) { |
328 | | - if( iObj[i]){ |
329 | | - this[ i ] = iObj[i]; |
330 | | - }else{ |
331 | | - this[ i ] = default_remote_search_options[i]; |
332 | | - } |
333 | | - } |
| 331 | + |
| 332 | + //merge in the options: |
| 333 | + //@@todo for cleaner config we should set _this.opt to the provided options) |
| 334 | + $j.extend( _this, default_remote_search_options, options); |
| 335 | + |
334 | 336 | //update the base text: |
335 | 337 | if(_this.target_textbox) |
336 | 338 | _this.getTexboxSelection(); |
337 | 339 | |
338 | | - //set up the content provider config: |
339 | | - if( this.cpconfig ){ |
340 | | - for(var cpc in cpconfig){ |
341 | | - for(var cinx in this.cpconfig[cpc]){ |
342 | | - if( this.content_providers[cpc] ) |
343 | | - this.content_providers[ cpc ][ cinx ] = this.cpconfig[cpc][ cinx]; |
| 340 | + //modify the content provider config based on options: |
| 341 | + if(_this.enabled_cps != 'all'){ |
| 342 | + for(var i in this.content_providers){ |
| 343 | + if( $j.inArray(i, _this.enabled_cps)!= -1){ |
| 344 | + this.content_providers[i].enabled = true; |
| 345 | + }else{ |
| 346 | + this.content_providers[i].enabled = false; |
344 | 347 | } |
345 | 348 | } |
346 | 349 | } |
347 | 350 | |
348 | | - //make sure the selected cp has an api to query against (if its a content_provider |
349 | | - if( this.content_providers[ this.disp_item ] && |
350 | | - !this.content_providers[ this.disp_item ].api_url ){ |
351 | | - for(var inx in this.content_providers){ |
352 | | - if( this.content_providers[ inx ].api_url ){ |
353 | | - this.disp_item = inx; |
354 | | - break; |
355 | | - } |
356 | | - } |
357 | | - } |
358 | | - |
359 | | - |
360 | 351 | //set up the default model config: |
361 | 352 | this.dmodalCss = { |
362 | 353 | 'width':'auto', |
— | — | @@ -602,13 +593,13 @@ |
603 | 594 | if( parseUri( document.URL ).host == parseUri( _this.upload_api_target ).host ){ |
604 | 595 | mvJsLoader.doLoad(['$j.fn.simpleUploadForm'],function(){ |
605 | 596 | |
606 | | - //get extened info about the file |
| 597 | + //get extends info about the file |
607 | 598 | var cp = _this.content_providers['this_wiki']; |
608 | 599 | //check for "this_wiki" enabled |
609 | | - if(!cp.enabled){ |
| 600 | + /*if(!cp.enabled){ |
610 | 601 | $j('#tab-upload').html('error this_wiki not enabled (can\'t get uploaded file info)'); |
611 | 602 | return false; |
612 | | - } |
| 603 | + }*/ |
613 | 604 | |
614 | 605 | //load this_wiki search system to grab the rObj |
615 | 606 | _this.loadSearchLib(cp, function(){ |
— | — | @@ -672,15 +663,14 @@ |
673 | 664 | js_log("f:runSearch::" + this.disp_item); |
674 | 665 | //draw_direct_flag |
675 | 666 | var draw_direct_flag = true; |
676 | | - if( !this.content_providers[this.disp_item] ){ |
677 | | - //check if its the special upload tab case: |
678 | | - if( this.disp_item == 'upload'){ |
679 | | - this.doUploadInteface(); |
680 | | - }else{ |
681 | | - js_log("can't run search for:" + this.disp_item); |
682 | | - } |
683 | | - return false; |
| 667 | + |
| 668 | + //check if its the special upload tab case: |
| 669 | + if( this.disp_item == 'upload'){ |
| 670 | + this.doUploadInteface(); |
| 671 | + return true; |
684 | 672 | } |
| 673 | + //else do runSearch |
| 674 | + |
685 | 675 | cp = this.content_providers[this.disp_item]; |
686 | 676 | |
687 | 677 | //check if we need to update: |
— | — | @@ -956,7 +946,8 @@ |
957 | 947 | p = rid.split('__'); |
958 | 948 | var cp_id = p[0]; |
959 | 949 | var rid = p[1]; |
960 | | - |
| 950 | + |
| 951 | + //Set the upload helper cp_id (to render recent uploads by this user) |
961 | 952 | if(cp_id == 'upload') |
962 | 953 | cp_id = 'this_wiki'; |
963 | 954 | |
Index: trunk/phase3/js2/mwEmbed/libSequencer/mvSequencer.js |
— | — | @@ -97,9 +97,11 @@ |
98 | 98 | sequenceEditToken:null, |
99 | 99 | //the time the sequence was last touched (grabbed at time of startup) |
100 | 100 | sequenceTouchedTime:null, |
| 101 | + |
| 102 | + //the default config for the add media wizard |
| 103 | + amw_conf: {}, |
101 | 104 | |
102 | 105 | |
103 | | - |
104 | 106 | //Msg are all the language specific values ... |
105 | 107 | // (@@todo overwrite by msg values preloaded in the page) |
106 | 108 | //tack/clips can be pushed via json or inline playlist format |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -23,21 +23,19 @@ |
24 | 24 | var MV_EMBED_VERSION = '1.0r19'; |
25 | 25 | |
26 | 26 | /* |
27 | | - * Configuration variables (can be set from some preceding script). |
28 | | - * Set up mwConfig global, override any of the defaultMwConfig values: |
29 | | - * @@ more config values on the way ;) |
| 27 | + * Configuration variables should be set by extending mwConfigOptions |
| 28 | + * here is the default config: |
30 | 29 | */ |
31 | | -var defaultMwConfig = { |
| 30 | +var mwConfig = { |
32 | 31 | 'skin_name': 'mvpcf', |
33 | 32 | 'jui_skin': 'redmond', |
34 | 33 | 'video_size':'400x300' |
35 | 34 | } |
36 | 35 | |
37 | | -if( !mwConfig ) |
38 | | - var mwConfig = {}; |
| 36 | +if( !mwConfigOptions ) |
| 37 | + var mwConfigOptions = {}; |
39 | 38 | |
40 | 39 | // Install the default config values for anything not set in mwConfig |
41 | | -checkDefaultMwConfig(); |
42 | 40 | |
43 | 41 | // Whether or not to load java from an iframe. |
44 | 42 | // Note: this is necessary for remote embedding because of Java's security model) |
— | — | @@ -85,19 +83,11 @@ |
86 | 84 | } |
87 | 85 | }; |
88 | 86 | |
89 | | - |
90 | | - |
91 | 87 | // Get the mv_embed location if it has not been set |
92 | 88 | if( !mv_embed_path ) { |
93 | 89 | var mv_embed_path = getMvEmbedPath(); |
94 | 90 | } |
95 | 91 | |
96 | | -// Set up the skin path |
97 | | -var mv_jquery_skin_path = mv_embed_path + 'jquery/jquery.ui/themes/' +mwConfig['jui_skin'] + '/'; |
98 | | -var mv_skin_img_path = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/'; |
99 | | -var mv_default_thumb_url = mv_skin_img_path + 'vid_default_thumb.jpg'; |
100 | | - |
101 | | - |
102 | 92 | // Init the global message table if it has not been initialised already |
103 | 93 | if( !gMsg ) { |
104 | 94 | var gMsg = {}; |
— | — | @@ -556,21 +546,35 @@ |
557 | 547 | * checks for jQuery and adds the $j noConflict var |
558 | 548 | */ |
559 | 549 | jQueryCheck: function( callback ) { |
560 | | - // Skip stuff if $j is already loaded |
| 550 | + // Skip stuff if $j is already loaded: |
561 | 551 | if( _global['$j'] && callback ) |
562 | | - callback(); |
| 552 | + callback(); |
563 | 553 | var _this = this; |
564 | 554 | // Load jQuery |
565 | 555 | _this.doLoad([ |
566 | 556 | 'window.jQuery' |
567 | 557 | ], function() { |
568 | 558 | _global['$j'] = jQuery.noConflict(); |
| 559 | + |
| 560 | + //setup our global settings using the (jQuery helper) |
| 561 | + $j.extend( mwConfig, mwConfigOptions); |
| 562 | + |
| 563 | + // Set up the skin path |
| 564 | + _global['mv_jquery_skin_path'] = mv_embed_path + 'jquery/jquery.ui/themes/' +mwConfig['jui_skin'] + '/'; |
| 565 | + _global['mv_skin_img_path'] = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/'; |
| 566 | + _global['mv_default_thumb_url'] = mv_skin_img_path + 'vid_default_thumb.jpg'; |
| 567 | + |
| 568 | + // Make sure the skin/style sheets are always available: |
| 569 | + loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
| 570 | + loadExternalCss( mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/styles.css' ); |
| 571 | + |
569 | 572 | // Set up AJAX to not send dynamic URLs for loading scripts (we control that with |
570 | 573 | // the scriptLoader) |
571 | 574 | $j.ajaxSetup({ |
572 | 575 | cache: true |
573 | 576 | }); |
574 | | - js_log( 'jquery loaded' ); |
| 577 | + |
| 578 | + js_log( 'jQuery loaded into $j' ); |
575 | 579 | // Set up mvEmbed jQuery bindings: |
576 | 580 | mv_jqueryBindings(); |
577 | 581 | // Run the callback |
— | — | @@ -581,15 +585,11 @@ |
582 | 586 | }, |
583 | 587 | embedVideoCheck:function( callback ) { |
584 | 588 | var _this = this; |
585 | | - js_log( 'embedVideoCheck:' ); |
586 | | - // Set videonojs to loading |
587 | | - // Issue a style sheet request to get both mv_embed and jQuery styles: |
588 | | - loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
589 | | - loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name'] + '/styles.css' ); |
590 | | - |
| 589 | + js_log( 'embedVideoCheck:' ); |
591 | 590 | // Make sure we have jQuery |
592 | 591 | _this.jQueryCheck( function() { |
593 | 592 | $j('.videonojs').html( gM('mwe-loading_txt') ); |
| 593 | + //Set up the embed video player class request: |
594 | 594 | var depReq = [ |
595 | 595 | [ |
596 | 596 | '$j.ui', |
— | — | @@ -604,7 +604,7 @@ |
605 | 605 | // Add PNG fix if needed: |
606 | 606 | if( $j.browser.msie || $j.browser.version < 7 ) |
607 | 607 | depReq[0].push( '$j.fn.pngFix' ); |
608 | | - |
| 608 | + |
609 | 609 | _this.doLoadDepMode( depReq, function() { |
610 | 610 | embedTypes.init(); |
611 | 611 | callback(); |
— | — | @@ -685,11 +685,7 @@ |
686 | 686 | //} |
687 | 687 | } |
688 | 688 | //js2AddOnloadHook: ensure jQuery and the DOM are ready |
689 | | -function js2AddOnloadHook( func ) { |
690 | | - // Make sure the skin/style sheets are always available: |
691 | | - loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
692 | | - loadExternalCss( mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/styles.css' ); |
693 | | - |
| 689 | +function js2AddOnloadHook( func ) { |
694 | 690 | // If we have already run the DOM-ready function, just run the function directly: |
695 | 691 | if( mvJsLoader.doneReadyEvents ) { |
696 | 692 | // Make sure jQuery is there: |
— | — | @@ -1463,14 +1459,6 @@ |
1464 | 1460 | return false; |
1465 | 1461 | } |
1466 | 1462 | |
1467 | | -function checkDefaultMwConfig() { |
1468 | | - for( var i in defaultMwConfig ) { |
1469 | | - if( typeof( mwConfig[i] ) == 'undefined' ) { |
1470 | | - mwConfig[i] = defaultMwConfig[i]; |
1471 | | - } |
1472 | | - } |
1473 | | -} |
1474 | | - |
1475 | 1463 | function js_error( string ) { |
1476 | 1464 | alert( string ); |
1477 | 1465 | return false; |