Index: trunk/phase3/js2/mwEmbed/libSequencer/mvPlayList.js |
— | — | @@ -1689,7 +1689,7 @@ |
1690 | 1690 | this['type'][tObj.type][tObj.subtype].u(tObj,percent); |
1691 | 1691 | }, |
1692 | 1692 | getTransitionIcon:function( type, subtype){ |
1693 | | - return mv_embed_path +'/skins/'+mv_skin_name+'/transition_images/'+ type+'_'+ subtype+ '.png'; |
| 1693 | + return mv_embed_path +'/skins/'+mwConfig['skin_name']+'/transition_images/'+ type+'_'+ subtype+ '.png'; |
1694 | 1694 | }, |
1695 | 1695 | /* |
1696 | 1696 | * mvTransLib: functional library mapping: |
Index: trunk/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -24,22 +24,24 @@ |
25 | 25 | |
26 | 26 | /* |
27 | 27 | * Configuration variables (can be set from some precceding script) |
| 28 | + * set up mwConfig global overide any of the defaultMwConfig values: |
| 29 | + * @@ more config valuse on the way ;) |
28 | 30 | */ |
29 | | -//the name of the player skin (default is mvpcf) |
30 | | -if(!mv_skin_name) |
31 | | - var mv_skin_name = 'mvpcf'; |
32 | | - |
33 | | -if(!mwjQueryUiSkin) |
34 | | - var mwjQueryUiSkin = 'redmond'; |
| 31 | +var defaultMwConfig = { |
| 32 | + 'skin_name': 'mvpcf', |
| 33 | + 'video_size':'400x300' |
| 34 | +} |
35 | 35 | |
| 36 | +if(!mwConfig) |
| 37 | + var mwConfig = {}; |
| 38 | + |
| 39 | +//install the default config values for anything not set in mwConfig |
| 40 | +checkDefaultMwConfig(); |
| 41 | + |
36 | 42 | //whether or not to load java from an iframe. |
37 | 43 | //note: this is necessary for remote embedding because of java security model) |
38 | 44 | if(!mv_java_iframe) |
39 | 45 | var mv_java_iframe = true; |
40 | | - |
41 | | -//the default height/width of the video (if no style or width attribute provided) |
42 | | -if(!mv_default_video_size) |
43 | | - var mv_default_video_size = '400x300'; |
44 | 46 | |
45 | 47 | //for when useing mv_embed with script-loader in root mediawiki path |
46 | 48 | var mediaWiki_mvEmbed_path = 'js2/mwEmbed/'; |
— | — | @@ -62,8 +64,8 @@ |
63 | 65 | |
64 | 66 | |
65 | 67 | //setup the skin path: |
66 | | -var mv_jquery_skin_path = mv_embed_path + 'jquery/' + jQueryUiVN + '/themes/' + mwjQueryUiSkin + '/'; |
67 | | -var mv_skin_img_path = mv_embed_path + 'skins/' + mv_skin_name + '/images/'; |
| 68 | +var mv_jquery_skin_path = mv_embed_path + 'jquery/' + jQueryUiVN + '/themes/redmond/'; |
| 69 | +var mv_skin_img_path = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/'; |
68 | 70 | var mv_default_thumb_url = mv_skin_img_path + 'vid_default_thumb.jpg'; |
69 | 71 | |
70 | 72 | |
— | — | @@ -547,7 +549,7 @@ |
548 | 550 | //set videonojs to loading |
549 | 551 | //issue a style sheet request get both mv_embed and jquery styles: |
550 | 552 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
551 | | - loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css'); |
| 553 | + loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name']+'/styles.css'); |
552 | 554 | |
553 | 555 | //make sure we have jQuery |
554 | 556 | _this.jQueryCheck(function(){ |
— | — | @@ -642,7 +644,7 @@ |
643 | 645 | function js2AddOnloadHook( func ) { |
644 | 646 | //make sure the skin/style sheets are avaliable always: |
645 | 647 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
646 | | - loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css'); |
| 648 | + loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name']+'/styles.css'); |
647 | 649 | |
648 | 650 | //if we have already run the dom ready just run the function directly: |
649 | 651 | if( mvJsLoader.doneReadyEvents ){ |
— | — | @@ -770,7 +772,7 @@ |
771 | 773 | |
772 | 774 | //load the mv_embed_base skin: |
773 | 775 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' ); |
774 | | - loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css' ); |
| 776 | + loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name']+'/styles.css' ); |
775 | 777 | //load all the req libs: |
776 | 778 | mvJsLoader.jQueryCheck(function(){ |
777 | 779 | //load with staged dependeinces (for ie and safari that don't execute in order) |
— | — | @@ -799,7 +801,7 @@ |
800 | 802 | iObj['target_sequence_container'] = this.selector; |
801 | 803 | //issue a request to get the css file (if not already included): |
802 | 804 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css'); |
803 | | - loadExternalCss( mv_embed_path+'skins/'+mv_skin_name+'/mv_sequence.css'); |
| 805 | + loadExternalCss( mv_embed_path+'skins/'+mwConfig['skin_name']+'/mv_sequence.css'); |
804 | 806 | //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page) |
805 | 807 | mvJsLoader.embedVideoCheck(function(){ |
806 | 808 | //load playlist object and then jquery ui stuff: |
— | — | @@ -842,7 +844,7 @@ |
843 | 845 | iObj={}; |
844 | 846 | //add base theme css: |
845 | 847 | loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css'); |
846 | | - loadExternalCss( mv_embed_path + 'skins/'+mv_skin_name+'/styles.css' ); |
| 848 | + loadExternalCss( mv_embed_path + 'skins/'+mwConfig['skin_name']+'/styles.css' ); |
847 | 849 | |
848 | 850 | //check if we already have firefogg loaded (the call just updates properties for that element) |
849 | 851 | var sElm = $j(this.selector).get(0); |
— | — | @@ -1406,6 +1408,14 @@ |
1407 | 1409 | return false; |
1408 | 1410 | } |
1409 | 1411 | |
| 1412 | +function checkDefaultMwConfig(){ |
| 1413 | + for(var i in defaultMwConfig){ |
| 1414 | + if(typeof(mwConfig[i])=='undefined'){ |
| 1415 | + mwConfig[i] =defaultMwConfig[i]; |
| 1416 | + } |
| 1417 | + } |
| 1418 | + } |
| 1419 | + |
1410 | 1420 | function js_error(string){ |
1411 | 1421 | alert(string); |
1412 | 1422 | return false; |
Index: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js |
— | — | @@ -1156,7 +1156,7 @@ |
1157 | 1157 | this.duration = parseFloat(this.duration); |
1158 | 1158 | js_log("duration is: " + this.duration); |
1159 | 1159 | //if style is set override width and height |
1160 | | - var dwh = mv_default_video_size.split('x'); |
| 1160 | + var dwh = mwConfig['video_size'].split('x'); |
1161 | 1161 | this.width = element.style.width ? element.style.width : dwh[0]; |
1162 | 1162 | this.height = element.style.height ? element.style.height : dwh[1]; |
1163 | 1163 | //set the plugin id |