r50943 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50942‎ | r50943 | r50944 >
Date:00:50, 24 May 2009
Author:dale
Status:deferred
Tags:
Comment:
advanced firefogg local encoder updates
Modified paths:
  • /branches/new-upload/phase3/js2/mwEmbed/example_usage/Make_Ogg_Advanced.html (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js (modified) (history)
  • /branches/new-upload/phase3/js2/mwEmbed/mv_embed.js (modified) (history)

Diff [purge]

Index: branches/new-upload/phase3/js2/mwEmbed/mv_embed.js
@@ -628,6 +628,10 @@
629629 };
630630 //see if we need to load the advanced firefog controls and associated ui components:
631631 if( iObj.encoder_interface ){
 632+
 633+ //grab the css:
 634+ loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css');
 635+
632636 //@@todo would be nice to have a "dependency" map we could use/
633637 loadSet['mvAdvFirefogg'] = 'libAddMedia/mvAdvFirefogg.js';
634638 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 @@
2929 Make Ogg Video</h1>
3030 <br><br><br>
3131 <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>
3433 <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
3635 <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+
3938 </center>
4039 </body></html>
Index: branches/new-upload/phase3/js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
@@ -49,9 +49,11 @@
5050 }
5151 }
5252 },
 53+ //local instance encoder config (empty by default)
 54+ local_encoder_config:{},
5355 //core firefogg default encoder configuration
5456 //see encoder options here: http://www.firefogg.org/dev/index.html
55 - encoder_config : {
 57+ default_encoder_config : {
5658 //base quality settings:
5759 'videoQuality': {
5860 'd' : 5,
@@ -220,13 +222,15 @@
221223 var myFogg = new mvFirefogg( initObj );
222224 for(var i in myFogg){
223225 if( typeof this[i] != 'undefined'){
224 - this[ 'pfogg_' + i ] = mvFogg[i];
 226+ this[ 'basefogg_' + i ] = myFogg[i];
225227 }else{
226 - this[ i ] = mvFogg[i];
 228+ this[ i ] = myFogg[i];
227229 }
228230 }
229231 },
230 - setupForm:function(){
 232+ setupForm:function(){
 233+ //call base firefogg form setup
 234+ basefogg_setupForm();
231235 //if we have a target control form gennerate the html and setup the bindings
232236 if( this.control_container != ''){
233237 //gennerate the control html
@@ -240,7 +244,8 @@
241245 },
242246 doControlHTML: function(){
243247 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){
245250 out+= '<div> '+
246251 '<h3><a href="#" id="gd_'+group_key+'" >' + group_desc + '</a></h3>'+
247252 '<div>';
@@ -248,10 +253,10 @@
249254 out+='<table width="450" ><tr><td width="35%"></td><td width="65%"></td></tr>';
250255 //special preset case:
251256
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];
254259 if(cConf.group == group_key){
255 - out+= proccessCkControlHTML( cK );
 260+ out+= _this.proccessCkControlHTML( cK );
256261 }
257262 }
258263 out+='</table>';
@@ -263,7 +268,7 @@
264269 $j('#control_container').html( out );
265270 },
266271 proccessCkControlHTML:function( cK ){
267 - var cConf = firefogg_defaults[cK];
 272+ var cConf = this.default_encoder_config[cK];
268273 var out ='';
269274 out+='<tr><td valign="top">'+
270275 '<label for="_' + cK + '">' +
@@ -271,14 +276,14 @@
272277 '<span id="help_'+ cK + '" class="ui-icon ui-icon-info" style="float:left"></span>'+
273278 '</label></td><td>';
274279 //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 ] : '';
276281 //switch on the config type
277282 switch( cConf.type ){
278283 case 'string':
279284 out+= '<input type="text" id="_' + cK + '" value="' + dv + '" >' ;
280285 break;
281286 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);
283288 out+= '<input type="text" maxlength="'+maxdigits+'" size="' +maxdigits + '" '+
284289 'id="_' + cK + '" style="display:inline;border:0; color:#f6931f; font-weight:bold;" ' +
285290 'value="' + dv + '" >' +
@@ -354,8 +359,8 @@
355360 }
356361 }
357362
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];
360365 //set up the help for all types:
361366 if(cConf.help){
362367 //initial state is hidden:
@@ -398,8 +403,8 @@
399404 $j('#slider_' + cK ).slider({
400405 range: "min",
401406 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,
404409 slide: function(event, ui) {
405410 var id = $j(this).attr('id').replace('slider_', '');;
406411 $j('#_'+ id).val( ui.value );
@@ -420,26 +425,26 @@
421426 //sets up the local settings for the encode (restored from a cookie if you have them)
422427 setupSettings:function( force ){
423428 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') );
426431 }
427432 }
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'];
431436 }
432437 }
433438 setValuesInHtml();
434439 },
435440 setValuesInHtml:function(){
436441 //set the actual HTML:
437 - $.each(firefogg_settings, function(inx, val){
 442+ $.each(this.local_encoder_config, function(inx, val){
438443 if($j('#_'+inx).length !=0){
439444 $j('#_'+inx).val( val );
440445 }
441446 })
442447 },
443448 saveSettings:function(){
444 - $j.cookie('firefogg_settings', JSON.stringify( firefogg_settings ) );
 449+ $j.cookie('this.local_encoder_config', JSON.stringify( this.local_encoder_config ) );
445450 }
446451 }
\ No newline at end of file

Status & tagging log