Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js |
— | — | @@ -628,6 +628,10 @@ |
629 | 629 | }; |
630 | 630 | //see if we need to load the advanced firefog controls and associated ui components: |
631 | 631 | if( iObj.encoder_interface ){ |
| 632 | + |
| 633 | + //grab the css: |
| 634 | + loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css'); |
| 635 | + |
632 | 636 | //@@todo would be nice to have a "dependency" map we could use/ |
633 | 637 | loadSet['mvAdvFirefogg'] = 'libAddMedia/mvAdvFirefogg.js'; |
634 | 638 | loadSet['$j.cookie'] = 'jquery/' + jQueryUiVN + '/external/cookie/jquery.cookie.js'; |
Index: branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Advanced.html |
— | — | @@ -28,12 +28,11 @@ |
29 | 29 | Make Ogg Video</h1> |
30 | 30 | <br><br><br> |
31 | 31 | <center> |
32 | | - <div style="width:500px"> |
33 | | - <div style="float:left;height:400px" id="control_container"></div> |
| 32 | + <div style="width:500px;height:450px" id="control_container"> </div> |
34 | 33 | <br><br> |
35 | | - <!-- <span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a> & <a href="http://jqueryui.com/">jquery.ui</a> Supports |
| 34 | + <span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a> & <a href="http://jqueryui.com/">jquery.ui</a> Supports |
36 | 35 | <a href="javascript:(function(){if%20(!/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){alert('Sorry,%20due%20to%20security%20restrictions,%20this%20tool%20only%20works%20in%20Firefox');%20return%20false;%20};%20if(window.jquitr){%20jquitr.addThemeRoller();%20}%20else{%20jquitr%20=%20{};%20jquitr.s%20=%20document.createElement('script');%20jquitr.s.src%20=%20'http://jqueryui.com/themeroller/developertool/developertool.js.php';%20document.getElementsByTagName('head')[0].appendChild(jquitr.s);}%20})();">custom themes</a>, <b>remix me</b> |
37 | | - </span> --> |
38 | | - </div> |
| 36 | + </span> |
| 37 | + |
39 | 38 | </center> |
40 | 39 | </body></html> |
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js |
— | — | @@ -49,9 +49,11 @@ |
50 | 50 | } |
51 | 51 | } |
52 | 52 | }, |
| 53 | + //local instance encoder config (empty by default) |
| 54 | + local_encoder_config:{}, |
53 | 55 | //core firefogg default encoder configuration |
54 | 56 | //see encoder options here: http://www.firefogg.org/dev/index.html |
55 | | - encoder_config : { |
| 57 | + default_encoder_config : { |
56 | 58 | //base quality settings: |
57 | 59 | 'videoQuality': { |
58 | 60 | 'd' : 5, |
— | — | @@ -220,13 +222,15 @@ |
221 | 223 | var myFogg = new mvFirefogg( initObj ); |
222 | 224 | for(var i in myFogg){ |
223 | 225 | if( typeof this[i] != 'undefined'){ |
224 | | - this[ 'pfogg_' + i ] = mvFogg[i]; |
| 226 | + this[ 'basefogg_' + i ] = myFogg[i]; |
225 | 227 | }else{ |
226 | | - this[ i ] = mvFogg[i]; |
| 228 | + this[ i ] = myFogg[i]; |
227 | 229 | } |
228 | 230 | } |
229 | 231 | }, |
230 | | - setupForm:function(){ |
| 232 | + setupForm:function(){ |
| 233 | + //call base firefogg form setup |
| 234 | + basefogg_setupForm(); |
231 | 235 | //if we have a target control form gennerate the html and setup the bindings |
232 | 236 | if( this.control_container != ''){ |
233 | 237 | //gennerate the control html |
— | — | @@ -240,7 +244,8 @@ |
241 | 245 | }, |
242 | 246 | doControlHTML: function(){ |
243 | 247 | var out =''; |
244 | | - $.each(firefogg_config_groups, function(group_key, group_desc){ |
| 248 | + var _this = this; |
| 249 | + $j.each(this.config_groups, function(group_key, group_desc){ |
245 | 250 | out+= '<div> '+ |
246 | 251 | '<h3><a href="#" id="gd_'+group_key+'" >' + group_desc + '</a></h3>'+ |
247 | 252 | '<div>'; |
— | — | @@ -248,10 +253,10 @@ |
249 | 254 | out+='<table width="450" ><tr><td width="35%"></td><td width="65%"></td></tr>'; |
250 | 255 | //special preset case: |
251 | 256 | |
252 | | - for(var cK in firefogg_defaults){ |
253 | | - var cConf = firefogg_defaults[cK]; |
| 257 | + for(var cK in _this.default_encoder_config){ |
| 258 | + var cConf = _this.default_encoder_config[cK]; |
254 | 259 | if(cConf.group == group_key){ |
255 | | - out+= proccessCkControlHTML( cK ); |
| 260 | + out+= _this.proccessCkControlHTML( cK ); |
256 | 261 | } |
257 | 262 | } |
258 | 263 | out+='</table>'; |
— | — | @@ -263,7 +268,7 @@ |
264 | 269 | $j('#control_container').html( out ); |
265 | 270 | }, |
266 | 271 | proccessCkControlHTML:function( cK ){ |
267 | | - var cConf = firefogg_defaults[cK]; |
| 272 | + var cConf = this.default_encoder_config[cK]; |
268 | 273 | var out =''; |
269 | 274 | out+='<tr><td valign="top">'+ |
270 | 275 | '<label for="_' + cK + '">' + |
— | — | @@ -271,14 +276,14 @@ |
272 | 277 | '<span id="help_'+ cK + '" class="ui-icon ui-icon-info" style="float:left"></span>'+ |
273 | 278 | '</label></td><td>'; |
274 | 279 | //check if we have a value for this: |
275 | | - var dv = ( firefogg_settings[ cK ] ) ? firefogg_settings[ cK ] : ''; |
| 280 | + var dv = ( this.local_encoder_config[ cK ] ) ? this.local_encoder_config[ cK ] : ''; |
276 | 281 | //switch on the config type |
277 | 282 | switch( cConf.type ){ |
278 | 283 | case 'string': |
279 | 284 | out+= '<input type="text" id="_' + cK + '" value="' + dv + '" >' ; |
280 | 285 | break; |
281 | 286 | case 'slider': |
282 | | - maxdigits = (Math.round( firefogg_defaults[ cK ].range.max / 10) +1); |
| 287 | + maxdigits = (Math.round( this.default_encoder_config[ cK ].range.max / 10) +1); |
283 | 288 | out+= '<input type="text" maxlength="'+maxdigits+'" size="' +maxdigits + '" '+ |
284 | 289 | 'id="_' + cK + '" style="display:inline;border:0; color:#f6931f; font-weight:bold;" ' + |
285 | 290 | 'value="' + dv + '" >' + |
— | — | @@ -354,8 +359,8 @@ |
355 | 360 | } |
356 | 361 | } |
357 | 362 | |
358 | | - for(var cK in firefogg_defaults){ |
359 | | - var cConf = firefogg_defaults[cK]; |
| 363 | + for(var cK in this.default_encoder_config){ |
| 364 | + var cConf = this.default_encoder_config[cK]; |
360 | 365 | //set up the help for all types: |
361 | 366 | if(cConf.help){ |
362 | 367 | //initial state is hidden: |
— | — | @@ -398,8 +403,8 @@ |
399 | 404 | $j('#slider_' + cK ).slider({ |
400 | 405 | range: "min", |
401 | 406 | value: parseInt($j('#_' + cK ).val() ), |
402 | | - min: firefogg_defaults[ cK ].range.min, |
403 | | - max: firefogg_defaults[ cK ].range.max, |
| 407 | + min: this.default_encoder_config[ cK ].range.min, |
| 408 | + max: this.default_encoder_config[ cK ].range.max, |
404 | 409 | slide: function(event, ui) { |
405 | 410 | var id = $j(this).attr('id').replace('slider_', '');; |
406 | 411 | $j('#_'+ id).val( ui.value ); |
— | — | @@ -420,26 +425,26 @@ |
421 | 426 | //sets up the local settings for the encode (restored from a cookie if you have them) |
422 | 427 | setupSettings:function( force ){ |
423 | 428 | if(!force){ |
424 | | - if($.cookie('firefogg_settings')){ |
425 | | - firefogg_settings = JSON.parse( $.cookie('firefogg_settings') ); |
| 429 | + if($.cookie('this.local_encoder_config')){ |
| 430 | + this.local_encoder_config = JSON.parse( $.cookie('this.local_encoder_config') ); |
426 | 431 | } |
427 | 432 | } |
428 | | - for(var i in firefogg_defaults){ |
429 | | - if( firefogg_defaults[i]['d'] ){ |
430 | | - firefogg_settings[i] = firefogg_defaults[i]['d']; |
| 433 | + for(var i in this.default_encoder_config){ |
| 434 | + if( this.default_encoder_config[i]['d'] ){ |
| 435 | + this.local_encoder_config[i] = this.default_encoder_config[i]['d']; |
431 | 436 | } |
432 | 437 | } |
433 | 438 | setValuesInHtml(); |
434 | 439 | }, |
435 | 440 | setValuesInHtml:function(){ |
436 | 441 | //set the actual HTML: |
437 | | - $.each(firefogg_settings, function(inx, val){ |
| 442 | + $.each(this.local_encoder_config, function(inx, val){ |
438 | 443 | if($j('#_'+inx).length !=0){ |
439 | 444 | $j('#_'+inx).val( val ); |
440 | 445 | } |
441 | 446 | }) |
442 | 447 | }, |
443 | 448 | saveSettings:function(){ |
444 | | - $j.cookie('firefogg_settings', JSON.stringify( firefogg_settings ) ); |
| 449 | + $j.cookie('this.local_encoder_config', JSON.stringify( this.local_encoder_config ) ); |
445 | 450 | } |
446 | 451 | } |
\ No newline at end of file |