* update messages in the actual JavaScript files; also remove trailing whitespace
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Tue, 18 Aug 2009 23:23:59 +0000 (23:23 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Tue, 18 Aug 2009 23:23:59 +0000 (23:23 +0000)
* update mwEmbed.i18n.php

13 files changed:
js2/mwEmbed/libAddMedia/mvAdvFirefogg.js
js2/mwEmbed/libAddMedia/mvBaseUploadInterface.js
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libAddMedia/searchLibs/baseRemoteSearch.js
js2/mwEmbed/libAddMedia/simpleUploadForm.js
js2/mwEmbed/libClipEdit/mvClipEdit.js
js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/libSequencer/mvSequencer.js
js2/mwEmbed/libSequencer/mvTimedEffectsEdit.js
js2/mwEmbed/libTimedText/mvTextInterface.js
js2/mwEmbed/mv_embed.js
js2/mwEmbed/php/languages/mwEmbed.i18n.php

index 2a3a030..beb1c6d 100644 (file)
@@ -1,18 +1,18 @@
 /*
-* Adds advanced firefogg support (let you control and structure advanced controls over many aspects of video encoding)  
+* Adds advanced firefogg support (let you control and structure advanced controls over many aspects of video encoding)
 */
 
 //@@todo put all msg text into loadGM json
 
 loadGM({
-       "help-sticky": "Help (Click to Stick)",
+       "help-sticky": "Help (click to stick)",
        "fogg-cg-preset": "Preset: <strong>$1</strong>",
-       "fogg-cg-quality": "Basic Quality and Resolution Control",
-       "fogg-cg-meta": "Meta Data for the Clip",
-       "fogg-cg-range" : "Encoding Range",
-       "fogg-cg-advVideo": "Advanced Video Encoding Controls",
-       "fogg-cg-advAudio": "Advanced Audio Encoding Controls",
-       "fogg-preset-custom": "Custom Settings" 
+       "fogg-cg-quality": "Basic quality and resolution control",
+       "fogg-cg-meta": "Metadata for the clip",
+       "fogg-cg-range" : "Encoding range",
+       "fogg-cg-advVideo": "Advanced video encoding controls",
+       "fogg-cg-advAudio": "Advanced audio encoding controls",
+       "fogg-preset-custom": "Custom settings"
 });
 
 var mvAdvFirefogg = function( iObj ){
@@ -21,25 +21,25 @@ var mvAdvFirefogg = function( iObj ){
 var default_mvAdvFirefogg_config = {
        //which config groups to include
        'config_groups'  : ['preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio'],
-       
+
        //if you want to load any custom presets must follow the mvAdvFirefogg.presetConf json outline below
-       'custom_presets'        : {}, 
-       
+       'custom_presets'        : {},
+
        //any firefog config properties that may need to be excluded from options
        'exclude_settings' : [],
-       
-       //the control container (where we put all the controls)                          
+
+       //the control container (where we put all the controls)
        'target_control_container':false
 }
 
-mvAdvFirefogg.prototype = {    
-       //the global groupings and titles for for configuration options : 
-       config_groups : [ 'preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio'],                
-       //list of pre-sets:      
+mvAdvFirefogg.prototype = {
+       //the global groupings and titles for for configuration options :
+       config_groups : [ 'preset', 'range', 'quality', 'meta', 'advVideo', 'advAudio'],
+       //list of pre-sets:
        //local instance encoder config:
        default_local_settings:{
                'd'     : 'webvideo',
-               'type'  : 'select',             
+               'type'  : 'select',
                'selectVal': ['webvideo'],
                'group' : "preset",
                'pSet' : {
@@ -50,42 +50,42 @@ mvAdvFirefogg.prototype = {
                        'webvideo': {
                                'desc': "Web Video Theora, Vorbis 400kbs & 400px max width",
                                'conf': {
-                                               'maxSize'               : 400, 
+                                               'maxSize'               : 400,
                                                'videoBitrate'  : 544,
                                                'audioBitrate'  : 96,
-                                       'noUpscaling'   : true,                                         
+                                       'noUpscaling'   : true,
                                        }
                        },
                        'savebandwith': {
                                'desc': "Low Bandwith Theora, Vorbis 164kbs & 200px max size",
                                'conf': {
-                                               'maxSize'               : 200, 
+                                               'maxSize'               : 200,
                                                'videoBitrate'  : 164,
                                                'audioBitrate'  : 32,
                                'samplerate'    : 22050,
                                'framerate'     : 15,
-                               'channels'      : 1,         
+                               'channels'      : 1,
                                'noUpscaling'   : true
                                        }
                        },
                        'hqstream':{
                                'desc': "High Quality Theora, Vorbis 1080px max width",
                                'conf': {
-                                               'maxSize'               : 1080, 
+                                               'maxSize'               : 1080,
                                                'videoQuality'  : 6,
                                                'audioQuality'  : 3,
-                                       'noUpscaling'   : true,                                         
+                                       'noUpscaling'   : true,
                                        }
                        },
-               }       
-       }, 
+               }
+       },
        local_settings: {},
-       
+
        //core firefogg default encoder configuration
        //see encoder options here: http://www.firefogg.org/dev/index.html
-       default_encoder_config : {              
+       default_encoder_config : {
                //base quality settings:
-               'videoQuality': { 
+               'videoQuality': {
                        'd'                     : 5,
                        't'                     : 'Video Quality',
                        'range'  : {'min':0,'max':10},
@@ -99,13 +99,13 @@ mvAdvFirefogg.prototype = {
                        'group' : "quality",
                        'help'  : "Two Pass Encoding enables more consitant quality by making two passes over the video file"
                },
-               'starttime':{                   
+               'starttime':{
                        't'             : "Start Second",
                        'type'  : "float",
                        'group' : "range",
                        'help'  : "Only encode from time in seconds"
                },
-               'endtime':{                     
+               'endtime':{
                        't'             : "End Second",
                        'type'  : "float",
                        'group' : "range",
@@ -139,7 +139,7 @@ mvAdvFirefogg.prototype = {
                        't'                     : 'Video Width',
                        'range'  : {'min':0,'max':1080},
                        'step'          : 4,
-                       'type'    : 'slider',                   
+                       'type'    : 'slider',
                        'group'  : "quality",
                        'help'          : "Resize to given width."
                },
@@ -147,17 +147,17 @@ mvAdvFirefogg.prototype = {
                        't'                     : 'Video Height',
                        'range'  : {'min':0,'max':1080},
                        'step'          : 4,
-                       'type'          : "slider",                                             
+                       'type'          : "slider",
                        'group'         : "quality",
                        'help'          : "Resize to given height"
-               },                              
+               },
                //advanced Video control configs:
                'videoBitrate':{
                        't'                     : 'Video Bitrate',
-                       'range'         : {'min':1, 'max':16778},                       
+                       'range'         : {'min':1, 'max':16778},
                        'type'          : "slider",
                        'group'         : "advVideo",
-                       'help'          : "Video Bitrate sets the encoding bitrate for video in (kb/s)"                 
+                       'help'          : "Video Bitrate sets the encoding bitrate for video in (kb/s)"
                } ,
                'framerate':{
                        't'                     : 'Framerate',
@@ -166,11 +166,11 @@ mvAdvFirefogg.prototype = {
                        'type'             : "select",
                        'group'         : "advVideo",
                        'help'             : "The video Framerate. More about <a target=\"_new\" href=\"http://en.wikipedia.org/wiki/Frame_rate\">Framerate</a>"
-               },              
+               },
                'aspect':{
                        't'                     : 'Aspect Ratio',
                        'd'                     : '4:3',
-                       'type'          : "select",     
+                       'type'          : "select",
                        'selectVal'     : ['4:3', '16:9'],
                        'group'         : "advVideo",
                        'help'          : "The video aspect ratio can be fraction 4:3 or 16:9. More about <a target=\"_new\" href=\"http://en.wikipedia.org/wiki/Aspect_ratio_%28image%29\">aspect ratios</a>"
@@ -184,7 +184,7 @@ mvAdvFirefogg.prototype = {
                        'group'         : 'advVideo',
                        'help'          : "The keyframe interval in frames. Note: Most codecs force keyframes if the difference between frames is greater than keyframe encode size. More about <a href=\"http://en.wikipedia.org/wiki/I-frame\">keyframes</a>"
                },
-               'denoise':{     
+               'denoise':{
                        'type'          : "boolean",
                        't'                     : "Denoise Filter",
                        'group'         : 'advVideo',
@@ -196,8 +196,8 @@ mvAdvFirefogg.prototype = {
                        'group'         : 'advVideo',
                        'help'          : "disable video in the output"
                },
-       
-               //advanced Audio control Config: 
+
+               //advanced Audio control Config:
                'audioBitrate':{
                        't'                     : "Audio Bitrate",
                        'range'         : {'min':32,'max':500},
@@ -215,12 +215,12 @@ mvAdvFirefogg.prototype = {
                        'help'          : "set output samplerate (in Hz)."
                },
                'noaudio':{
-                       't'             : "No Audio",           
+                       't'             : "No Audio",
                        'type'          : 'boolean',
                        'group'         : 'advAudio',
                        'help'          : "disable audio in the output"
                },
-       
+
                //meta tags:
                'title':{
                        't'     : "Title",
@@ -270,15 +270,15 @@ mvAdvFirefogg.prototype = {
                        'group' : 'meta',
                        'help'  : "Contact link"
                }
-       },      
-       init:function( iObj ){                          
+       },
+       init:function( iObj ){
                //setup a "supported" iObj:
                for(var i in iObj){
                        if( typeof default_mvAdvFirefogg_config [i] != 'undefined' ){
-                               this[i] = iObj[i];                              
-                       }                       
+                               this[i] = iObj[i];
+                       }
                }
-               //inherit the base mvFirefogg class: 
+               //inherit the base mvFirefogg class:
                var myFogg = new mvFirefogg( iObj );
                for(var i in myFogg){
                        if( typeof this[i] != 'undefined'){
@@ -286,29 +286,29 @@ mvAdvFirefogg.prototype = {
                        }else{
                                this[ i ] = myFogg[i];
                        }
-               }               
+               }
        },
        setupForm:function(){
-               //call base firefogg form setup         
-               basefogg_setupForm();           
-                       
+               //call base firefogg form setup
+               basefogg_setupForm();
+
                //gennerate the control html
-               this.doControlHTML();                                           
-               
-               //setup control bindings: 
-               this.doControlBindings();               
-               
+               this.doControlHTML();
+
+               //setup control bindings:
+               this.doControlBindings();
+
        },
        doControlHTML: function(){
                js_log("adv doControlHTML");
                var _this = this;
-               //load presets from cookie: 
+               //load presets from cookie:
                this.loadEncSettings();
-               
-               //add base control buttons:              
+
+               //add base control buttons:
                this.basefogg_doControlHTML();
-               
-               //build the config group outpouts 
+
+               //build the config group outpouts
                var gdout ='';
                $j.each(this.config_groups, function(inx, group_key){
                        gdout+= '<div> '+
@@ -319,51 +319,51 @@ mvAdvFirefogg.prototype = {
                        //output the special prset output
                        if(group_key=='preset'){
                                gdout += _this.proccessPresetControl();
-                       }                        
-                       for(var cK in _this.default_encoder_config){                            
+                       }
+                       for(var cK in _this.default_encoder_config){
                                var cConf = _this.default_encoder_config[cK];
                                if(cConf.group == group_key){
-                                       gdout+= _this.proccessCkControlHTML( cK );                                                      
+                                       gdout+= _this.proccessCkControlHTML( cK );
                                }
                        }
                        gdout+='</table>';
-                       gdout+=         '</div>' + 
+                       gdout+=         '</div>' +
                                 '</div>';
-       
-               });             
-               //add the control container:  
-               if(!this.target_control_container){                     
+
+               });
+               //add the control container:
+               if(!this.target_control_container){
                        this.target_control_container = this.selector + ' .control_container';
                        //set the target contorl container to height
-                       $j(this.selector).append( '<p><div class="control_container"></div>' ); 
+                       $j(this.selector).append( '<p><div class="control_container"></div>' );
                }
                //hide the container and add the output
                $j(this.target_control_container).hide();
                $j(this.target_control_container).html( gdout );
-                               
+
        },
-       //custom advanced target rewrites: 
-       getTargetHtml:function(target){                         
-               if(     target=='target_btn_select_file' || 
-                       target=='target_btn_select_new_file'||                  
+       //custom advanced target rewrites:
+       getTargetHtml:function(target){
+               if(     target=='target_btn_select_file' ||
+                       target=='target_btn_select_new_file'||
                        target=='target_btn_save_local_file'){
-                       var icon = (target=='target_btn_save_local_file')?'ui-icon-video':'ui-icon-folder-open';        
+                       var icon = (target=='target_btn_save_local_file')?'ui-icon-video':'ui-icon-folder-open';
                        return   '<a class="ui-state-default ui-corner-all ui-icon_link '+
-                                               target +'" href="#"><span class="ui-icon ' + icon + '"/>' + 
+                                               target +'" href="#"><span class="ui-icon ' + icon + '"/>' +
                                                gM( 'fogg-' + target.substring(11) ) +
                                        '</a>';
-               }else if(  target=='target_btn_select_url'){                    
+               }else if(  target=='target_btn_select_url'){
                        //return the btnHtml:
                        return $j.btnHtml( gM( 'fogg-' + target.substring(11) ), target,  'link');
-                       
-               }else if(       target=='target_use_latest_fox' || 
-                                       target=='target_please_install' || 
+
+               }else if(       target=='target_use_latest_fox' ||
+                                       target=='target_please_install' ||
                                        target == 'target_passthrough_mode'){
                        return '<div style="margin-top:1em;padding: 0pt 0.7em;" class="ui-state-error ui-corner-all ' +
-                                       target + '">' + 
-                                       '<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"/>'+ 
+                                       target + '">' +
+                                       '<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"/>'+
                                        gM( 'fogg-' + target.substring(7)) +'</p>'+
-                               '</div>';       
+                               '</div>';
                }else if( target == 'target_input_file_name'){
                        return '<br><br><input style="" class="text ui-widget-content ui-corner-all ' + target + '" '+
                                        'type="text" value="' + gM( 'fogg-' + target.substring(11)) + '" size="60" /> ';
@@ -372,16 +372,16 @@ mvAdvFirefogg.prototype = {
                        return this.basefogg_getTargetHtml(target);
                }
        },
-       proccessPresetControl:function(){ 
+       proccessPresetControl:function(){
                var out='';
                var _this = this;
-               js_log('proccessPresetControl::');              
+               js_log('proccessPresetControl::');
                if(typeof this.local_settings.pSet!= 'undefined' ){
-                       out+= '<select class="_preset_select">';                        
+                       out+= '<select class="_preset_select">';
                        $j.each(this.local_settings.pSet, function(pKey, pSet){
                                var pDesc = (pSet.descKey) ? gM(pSet.descKey) : pSet.desc;
-                               var sel = (_this.local_settings.d == pKey)?' selected':'';                                      
-                               out+='<option value="'+pKey+'" '+sel+'>'+ pDesc+'</option>';                    
+                               var sel = (_this.local_settings.d == pKey)?' selected':'';
+                               out+='<option value="'+pKey+'" '+sel+'>'+ pDesc+'</option>';
                        });
                        out+='</select>';
                        }
@@ -391,14 +391,14 @@ mvAdvFirefogg.prototype = {
                var cConf =  this.default_encoder_config[cK];
                var out ='';
                out+='<tr><td valign="top">'+
-                       '<label for="_' + cK + '">' +                                   
-                        cConf.t + ':' + 
+                       '<label for="_' + cK + '">' +
+                        cConf.t + ':' +
                         '<span title="' + gM('help-sticky') + '" class="help_'+ cK + ' ui-icon ui-icon-info" style="float:left"></span>'+
                         '</label></td><td valign="top">';
-               //if we don't value for this: 
-               var dv = ( this.default_encoder_config[cK].d ) ? this.default_encoder_config[cK].d : '';                
+               //if we don't value for this:
+               var dv = ( this.default_encoder_config[cK].d ) ? this.default_encoder_config[cK].d : '';
                //switch on the config type
-               switch( cConf.type ){                                   
+               switch( cConf.type ){
                        case 'string':
                        case 'date':
                        case 'int':
@@ -410,28 +410,28 @@ mvAdvFirefogg.prototype = {
                                var checked_attr = (dv===true)?' checked="true"':'';
                                out+='<input type="checkbox" class="_'+cK+ ' ui-widget-content ui-corner-all" ' + checked_attr + '>';
                        break;
-                       case 'slider':  
-                               var strMax = this.default_encoder_config[ cK ].range.max + '';                  
+                       case 'slider':
+                               var strMax = this.default_encoder_config[ cK ].range.max + '';
                                maxdigits = strMax.length +1;
-                               out+= '<input type="text" maxlength="'+maxdigits+'" size="' +maxdigits + '" '+          
-                                       'class="_'+cK+ ' text ui-widget-content ui-corner-all" style="display:inline;border:0; color:#f6931f; font-weight:bold;" ' + 
-                                       'value="' + dv + '" >' +                                                                
+                               out+= '<input type="text" maxlength="'+maxdigits+'" size="' +maxdigits + '" '+
+                                       'class="_'+cK+ ' text ui-widget-content ui-corner-all" style="display:inline;border:0; color:#f6931f; font-weight:bold;" ' +
+                                       'value="' + dv + '" >' +
                                        '<div class="slider_' + cK + '"></div>';
                        break;
                        case 'select':
                                out+= '<select class="_' + cK + '">'+
-                                               '<option value=""> </option>';                                          
-                               for(var i in cConf.selectVal){                          
+                                               '<option value=""> </option>';
+                               for(var i in cConf.selectVal){
                                        var val = cConf.selectVal[i];
-                                       if(typeof val == 'string'){     
-                                               var sel = (     cConf.selectVal[i] == val)?' selected':'';                                                                      
+                                       if(typeof val == 'string'){
+                                               var sel = (     cConf.selectVal[i] == val)?' selected':'';
                                                out+= '<option value="'+val+'"'+sel+'>'+val+'</option>';
                                        }else if(typeof val == 'object'){
                                                for(var key in val){
                                                        hr_val = val[key];
                                                }
-                                               var sel = ( cConf.selectVal[i] == key )?' selected':''; 
-                                                       
+                                               var sel = ( cConf.selectVal[i] == key )?' selected':'';
+
                                                out+= '<option value="'+key+'"'+sel+'>'+hr_val+'</option>';
                                        }
                                }
@@ -441,7 +441,7 @@ mvAdvFirefogg.prototype = {
                //output the help row:
                if(cConf.help){
                        out+='<div class="helpRow_' + cK + '">'+
-                                       '<span class="helpClose_' + cK + ' ui-icon ui-icon-circle-close" '+ 
+                                       '<span class="helpClose_' + cK + ' ui-icon ui-icon-circle-close" '+
                                        'title="Close Help"'+
                                        'style="float:left"/>'+
                                 cConf.help +
@@ -452,16 +452,16 @@ mvAdvFirefogg.prototype = {
        },
        selectByUrl:function(){
                var urlValue = prompt("Please enter the source media url you would like to transcode from.","http://");
-               if( urlValue ){                 
+               if( urlValue ){
                        //update the mode:
                        this.sourceMode = 'url';
-                       this.sourceUrl = urlValue;                                                                                      
+                       this.sourceUrl = urlValue;
                        this.selectFoggActions();
                        this.autoEncoderSettings();
                        //update the input target
-                       $j(this.target_input_file_name).unbind().val( urlValue ).removeAttr('readonly');                                
+                       $j(this.target_input_file_name).unbind().val( urlValue ).removeAttr('readonly');
                }
-       },       
+       },
        doControlBindings:function(){
                var _this = this;
                _this.basefogg_doControlBindings();
@@ -469,74 +469,74 @@ mvAdvFirefogg.prototype = {
                /*$j( this.target_btn_select_url ).unbind(
                        ).attr('disabled', false
                        ).css({'display':'inline'}
-                       ).click(function(){                                     
+                       ).click(function(){
                                _this.selectByUrl();
                });
-               */                      
-               
-               
+               */
+
+
                //hide the base advanced controls untill a file is selected:
                $j(this.target_control_container).hide();
-               
+
                var helpState = {};
-               //do some display tweeks:                        
-               js_log('tw:' + $j(this.selector).width() + 
-                               'ssf:' + $j(this.target_btn_select_new_file).width() + 
+               //do some display tweeks:
+               js_log('tw:' + $j(this.selector).width() +
+                               'ssf:' + $j(this.target_btn_select_new_file).width() +
                                'sf:' +  $j(this.target_btn_save_local_file).width() );
-               
+
                //set width to 250
                $j(this.target_input_file_name).width( 250 );
-               
-               //special preset action: 
+
+               //special preset action:
                $j(this.selector + ' ._preset_select').change(function(){
                        _this.updatePresetSelection( $j(this).val() );
                });
-               
+
                //bind control actions
                for(var cK in this.default_encoder_config){
                        var cConf =  this.default_encoder_config[cK];
-                       //set up the help for all types: 
+                       //set up the help for all types:
                        if(cConf.help){
-                               //initial state is hidden: 
-                               $j( this.selector + ' .helpRow_' + cK).hide();          
-                               $j(this.selector + ' .help_' + cK).click(function(){                                    
+                               //initial state is hidden:
+                               $j( this.selector + ' .helpRow_' + cK).hide();
+                               $j(this.selector + ' .help_' + cK).click(function(){
                                        //get the ckId (assume its the last class)
-                                       var cK = _this.getClassId(this, 'help_'); 
-                                                                       
+                                       var cK = _this.getClassId(this, 'help_');
+
                                        if(helpState[cK]){
                                                $j(_this.selector + ' .helpRow_' + cK).hide('slow');
                                                helpState[cK] = false;
-                                       }else{                                                  
+                                       }else{
                                                $j(_this.selector + ' .helpRow_' + cK).show('slow');
                                                helpState[cK] = true;
-                                       }                                       
-                                       return false;           
+                                       }
+                                       return false;
                                }).hover(
-                                       function(){                                       
+                                       function(){
                                                //get the ckId (assume its the last class)
-                                               var cK = _this.getClassId(this, 'help_');                                                       
+                                               var cK = _this.getClassId(this, 'help_');
                                                $j( _this.selector + ' .helpRow_' + cK).show('slow');
                                        },function(){
-                                               var cK = _this.getClassId(this, 'help_'); 
-                                               if(!helpState[cK])                                              
-                                                       $j( _this.selector + ' .helpRow_' + cK).hide('slow')                                            
+                                               var cK = _this.getClassId(this, 'help_');
+                                               if(!helpState[cK])
+                                                       $j( _this.selector + ' .helpRow_' + cK).hide('slow')
                                        }
                                );
                                $j( _this.selector + ' .helpClose_' + cK).click(function(){
-                                       js_log("close help: " +cK);                        
+                                       js_log("close help: " +cK);
                                        //get the ckId (assume its the last class)
                                        var cK = _this.getClassId(this, 'helpClose_');
-                                       $j(_this.selector + ' .helpRow_' + cK).hide('slow');                    
-                                       helpState[cK] = false;  
+                                       $j(_this.selector + ' .helpRow_' + cK).hide('slow');
+                                       helpState[cK] = false;
                                        return false;
                                }).css('cursor', 'pointer');
                        }else{
                                $j(this.selector + ' .help_' + cK).hide();
                        }
-                       
-                       //setup bindings for change values: (validate input)             
-                       
-                       switch( cConf.type ){   
+
+                       //setup bindings for change values: (validate input)
+
+                       switch( cConf.type ){
                                case 'boolean':
                                        $j(_this.selector + ' ._'+cK).click(function(){
                                                _this.updateLocalValue(  _this.getClassId(this), $j(this).is(":checked") );
@@ -548,9 +548,9 @@ mvAdvFirefogg.prototype = {
                                case 'int':
                                case 'float':
                                        //@@check if we have a validate function on the string
-                                       $j(_this.selector + ' ._'+cK).change(function(){                                                                
+                                       $j(_this.selector + ' ._'+cK).change(function(){
                                                $j(this).val( _this.updateLocalValue(
-                                                       _this.getClassId(this), 
+                                                       _this.getClassId(this),
                                                        $j(this).val() ));
                                                _this.updatePresetSelection('custom');
                                        })
@@ -559,13 +559,13 @@ mvAdvFirefogg.prototype = {
                                        $j(_this.selector + ' ._'+cK).datepicker({
                                                        changeMonth: true,
                                                        changeYear: true,
-                                                       dateFormat: 'd MM, yy',   
+                                                       dateFormat: 'd MM, yy',
                                                        onSelect: function(dateText) {
-                                                               _this.updateInterfaceValue(_this.getClassId(this), dateText);           
+                                                               _this.updateInterfaceValue(_this.getClassId(this), dateText);
                                                        }
-                                       });                             
+                                       });
                                break;
-                               case 'slider':                                                                          
+                               case 'slider':
                                        $j(this.selector + ' .slider_' + cK ).slider({
                                                range: "min",
                                                animate: true,
@@ -573,55 +573,55 @@ mvAdvFirefogg.prototype = {
                                                value: $j( this.selector +' ._' + cK ).val(),
                                                min: this.default_encoder_config[ cK ].range.min,
                                                max: this.default_encoder_config[ cK ].range.max,
-                                               slide: function(event, ui) {                                                            
+                                               slide: function(event, ui) {
                                                        $j( _this.selector + ' ._' + _this.getClassId(this, 'slider_') ).val( ui.value );
-                                                       
-                                                       //maintain source video aspect ratio:  
-                                                       if(_this.getClassId(this, 'slider_') == 'width'){                                                                                                                                                                                                                                                               
+
+                                                       //maintain source video aspect ratio:
+                                                       if(_this.getClassId(this, 'slider_') == 'width'){
                                                                var hv = parseInt((_this.sourceFileInfo.video[0]['height']/_this.sourceFileInfo.video[0]['width'])* ui.value );
-                                                               //update the height value:        the new hight value is > that orginal the slider: 
+                                                               //update the height value:        the new hight value is > that orginal the slider:
                                                                if(hv > _this.updateInterfaceValue('height', hv))
-                                                                       return false;                                                                                                                                                                                   
+                                                                       return false;
                                                        }
                                                        if(_this.getClassId(this, 'slider_') == 'height'){
                                                                var wv = parseInt((_this.sourceFileInfo.video[0]['width']/_this.sourceFileInfo.video[0]['height'])* ui.value );
-                                                               //update the height value:        the new hight value is > that orginal the slider: 
+                                                               //update the height value:        the new hight value is > that orginal the slider:
                                                                if(wv > _this.updateInterfaceValue('width', wv))
-                                                                       return false;   
+                                                                       return false;
                                                        }
                                                },
-                                               change: function(event, ui){                                                                                                    
+                                               change: function(event, ui){
                                                        //update the local settings
-                                                       _this.updateLocalValue( _this.getClassId(this, 'slider_'), ui.value);           
-                                                       _this.updatePresetSelection('custom');                                                                          
-                                               }                                       
+                                                       _this.updateLocalValue( _this.getClassId(this, 'slider_'), ui.value);
+                                                       _this.updatePresetSelection('custom');
+                                               }
                                        })
-                                       $j( this.selector +' ._' + cK).change(function(){       
-                                               var scid = _this.getClassId(this);      
-                                               var valdVal = _this.updateLocalValue(scid.substr(1),$j(this).val() );           
+                                       $j( this.selector +' ._' + cK).change(function(){
+                                               var scid = _this.getClassId(this);
+                                               var valdVal = _this.updateLocalValue(scid.substr(1),$j(this).val() );
                                                _this.updatePresetSelection('custom');
-                                               //(validate user form input) 
+                                               //(validate user form input)
                                                $j(this).val(valdVal);
                                                //update the slider
                                                js_log("update: " + _this.selector + ' .slider' + scid);
-                                               $j(_this.selector + ' .slider'+ scid).slider('option', 'value', valdVal );                                              
-                                       });                                                                                                                                                             
-                               break           
+                                               $j(_this.selector + ' .slider'+ scid).slider('option', 'value', valdVal );
+                                       });
+                               break
                        }
-               }       
-               $j(this.target_control_container).accordion({ 
+               }
+               $j(this.target_control_container).accordion({
                        header: "h3",
-                       collapsible: true, 
+                       collapsible: true,
                        active: false,
                        fillSpace: true
-               });             
-               
+               });
+
                //do config value updates if any
                this.updateValuesInHtml();
        },
        updatePresetSelection:function( pKey ){
                //update the local key:
-               this.local_settings.d = pKey;   
+               this.local_settings.d = pKey;
                 //js_log('update preset desc: '+ pKey);
                var pset_desc = '';
                if(this.local_settings.pSet[ pKey  ].desc){
@@ -629,15 +629,15 @@ mvAdvFirefogg.prototype = {
                }else{
                        pset_desc = gM('fogg-preset-'+ pKey);
                }
-               //update the preset title:              
-               $j( this.selector + ' .gd_preset' ).html( 
-                       gM('fogg-cg-preset', pset_desc) 
+               //update the preset title:
+               $j( this.selector + ' .gd_preset' ).html(
+                       gM('fogg-cg-preset', pset_desc)
                );
                //update the selector
                $j(this.selector + ' ._preset_select').val(pKey);
        },
        /*
-        * updates the interface 
+        * updates the interface
         */
        updateInterfaceValue:function(confKey, val){
                var _this = this;
@@ -650,7 +650,7 @@ mvAdvFirefogg.prototype = {
                        js_error('error: missing default key: '+ confKey);
                        return false;
                }
-                       
+
                //update the local value (if not already up-to-date
                if( this.local_settings.pSet['custom']['conf'][confKey] != val ){
                        val = this.updateLocalValue(confKey, val);
@@ -660,14 +660,14 @@ mvAdvFirefogg.prototype = {
                //update the interaface widget:
                switch(this.default_encoder_config[confKey].type){
                        case 'slider':
-                               $j(_this.selector + ' .slider_' + confKey).slider('option', 
+                               $j(_this.selector + ' .slider_' + confKey).slider('option',
                                                'value', $j(_this.selector + ' ._'+ confKey).val() );
                        break;
-               }                                       
-               return val;                                     
+               }
+               return val;
        },
-       updateLocalValue:function(confKey, value){      
-               //update the local value (return the value we acutally set)     
+       updateLocalValue:function(confKey, value){
+               //update the local value (return the value we acutally set)
                if(typeof this.default_encoder_config[confKey] == 'undefined'){
                  js_log("Error:could not update conf key:" + confKey)
                  return value;
@@ -676,27 +676,27 @@ mvAdvFirefogg.prototype = {
                if(dec.range){
                        value = parseInt(value);
                        var min = ( dec.range.local_min) ? dec.range.local_min  :dec.range.min;
-                       if(value < min)                 
+                       if(value < min)
                                value = min;
                        var max = ( dec.range.local_max) ? dec.range.local_max : dec.range.max
                        if(value > max)
                                value = max;
-               }                       
+               }
                if(dec.type=='int')
                        value = parseInt(value);
-               
-               //step value: 
+
+               //step value:
                /*if(dec.step){
                        if((value % dec.step)!=0){
                                value = value - (value % dec.step);
                        }
-               }*/   
-               
-               js_log('update:local_settings:custom:conf:'+ confKey + ' = ' + value); 
-               this.local_settings.pSet['custom']['conf'][confKey] = value;                                            
-               
-               return value;                   
-       },      
+               }*/
+
+               js_log('update:local_settings:custom:conf:'+ confKey + ' = ' + value);
+               this.local_settings.pSet['custom']['conf'][confKey] = value;
+
+               return value;
+       },
        getLocalValue:function(confKey){
                return this.local_settings.pSet['custom']['conf'][confKey];
        },
@@ -707,25 +707,25 @@ mvAdvFirefogg.prototype = {
                }else{
                        //strip leading underscore:
                        return (elmclass[0]=='_')?elmclass.substr(1):elmclass;
-               }               
+               }
        },
        /*
         * sets up the autoEncoder settings
-        */     
+        */
        autoEncoderSettings:function(){
                var _this = this;
-               //do the base encoder settings setup: 
-               this.basefogg_autoEncoderSettings();            
+               //do the base encoder settings setup:
+               this.basefogg_autoEncoderSettings();
                //make sure we are "encoding" if not display not a video file eror:
                if( this.encoder_settings['passthrough'] ){
                        js_log("in passthrough mode (hide control)");
-                       //hide all controls 
-                       //dispaly not encodable video 
+                       //hide all controls
+                       //dispaly not encodable video
                        $j(this.target_control_container).hide('slow');
                        $j(this.target_passthrough_mode).show('slow');
-                       return ;                        
+                       return ;
                }
-               //restore display: 
+               //restore display:
                $j(this.target_control_container).show('slow');
                $j(this.target_passthrough_mode).hide('slow');
 
@@ -733,14 +733,14 @@ mvAdvFirefogg.prototype = {
                //see: http://firefogg.org/dev/sourceInfo_example.html
                var setValues = function(k, val, maxVal) {
                        if( k !== false){
-                               //update the value if unset: 
-                               _this.updateLocalValue(k, val);                                                                    
+                               //update the value if unset:
+                               _this.updateLocalValue(k, val);
                        }
                        if( maxVal ){
                                 //update the local range:
                                if(_this.default_encoder_config[k].range){
                                        _this.default_encoder_config[k].range.local_max = maxVal;
-                               }       
+                               }
                        }
                }
                //container level settings
@@ -749,11 +749,11 @@ mvAdvFirefogg.prototype = {
                        var k = false;
                        var maxVal= false;
                        switch(i){
-                               //do nothing with these:                                
-                               case 'bitrate': 
-                                       k = 'videoBitrate'; 
+                               //do nothing with these:
+                               case 'bitrate':
+                                       k = 'videoBitrate';
                                        maxVal = (val*2 > this.default_encoder_config[k])?this.default_encoder_config[k]:val*2;
-                               break;  
+                               break;
                        }
                        setValues(k, val, maxVal);
                }
@@ -763,11 +763,11 @@ mvAdvFirefogg.prototype = {
                        var k = false;
                        var maxVal= false;
                        switch(i){
-                               case 'width': 
-                               case 'height': 
+                               case 'width':
+                               case 'height':
                                        k = i;
-                                       maxVal = val;                                                                   
-                               break;                                          
+                                       maxVal = val;
+                               break;
                        }
                        setValues(k, val, maxVal);
                }
@@ -785,16 +785,16 @@ mvAdvFirefogg.prototype = {
                        setValues(k, val, maxVal);
                }
 
-               //set all values to new default ranges & update slider: 
+               //set all values to new default ranges & update slider:
                $j.each(this.default_encoder_config, function(inx, val){
                        if($j(_this.selector + ' ._'+inx).length!=0){
-                               if(typeof val.range != 'undefined'){                                    
+                               if(typeof val.range != 'undefined'){
                                        //udate slider range
                                        var new_max = (val.range.local_max)?val.range.local_max: val.range.max
                                        $j( _this.selector + ' .slider_'+inx).slider('option', 'max', new_max);
-                                                                               
+
                                        //update slider/input value:
-                                       _this.updateInterfaceValue(inx, _this.local_settings.pSet['custom']['conf'][inx]);                                                      
+                                       _this.updateInterfaceValue(inx, _this.local_settings.pSet['custom']['conf'][inx]);
                                }
                        }
                });
@@ -803,40 +803,40 @@ mvAdvFirefogg.prototype = {
        },
        doEncode:function(){
                //update the encoder settings (from local settings)
-               pKey = this.local_settings.d;           
-               this.encoder_settings = this.local_settings.pSet[ pKey ].conf;          
+               pKey = this.local_settings.d;
+               this.encoder_settings = this.local_settings.pSet[ pKey ].conf;
                this.basefogg_doEncode();
-       },      
+       },
        updateValuesInHtml:function(){
                js_log('updateValuesInHtml::');
-               var _this = this;               
-               var pKey = this.local_settings.d;               
-               this.updatePresetSelection( pKey );                                                             
-                               
-               //set the actual HTML & widgets based on any local settings values:             
-               $j.each(_this.local_settings.pSet['custom']['conf'], function(inx, val){                                                
+               var _this = this;
+               var pKey = this.local_settings.d;
+               this.updatePresetSelection( pKey );
+
+               //set the actual HTML & widgets based on any local settings values:
+               $j.each(_this.local_settings.pSet['custom']['conf'], function(inx, val){
                        if($j(_this.selector + ' ._'+inx).length !=0){
-                               $j(_this.selector + ' ._'+inx).val( val );                              
+                               $j(_this.selector + ' ._'+inx).val( val );
                        }
                });
        },
        //restors settings from a cookie if you have them)
-       loadEncSettings:function( force ){              
+       loadEncSettings:function( force ){
                if($j.cookie('fogg_encoder_config')){
-                       js_log("load:fogg_encoder_config from cookie ");                
-                       this.local_settings = JSON.parse( $j.cookie('fogg_settings') );                                 
-               }               
-               //set to default if not loaded yet: 
+                       js_log("load:fogg_encoder_config from cookie ");
+                       this.local_settings = JSON.parse( $j.cookie('fogg_settings') );
+               }
+               //set to default if not loaded yet:
                if( this.local_settings &&  this.local_settings.pSet && this.local_settings.pSet['custom']['conf']){
                        js_log('local settings already populated');
-               }else{                  
-                       this.local_settings  = this.default_local_settings; 
+               }else{
+                       this.local_settings  = this.default_local_settings;
                }
-                       
+
        },
-       //clear preset settings: 
+       //clear preset settings:
        clearSettings:function(force){
-               
+
        },
        //save settings to the cookie
        saveEncSettings:function(){
index 5b7c673..b39283e 100644 (file)
@@ -1,63 +1,63 @@
 /**
  * the base Upload Interface for uploading.
- * 
+ *
  * this base uploader is optionally extended by firefogg
  */
-loadGM({ 
-       "upload-transcode-in-progress":"Doing Transcode & Upload (do not close this window)",
-       "upload-in-progress": "Upload in Progress (do not close this window)",
+loadGM({
+       "upload-transcode-in-progress": "Transcode and upload in progress (do not close this window)",
+       "upload-in-progress": "Upload in progress (do not close this window)",
        "upload-transcoded-status": "Transcoded",
        "uploaded-status": "Uploaded",
-       
-       "wgfogg_wrong_version": "You have firefogg installed but its outdated, <a href=\"http://firefogg.org\">please upgrade</a> ",
+
+       "wgfogg_wrong_version": "You have Firefogg installed but it is outdated. <a href=\"http://firefogg.org\">Please upgrade</a>.",
        "upload-stats-fileprogres": "$1 of $2",
-       
+
        "mv_upload_completed":  "Your upload is complete",
-       
-       "mv_upload_done"          : "Your upload <i>should be</i> accessible <a href=\"$1\">here</a>",
-       "upload-unknown-size": "Unknown size",  
-       
+
+       "mv_upload_done": "<a href=\"$1\">Your upload <i>should be</i> accessible</a>.",
+       "upload-unknown-size": "Unknown size",
+
        "mv-cancel-confim"       : "Are you sure you want to cancel?",
-       
-       "successfulupload" : "Successful Upload",
+
+       "successfulupload": "Upload successful",
        "uploaderror" : "Upload error",
        "uploadwarning": "Upload warning",
-       "unknown-error": "Unknown Error",
+       "unknown-error": "Unknown error:",
        "return-to-form": "Return to form",
-       
-       "file-exists-duplicate" : "This file is a duplicate of the following file",
-       "fileexists" : "A file with this name exists already, please check <b><tt>$1</tt></b> if you are not sure if you want to change it.",
+
+       "file-exists-duplicate": "This file is a duplicate of the following file:",
+       "fileexists" : "A file with this name exists already. Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.",
        "fileexists-thumb": "<center><b>Existing file</b></center>",
        "ignorewarning" : "Ignore warning and save file anyway",
        "file-thumbnail-no" :  "The filename begins with <b><tt>$1</tt></b>",
-       "go-to-resource" : "Go to Resource Page",
+       "go-to-resource" : "Go to resource page",
        "upload-misc-error" : "Unknown upload error",
 
        "wgfogg_waring_bad_extension" : "You have selected a file with an unsuported extension (<a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg#Supported_File_Types\">more information</a>).",
-       
-       "cancel-button"  : "Cancel",    
+
+       "cancel-button"  : "Cancel",
        "ok-button"       : "OK"
-               
+
 });
+
+
 var default_bui_options = {
        'api_url':null,
        'parent_uploader':null,
        'edit_from':null,
        'done_upload_cb': null,
        'target_edit_from':null,
-       
+
        //upload_mode can be 'post', 'api' or 'autodetect'. (autodetect issues an api call)
        'upload_mode': 'autodetect'
-       
+
 }
 var mvBaseUploadInterface = function( iObj ){
        return this.init( iObj );
 }
 mvBaseUploadInterface.prototype = {
        parent_uploader:false,
-       formData:{}, //the form to be submitted    
+       formData:{}, //the form to be submitted
        warnings_sessionkey:null,
        chunks_supported:false,
        form_post_override:false,
@@ -66,7 +66,7 @@ mvBaseUploadInterface.prototype = {
        etoken:false,
        init: function( iObj ){
                if(!iObj)
-                       iObj = {};              
+                       iObj = {};
                //inherit iObj properties:
                for(var i in default_bui_options){
                        if(iObj[i]){
@@ -74,172 +74,172 @@ mvBaseUploadInterface.prototype = {
                        }else{
                                this[i] = default_bui_options[i];
                        }
-               }               
+               }
        },
-       setupForm:function(){   
-               var _this = this;       
+       setupForm:function(){
+               var _this = this;
                //set up the local pointer to the edit form:
-               _this.editForm = _this.getEditForm();           
+               _this.editForm = _this.getEditForm();
                if( _this.editForm ){
-                       //set up the org_onsubmit if not set: 
+                       //set up the org_onsubmit if not set:
                        if( typeof( _this.org_onsubmit ) == 'undefined' &&  _this.editForm.onsubmit )
-                               _this.org_onsubmit = _this.editForm.onsubmit;                                                                                   
-                       
-                       //set up the submit action: 
-                       $j( _this.editForm ).submit( function(){        
-                               js_log('j.onSubmit');   
-                               //run the original onsubmit (if not run yet set flag to avoid excessive chaining ) 
-                               if( typeof( _this.org_onsubmit ) == 'function' ){                                                                 
+                               _this.org_onsubmit = _this.editForm.onsubmit;
+
+                       //set up the submit action:
+                       $j( _this.editForm ).submit( function(){
+                               js_log('j.onSubmit');
+                               //run the original onsubmit (if not run yet set flag to avoid excessive chaining )
+                               if( typeof( _this.org_onsubmit ) == 'function' ){
                                        if( ! _this.org_onsubmit() ){
                                                //error in org submit return false;
                                                return false;
                                        }
-                               }       
-                               //check for post action override:                                                                                                                       
-                               if( _this.form_post_override ){ 
-                                       js_log('form_post_override is true do form proccessing:');                                                                                                              
+                               }
+                               //check for post action override:
+                               if( _this.form_post_override ){
+                                       js_log('form_post_override is true do form proccessing:');
                                        return true;
-                               }                                                                               
-                               //get the input form data in flat json:                                                                                 
-                               var tmpAryData = $j( _this.editForm ).serializeArray();                                 
+                               }
+                               //get the input form data in flat json:
+                               var tmpAryData = $j( _this.editForm ).serializeArray();
                                for(var i=0; i < tmpAryData.length; i++){
                                        if( tmpAryData[i]['name'] )
                                                _this.formData[ tmpAryData[i]['name'] ] = tmpAryData[i]['value'];
-                               }                                                       
-                               //put into a try catch so we are sure to return false:          
+                               }
+                               //put into a try catch so we are sure to return false:
                                try{
-                                       //get a clean loader: 
-                                       _this.dispProgressOverlay();                                                                                            
-                                       
+                                       //get a clean loader:
+                                       _this.dispProgressOverlay();
+
                                        //for some unknown reason we have to drop down the #p-search z-index:
-                                       $j('#p-search').css('z-index', 1);                                                              
-                                       
-                                       //select upload mode:                           
+                                       $j('#p-search').css('z-index', 1);
+
+                                       //select upload mode:
                                        _this.detectUploadMode();
                                }catch(e){
-                                       
+
                                }
-                                
+
                                //don't submit the form we will do the post in ajax
-                               return false;   
-                       });                                                                     
+                               return false;
+                       });
                }
-                                       
-       },      
+
+       },
        detectUploadMode:function( callback ){
-               var _this = this;               
-               //check the upload mode: 
+               var _this = this;
+               //check the upload mode:
                if( _this.upload_mode == 'autodetect' ){
                        js_log('detectUploadMode::' + _this.upload_mode + ' api:' + _this.api_url);
                        if( ! _this.api_url )
                                return js_error( 'Error: can\'t autodetect mode without api url' );
                        do_api_req( {
                                'data':{ 'action':'paraminfo','modules':'upload' },
-                               'url' :_this.api_url 
+                               'url' :_this.api_url
                        }, function(data){
                                if( typeof data.paraminfo == 'undefined' || typeof data.paraminfo.modules == 'undefined' )
                                        return js_error( 'Error: bad api results' );
                                if( typeof data.paraminfo.modules[0].classname == 'undefined'){
                                        js_log( 'Autodetect Upload Mode: \'post\' ');
                                        _this.upload_mode = 'post';
-                               }else{          
+                               }else{
                                        js_log( 'Autodetect Upload Mode: api ' );
                                        _this.upload_mode = 'api';
-                                       //check to see if chunks are supported:                 
-                                       for( var i in data.paraminfo.modules[0].parameters ){                                           
+                                       //check to see if chunks are supported:
+                                       for( var i in data.paraminfo.modules[0].parameters ){
                                                var pname = data.paraminfo.modules[0].parameters[i].name;
                                                if( pname == 'enablechunks' ){
                                                        js_log( 'this.chunks_supported = true' );
-                                                       _this.chunks_supported = true;                                                  
+                                                       _this.chunks_supported = true;
                                                        break;
                                                }
-                                       }                                                                                                                               
-                               }       
-                               js_log("do call: doUploadSwitch");                      
+                                       }
+                               }
+                               js_log("do call: doUploadSwitch");
                                _this.doUploadSwitch();
                        });
                }else{
                        _this.doUploadSwitch();
                }
        },
-       doUploadSwitch:function(){              
-               var _this = this;                       
-               js_log('mvUPload:doUploadSwitch():' + _this.upload_mode);                       
-               //issue a normal post request           
+       doUploadSwitch:function(){
+               var _this = this;
+               js_log('mvUPload:doUploadSwitch():' + _this.upload_mode);
+               //issue a normal post request
                if( _this.upload_mode == 'post' ) {
                        //we don't support the upload api
-                       //trick the browser into thinking the wpUpload button was pressed (there might be a cleaner way to do this)                     
+                       //trick the browser into thinking the wpUpload button was pressed (there might be a cleaner way to do this)
                        $j(_this.editForm).append(
                                '<input type="hidden" name="wpUpload" value="' + $j('input[name=\'wpUpload\']').val() + '"/>'
-                       );                      
+                       );
                        //do normal post
                        _this.form_post_override = true;
-                       //do the submit :                       
+                       //do the submit :
                        _this.editForm.submit();
                }else if(
-                       _this.upload_mode=='api' &&  
-                       ( $j('#wpSourceTypeFile').length ==  0 || $j('#wpSourceTypeFile').get(0).checked )              
-               ){      
-                       //@@TODO check for sendAsBinnary to support firefox 3.5 progress                                
-                       
-                       //set the form target to iframe target: 
+                       _this.upload_mode=='api' &&
+                       ( $j('#wpSourceTypeFile').length ==  0 || $j('#wpSourceTypeFile').get(0).checked )
+               ){
+                       //@@TODO check for sendAsBinnary to support firefox 3.5 progress
+
+                       //set the form target to iframe target:
                        _this.iframeId = 'f_' + ($j('iframe').length + 1);
                        $j(_this.editForm).attr('target', _this.iframeId);
-                                       
-                       //add the iframe                        
+
+                       //add the iframe
                        $j("body").append('<iframe src="javascript:false;" id="' + _this.iframeId + '" ' +
-                               'name="' + _this.iframeId + '" style="display:none;" ></iframe>');                                                              
-                                       
+                               'name="' + _this.iframeId + '" style="display:none;" ></iframe>');
+
                        //set up the done binding
-                       $j('#' + _this.iframeId).load(function(){                               
+                       $j('#' + _this.iframeId).load(function(){
                                _this.proccessIframeResult(  $j(this).get(0) );
-                       });             
-               
+                       });
+
                        //set the editForm iframe target
                        //$j(_this.editForm).attr('target', id);
-                       
+
                        //set the action to the api url:
                        $j(_this.editForm).attr('action', _this.api_url );
                        //add api action:
                        if( $j(_this.editForm).find("[name='action']").length == 0)
                                $j(_this.editForm).append('<input type="hidden" name="action" value="upload">');
-                       
+
                        //add json format
                        if( $j(_this.editForm).find("[name='format']").length == 0)
-                               $j(_this.editForm).append('<input type="hidden" name="format" value="jsonfm">');                
-                       
-                       //map the form vars to api vars:  
+                               $j(_this.editForm).append('<input type="hidden" name="format" value="jsonfm">');
+
+                       //map the form vars to api vars:
                        $j(_this.editForm).find('#wpUploadFile').attr('name', 'file');
                        $j(_this.editForm).find('#wpDestFile').attr('name', 'filename');
                        $j(_this.editForm).find('#wpUploadDescription').attr('name', 'comment');
-                       $j(_this.editForm).find('#wpEditToken').attr('name', 'token');                  
+                       $j(_this.editForm).find('#wpEditToken').attr('name', 'token');
                        $j(_this.editForm).find('#wpIgnoreWarning').attr('name', 'ignorewarnings');
                        $j(_this.editForm).find('#wpWatchthis').attr('name', 'watch');
-                       
-                       //update the status to 100% progress bar (no status in iframe submit) 
-                       $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) );                                                          
+
+                       //update the status to 100% progress bar (no status in iframe submit)
+                       $j('#up-progressbar' ).progressbar('value', parseInt( 100 ) );
                        $j('#up-status-container').html( gM('upload-in-progress') );
-                                               
-                       js_log('do iframe form submit to: ' +  $j(_this.editForm).attr('target'));                      
+
+                       js_log('do iframe form submit to: ' +  $j(_this.editForm).attr('target'));
 
                        //do post override
-                       _this.form_post_override = true;                                                        
+                       _this.form_post_override = true;
                        //reset the done with action flag:
-                       _this.action_done = false;                                                              
-                       
+                       _this.action_done = false;
+
                        _this.editForm.submit();
-                                                                                                               
+
                        return false;
-               }else if( _this.upload_mode == 'api' && $j('#wpSourceTypeURL').get(0).checked){ 
+               }else if( _this.upload_mode == 'api' && $j('#wpSourceTypeURL').get(0).checked){
                        js_log('doHttpUpload (no form submit) ');
                        //if the api is supported.. && source type is http do upload with http status updates
                        var httpUpConf ={
                            'url'               : $j('#wpUploadFileURL').val(),
                            'filename'  : $j('#wpDestFile').val(),
-                           'comment'   : $j('#wpUploadDescription').val(),                             
-                               'watch'         : ($j('#wpWatchthis').is(':checked'))?'true':'false'                                        
+                           'comment'   : $j('#wpUploadDescription').val(),
+                               'watch'         : ($j('#wpWatchthis').is(':checked'))?'true':'false'
                        }
-                       //set up ignore warnings and watch arguments: 
+                       //set up ignore warnings and watch arguments:
                        if( $j('#wpIgnoreWarning').is(':checked') ){
                                httpUpConf[ 'ignorewarnings'] =  'true';
                        }
@@ -247,11 +247,11 @@ mvBaseUploadInterface.prototype = {
                                httpUpConf[ 'watch'] =  'true';
                        }
                        //check for editToken
-                       _this.etoken = $j("#wpEditToken").val();                                                
+                       _this.etoken = $j("#wpEditToken").val();
                        _this.doHttpUpload( httpUpConf );
                }else{
                        js_error( 'Error: unrecongized upload mode: ' + _this.upload_mode );
-               }                               
+               }
                return false;
        },
        proccessIframeResult:function(iframe){
@@ -260,19 +260,19 @@ mvBaseUploadInterface.prototype = {
                // fixing Opera 9.26
                if (doc.readyState && doc.readyState != 'complete'){
                        return;
-               }               
+               }
                // fixing Opera 9.64
-               if (doc.body && doc.body.innerHTML == "false"){         
-                       return;                         
-               }               
-               var response;           
+               if (doc.body && doc.body.innerHTML == "false"){
+                       return;
+               }
+               var response;
                if (doc.XMLDocument){
                        // response is a xml document IE property
                        response = doc.XMLDocument;
                } else if (doc.body){
                        // get the json str:
-                       json_str = $j(doc.body).find('pre').html();                     
-                       //htmlentties 
+                       json_str = $j(doc.body).find('pre').html();
+                       //htmlentties
                        if (json_str) {
                                response = window["eval"]("(" +json_str + ")");
                        } else {
@@ -281,41 +281,41 @@ mvBaseUploadInterface.prototype = {
                } else {
                        // response is a xml document
                        var response = doc;
-               }                                       
+               }
                //do proccess the api result
                _this.processApiResult( response );
        },
        doHttpUpload:function( opt ){
                var _this = this;
-               //set the http box to loading (in case we don't get an update for some time) 
-               $j('#dlbox-centered').html( '<h5>' + _this.getProgressTitle() + '</h5>' + 
+               //set the http box to loading (in case we don't get an update for some time)
+               $j('#dlbox-centered').html( '<h5>' + _this.getProgressTitle() + '</h5>' +
                        mv_get_loading_img( 'left:40%;top:20%')
-               );      
+               );
                //setup request:
                var req = {
                        'action'                : 'upload',
                        'asyncdownload' : true  //do a s
                };
                //set config from options:
-               for(var i in opt){                      
+               for(var i in opt){
                        req[i]= opt[i];
-               }                                               
-                       
+               }
+
                //else try and get a token:
                if(!_this.etoken  && _this.api_url){
-                       js_log('Error:doHttpUpload: missing token');                    
-               }else{                                  
+                       js_log('Error:doHttpUpload: missing token');
+               }else{
                        req['token'] =_this.etoken;
-               }                               
+               }
                //reset the done with action flag:
                _this.action_done = false;
-               //do the api req                
+               //do the api req
                do_api_req({
                        'data': req,
-                       'url' : _this.api_url 
-               }, function( data ){                    
-                       _this.processApiResult( data );         
-               });                             
+                       'url' : _this.api_url
+               }, function( data ){
+                       _this.processApiResult( data );
+               });
        },
        doAjaxWarningIgnore:function(){
                var _this = this;
@@ -326,10 +326,10 @@ mvBaseUploadInterface.prototype = {
                                'ignorewarnings' : 'true',
                                'sessionkey'     :!_this.upload_session_key
                        };
-               //add token if present:                 
+               //add token if present:
                if(this.etoken)
                        req['token'] = this.etoken;
-                        
+
                do_api_req({
                        'data':req,
                        'url': _this.api_url
@@ -338,32 +338,32 @@ mvBaseUploadInterface.prototype = {
                });
        },
        doAjaxUploadStatus:function() {
-               var _this = this;       
-               
-               //set up the progress display for status updates: 
+               var _this = this;
+
+               //set up the progress display for status updates:
                _this.dispProgressOverlay();
                var req = {
                                        'action'         : 'upload',
                                        'httpstatus' : 'true',
                                        'sessionkey' : _this.upload_session_key
                };
-               //add token if present:                 
+               //add token if present:
                if(this.etoken)
                        req['token'] = this.etoken;
-                       
+
                var uploadStatus = function(){
-                       //do the api request: 
+                       //do the api request:
                        do_api_req({
                                'data':req,
                                'url' : _this.api_url
-                       }, function( data ){                                                                    
+                       }, function( data ){
                                //@@check if we are done
                                if( data.upload['apiUploadResult'] ){
                                        //update status to 100%
                                        _this.updateProgress( 1 );
                                        if(typeof JSON == 'undefined'){
-                                               //we need to load the jQuery json parser: (older browsers don't have JSON.parse 
-                                               mvJsLoader.doLoad([     
+                                               //we need to load the jQuery json parser: (older browsers don't have JSON.parse
+                                               mvJsLoader.doLoad([
                                                        '$j.secureEvalJSON'
                                                ],function(){
                                                        var  apiResult = $j.secureEvalJSON( data.upload['apiUploadResult'] );
@@ -375,32 +375,32 @@ mvBaseUploadInterface.prototype = {
                                                        apiResult = JSON.parse ( data.upload['apiUploadResult'] ) ;
                                                }catch (e){
                                                        //could not parse api result
-                                                       js_log('errro: could not parse apiUploadResult ')                                               
+                                                       js_log('errro: could not parse apiUploadResult ')
                                                }
-                                               _this.processApiResult( apiResult );                                            
+                                               _this.processApiResult( apiResult );
                                        }
-                                       return ;                                
+                                       return ;
                                }
-                               
+
                                //@@ else update status:
                                if( data.upload['content_length'] &&  data.upload['loaded'] ){
-                                       //we have content length we can show percentage done: 
+                                       //we have content length we can show percentage done:
                                        var perc =  data.upload['loaded'] / data.upload['content_length'];
                                        //update the status:
                                        _this.updateProgress( perc );
-                                       //special case update the file progress where we have data size: 
-                                       $j('#up-status-container').html( 
-                                               gM('upload-stats-fileprogres', [ 
-                                                       formatSize( data.upload['loaded'] ), 
+                                       //special case update the file progress where we have data size:
+                                       $j('#up-status-container').html(
+                                               gM('upload-stats-fileprogres', [
+                                                       formatSize( data.upload['loaded'] ),
                                                        formatSize( data.upload['content_length'] )
-                                                       ]  
+                                                       ]
                                                )
                                        );
-                               }else if( data.upload['loaded'] ){              
-                                       _this.updateProgress( 1 );              
+                               }else if( data.upload['loaded'] ){
+                                       _this.updateProgress( 1 );
                                        js_log('just have loaded (no cotent length: ' + data.upload['loaded']);
-                                       //for lack of content-length requests: 
-                                       $j('#up-status-container').html( 
+                                       //for lack of content-length requests:
+                                       $j('#up-status-container').html(
                                                gM('upload-stats-fileprogres', [
                                                        formatSize( data.upload['loaded'] ),
                                                        gM('upload-unknown-size')
@@ -409,57 +409,57 @@ mvBaseUploadInterface.prototype = {
                                        );
                                }
                                //(we got a result) set it to 100ms + your server update interval (in our case 2s)
-                               setTimeout(uploadStatus, 2100);                 
-                       });                     
+                               setTimeout(uploadStatus, 2100);
+                       });
                }
                uploadStatus();
        },
        apiUpdateErrorCheck:function( apiRes ){
                var _this = this;
                if( apiRes.error || ( apiRes.upload && apiRes.upload.result == "Failure" ) ){
-                       //gennerate the error button:           
+                       //gennerate the error button:
                        var bObj = {};
                        bObj[ gM('return-to-form') ] =  function(){
                                        _this.form_post_override = false;
                                        $j(this).dialog('close');
-                        };             
-                        
+                        };
+
                        //@@TODO should be refactored to more specialUpload page type error handling
-                       
-                       //check a few places for the error code: 
-                       var error_code=0;       
-                       var errorReplaceArg='';         
-                       if( apiRes.error && apiRes.error.code ){                                
+
+                       //check a few places for the error code:
+                       var error_code=0;
+                       var errorReplaceArg='';
+                       if( apiRes.error && apiRes.error.code ){
                                error_code = apiRes.error.code;
                        }else if( apiRes.upload.code ){
-                               if(typeof apiRes.upload.code == 'object'){                              
+                               if(typeof apiRes.upload.code == 'object'){
                                        if(apiRes.upload.code[0]){
                                                error_code = apiRes.upload.code[0];
                                        }
                                        if(apiRes.upload.code['status']){
                                                error_code = apiRes.upload.code['status'];
                                                if(apiRes.upload.code['filtered'])
-                                                       errorReplaceArg =apiRes.upload.code['filtered']; 
+                                                       errorReplaceArg =apiRes.upload.code['filtered'];
                                        }
                                }else{
                                        apiRes.upload.code;
                                }
-                       }       
-                       
-                       var error_msg = '';             
+                       }
+
+                       var error_msg = '';
                        if(typeof apiRes.error == 'string')
-                               error_msg = apiRes.error;               
+                               error_msg = apiRes.error;
                        //error space is too large so we don't front load it
                        //this upload error space replicates code in: SpecialUpload.php::processUpload()
-                       //would be nice if we refactored that to the upload api.(problem is some need special actions)                  
-                       var error_msg_key = {   
-                               '2' : 'largefileserver',                        
+                       //would be nice if we refactored that to the upload api.(problem is some need special actions)
+                       var error_msg_key = {
+                               '2' : 'largefileserver',
                                '3' : 'emptyfile',
                                '4' : 'minlength1',
-                               '5' : 'illegalfilename'                         
+                               '5' : 'illegalfilename'
                        };
-                       
-                       //@@todo: need to write conditionals that mirror SpecialUpload for handling these error types:  
+
+                       //@@todo: need to write conditionals that mirror SpecialUpload for handling these error types:
                        var error_onlykey = {
                                '1': 'BEFORE_PROCESSING',
                                '6': 'PROTECTED_PAGE',
@@ -471,26 +471,26 @@ mvBaseUploadInterface.prototype = {
                                '12': 'UPLOAD_WARNING',
                                '13': 'INTERNAL_ERROR',
                                '14': 'MIN_LENGHT_PARTNAME'
-                       }                       
-                       
-                       //do a remote call to get the error msg:                
+                       }
+
+                       //do a remote call to get the error msg:
                        if(!error_code || error_code == 'unknown-error'){
                                if(typeof JSON != 'undefined'){
                                        js_log('Error: apiRes: ' + JSON.stringify( apiRes) );
                                }
-                               if( apiRes.upload.error == 'internal-error'){                                   
+                               if( apiRes.upload.error == 'internal-error'){
                                        errorKey = apiRes.upload.details[0];
-                                       gMsgLoadRemote(errorKey, function(){    
+                                       gMsgLoadRemote(errorKey, function(){
                                                _this.updateProgressWin( gM( 'uploaderror' ), gM( errorKey ), bObj );
-                                               
+
                                        });
-                                       return false;                                           
+                                       return false;
                                }
-                               
+
                                _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>' + error_msg, bObj );
                                return false;
                        }else{
-                               if(apiRes.error && apiRes.error.info ){                                 
+                               if(apiRes.error && apiRes.error.info ){
                                        _this.updateProgressWin(  gM('uploaderror'), apiRes.error.info ,bObj);
                                        return false;
                                }else{
@@ -502,38 +502,38 @@ mvBaseUploadInterface.prototype = {
                                                }
                                        }else{
                                                js_log('get key: ' + error_msg_key[ error_code ])
-                                               gMsgLoadRemote( error_msg_key[ error_code ], function(){                                                                                                
+                                               gMsgLoadRemote( error_msg_key[ error_code ], function(){
                                                        _this.updateProgressWin(  gM('uploaderror'), gM(  error_msg_key[ error_code ], errorReplaceArg ), bObj);
-                                               });             
-                                               js_log("api.erorr");            
+                                               });
+                                               js_log("api.erorr");
                                        }
-                                       return false;   
+                                       return false;
                                }
                        }
-               }                               
-               //check for upload.error type erros.  
+               }
+               //check for upload.error type erros.
                if( apiRes.upload && apiRes.upload.error){
                        js_log(' apiRes.upload.error: ' +  apiRes.upload.error );
                        _this.updateProgressWin( gM('uploaderror'), gM('unknown-error') + '<br>', bObj);
                        return false;
                }
-               //check for known warnings: 
+               //check for known warnings:
                if(apiRes.upload && apiRes.upload.warnings ){
-                       //debugger;     
+                       //debugger;
                        var wmsg = '<ul>';
                        for(var wtype in apiRes.upload.warnings){
                                var winfo = apiRes.upload.warnings[wtype]
-                               wmsg+='<li>';           
+                               wmsg+='<li>';
                                switch(wtype){
                                        case 'duplicate':
                                        case 'exists':
                                                if(winfo[1] && winfo[1].title && winfo[1].title.mTextform){
-                                                       wmsg += gM('file-exists-duplicate') +' '+ 
-                                                                       '<b>' + winfo[1].title.mTextform + '</b>';              
+                                                       wmsg += gM('file-exists-duplicate') +' '+
+                                                                       '<b>' + winfo[1].title.mTextform + '</b>';
                                                }else{
                                                        //misc error (weird that winfo[1] not present
                                                        wmsg += gM('upload-misc-error') + ' ' + wtype;
-                                               }                                                                                               
+                                               }
                                        break;
                                        case 'file-thumbnail-no':
                                                wmsg += gM('file-thumbnail-no', winfo);
@@ -541,17 +541,17 @@ mvBaseUploadInterface.prototype = {
                                        default:
                                                wmsg += gM('upload-misc-error') + ' ' + wtype;
                                        break;
-                               }                       
-                               wmsg+='</li>';                                                                                                          
+                               }
+                               wmsg+='</li>';
                        }
-                       wmsg+='</ul>';                  
+                       wmsg+='</ul>';
                        if( apiRes.upload.warnings.sessionkey)
                                _this.warnings_sessionkey = apiRes.upload.warnings.sessionkey;
                        var bObj = {};
-                       bObj[ gM('ignorewarning') ] =   function() { 
+                       bObj[ gM('ignorewarning') ] =   function() {
                                //re-inciate the upload proccess
                                $j('#wpIgnoreWarning').attr('checked', true);
-                               $j( '#mw-upload-form' ).submit();                                                                                         
+                               $j( '#mw-upload-form' ).submit();
                        };
                        bObj[ gM('return-to-form') ] = function(){
                                $j(this).dialog('close');
@@ -559,39 +559,39 @@ mvBaseUploadInterface.prototype = {
                        }
                        _this.updateProgressWin(  gM('uploadwarning'),  '<h3>' + gM('uploadwarning') + '</h3>' +wmsg + '<p>',bObj);
                        return false;
-               }                                                       
-               //should be "OK"                
-               return true;    
+               }
+               //should be "OK"
+               return true;
        },
-       processApiResult: function( apiRes ){   
-               var _this = this;                       
+       processApiResult: function( apiRes ){
+               var _this = this;
                js_log('processApiResult::');
                //check for upload api error:
                // {"upload":{"result":"Failure","error":"unknown-error","code":{"status":5,"filtered":"NGC2207%2BIC2163.jpg"}}}
                if( _this.apiUpdateErrorCheck(apiRes) === false){
-                       //error returned false (updated and 
+                       //error returned false (updated and
                        return false;
                }else{
                        //check for upload_session key for async upload:
-                       if( apiRes.upload && apiRes.upload.upload_session_key ){                                                        
+                       if( apiRes.upload && apiRes.upload.upload_session_key ){
                                //set the session key
                                _this.upload_session_key = apiRes.upload.upload_session_key;
-                               
-                               //do ajax upload status: 
-                               _this.doAjaxUploadStatus();             
-                               js_log("set upload_session_key: " + _this.upload_session_key);  
+
+                               //do ajax upload status:
+                               _this.doAjaxUploadStatus();
+                               js_log("set upload_session_key: " + _this.upload_session_key);
                                return ;
-                       }               
-                       
-                       if( apiRes.upload.imageinfo &&  apiRes.upload.imageinfo.descriptionurl ){       
+                       }
+
+                       if( apiRes.upload.imageinfo &&  apiRes.upload.imageinfo.descriptionurl ){
                                var url = apiRes.upload.imageinfo.descriptionurl;
-                               //check done action: 
+                               //check done action:
                                if( _this.done_upload_cb && typeof _this.done_upload_cb == 'function'){
-                                       //close up shop: 
-                                       $j('#upProgressDialog').dialog('close');        
-                                       //call the callback:                    
+                                       //close up shop:
+                                       $j('#upProgressDialog').dialog('close');
+                                       //call the callback:
                                        _this.done_upload_cb( url );
-                               }else{             
+                               }else{
                                        var bObj = {};
                                        bObj[ gM('return-to-form')] = function(){
                                                $j(this).dialog('close');
@@ -599,14 +599,14 @@ mvBaseUploadInterface.prototype = {
                                        }
                                        bObj[ gM('go-to-resource') ] = function(){
                                                        window.location = url;
-                                       };                                      
+                                       };
                                        _this.action_done = true;
                                        _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', url), bObj);
                                        js_log('apiRes.upload.imageinfo::'+url);
                                }
-                               return ;        
+                               return ;
                        }
-               }                       
+               }
        },
        updateProgressWin:function(title_txt, msg, buttons){
                var _this = this;
@@ -616,92 +616,92 @@ mvBaseUploadInterface.prototype = {
                   msg = mv_get_loading_img( 'left:40%;top:40px;');
                 $j( '#upProgressDialog' ).dialog('option', 'title',  title_txt );
                 $j( '#upProgressDialog' ).html( msg );
-                if(buttons){              
+                if(buttons){
                         $j('#upProgressDialog').dialog('option','buttons', buttons);
-                }else{                  
+                }else{
                         //@@todo should convice the jquery ui people to not use object keys as user msg's
                         var bObj = {};
                         bObj[ gM('ok-button') ] =  function(){
                                  $j(this).dialog('close');
-                        }; 
+                        };
                         $j('#upProgressDialog').dialog('option','buttons', bObj);
-                }               
-       },              
+                }
+       },
        getProgressTitle:function(){
                return gM('upload-in-progress');
-       },      
-       getEditForm:function(){         
-               if( this.target_edit_from && $j( this.target_edit_from ).length != 0){                  
+       },
+       getEditForm:function(){
+               if( this.target_edit_from && $j( this.target_edit_from ).length != 0){
                        return $j( this.target_edit_from ).get(0);
                }
-               //just return the first form fond on the page. 
+               //just return the first form fond on the page.
                return $j('form :first').get(0);
        },
-       updateProgress:function( perc ){                
+       updateProgress:function( perc ){
                //js_log('update progress: ' + perc);
-               $j( '#up-progressbar' ).progressbar('value', parseInt( perc * 100 ) );  
+               $j( '#up-progressbar' ).progressbar('value', parseInt( perc * 100 ) );
                $j( '#up-pstatus' ).html( parseInt( perc * 100 ) + '% - ' );
        },
        /*update to jQuery.ui progress display type */
        dispProgressOverlay:function(){
          var _this = this;
-         //remove old instance: 
+         //remove old instance:
          if($j('#upProgressDialog').length!=0){
                 $j('#upProgressDialog').dialog( 'destroy' ).remove();
          }
-         //re add it: 
+         //re add it:
          $j('body').append('<div id="upProgressDialog" ></div>');
-               
+
          $j('#upProgressDialog').dialog({
-                 title:_this.getProgressTitle(), 
+                 title:_this.getProgressTitle(),
                  bgiframe: true,
                  modal: true,
                  width:400,
                  heigh:200,
-                 beforeclose: function(event, ui) {                                       
-                         if( event.button==0 && _this.action_done === false){                                                                                   
+                 beforeclose: function(event, ui) {
+                         if( event.button==0 && _this.action_done === false){
                                return _this.cancel_action();
                          }else{
                                 //click on button (dont do close action);
-                                return true; 
+                                return true;
                          }
-                 },              
-                 buttons: _this.cancel_button()          
-         });     
+                 },
+                 buttons: _this.cancel_button()
+         });
          $j('#upProgressDialog').html(
-         //set initial content: 
+         //set initial content:
                '<div id="up-pbar-container" style="width:90%;height:15px;" >' +
                        '<div id="up-progressbar" style="height:15px;"></div>' +
                        '<div id="up-status-container">'+
-                               '<span id="up-pstatus">0% - </span> ' +                                          
+                               '<span id="up-pstatus">0% - </span> ' +
                                '<span id="up-status-state">' + gM('uploaded-status') + '</span> ' +
-                       '</div>'+               
-               '</div>' 
+                       '</div>'+
+               '</div>'
          )
-         //setup progress bar: 
-          $j('#up-progressbar').progressbar({ 
-                  value:0 
-          });    
+         //setup progress bar:
+          $j('#up-progressbar').progressbar({
+                  value:0
+          });
           //just display an empty progress window
           $j('#upProgressDialog').dialog('open');
+
        },
        cancel_button:function(){
           var _this = this;
           var cancelBtn = new Array();
-          cancelBtn[ gM('cancel-button') ] =  function(){  
-                       return _this.cancel_action(this) 
+          cancelBtn[ gM('cancel-button') ] =  function(){
+                       return _this.cancel_action(this)
           };
           return cancelBtn;
-       },      
+       },
        cancel_action : function( dlElm ){
-               //confirm:      
-               if( confirm( gM('mv-cancel-confim') )){                 
+               //confirm:
+               if( confirm( gM('mv-cancel-confim') )){
                        //@@todo (cancel the encode / upload)
                        $j(this).dialog('close');
-                       return false;                   
+                       return false;
                }else{
                        return true;
-               }  
+               }
        }
 };
index 7dd518d..e8bb61c 100644 (file)
@@ -1,27 +1,26 @@
-/* adds firefogg support. 
-* autodetects: new upload api or old http POST.  
+/* adds firefogg support.
+* autodetects: new upload api or old http POST.
  */
 
-loadGM({ 
-       "fogg-select_file"                      : "Select File", 
-       "fogg-select_new_file"          : "Select New File",
-       "fogg-select_url"                       : "Select Url",
-       "fogg-save_local_file"          : "Save Ogg",
-       "fogg-check_for_fogg"           : "Checking for Firefogg <blink>...</blink>",
-       "fogg-installed"                        : "Firefogg is Installed",
-       "fogg-for_improved_uplods"      : "For Improved uploads: ",
-       "fogg-please_install"           : "<a href=\"$1\">Install Firefogg</a>. More <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">about firefogg</a>",        
-       "fogg-use_latest_fox"           : "Please first install <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg\">Firefox 3.5</a> (or later). <i>then revisit this page to install the <b>firefogg</b> extention</i>",        
-       "fogg-passthrough_mode"     : "Your selected file is already ogg or not a video file",
-       "fogg-transcoding"                      : "Encoding Video to Ogg",
-       "fogg-encoding-done"            : "Encoding Done",
-       "fogg-badtoken"                         : "Token is not valid"
-       
+loadGM({
+       "fogg-select_file": "Select file",
+       "fogg-select_new_file": "Select new file",
+       "fogg-select_url": "Select URL",
+       "fogg-save_local_file": "Save Ogg",
+       "fogg-check_for_fogg": "Checking for Firefogg <blink>...</blink>",
+       "fogg-installed": "Firefogg is installed",
+       "fogg-for_improved_uplods": "For improved uploads:",
+       "fogg-please_install": "<a href=\"$1\">Install Firefogg</a>. More <a href=\"http://commons.wikimedia.org/wiki/Commons:Firefogg\">about Firefogg</a>",
+       "fogg-use_latest_fox": "Please first install <a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg\">Firefox 3.5</a> (or later). <i>Then revisit this page to install the <b>Firefogg</b> extension.</i>",
+       "fogg-passthrough_mode": "Your selected file is already Ogg or not a video file",
+       "fogg-transcoding": "Encoding video to Ogg",
+       "fogg-encoding-done": "Encoding complete",
+       "fogg-badtoken": "Token is not valid"
 });
 
 var firefogg_install_links =  {
        'macosx':       'http://firefogg.org/macosx/Firefogg.xpi',
-       'win32' :       'http://firefogg.org/win32/Firefogg.xpi',
+       'win32'       'http://firefogg.org/win32/Firefogg.xpi',
        'linux' :       'http://firefogg.org/linux/Firefogg.xpi'
 };
 
@@ -36,40 +35,40 @@ var default_firefogg_options = {
        'passthrough': false,
        //if we will be showing the encoder interface
        'encoder_interface': false,
-       //if we want to limit the library functionality to "only firefoog" (no upload or progress bars) 
+       //if we want to limit the library functionality to "only firefoog" (no upload or progress bars)
        'only_fogg': false,
-       
-       
+
+
        //callbacks:
        'new_source_cb': false, //called on source name update passes along source name
-       
+
        //target control container or form (can't be left null)
-       'selector'                      : '',
-       
+       'selector': '',
+
        //if not rewriting a form we are encoding local.
-       'form_rewrite'          : false, 
-       
-       //taget buttons: 
-       'target_btn_select_file'        : false,
-       'target_btn_select_new_file': false,    
-       
-       //'target_btn_select_url'               : false,
-       
+       'form_rewrite': false,
+
+       //taget buttons:
+       'target_btn_select_file': false,
+       'target_btn_select_new_file': false,
+
+       //'target_btn_select_url': false,
+
        'target_btn_save_local_file': false,
-       'target_input_file_name'        : false,        
-       
-       
-       //target install descriptions 
-       'target_check_for_fogg'         : false,
-       'target_installed'      : false,
-       'target_please_install' : false,
+       'target_input_file_name': false,
+
+
+       //target install descriptions
+       'target_check_for_fogg': false,
+       'target_installed': false,
+       'target_please_install': false,
        'target_use_latest_fox': false,
-       //status: 
+       //status:
        'target_passthrough_mode':false,
-       
+
        //if firefogg should take over the form submit action
        'firefogg_form_action':true
-}      
+}
 
 
 var mvFirefogg = function(iObj){
@@ -77,29 +76,29 @@ var mvFirefogg = function(iObj){
 }
 mvFirefogg.prototype = { //extends mvBaseUploadInterface
 
-       min_firefogg_version : '0.9.9.5',       
-       fogg_enabled : false,            //if firefogg is enabled or not.        
-       encoder_settings:{                      //@@todo allow server to set this 
+       min_firefogg_version : '0.9.9.5',
+       fogg_enabled : false,            //if firefogg is enabled or not.
+       encoder_settings:{                      //@@todo allow server to set this
                'maxSize'        : '400',
         'videoBitrate'   : '544',
         'audioBitrate'   : '96',
         'noUpscaling'    : true
-       },      
-       sourceFileInfo  : {},
-       ogg_extensions  : ['ogg', 'ogv', 'oga'],
+       },
+       sourceFileInfo: {},
+       ogg_extensions: ['ogg', 'ogv', 'oga'],
        video_extensions: ['avi', 'mov', 'mp4', 'mp2', 'mpeg', 'mpeg2', 'mpeg4', 'dv', 'wmv'],
-       
-       passthrough     : false,
-       sourceMode      : 'file',
-       
+
+       passthrough: false,
+       sourceMode: 'file',
+
        init: function( iObj ){
                if(!iObj)
                        iObj = {};
-                       
-               //if we have no api_url set upload to "post" 
+
+               //if we have no api_url set upload to "post"
                if(!iObj.api_url)
-                       iObj.upload_mode = 'post'; 
-                       
+                       iObj.upload_mode = 'post';
+
                //inherit iObj properties:
                for(var i in default_firefogg_options){
                        if(iObj[i]){
@@ -111,9 +110,9 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                //check if we want to limit the usage:
                if(!this.only_fogg){
                        var myBUI = new mvBaseUploadInterface( iObj );
-                       
-                       //standard extends code: 
-                       for(var i in myBUI){                    
+
+                       //standard extends code:
+                       for(var i in myBUI){
                                if(this[i]){
                                        this['pe_'+ i] = myBUI[i];
                                }else{
@@ -121,119 +120,119 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                }
                        }
                }
-               
+
                if(!this.selector){
                        js_log('firefogg: missing selector ');
-               }               
+               }
        },
        doRewrite:function( callback ){
                var _this = this;
                js_log('sel len: ' + this.selector + '::' + $j(this.selector).length + ' tag:'+ $j(this.selector).get(0).tagName);
                if( $j(this.selector).length >=0 ){
-                       
-                       if( $j(this.selector).get(0).tagName.toLowerCase() == 'input' ){                                        
-                               _this.form_rewrite = true;                                                                              
-                       }               
+
+                       if( $j(this.selector).get(0).tagName.toLowerCase() == 'input' ){
+                               _this.form_rewrite = true;
+                       }
                }
                //check if we are rewriting an input or a form:
                if( this.form_rewrite ){
                        this.setupForm();
                }else{
-                       this.doControlHTML();    
-                       this.doControlBindings();       
+                       this.doControlHTML();
+                       this.doControlBindings();
                }
-               
-               //doRewrite is done: 
+
+               //doRewrite is done:
                if(callback)
                        callback();
        },
-       doControlHTML: function( ){             
-               var _this = this;               
-               var out = '';           
-               $j.each(default_firefogg_options, function(target, na){                 
+       doControlHTML: function( ){
+               var _this = this;
+               var out = '';
+               $j.each(default_firefogg_options, function(target, na){
                        if(target.substring(0, 6)=='target'){
                                //js_log('check for target html: ' + target);
-                               //check for the target if missing add to the output: 
-                               if( _this[target] === false){                                   
+                               //check for the target if missing add to the output:
+                               if( _this[target] === false){
                                        out += _this.getTargetHtml(target) + ' ';
-                                       //update the target selector 
+                                       //update the target selector
                                    _this[target] = _this.selector + ' .' + target;
-                               }                                                                                       
+                               }
                        }
-               });             
+               });
                $j( this.selector ).append( out ).hide();
        },
-       getTargetHtml:function(target){                                     
+       getTargetHtml:function(target){
                if( target.substr(7,3)=='btn'){
                        return '<input style="" class="' + target + '" type="button" value="' + gM( 'fogg-' + target.substring(11)) + '"/> ';
                }else if(target.substr(7,5)=='input'){
                        return '<input style="" class="' + target + '" type="text" value="' + gM( 'fogg-' + target.substring(11)) + '"/> ';
-               }else{                                                          
+               }else{
                        return '<div style="" class="' + target + '" >'+ gM('fogg-'+ target.substring(7)) + '</div> ';
                }
        },
        doControlBindings: function(){
-               var _this = this;                       
-               
+               var _this = this;
+
                //hide all targets:
                var hide_target_list='';
                var coma='';
-               $j.each(default_firefogg_options, function(target, na){ 
+               $j.each(default_firefogg_options, function(target, na){
                        if(target.substring(0, 6)=='target'){
                                hide_target_list+=coma + _this[target];
                                coma=',';
-                       }                       
-               });                             
-               $j( hide_target_list ).hide();                          
-               //now that the proper set of items has been hiiden show: 
+                       }
+               });
+               $j( hide_target_list ).hide();
+               //now that the proper set of items has been hiiden show:
                $j( this.selector ).show();
-                       
-                               
+
+
                //hide all but check-for-fogg
                //check for firefogg
                if( _this.firefoggCheck() ){
-                       
-                       //if rewriting the form lets keep the text input around:                                                 
+
+                       //if rewriting the form lets keep the text input around:
                        if( _this.form_rewrite )
                                $j(this.target_input_file_name).show();
-                       
-                       //show select file: 
+
+                       //show select file:
                        $j( this.target_btn_select_file ).unbind(
                                ).attr('disabled', false
                                ).css({'display':'inline'}
-                               ).click(function(){                                     
+                               ).click(function(){
                                        _this.selectFogg();
-                               });                                                                             
-                               
-                   //also setup the text file display on Click to select file:  
-                   $j(this.target_input_file_name).unbind().attr('readonly', 'readonly').click(function(){                     
+                               });
+
+                   //also setup the text file display on Click to select file:
+                   $j(this.target_input_file_name).unbind().attr('readonly', 'readonly').click(function(){
                        _this.selectFogg();
-                   })          
-                       
+                   })
+
                }else{
-                       //first check firefox version:           
+                       //first check firefox version:
                        if(!( $j.browser.mozilla && $j.browser.version >= '1.9.1' )) {
                                js_log( 'show use latest::' + _this.target_use_latest_fox );
                                if( _this.target_use_latest_fox ){
                                        if( _this.form_rewrite )
                                                $j( _this.target_use_latest_fox ).prepend( gM('fogg-for_improved_uplods') );
-                                                        
+
                                        $j( _this.target_use_latest_fox ).show();
                                }
                                return ;
-                       }               
-                                                                                                       
+                       }
+
                        //if rewriting form use upload msg text
-                       var upMsg = (_this.form_rewrite) ? gM('fogg-for_improved_uplods') : '';                 
-                       $j( _this.target_please_install ).html( upMsg + gM('fogg-please_install', _this.getOSlink() )).css('padding', '10px').show();                   
+                       var upMsg = (_this.form_rewrite) ? gM('fogg-for_improved_uplods') : '';
+                       $j( _this.target_please_install ).html( upMsg + gM('fogg-please_install', _this.getOSlink() )).css('padding', '10px').show();
                }
-               //setup the target save local file bindins: 
+               //setup the target save local file bindins:
                $j( _this.target_btn_save_local_file ).unbind().click(function(){
                        _this.saveLocalFogg();
                });
        },
        /*
-        * returns the firefogg link for your os: 
+        * returns the firefogg link for your os:
         */
        getOSlink:function(){
                var os_link = false;
@@ -244,43 +243,43 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                  os_link = firefogg_install_links['macosx'];
                        else if(navigator.oscpu.search('Win') >= 0)
                                  os_link = firefogg_install_links['win32'];
-               }       
+               }
                return os_link
        },
-       firefoggCheck:function(){                                  
-               if(typeof(Firefogg) != 'undefined' && Firefogg().version >= this.min_firefogg_version){                                         
-                       this.fogg = new Firefogg();     
+       firefoggCheck:function(){
+               if(typeof(Firefogg) != 'undefined' && Firefogg().version >= this.min_firefogg_version){
+                       this.fogg = new Firefogg();
                        this.fogg_enabled = true;
                        return true;
-               }else{                                                          
+               }else{
                        return false;
                }
        },
        //assume input target
-       setupForm: function(){          
+       setupForm: function(){
                js_log('firefogg::setupForm::');
-               //to parent form setup if we want http updates 
+               //to parent form setup if we want http updates
                if( this.form_rewrite ){
-                       //do parent form setup: 
-                       this.pe_setupForm();            
+                       //do parent form setup:
+                       this.pe_setupForm();
                }
-               
-               //check if we have firefogg (if not just add a link and stop proccessing) 
+
+               //check if we have firefogg (if not just add a link and stop proccessing)
                if( !this.firefoggCheck() ){
-                       //add some status indicators if not provided: 
-                       if(!this.target_please_install){                                
-                               $j(this.selector).after ( this.getTargetHtml('target_please_install') );                                                                
+                       //add some status indicators if not provided:
+                       if(!this.target_please_install){
+                               $j(this.selector).after ( this.getTargetHtml('target_please_install') );
                                this.target_please_install = this.selector + ' ~ .target_please_install';
                        }
-                       if(!this.target_use_latest_fox){                
-                               $j(this.selector).after ( this.getTargetHtml('target_use_latest_fox') );        
-                               this.target_use_latest_fox = this.selector + ' ~ .target_use_latest_fox';                       
+                       if(!this.target_use_latest_fox){
+                               $j(this.selector).after ( this.getTargetHtml('target_use_latest_fox') );
+                               this.target_use_latest_fox = this.selector + ' ~ .target_use_latest_fox';
                        }
                        //update download link:
-                       this.doControlBindings();               
+                       this.doControlBindings();
                        return ;
                }
-               
+
                //change the file browser to type text: (can't directly change input from "file" to "text" so longer way:
                var inTag = '<input ';
                $j.each($j(this.selector).get(0).attributes, function(i, attr){
@@ -291,85 +290,85 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                });
                if(!$j(this.selector).attr('style'))
                        inTag += 'style="display:inline" ';
-                       
+
                inTag+= '/><span id="' + $j(this.selector).attr('name') + '_fogg-control"></span>';
-                                                                               
+
                js_log('set input: ' + inTag);
-               $j(this.selector).replaceWith(inTag);                   
-               
+               $j(this.selector).replaceWith(inTag);
+
                this.target_input_file_name = 'input[name=' + $j(this.selector).attr('name') + ']';
-               //update the selector to the control target: 
+               //update the selector to the control target:
                this.selector = '#' + $j(this.selector).attr('name') +  "_fogg-control";
-               
+
                this.doControlHTML();
-               //check for the other inline status indicator targets:           
-               
-               //update the bindings: 
+               //check for the other inline status indicator targets:
+
+               //update the bindings:
                this.doControlBindings();
        },
        getEditForm:function(){
                if( this.target_edit_from )
                        return this.pe_getEditForm();
-               //else try to get the parent "from" of the file selector:  
+               //else try to get the parent "from" of the file selector:
                return $j(this.selector).parents('form:first').get(0);
-       },   
-       selectFogg:function(){                  
+       },
+       selectFogg:function(){
                var _this = this;
-               if(_this.fogg.selectVideo() ){                  
-                       this.selectFoggActions();                       
+               if(_this.fogg.selectVideo() ){
+                       this.selectFoggActions();
                }
        },
        selectFoggActions:function(){
                var _this = this;
                js_log('videoSelectReady');
-               //if not already hidden hide select file and show "select new": 
+               //if not already hidden hide select file and show "select new":
                $j(_this.target_btn_select_file).hide();
-               
-               //show and setup binding for select new file: 
+
+               //show and setup binding for select new file:
                $j(_this.target_btn_select_new_file).show().unbind().click(function(){
-                       //create new fogg instance:                              
+                       //create new fogg instance:
                        _this.fogg = new Firefogg();
                        _this.selectFogg();
                });
-               
-               //update if we are in passthrough mode or going to encode                                       
-               if( _this.fogg.sourceInfo && _this.fogg.sourceFilename  ){                                                                      
+
+               //update if we are in passthrough mode or going to encode
+               if( _this.fogg.sourceInfo && _this.fogg.sourceFilename  ){
                        //update the source status
                        try{
                                _this.sourceFileInfo = JSON.parse( _this.fogg.sourceInfo ) ;
                        }catch (e){
                                js_error('error could not parse fogg sourceInfo');
-                       }                                       
-                                       
+                       }
+
                        //now setup encoder settings based source type:
-                       _this.autoEncoderSettings();                                    
-                       
+                       _this.autoEncoderSettings();
+
                        //if set to passthough update the interface:
                        if(_this.encoder_settings['passthrough']==true){
                                $j(_this.target_passthrough_mode).show();
-                       }else{                                  
-                               $j(_this.target_passthrough_mode).hide();       
-                               //if set to encoder expose the encode button: 
+                       }else{
+                               $j(_this.target_passthrough_mode).hide();
+                               //if set to encoder expose the encode button:
                                if( !_this.form_rewrite ){
                                        $j(_this.target_btn_save_local_file).show();
                                }
                        }
                        //~otherwise the encoding will be triggered by the form~
-                       
-                       //do source name update callback:       
-                       js_log(" should update: " + _this.target_input_file_name + ' to: ' + _this.fogg.sourceFilename );                                
+
+                       //do source name update callback:
+                       js_log(" should update: " + _this.target_input_file_name + ' to: ' + _this.fogg.sourceFilename );
                        $j(_this.target_input_file_name).val(_this.fogg.sourceFilename).show();
-                       
-                       if(_this.new_source_cb){                                                                                                
+
+                       if(_this.new_source_cb){
                                if(_this.encoder_settings['passthrough']){
                                        var fName = _this.fogg.sourceFilename
-                               }else{  
+                               }else{
                                    var oggExt = (_this.isSourceAudio())?'oga':'ogg';
                     oggExt = (_this.isSourceVideo())?'ogv':oggExt;
                     oggExt = (_this.isUnknown())?'ogg':oggExt;
                                    oggName = _this.fogg.sourceFilename.substr(0,
                                                  _this.fogg.sourceFilename.lastIndexOf('.'));
-                                   var fName = oggName +'.'+ oggExt              
+                                   var fName = oggName +'.'+ oggExt
                                }
                                _this.new_source_cb( _this.fogg.sourceFilename , fName);
                        }
@@ -380,34 +379,34 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
           if(this.fogg){
                   if(!this.fogg.saveVideoAs() )
                           return false;
-                  
-                  //we have set a target now call the encode: 
-                 this.doEncode();                 
-          }  
+
+                  //we have set a target now call the encode:
+                 this.doEncode();
+          }
        },
-       //simple auto encoder settings just enable passthough if file is not video or > 480 pixles tall 
-       autoEncoderSettings:function(){         
+       //simple auto encoder settings just enable passthough if file is not video or > 480 pixles tall
+       autoEncoderSettings:function(){
                var _this = this;
                //grab the extension:
-               var sf = _this.fogg.sourceFilename;                                             
+               var sf = _this.fogg.sourceFilename;
                var ext = '';
                if(     sf.lastIndexOf('.') != -1){
                        ext = sf.substring( sf.lastIndexOf('.')+1 ).toLowerCase();
-               }       
-                                 
-               //set to passthrough to true by default (images, arbitrary files that we want to send with http chunks) 
+               }
+
+               //set to passthrough to true by default (images, arbitrary files that we want to send with http chunks)
                this.encoder_settings['passthrough'] = true;
-               
-               //see if we have video or audio:  
+
+               //see if we have video or audio:
                if(  _this.isSourceAudio() || _this.isSourceVideo() ){
-                        _this.encoder_settings['passthrough'] = false; 
+                        _this.encoder_settings['passthrough'] = false;
                }
-                                                       
-               //special case see if we already have ogg video: 
+
+               //special case see if we already have ogg video:
                if( _this.isOggFormat() ){
                        _this.encoder_settings['passthrough'] = true;
-               }               
-                                
+               }
+
                js_log('base autoEncoderSettings::' + _this.sourceFileInfo.contentType  + ' passthrough:' + _this.encoder_settings['passthrough']);
        },
        isUnknown:function(){
@@ -418,42 +417,42 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        },
        isSourceVideo:function(){
            return (this.sourceFileInfo.contentType.indexOf("video/") != -1);
-       },      
+       },
        isOggFormat:function(){
-          return ( this.sourceFileInfo.contentType.indexOf("video/ogg") != -1 || 
-                       this.sourceFileInfo.contentType.indexOf("application/ogg") != -1   ); 
+          return ( this.sourceFileInfo.contentType.indexOf("video/ogg") != -1 ||
+                       this.sourceFileInfo.contentType.indexOf("application/ogg") != -1   );
        },
        getProgressTitle:function(){
                js_log("fogg:getProgressTitle f:" + this.fogg_enabled  + ' rw:' + this.form_rewrite);
-               //return the parent if we don't have fogg turned on: 
+               //return the parent if we don't have fogg turned on:
                if(! this.fogg_enabled || !this.firefogg_form_action )
-                       return this.pe_getProgressTitle();                                 
+                       return this.pe_getProgressTitle();
                if( !this.form_rewrite )
                  return gM('fogg-transcoding');
-               //else return our upload+transcode msg:                         
+               //else return our upload+transcode msg:
                return gM('upload-transcode-in-progress');
-       },      
-       doUploadSwitch:function(){                              
+       },
+       doUploadSwitch:function(){
                var _this = this;
                js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled + ' up mode:' +  _this.upload_mode);
-               //make sure firefogg is enabled otherwise do parent UploadSwich:                
+               //make sure firefogg is enabled otherwise do parent UploadSwich:
                if( !this.fogg_enabled || !this.firefogg_form_action )
                        return _this.pe_doUploadSwitch();
-               
-               //check what mode to use firefogg in: 
+
+               //check what mode to use firefogg in:
                if( _this.upload_mode == 'post' ){
                        _this.doEncode();
                }else if( _this.upload_mode == 'api' && _this.chunks_supported){ //if api mode and chunks supported do chunkUpload
                        _this.doChunkUpload();
                }else{
                        js_error( 'Error: unrecongized upload mode: ' + _this.upload_mode );
-               }               
+               }
        },
        //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
        doChunkUpload : function(){
                js_log('doChunkUpload::');
-               var _this = this;                                       
-               _this.action_done = false;                                      
+               var _this = this;
+               _this.action_done = false;
                //extension should already be ogg but since its user editable,
                //check again
                //we are transcoding so we know it will be an ogg
@@ -463,12 +462,12 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                if(     sf.lastIndexOf('.') != -1){
                        ext = sf.substring( sf.lastIndexOf('.') ).toLowerCase();
                }
-               if(!_this.encoder_settings['passthrough'] && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){           
+               if(!_this.encoder_settings['passthrough'] && $j.inArray(ext.substr(1), _this.ogg_extensions) == -1 ){
                        var extreg = new RegExp(ext + '$', 'i');
                        _this.formData['wpDestFile'] = sf.replace(extreg, '.ogg');
                }
-               //add chunk response hook to build the resultURL when uploading chunks          
-                               
+               //add chunk response hook to build the resultURL when uploading chunks
+
                //check for editToken:
                if(!this.etoken){
                        if( _this.formData['wpEditToken']){
@@ -476,13 +475,13 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                _this.doChunkWithFormData();
                        }else{
                                get_mw_token(
-                                       'File:'+ _this.formData['wpDestFile'], 
-                                       _this.api_url, 
-                                       function( eToken ){             
+                                       'File:'+ _this.formData['wpDestFile'],
+                                       _this.api_url,
+                                       function( eToken ){
                                                if( !eToken || eToken == '+\\' ){
                                                        _this.updateProgressWin(gM('fogg-badtoken'), gM('fogg-badtoken'));
                                                        return false;
-                                               }                                                       
+                                               }
                                                _this.etoken = eToken;
                                                _this.doChunkWithFormData();
                                        }
@@ -495,96 +494,96 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        doChunkWithFormData:function(){
                var _this = this;
                js_log("doChunkWithFormData::"  + _this.etoken);
-               //build the api url: 
+               //build the api url:
                var aReq ={
-                       'action'                : 'upload',
-                       'format'                : 'json',
-                       'filename'              : _this.formData['wpDestFile'],
-                       'comment'               : _this.formData['wpUploadDescription'],
-                       'enablechunks'  : 'true'
+                       'action': 'upload',
+                       'format': 'json',
+                       'filename': _this.formData['wpDestFile'],
+                       'comment': _this.formData['wpUploadDescription'],
+                       'enablechunks': 'true'
                };
-               
+
                if( _this.etoken )
                        aReq['token'] = this.etoken;
-               
+
                if( _this.formData['wpWatchthis'] )
                        aReq['watch'] =  _this.formData['wpWatchthis'];
-               
+
                if(  _this.formData['wpIgnoreWarning'] )
                        aReq['ignorewarnings'] = _this.formData['wpIgnoreWarning'];
-               
-               js_log('do fogg upload/encode call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) );                       
-               js_log('foggEncode: '+ JSON.stringify( _this.encoder_settings ) );                      
-               _this.fogg.upload( JSON.stringify( _this.encoder_settings ),  _this.api_url ,  JSON.stringify( aReq ) );                
-                       
-               //update upload status:                                         
+
+               js_log('do fogg upload/encode call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) );
+               js_log('foggEncode: '+ JSON.stringify( _this.encoder_settings ) );
+               _this.fogg.upload( JSON.stringify( _this.encoder_settings ),  _this.api_url ,  JSON.stringify( aReq ) );
+
+               //update upload status:
                _this.doUploadStatus();
        },
        //doEncode and monitor progress:
-       doEncode : function(){  
+       doEncode : function(){
                var _this = this;
                _this.action_done = false;
-               _this.dispProgressOverlay();                            
+               _this.dispProgressOverlay();
                js_log('doEncode: with: ' +  JSON.stringify( _this.encoder_settings ) );
-               _this.fogg.encode( JSON.stringify( _this.encoder_settings ) );                    
-               
-               
+               _this.fogg.encode( JSON.stringify( _this.encoder_settings ) );
+
+
                 //show transcode status:
                $j('#up-status-state').html( gM('upload-transcoded-status') );
-               
+
                //setup a local function for timed callback:
                var encodingStatus = function() {
                        var status = _this.fogg.status();
-                       
+
                        //update progress bar
-                       _this.updateProgress( _this.fogg.progress() );                  
-                       
+                       _this.updateProgress( _this.fogg.progress() );
+
                        //loop to get new status if still encoding
                        if( _this.fogg.state == 'encoding' ) {
                                setTimeout(encodingStatus, 500);
-                       }else if ( _this.fogg.state == 'encoding done' ) { //encoding done, state can also be 'encoding failed                                                                                                                          
+                       }else if ( _this.fogg.state == 'encoding done' ) { //encoding done, state can also be 'encoding failed
                                _this.encodeDone();
                        }else if(_this.fogg.state == 'encoding fail'){
-                               //@@todo error handling: 
+                               //@@todo error handling:
                                js_error('encoding failed');
                        }
                }
-               encodingStatus();                                         
-       },      
+               encodingStatus();
+       },
        encodeDone:function(){
                var _this = this;
                js_log('::encodeDone::');
                _this.action_done = true;
-               //send to the post url:                          
+               //send to the post url:
                if( _this.form_rewrite && _this.upload_mode == 'post' ){
-                       js_log('done with encoding do POST upload:' + _this.editForm.action);                                                           
-                       // ignore warnings & set source type 
+                       js_log('done with encoding do POST upload:' + _this.editForm.action);
+                       // ignore warnings & set source type
                        //_this.formData[ 'wpIgnoreWarning' ]='true';
-                       _this.formData[ 'wpSourceType' ] = 'upload';            
+                       _this.formData[ 'wpSourceType' ] = 'upload';
                        _this.formData[ 'action' ]               = 'submit';
                        //wpUploadFile is set by firefogg
-                       delete _this.formData[ 'wpUploadFile' ];           
+                       delete _this.formData[ 'wpUploadFile' ];
 
-                       _this.fogg.post( _this.editForm.action, 'wpUploadFile', JSON.stringify( _this.formData ) );                             
-                       //update upload status:                                         
+                       _this.fogg.post( _this.editForm.action, 'wpUploadFile', JSON.stringify( _this.formData ) );
+                       //update upload status:
                        _this.doUploadStatus();
                }else{
                        js_log("done with encoding (no upload) ");
                        //set stuats to 100% for one second:
-                       _this.updateProgress( 1 );              
+                       _this.updateProgress( 1 );
                        setTimeout(function(){
                                _this.updateProgressWin(gM('fogg-encoding-done'), gM('fogg-encoding-done'));
-                       }, 1000);       
+                       }, 1000);
                }
        },
-       doUploadStatus:function() {     
+       doUploadStatus:function() {
                var _this = this;
                $j( '#up-status-state' ).html( gM('uploaded-status')  );
-               
+
                _this.oldResponseText = '';
-               //setup a local function for timed callback:                             
-               var uploadStatus = function(){                  
-                       //get the response text: 
+               //setup a local function for timed callback:
+               var uploadStatus = function(){
+                       //get the response text:
                        var response_text =  _this.fogg.responseText;
                        if(!response_text){
                                   try{
@@ -594,13 +593,13 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                           js_log("could not parse uploadstatus / could not get responseText");
                                   }
                        }
-                                          
-                       if( _this.oldResponseText != response_text){                                                                                                                                                                                                                      
+
+                       if( _this.oldResponseText != response_text){
                                js_log('new result text:' + response_text + ' state:' + _this.fogg.state);
-                               _this.oldResponseText = response_text;                          
-                               //try and parse the response text and check for errors                  
+                               _this.oldResponseText = response_text;
+                               //try and parse the response text and check for errors
                                try{
-                                       var apiResult = JSON.parse( response_text );                                    
+                                       var apiResult = JSON.parse( response_text );
                                }catch(e){
                                        js_log("could not parse response_text::" + response_text + ' ...for now try with eval...');
                                        try{
@@ -608,61 +607,61 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                        }catch(e){
                                                var apiResult = null;
                                        }
-                               }                                               
-                               if(apiResult && _this.apiUpdateErrorCheck( apiResult ) === false){                                      
+                               }
+                               if(apiResult && _this.apiUpdateErrorCheck( apiResult ) === false){
                                        //stop status update we have an error
                                        _this.action_done = true;
                                        _this.fogg.cancel();
-                                       return false; 
-                               }               
-                       }       
+                                       return false;
+                               }
+                       }
                        //update progress bar
                        _this.updateProgress( _this.fogg.progress() );
-                                               
-                       //loop to get new status if still uploading (could also be encoding if we are in chunk upload mode) 
+
+                       //loop to get new status if still uploading (could also be encoding if we are in chunk upload mode)
                        if( _this.fogg.state == 'encoding' || _this.fogg.state == 'uploading') {
                                setTimeout(uploadStatus, 100);
-                               
+
                        }//check upload state
-                       else if( _this.fogg.state == 'upload done' || 
+                       else if( _this.fogg.state == 'upload done' ||
                                                 _this.fogg.state == 'done' ||
-                                                _this.fogg.state == 'encoding done' ) {                                                                                                                                                                                                                                                                                         
-                                  //if in "post" upload mode read the html response (should be depricated):                                                       
-                                  if( _this.upload_mode == 'api' ){                                                                              
-                                          if( apiResult.resultUrl ){   
-                                                       var buttons ={}; 
+                                                _this.fogg.state == 'encoding done' ) {
+                                  //if in "post" upload mode read the html response (should be depricated):
+                                  if( _this.upload_mode == 'api' ){
+                                          if( apiResult.resultUrl ){
+                                                       var buttons ={};
                                                        buttons[gM('go-to-resource')] =  function(){
                                                                window.location = apiResult.resultUrl;
                                                        }
-                                                       var go_to_url_txt = gM('go-to-resource');                                                                          
+                                                       var go_to_url_txt = gM('go-to-resource');
                                                        if( typeof _this.done_upload_cb == 'function' ){
                                                                //if done action return 'true'
-                                                               if( _this.done_upload_cb() ){                                                                           
+                                                               if( _this.done_upload_cb() ){
                                                                        //update status
-                                                                       _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', apiResult.resultUrl),buttons);  
+                                                                       _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', apiResult.resultUrl),buttons);
                                                                }else{
                                                                        //if done action returns 'false' //close progress window
-                                                                       this.action_done = true;                                                                        
-                                                               $j('#upProgressDialog').dialog('close');        
-                                                               } 
+                                                                       this.action_done = true;
+                                                               $j('#upProgressDialog').dialog('close');
+                                                               }
                                                        }else{
-                                                               //update status (without done_upload_cb) 
-                                                               _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', apiResult.resultUrl),buttons);  
+                                                               //update status (without done_upload_cb)
+                                                               _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', apiResult.resultUrl),buttons);
                                                        }
                                           }else{
                                                   //done state with error? ..not really possible given how firefogg works
                                                   js_log(" upload done, in chunks mode, but no resultUrl!");
-                                          }                                                                                                                                                                                                               
-                                  }else if( _this.upload_mode == 'post' && _this.api_url ) {                                                                             
+                                          }
+                                  }else if( _this.upload_mode == 'post' && _this.api_url ) {
                                           _this.procPageResponse( response_text );
-                                  }                                                                                                                            
-                       }else{  
-                               //upload error: 
-                               js_log('Error:firefogg upload error: ' + _this.fogg.state );            
+                                  }
+                       }else{
+                               //upload error:
+                               js_log('Error:firefogg upload error: ' + _this.fogg.state );
                   }
           }
           uploadStatus();
-       },      
+       },
        cancel_action:function( dlElm ){
                if(!this.fogg_enabled){
                        return this.pe_cancel_action();
@@ -676,30 +675,30 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                        this.fogg.cancel();
                        $j(dlElm).dialog('close');
                    }
-               } else{                         
+               } else{
                        return false;
-               } 
+               }
        },
        /**
-       * procPageResponse should be faded out in favor of the upload api soon.. 
+       * procPageResponse should be faded out in favor of the upload api soon..
        * its all very fragile to read the html output and guess at stuff
        */
        procPageResponse:function( result_page ){
                var _this = this;
                js_log('f:procPageResponse');
-               var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' ');         
-               
+               var sstring = 'var wgTitle = "' + this.formData['wpDestFile'].replace('_',' ');
+
                if(wgArticlePath){
                        var result_txt = gM('mv_upload_done', wgArticlePath.replace(/\$1/, 'File:' + _this.formData['wpDestFile'] ) );
                }else{
                        result_txt = 'File has uploaded but api "done" url was provided. Check the log for result page output';
-               }               
-               
-               //set the error text in case we dont' get far along in processing the response 
+               }
+
+               //set the error text in case we dont' get far along in processing the response
                _this.updateProgressWin( gM('mv_upload_completed'), result_txt );
-                                                                                               
-               if( result_page && result_page.toLowerCase().indexOf( sstring.toLowerCase() ) != -1){   
-                       js_log( 'upload done got redirect found: ' + sstring + ' r:' + _this.done_upload_cb );                                                                          
+
+               if( result_page && result_page.toLowerCase().indexOf( sstring.toLowerCase() ) != -1){
+                       js_log( 'upload done got redirect found: ' + sstring + ' r:' + _this.done_upload_cb );
                        if( _this.done_upload_cb == 'redirect' ){
                                $j( '#dlbox-centered' ).html( '<h3>Upload Completed:</h3>' + result_txt + '<br>' + form_txt);
                                window.location = wgArticlePath.replace( /\$1/, 'File:' + _this.formData['wpDestFile'] );
@@ -707,23 +706,23 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                //check if the add_done_action is a callback:
                                if( typeof _this.done_upload_cb == 'function' )
                                        _this.done_upload_cb();
-                       }                                                                       
-               }else{                                                          
-                       //js_log( 'upload page error: did not find: ' +sstring + ' in ' + "\n" + result_page );                                 
-                       var form_txt = '';              
+                       }
+               }else{
+                       //js_log( 'upload page error: did not find: ' +sstring + ' in ' + "\n" + result_page );
+                       var form_txt = '';
                        if( !result_page ){
-                               //@@todo fix this: 
-                               //the mediaWiki upload system does not have an API so we can\'t read errors                                                     
+                               //@@todo fix this:
+                               //the mediaWiki upload system does not have an API so we can\'t read errors
                        }else{
                                var res = grabWikiFormError( result_page );
-                                                       
+
                                if(res.error_txt)
                                        result_txt = res.error_txt;
-                                       
+
                                if(res.form_txt)
                                        form_txt = res.form_txt;
-                       }               
-                       js_log( 'error text is: ' + result_txt );               
+                       }
+                       js_log( 'error text is: ' + result_txt );
                        $j( '#dlbox-centered' ).html( '<h3>' + gM('mv_upload_completed') + '</h3>' + result_txt + '<br>' + form_txt);
                }
        }
index b5a9eb8..57c21b9 100644 (file)
@@ -1,6 +1,6 @@
 /*
 * a library for doing remote media searches
-* 
+*
 * initial targeted archives are:
        the local wiki
        wikimedia commons
@@ -8,21 +8,21 @@
        and archive.org
 */
 loadGM({
-       "add_media_wizard": "Add Media Wizard",
-       "mv_media_search" : "Media Search",
+       "add_media_wizard": "Add media wizard",
+       "mv_media_search" : "Media search",
        "rsd_box_layout" : "Box layout",
-       "rsd_list_layout" : "List Layout",
-       "rsd_results_desc" : "Results ",
-       "rsd_results_next" : "next ",
-       "rsd_results_prev" : "previous ",
+       "rsd_list_layout" : "List layout",
+       "rsd_results_desc" : "Results",
+       "rsd_results_next" : "next",
+       "rsd_results_prev" : "previous",
        "rsd_no_results"   : "No search results for <b>$1</b>",
 
        "upload_tab" : "Upload",
        "rsd_layout" : "Layout:",
-       "rsd_resource_edit" : "Edit Resource: $1",
-       "resource_description_page": "Resource Description Page",
-       "rsd_local_resource_title": "Local Resource Title",
-       "rsd_do_insert": "Do Insert",
+       "rsd_resource_edit" : "Edit resource: $1",
+       "resource_description_page": "Resource description page",
+       "rsd_local_resource_title": "Local resource title",
+       "rsd_do_insert": "Do insert",
 
        "cc_title": "Creative Commons",
        "cc_by_title": "Attribution",
@@ -30,20 +30,20 @@ loadGM({
        "cc_nd_title": "No Derivative Works",
        "cc_sa_title": "Share Alike",
        "cc_pd_title": "Public Domain",
-       "unknown_license": "Unknown License",   
-       "no_import_by_url": "This User or Wiki <b>can not</b> import assets from remote URLs. </p><p> Do you need to Login? </p><p> If permissions are set you may have to enable $wgAllowCopyUploads, <a href=\"http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads\">more info</a></p>",
+       "unknown_license": "Unknown license",
+       "no_import_by_url": "This user or wiki <b>can not</b> import assets from remote URLs.</p><p>Do you need to login?</p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href=\"http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads\">more information</a>).</p>",
        "results_from": "Results from <a href=\"$1\" target=\"_new\" >$2</a>",
-       
-       "missing_desc_see_soruce": "This Asset is missing a description. Please see the [$1 orginal source] and help describe it",
-       
-       "rsd_config_error": "Add media Wizard configuation error: $1"   
+
+       "missing_desc_see_soruce": "This asset is missing a description. Please see the [$1 orginal source] and help describe it.",
+
+       "rsd_config_error": "Add media wizard configuration error: $1"
 });
 var default_remote_search_options = {
        'profile':'mediawiki_edit',
        'target_container':null, //the div that will hold the search interface
-       //if using a modeal dialog (instead of target_container) how close to the edge of the window should we go:       
+       //if using a modeal dialog (instead of target_container) how close to the edge of the window should we go:
        'modal_edge_padding':'20px',
-       
+
        'target_invocation': null, //the button or link that will invoke the search interface
 
        'default_provider_id':'all', //all or one of the content_providers ids
@@ -52,20 +52,20 @@ var default_remote_search_options = {
        'local_wiki_api_url':null,
 
        //can be 'api', 'form', 'autodetect', 'remote_link'
-       'import_url_mode': 'autodetect', 
+       'import_url_mode': 'autodetect',
 
        'target_title':null,
 
        'target_textbox':null,
-       'target_render_area': null, //where output render should go:  
+       'target_render_area': null, //where output render should go:
        'instance_name': null, //a globally accessible callback instance name
        'default_query':null, //default search query
        //specific to sequence profile
        'p_seq':null,
        'cFileNS':'File', //what is the cannonical namespace for images
                                          //@@todo (should get that from the api or inpage vars)
-                                        
-       'enable_upload_tab':true, // if we want to enable an uploads tab:       
+
+       'enable_upload_tab':true, // if we want to enable an uploads tab:
        'upload_api_target'        : 'http://localhost/wiki_trunk/api.php' // can be local or the url of the upload api.
 }
 if(typeof wgServer == 'undefined')
@@ -86,28 +86,28 @@ remoteSearchDriver.prototype = {
        //here we define the set of possible media content providers:
        main_search_options:{
                'selprovider':{
-                       'title': 'Select Providers'             
+                       'title': 'Select Providers'
                },
                'advanced_search':{
                        'title': 'Advanced Options'
-               }       
-       },      
+               }
+       },
        /*
         * sets the default display item:
         * can be any content_providers key or 'all'
         */
        disp_item : 'upload',
-       /** the default content providers list. 
+       /** the default content providers list.
         *
         * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list:
         *
         * @@todo we will want to load more per user-preference and per category lookup
         */
-       content_providers:{                     
-               /*content_providers documentation:                      
+       content_providers:{
+               /*content_providers documentation:
                 *  @@todo we should move the bulk of the configuration to each file
-                *       
-               
+                *
+
                        @enabled: whether the search provider can be selected
                        @checked: whether the search provider will show up as seleatable tab (todo: user prefrence)
                        @d:        default: if the current cp should be displayed (only one should be the default)
@@ -119,45 +119,45 @@ remoteSearchDriver.prototype = {
                        @tab_img: the tab image (if set to false use title text)
                                                if === "ture" use standard location skin/images/{cp_id}_tab.png
                                                if === string use as url for image
-                                               
+
                        @linkback_icon default is: /wiki/skins/common/images/magnify-clip.png
-               
+
                        //domain insert: two modes: simple config or domain list:
                        @local : if the content provider assets need to be imported or not.
-                       @local_domains : sets of domains for which the content is local  
+                       @local_domains : sets of domains for which the content is local
                        //@@todo should query wgForeignFileRepos setting maybe interwikimap from the api
-               */                               
+               */
                'this_wiki':{
                        'enabled': 1,
-                       'checked': 1,                   
+                       'checked': 1,
                        'title'  : 'This Wiki',
                        'desc'   : '(should be updated with the proper text) maybe import from some config value',
                        'api_url':  ( wgServer && wgScriptPath )? wgServer + wgScriptPath+ '/api.php': null,
-                       'lib'    : 'mediaWiki', 
+                       'lib'    : 'mediaWiki',
                        'local'  : true,
                        'tab_img': false
-               },      
+               },
                'wiki_commons':{
                        'enabled': 1,
-                       'checked': 1,                   
-                       'title'  :'Wikimedia Commons',          
+                       'checked': 1,
+                       'title'  :'Wikimedia Commons',
                        'desc'   : 'Wikimedia Commons is a media file repository making available public domain '+
                                         'and freely-licensed educational media content (images, sound and video clips) to all.',
-                       'homepage': 'http://commons.wikimedia.org/wiki/Main_Page',      
+                       'homepage': 'http://commons.wikimedia.org/wiki/Main_Page',
                        'api_url':'http://commons.wikimedia.org/w/api.php',
-                       'lib'   :'mediaWiki',           
+                       'lib'   :'mediaWiki',
                        'resource_prefix': 'WC_', //prefix on imported resources (not applicable if the repository is local)
-               
+
                        //list all the domains where commons is local?
                        // probably should set this some other way by doing an api query
-                       // or by seeding this config when calling the remote search?                    
+                       // or by seeding this config when calling the remote search?
                        'local_domains': ['wikimedia','wikipedia','wikibooks'],
                        //specific to wiki commons config:
                        'search_title':false, //disable title search
                        //set up default range limit
                        'offset'                        : 0,
                        'limit'                         : 30,
-                       'tab_img':true          
+                       'tab_img':true
                },
                'archive_org':{
                        'enabled':1,
@@ -165,7 +165,7 @@ remoteSearchDriver.prototype = {
                        'title' : 'Archive.org',
                        'desc'  : 'The Internet Archive, a digital library of cultural artifacts',
                        'homepage':'http://www.archive.org/about/about.php',
-               
+
                        'api_url':'http://homeserver7.us.archive.org:8983/solr/select',
                        'lib'   : 'archiveOrg',
                        'local' : false,
@@ -182,28 +182,28 @@ remoteSearchDriver.prototype = {
                        'lib'   : 'metavid',
                        'local' :false,                 //if local set to true we can use local
                        'resource_prefix': 'MV_', //what prefix to use on imported resources
-               
+
                        'local_domains': ['metavid'], // if the domain name contains metavid
                                                                           // no need to import metavid content to metavid sites
-                                                                         
+
                        'stream_import_key': 'mv_ogg_low_quality', // which stream to import, could be mv_ogg_high_quality
                                                                                                          //or flash stream, see ROE xml for keys
-                                                                                                        
+
                        'remote_embed_ext': false, //if running the remoteEmbed extension no need to copy local
-                                                                          //syntax will be [remoteEmbed:roe_url link title]    
-                       'tab_img':true                                                  
+                                                                          //syntax will be [remoteEmbed:roe_url link title]
+                       'tab_img':true
                }
        },
        //define the licenses
        // ... this will get complicated quick...
        // (just look at complexity for creative commons without exessive "duplicate data")
        // ie cc_by could be "by/3.0/us/" or "by/2.1/jp/" to infinitum...
-       // some complexity should be negated by license equivalances.   
+       // some complexity should be negated by license equivalances.
 
        // but we will have to abstract into another class let content providers provide license urls
        // and we have to clone the license object and allow local overrides
 
-       licenses:{      
+       licenses:{
                //for now only support creative commons type licenses
                //used page: http://creativecommons.org/licenses/
                'cc':{
@@ -211,7 +211,7 @@ remoteSearchDriver.prototype = {
                        'base_license_url': 'http://creativecommons.org/licenses/',
                        'licenses':{
                                'by': 'by/3.0/',
-                               'by-sa': 'by-sa/3.0/',                                  
+                               'by-sa': 'by-sa/3.0/',
                                'by-nc-nd': 'by-nc-nd/3.0/',
                                'by-nc': 'by-nc/3.0/',
                                'by-nd': 'by-nd/3.0/',
@@ -233,7 +233,7 @@ remoteSearchDriver.prototype = {
                                        'im':'d/df/Cc-sa_white.svg/20px-Cc-sa_white.svg.png'
                                },
                                'pd':{
-                                       'im':'5/51/Cc-pd-new_white.svg/20px-Cc-pd-new_white.svg.png'                    
+                                       'im':'5/51/Cc-pd-new_white.svg/20px-Cc-pd-new_white.svg.png'
                                }
                        }
                }
@@ -242,7 +242,7 @@ remoteSearchDriver.prototype = {
        * getlicenseImgSet
        * @param license_key  the license key (ie "by-sa" or "by-nc-sa" etc)
        */
-       getlicenseImgSet: function( licenseObj ){       
+       getlicenseImgSet: function( licenseObj ){
                //js_log('output images: '+ imgs);
                return '<div class="rsd_license" title="'+ licenseObj.title + '" >' +
                                        '<a target="_new" href="'+ licenseObj.lurl +'" ' +
@@ -261,10 +261,10 @@ remoteSearchDriver.prototype = {
                //set the current license pointer:
                var cl = this.licenses.cc;
                var title = gM('cc_title');
-               var imgs = '';  
-               var license_set = license_key.split('-');       
-               for(var i=0;i < license_set.length; i++){               
-                       lkey =   license_set[i];                                                        
+               var imgs = '';
+               var license_set = license_key.split('-');
+               for(var i=0;i < license_set.length; i++){
+                       lkey =   license_set[i];
                        title += ' ' + gM( 'cc_' + lkey + '_title');
                        imgs +='<img class="license_desc" width="20" src="' + cl.base_img_url +
                                cl.license_img[ lkey ].im + '">';
@@ -287,18 +287,18 @@ remoteSearchDriver.prototype = {
                for(var i in this.licenses.cc.licenses){
                        var lkey = this.licenses.cc.licenses[i].split('/')[0];
                        //guess by url trim
-                       if( parseUri(license_url).path.indexOf('/'+ lkey +'/') != -1){          
+                       if( parseUri(license_url).path.indexOf('/'+ lkey +'/') != -1){
                                return this.getLicenceFromKey( i , license_url);
                        }
                }
                //could not find it return unknown_license
                return {
                        'title'         : gM('unknown_license'),
-                       'img_html'      : '<span>' + gM('unknown_license') + '</span>',         
+                       'img_html'      : '<span>' + gM('unknown_license') + '</span>',
                        'lurl'          : license_url
                };
        },
-       //some default layout values:   
+       //some default layout values:
        thumb_width              : 80,
        image_edit_width        : 400,
        video_edit_width        : 400,
@@ -311,29 +311,29 @@ remoteSearchDriver.prototype = {
 
        init: function( iObj ){
                var _this = this;
-               js_log('remoteSearchDriver:init');              
+               js_log('remoteSearchDriver:init');
                for( var i in default_remote_search_options ) {
                        if( iObj[i]){
                                this[ i ] = iObj[i];
                        }else{
                                this[ i ] = default_remote_search_options[i];
-                       }               
-               }       
+                       }
+               }
                //update the base text:
                if(_this.target_textbox)
                   _this.getTexboxSelection();
-                               
+
                //set up the content provider config:
                if( this.cpconfig ){
                        for(var cpc in cpconfig){
                                for(var cinx in this.cpconfig[cpc]){
-                                       if( this.content_providers[cpc] )                                       
-                                               this.content_providers[ cpc ][ cinx ] = this.cpconfig[cpc][ cinx];                              
+                                       if( this.content_providers[cpc] )
+                                               this.content_providers[ cpc ][ cinx ] = this.cpconfig[cpc][ cinx];
                                }
                        }
-               }       
-               
-               //make sure the selected cp has an api to query against (if its a content_provider              
+               }
+
+               //make sure the selected cp has an api to query against (if its a content_provider
                if( this.content_providers[ this.disp_item ] &&
                        !this.content_providers[ this.disp_item ].api_url  ){
                        for(var inx in this.content_providers){
@@ -342,10 +342,10 @@ remoteSearchDriver.prototype = {
                                        break;
                                }
                        }
-               }               
-                       
-               
-               //set up the default model config: 
+               }
+
+
+               //set up the default model config:
                this.dmodalCss = {
                        'width':'auto',
                        'height':'auto',
@@ -354,8 +354,8 @@ remoteSearchDriver.prototype = {
                        'right' : this.modal_edge_padding,
                        'bottom': this.modal_edge_padding
                }
-               
-               
+
+
                //set up the target invocation:
                if( $j(this.target_invocation).length==0 ){
                        js_log("RemoteSearchDriver:: no target invocation provided (will have to run your own doInitDisplay() )");
@@ -363,19 +363,19 @@ remoteSearchDriver.prototype = {
                        if(this.target_invocation){
                                $j(this.target_invocation).css('cursor','pointer').attr('title', gM('add_media_wizard')).click(function(){
                                        _this.doInitDisplay();
-                               });             
+                               });
                        }
-               }                                                               
+               }
        },
-       doInitDisplay:function(){       
-               var _this = this;                       
+       doInitDisplay:function(){
+               var _this = this;
                //setup the parent container:
                this.init_modal();
                //fill in the html:
                this.init_interface_html();
                //bind actions:
                this.add_interface_bindings();
-       
+
                //update the target bining to just unhide the dialog:
                $j(this.target_invocation).unbind().click(function(){
                          js_log("re-open");
@@ -384,22 +384,22 @@ remoteSearchDriver.prototype = {
                                        _this.getTexboxSelection();
                          //$j(_this.target_container).dialog("open");
                          $j(_this.target_container).parents('.ui-dialog').fadeIn('slow');
-                });    
+                });
        },
        //gets the in and out points for insert position or grabs the selected text for search
        getTexboxSelection:function(){
                //update the caretPos
-               this.getCaretPos();                     
-       
+               this.getCaretPos();
+
                //if we have highlighted text use that as the query: (would be fun to add context menu once we have rich editor in-place)
                if( this.caret_pos.selection )
                        this.default_query = this.caret_pos.selection
-       
+
        },
        getCaretPos:function(){
                this.caret_pos={};
                var txtarea = $j(this.target_textbox).get(0);
-               var getTextCusorStartPos = function (o){        
+               var getTextCusorStartPos = function (o){
                        if (o.createTextRange) {
                                        var r = document.selection.createRange().duplicate()
                                        r.moveEnd('character', o.value.length)
@@ -417,13 +417,13 @@ remoteSearchDriver.prototype = {
                        }
                }
                this.caret_pos.s = getTextCusorStartPos( txtarea );
-               this.caret_pos.e = getTextCusorEndPos( txtarea );       
+               this.caret_pos.e = getTextCusorEndPos( txtarea );
                this.caret_pos.text = txtarea.value;
                if(this.caret_pos.s && this.caret_pos.e &&
                                (this.caret_pos.s != this.caret_pos.e))
                        this.caret_pos.selection = this.caret_pos.text.substring(this.caret_pos.s, this.caret_pos.e).replace(/ /g, '\xa0') || '\xa0';
-                       
-               js_log('got caret_pos:' + this.caret_pos.s);                    
+
+               js_log('got caret_pos:' + this.caret_pos.s);
                //restore text value: (creating textRanges sometimes screws with the text content)
                $j(this.target_textbox).val(this.caret_pos.text);
        },
@@ -436,13 +436,13 @@ remoteSearchDriver.prototype = {
                        _this.target_container = '#rsd_modal_target';
                        //js_log('appended: #rsd_modal_target' + $j(_this.target_container).attr('id'));
                        //js_log('added target id:' + $j(_this.target_container).attr('id'));
-                       //get layout                    
-                       //layout = _this.getMaxModalLayout();                   
+                       //get layout
+                       //layout = _this.getMaxModalLayout();
                        $j(_this.target_container).dialog({
                                bgiframe: true,
-                               autoOpen: true,           
+                               autoOpen: true,
                                modal: true,
-                               buttons: {              
+                               buttons: {
                                        '_': function() {
                                                //just a place-holder
                                        }
@@ -450,9 +450,9 @@ remoteSearchDriver.prototype = {
                                close: function() {
                                        js_log('closed modal');
                                        $j(this).parents('.ui-dialog').fadeOut('slow');
-                               }               
+                               }
                        }).parent('.ui-dialog').css( _this.dmodalCss )
-                       //@@bind on resize to disable css dialog to update dmodelCss 
+                       //@@bind on resize to disable css dialog to update dmodelCss
                        .bind('resizestart', function(event, ui) {
                                 _this.dmodalCss = {};
                                 $j(this).css({});
@@ -460,28 +460,28 @@ remoteSearchDriver.prototype = {
                        //bind on drag to remove preset style as well
                        .bind('dragstart', function(event, ui) {
                                 _this.dmodalCss = {};
-                                $j(this).css({});                      
+                                $j(this).css({});
                        });
-                       //update the child position: (some of this should be pushed up-stream via dialog config options 
-                       $j(_this.target_container +'~ .ui-dialog-buttonpane').css({             
-                               'position':'absolute',          
+                       //update the child position: (some of this should be pushed up-stream via dialog config options
+                       $j(_this.target_container +'~ .ui-dialog-buttonpane').css({
+                               'position':'absolute',
                                'left':'0px',
                                'right':'0px',
                                'bottom':'0px'
                        });
-                       //re add cancel button 
+                       //re add cancel button
                        _this.cancelClipEditCB();
-                       js_log('done setup of target_container: ' + 
+                       js_log('done setup of target_container: ' +
                                $j(_this.target_container +'~ .ui-dialog-buttonpane').length);
-                       
-                       
+
+
                        /*var resizeTimer = false;
                        $j(window).bind('resize', function() {
                                var adjustModal = function(){
                                        var layout = _this.getMaxModalLayout();
                                        //js_log("should adjust: h " + layout.h + ' width:' + layout.w);
                                        $j(_this.target_container).dialog('option', 'width', layout.w);
-                                       $j(_this.target_container).dialog('option', 'height', layout.h);                                
+                                       $j(_this.target_container).dialog('option', 'height', layout.h);
                                }
                                if (resizeTimer) clearTimeout(resizeTimer);
                                var resizeTimer = setTimeout(adjustModal, 100);
@@ -492,12 +492,12 @@ remoteSearchDriver.prototype = {
                if(!border)
                        border = 50;
                //js_log('setting h:' + (parseInt( $j(document).height() ) - parseInt(border*2)) + ' from:' + $j(document).height() );
-               return { 
+               return {
                        'h': parseInt( $j(document).height() ) - parseInt(border*4),
                        'w': parseInt( $j(document).width() ) - parseInt(border*2),
                        'r': border,
                        't': border
-               }       
+               }
        },
        //sets up the initial html interface
        init_interface_html:function(){
@@ -505,25 +505,25 @@ remoteSearchDriver.prototype = {
                var _this = this;
                var dq = (this.default_query)? this.default_query : '';
                js_log('f::init_interface_html');
-       
+
                var o = '<div class="rsd_control_container" style="width:100%">' +
-                                       '<form id="rsd_form" action="javascript:return false;" method="GET">'+                                                                          
+                                       '<form id="rsd_form" action="javascript:return false;" method="GET">'+
                                                '<input class="ui-widget-content ui-corner-all" type="text" tabindex="1" value="' + dq + '" maxlength="512" id="rsd_q" name="rsd_q" '+
-                                                       'size="20" autocomplete="off"/> '+                                      
-                                               $j.btnHtml( gM('mv_media_search'), 'rms_search_button', 'search') +                                                                                     
-                                       '</form>';                                                                                      
+                                                       'size="20" autocomplete="off"/> '+
+                                               $j.btnHtml( gM('mv_media_search'), 'rms_search_button', 'search') +
+                                       '</form>';
                //close up the control container:
                o+='</div>';
-       
+
                //search provider tabs based on "checked" and "enabled" and "combined tab"
-               o+='<div id="rsd_results_container" style="top:0px;bottom:0px;left:0px;right:0px;"></div>';                             
+               o+='<div id="rsd_results_container" style="top:0px;bottom:0px;left:0px;right:0px;"></div>';
                $j(this.target_container).html( o );
-                               
+
                //add simple styles:
                $j(this.target_container + ' .rms_search_button').btnBind().click(function(){
                        _this.runSearch();
                });
-       
+
                //draw the tabs:
                this.drawTabs();
                //run the default search:
@@ -532,8 +532,8 @@ remoteSearchDriver.prototype = {
        },
        add_interface_bindings:function(){
                var _this = this;
-               js_log("f:add_interface_bindings:");                                    
-       
+               js_log("f:add_interface_bindings:");
+
 
                $j('#mso_selprovider,#mso_selprovider_close').unbind().click(function(){
                        if($j('#rsd_options_bar:hidden').length !=0 ){
@@ -544,25 +544,25 @@ remoteSearchDriver.prototype = {
                        }else{
                                $j('#rsd_options_bar').animate({
                                        'height':'0px',
-                                       'opacity':0                             
+                                       'opacity':0
                                }, "normal", function(){
                                        $j(this).hide();
                                });
                        }
-               });                                                     
+               });
                //set form bindings
-               $j('#rsd_form').unbind().submit(function(){                                     
+               $j('#rsd_form').unbind().submit(function(){
                        _this.runSearch();
                        //don't submit the form
                        return false;
-               });     
+               });
        },
        doUploadInteface:function(){
-               js_log("doUploadInteface::");           
-               var _this = this;                                       
-               //set it to loading: 
-               mv_set_loading('#tab-upload');                          
-                       
+               js_log("doUploadInteface::");
+               var _this = this;
+               //set it to loading:
+               mv_set_loading('#tab-upload');
+
                //do config variable reality checks:
                if( _this.upload_api_target == 'local' ){
                        if( ! _this.local_wiki_api_url ){
@@ -570,15 +570,15 @@ remoteSearchDriver.prototype = {
                                return false;
                        }else{
                                _this.upload_api_target = _this.local_wiki_api_url;
-                       }                       
+                       }
                }
-               //make sure we have a url for the upload target: 
+               //make sure we have a url for the upload target:
                if(  parseUri( _this.upload_api_target ).host ==  _this.upload_api_target ){
                        $j('#tab-upload').html( gM('rsd_config_error', 'bad_api_url') );
                        return false;
                }
-               //output the form               
-               //set the form action based on domain: 
+               //output the form
+               //set the form action based on domain:
                if( parseUri( document.URL ).host == parseUri( _this.upload_api_target ).host ){
                        mvJsLoader.doLoad(['$j.fn.simpleUploadForm'],function(){
                                //deal with the api form upload form directly:
@@ -586,36 +586,36 @@ remoteSearchDriver.prototype = {
                                        "api_target" :  _this.upload_api_target ,
                                        "ondone_cb"     : function( resultData ){
                                                var cat = resultData;
-                                               debugger;                                                       
+                                               debugger;
                                                return false;
                                        }
                                })
-                       });     
+                       });
                }else{
-                       //setup the proxy  
+                       //setup the proxy
                        js_log('do proxy:: ' + parseUri( _this.upload_api_target ).host);
                        $j('#tab-upload').html('proxy upload not yet ready');
-               }                                                       
+               }
        },
-       runSearch: function(){          
+       runSearch: function(){
                js_log("f:runSearch::" + this.disp_item);
                //draw_direct_flag
-               var draw_direct_flag = true;                                    
-               if( !this.content_providers[this.disp_item] ){                  
-                       //check if its the special upload tab case: 
+               var draw_direct_flag = true;
+               if( !this.content_providers[this.disp_item] ){
+                       //check if its the special upload tab case:
                        if( this.disp_item == 'upload'){
-                               this.doUploadInteface();                                
+                               this.doUploadInteface();
                        }else{
-                               js_log("can't run search for:" + this.disp_item);                                                       
+                               js_log("can't run search for:" + this.disp_item);
                        }
                        return false;
-               }                       
-               cp = this.content_providers[this.disp_item];    
-       
+               }
+               cp = this.content_providers[this.disp_item];
+
                //check if we need to update:
                if( typeof cp.sObj != 'undefined' ){
                        if(cp.sObj.last_query == $j('#rsd_q').val() && cp.sObj.last_offset == cp.offset){
-                               js_log('last query is: ' + cp.sObj.last_query + ' matches: ' +  $j('#rsd_q').val() );                           
+                               js_log('last query is: ' + cp.sObj.last_query + ' matches: ' +  $j('#rsd_q').val() );
                        }else{
                                js_log('last query is: ' + cp.sObj.last_query + ' not match: ' +  $j('#rsd_q').val() );
                                draw_direct_flag = false;
@@ -623,20 +623,20 @@ remoteSearchDriver.prototype = {
                }else{
                        draw_direct_flag = false;
                }
-               if( !draw_direct_flag ){                
+               if( !draw_direct_flag ){
                        //set the content to loading while we do the search:
                        $j('#tab-' + this.disp_item).html( mv_get_loading_img() );
-       
+
                        //make sure the search library is loaded and issue the search request
                        this.getLibSearchResults( cp );
-               }                                       
+               }
        },
        //issue a api request & cache the result
        //this check can be avoided by setting the this.import_url_mode = 'api' | 'form' | insted of 'autodetect' or 'none'
        checkForCopyURLSupport:function ( callback ){
                var _this = this;
                js_log('checkForCopyURLSupport:: ');
-               //see if we already have the import mode: 
+               //see if we already have the import mode:
                if( this.import_url_mode != 'autodetect'){
                        js_log('import mode: ' + _this.import_url_mode);
                        callback();
@@ -644,28 +644,28 @@ remoteSearchDriver.prototype = {
                //if we don't have the local wiki api defined we can't auto-detect use "link"
                if(!_this.local_wiki_api_url){
                        js_log('import mode: remote link (no import_wiki_api_url)');
-                       _this.import_url_mode = 'remote_link';  
+                       _this.import_url_mode = 'remote_link';
                        callback();
                }
                if( this.import_url_mode == 'autodetect' ){
                        do_api_req( {
                                'data': { 'action':'paraminfo', 'modules':'upload' },
                                'url': _this.local_wiki_api_url
-                       }, function(data){                                      
-                               if( typeof data.paraminfo.modules[0].classname == 'undefined'){                                                                 
+                       }, function(data){
+                               if( typeof data.paraminfo.modules[0].classname == 'undefined'){
                                        //@@todo would be nice if API permission on: action=query&meta=userinfo&uiprop=rights
-                                       // upload_by_url property reflected if $wgAllowCopyUploads config value .. oh well.                                                             
+                                       // upload_by_url property reflected if $wgAllowCopyUploads config value .. oh well.
                                        $j.ajax({
                                                type: "GET",
                                                dataType: 'html',
                                                url: wgArticlePath.replace( '$1', 'Special:Upload' ), //@@todo may have problems in localized special pages
                                                                                                                           //(could hit meta=siteinfo & specialpagealiases )
-                                                                                                                          // but might be overkill for now cuz we want to switch to new-upload branch soon. 
-                                               success: function( form_html ){                                         
+                                                                                                                          // but might be overkill for now cuz we want to switch to new-upload branch soon.
+                                               success: function( form_html ){
                                                        if( form_html.indexOf( 'wpUploadFileURL' ) != -1){
-                                                               _this.import_url_mode = 'form';                                                                         
+                                                               _this.import_url_mode = 'form';
                                                        }else{
-                                                               _this.import_url_mode = 'none';                                         
+                                                               _this.import_url_mode = 'none';
                                                        }
                                                        js_log('import mode: ' + _this.import_url_mode);
                                                        callback();
@@ -673,62 +673,62 @@ remoteSearchDriver.prototype = {
                                                error: function(){
                                                        js_log('error in getting Special:Upload page');
                                                        _this.import_url_mode = 'none';
-                                               
+
                                                        js_log('import mode: ' + _this.import_url_mode);
                                                        callback();
                                                }
                                        });
-                               }else{                          
-                                       for( var i in data.paraminfo.modules[0].parameters ){                                   
-                                               var pname = data.paraminfo.modules[0].parameters[i].name;                                       
+                               }else{
+                                       for( var i in data.paraminfo.modules[0].parameters ){
+                                               var pname = data.paraminfo.modules[0].parameters[i].name;
                                                if( pname == 'url' ){
-                                                       js_log( 'Autodetect Upload Mode: api: copy by url:: ' );                                                
+                                                       js_log( 'Autodetect Upload Mode: api: copy by url:: ' );
                                                        //check permission  too:
                                                        _this.checkForCopyURLPermission(function( canCopyUrl ){
                                                                if(canCopyUrl){
                                                                        _this.import_url_mode = 'api';
                                                                        js_log('import mode: ' + _this.import_url_mode);
-                                                                       callback();                                                     
+                                                                       callback();
                                                                }else{
                                                                        _this.import_url_mode = 'none';
                                                                        js_log('import mode: ' + _this.import_url_mode);
                                                                        callback();
                                                                }
                                                        });
-                                                       break;                                  
+                                                       break;
                                                }
-                                       }                       
+                                       }
                                }
-                       });             
+                       });
                }
        },
        /*
        * checkForCopyURLPermission:
        * not really nessesary the api request to upload will return apopprirate error if the user lacks permission. or $wgAllowCopyUploads is set to false
        * (use this function if we want to issue a warning up front)
-       */ 
+       */
        checkForCopyURLPermission:function( callback ){
                var _this = this;
-               //do api check:         
+               //do api check:
                do_api_req( {
                                'data':{ 'action' : 'query', 'meta' : 'userinfo', 'uiprop' : 'rights' },
                                'url': _this.local_wiki_api_url,
                                'userinfo' : true
-               }, function(data){                      
-                       for( var i in data.query.userinfo.rights){      
+               }, function(data){
+                       for( var i in data.query.userinfo.rights){
                                var right = data.query.userinfo.rights[i];
-                               //js_log('checking: ' + right ) ;               
+                               //js_log('checking: ' + right ) ;
                                if(right == 'upload_by_url'){
-                                       callback( true );                       
+                                       callback( true );
                                        return true; //break out of the function
                                }
                        }
-                       callback( false );                              
+                       callback( false );
                });
        },
        getLibSearchResults:function( cp ){
-               var _this = this;       
-       
+               var _this = this;
+
                //first check if we should even run the search at all (can we import / insert into the page? )
                if( !this.checkRepoLocal( cp ) && this.import_url_mode == 'autodetect' ){
                        //cp is not local check if we can support the import mode:
@@ -740,86 +740,86 @@ remoteSearchDriver.prototype = {
                        if(  this.disp_item == 'combined' ){
                                //combined results are harder to error handle just ignore that repo
                                cp.sObj.loading = false;
-                       }else{                                                  
-                               $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>');                     
+                       }else{
+                               $j('#tab-' + this.disp_item).html( '<div style="padding:10px">'+ gM('no_import_by_url') +'</div>');
                        }
                        return false;
                }
-               //set up the library req:               
+               //set up the library req:
                mvJsLoader.doLoad( [
-                       'baseRemoteSearch',  
-                       cp.lib +'Search' 
+                       'baseRemoteSearch',
+                       cp.lib +'Search'
                ], function(){
-                       js_log("loaded .. disp is: " + _this.disp_item);        
+                       js_log("loaded .. disp is: " + _this.disp_item);
                        //else we need to run the search:
-                       var iObj = {'cp':cp, 'rsd':_this};              
+                       var iObj = {'cp':cp, 'rsd':_this};
                        eval('cp.sObj = new '+cp.lib+'Search( iObj );');
                        if(!cp.sObj)
                                js_log('Error: could not find search lib for ' + cp_id);
-               
+
                        //inherit defaults if not set:
                        cp.limit = (cp.limit) ? cp.limit : cp.sObj.limit;
                        cp.offset = (cp.offset) ? cp.offset : cp.sObj.offset;
-                                       
-                       //do search     
-                       cp.sObj.getSearchResults();                     
-                       _this.checkResultsDone();                       
+
+                       //do search
+                       cp.sObj.getSearchResults();
+                       _this.checkResultsDone();
                });
        },
        /* check for all the results to finish */
-       checkResultsDone: function(){           
+       checkResultsDone: function(){
                //js_log('rsd:checkResultsDone');
                var _this = this;
-               var loading_done = true;                                
-               
+               var loading_done = true;
+
                for(var cp_id in  this.content_providers){
                        var cp = this.content_providers[ cp_id ];
                        if(typeof cp['sObj'] != 'undefined'){
                                if( cp.sObj.loading )
                                        loading_done=false;
                        }
-               }               
-               if( loading_done ){                     
+               }
+               if( loading_done ){
                        this.drawOutputResults();
-               }else{                  
+               }else{
                        //make sure the instance name is up-to-date refrence to _this;
                        eval( _this.instance_name + ' = _this');
                        setTimeout( _this.instance_name + '.checkResultsDone()', 50);
-               }               
+               }
        },
        drawTabs: function(){
-               var _this = this;       
+               var _this = this;
                //add the tabs to the rsd_results container:
                var o='<div id="rsd_tabs_container" style="width:100%;">';
                var selected_tab = 0;
                var inx =0;
-               o+= '<ul>';                             
-                       var tabc = '';          
+               o+= '<ul>';
+                       var tabc = '';
                        for(var cp_id in  this.content_providers){
                                        var cp = this.content_providers[cp_id];
-                                       if( cp.enabled && cp.checked && cp.api_url){                                    
+                                       if( cp.enabled && cp.checked && cp.api_url){
                                                //add selected default if set
                                                if( this.disp_item == cp_id)
                                                        selected_tab=inx;
-                                                                               
+
                                                o+='<li class="rsd_cp_tab">';
                                                o+='<a id="rsd_tab_' + cp_id + '" href="#tab-' + cp_id + '">';
                                                        if(cp.tab_img === true){
-                                                               o+='<img alt="' + cp.title +'" src="' + mv_skin_img_path + 'remote_cp/' + cp_id + '_tab.png">';                 
+                                                               o+='<img alt="' + cp.title +'" src="' + mv_skin_img_path + 'remote_cp/' + cp_id + '_tab.png">';
                                                        }else{
                                                                o+= cp.title;
                                                        }
                                                o+='</a>';
                                                o+='</li>';
                                                inx++;
-                                       }                                       
+                                       }
                                        tabc+='<div id="tab-'+ cp_id +'" class="rsd_results"/>';
-                                                                                       
+
                        }
                        //do an upload tab if enabled:
-                       if( this.enable_upload_tab ){                   
+                       if( this.enable_upload_tab ){
                                o+='<li class="rsd_cp_tab" ><a id="rsd_tab_upload" href="#tab-upload">' + gM('upload_tab') + '</a></li>';
-                               tabc+='<div id="tab-upload" />';                
+                               tabc+='<div id="tab-upload" />';
                                if(this.disp_item == 'upload')
                                        selected_tab = inx++;
                        }
@@ -827,39 +827,39 @@ remoteSearchDriver.prototype = {
                        //output the tab content containers:
                        o+=tabc;
                o+='</div>'; //close tab container
-       
-               //output the respective results holders         
-               $j('#rsd_results_container').html(o);   
+
+               //output the respective results holders
+               $j('#rsd_results_container').html(o);
                //setup bindings for tabs make them sortable: (@@todo remember order)
-               js_log('selected tab is: ' + selected_tab);     
+               js_log('selected tab is: ' + selected_tab);
                $j("#rsd_tabs_container").tabs({
                        selected:selected_tab,
-                       select: function(event, ui) {                                                                   
+                       select: function(event, ui) {
                                _this.selectTab( $j(ui.tab).attr('id').replace('rsd_tab_', '') );
-                       }               
+                       }
                //add sorting
                }).find(".ui-tabs-nav").sortable({axis:'x'});
-               
+
                /*$j('.rsd_cp_tab').click(function(){
                        _this.selectTab( $j(this).attr('id').replace(/rsd_tab_/, '') );
                });*/
-       
+
                //setup key binding (no longer nessesary tabs provide this functionality)
                /*$j().keyup(function(e){
-                       js_log('keyup on : ' +e.which );                        
+                       js_log('keyup on : ' +e.which );
                        //if escape pressed clear the interface:
                        if(e.which == 27)
-                               _this.closeAll();               
-               });*/ 
-       
+                               _this.closeAll();
+               });*/
+
        },
-       //resource title                
+       //resource title
        getResourceFromTitle:function( rTitle , callback){
                var _this = this;
                reqObj={
                        'action':'query',
                        'titles': _this.cFileNS + ':' + rTitle
-               };                                                      
+               };
                do_api_req( {
                        'data':reqObj,
                        'url':this.local_wiki_api_url
@@ -877,9 +877,9 @@ remoteSearchDriver.prototype = {
                for(var cp_id in  this.content_providers){
                        cp = this.content_providers[ cp_id ];
                        if(rid.indexOf( cp_id ) != -1){
-                               rid = rid.replace( cp_id + '_','');             
+                               rid = rid.replace( cp_id + '_','');
                                if(     cp['sObj']){
-                                       for(var rInx in cp.sObj.resultsObj){                    
+                                       for(var rInx in cp.sObj.resultsObj){
                                                if( rInx == rid )
                                                        return cp.sObj.resultsObj[rInx];
                                        };
@@ -889,31 +889,31 @@ remoteSearchDriver.prototype = {
                js_log("ERROR: could not find " + rid);
                return false;
        },
-       drawOutputResults: function(){  
-               js_log('f:drawOutputResults::' + this.disp_item);                               
-               var _this = this;               
+       drawOutputResults: function(){
+               js_log('f:drawOutputResults::' + this.disp_item);
+               var _this = this;
                var o='';
-       
+
                var cp_id = this.disp_item;
                var cp = this.content_providers[this.disp_item];
-               
+
                //empty the existing results:
                $j('#tab-' + cp_id).empty();
-       
+
                //output the results bar / controls
                _this.setResultBarControl();
-                       
+
                var drawResultCount     =0;
-       
-               //output all the results for the current disp_item              
-               if( typeof cp['sObj'] != 'undefined' ){                         
-                       $j.each(cp.sObj.resultsObj, function(rInx, rItem){                                                                                                      
+
+               //output all the results for the current disp_item
+               if( typeof cp['sObj'] != 'undefined' ){
+                       $j.each(cp.sObj.resultsObj, function(rInx, rItem){
                                if( _this.result_display_mode == 'box' ){
                                        o+='<div id="mv_result_' + rInx + '" class="mv_clip_box_result" style="width:' +
                                                        _this.thumb_width + 'px;height:'+ (_this.thumb_width-20) +'px;position:relative;">';
                                                //check for missing poster types for audio
                                                if( rItem.mime=='audio/ogg' && !rItem.poster ){
-                                                       rItem.poster = mv_skin_img_path + 'sound_music_icon-80.png';                                                            
+                                                       rItem.poster = mv_skin_img_path + 'sound_music_icon-80.png';
                                                }
                                                //get a thumb with proper resolution transform if possible:
                                                o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '_' + rInx +
@@ -925,49 +925,49 @@ remoteSearchDriver.prototype = {
                                                        o+='<a target="_new" style="position:absolute;top:0px;right:0px" title="' +
                                                                 gM('resource_description_page') +
                                                                '" href="' + rItem.link + '"><img src="http://upload.wikimedia.org/wikipedia/commons/6/6b/Magnify-clip.png"></a>';
-                                               //add license icons if present                  
+                                               //add license icons if present
                                                if( rItem.license )
-                                                       o+= _this.getlicenseImgSet( rItem.license );                                                                                                                                                                                                                            
+                                                       o+= _this.getlicenseImgSet( rItem.license );
                                        o+='</div>';
                                }else if(_this.result_display_mode == 'list'){
-                                       o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="width:90%">';                           
+                                       o+='<div id="mv_result_' + rInx + '" class="mv_clip_list_result" style="width:90%">';
                                                o+='<img title="'+rItem.title+'" class="rsd_res_item" id="res_' + cp_id + '_' + rInx +'" style="float:left;width:' +
                                                                 _this.thumb_width + 'px;" src="' +
                                                                 cp.sObj.getImageTransform( rItem, {'width':_this.thumb_width } )
-                                                                 + '">';                                                               
-                                               //add license icons if present                  
+                                                                 + '">';
+                                               //add license icons if present
                                                if( rItem.license )
-                                                       o+= _this.getlicenseImgSet( rItem.license );                                                    
-                                       
-                                               o+= rItem.desc ;                                
-                                       o+='<div style="clear:both" />';                
-                                       o+='</div>';                                    
-                               }                       
-                               drawResultCount++;                                              
-                       });             
+                                                       o+= _this.getlicenseImgSet( rItem.license );
+
+                                               o+= rItem.desc ;
+                                       o+='<div style="clear:both" />';
+                                       o+='</div>';
+                               }
+                               drawResultCount++;
+                       });
                        js_log('append to: ' + '#tab-' + cp_id);
                        //put in the tab output (plus clear the output)
-                       $j('#tab-' + cp_id).append( o + '<div style="clear:both"/>');                                           
+                       $j('#tab-' + cp_id).append( o + '<div style="clear:both"/>');
                }
-       
+
                js_log( ' drawResultCount :: ' + drawResultCount + ' append: ' + $j('#rsd_q').val() );
-       
+
                //remove any old search res
                $j('#rsd_no_search_res').remove();
                if( drawResultCount == 0 )
-                       $j('#tab-' + cp_id).append( '<span style="padding:10px">' + gM( 'rsd_no_results', $j('#rsd_q').val() ) + '</span>');                                    
-                                                       
+                       $j('#tab-' + cp_id).append( '<span style="padding:10px">' + gM( 'rsd_no_results', $j('#rsd_q').val() ) + '</span>');
+
                this.addResultBindings();
        },
        addResultBindings:function(){
-               var _this = this;                               
+               var _this = this;
                $j('.mv_clip_'+_this.result_display_mode+'_result').hover(function(){
                        $j(this).addClass('mv_clip_'+_this.result_display_mode+'_result_over');
                        //also set the animated image if avaliable
                        var res_id = $j(this).children('.rsd_res_item').attr('id');
                        var rObj = _this.getResourceFromId( res_id );
-                       if( rObj.poster_ani )                   
-                               $j('#' + res_id ).attr('src', rObj.poster_ani);         
+                       if( rObj.poster_ani )
+                               $j('#' + res_id ).attr('src', rObj.poster_ani);
                },function(){
                        $j(this).removeClass('mv_clip_'+_this.result_display_mode+'_result_over');
                        var res_id = $j(this).children('.rsd_res_item').attr('id');
@@ -975,23 +975,23 @@ remoteSearchDriver.prototype = {
                        //restore the original (non animated)
                        if( rObj.poster_ani )
                                $j('#' + res_id ).attr('src', rObj.poster);
-               });                     
-               //resource click action: (bring up the resource editor)         
+               });
+               //resource click action: (bring up the resource editor)
                $j('.rsd_res_item').unbind().click(function(){
-                       var rObj = _this.getResourceFromId( $j(this).attr("id") );                                                                                              
-                       _this.resourceEdit( rObj, this );                                                                       
+                       var rObj = _this.getResourceFromId( $j(this).attr("id") );
+                       _this.resourceEdit( rObj, this );
                });
        },
        resourceEdit:function( rObj, rsdElement){
-               js_log('f:resourceEdit:' + rObj.title); 
+               js_log('f:resourceEdit:' + rObj.title);
                var _this = this;
                //remove any existing resource edit interface:
-               $j('#rsd_resource_edit').remove();                      
+               $j('#rsd_resource_edit').remove();
                //set the media type:
-               if(rObj.mime.indexOf('image')!=-1){                             
+               if(rObj.mime.indexOf('image')!=-1){
                        //set width to default image_edit_width
-                       var maxWidth = _this.image_edit_width;  
-                       var mediaType = 'image';                                                                                                
+                       var maxWidth = _this.image_edit_width;
+                       var mediaType = 'image';
                }else if(rObj.mime.indexOf('audio')!=-1){
                        var maxWidth = _this.video_edit_width;
                        var mediaType = 'audio';
@@ -999,44 +999,44 @@ remoteSearchDriver.prototype = {
                        //set to default video size:
                        var maxWidth = _this.video_edit_width;
                        var mediaType = 'video';
-               }       
+               }
                //so that transcripts show ontop
                var overflow_style = ( mediaType =='video' )?'':'overflow:auto;';
                //append to the top level of model window:
                $j( _this.target_container ).append('<div id="rsd_resource_edit" '+
-                       'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' +                      
+                       'style="position:absolute;top:0px;left:0px;bottom:5px;right:4px;background-color:#FFF;">' +
                                '<div id="clip_edit_disp" style="position:absolute;' + overflow_style + 'width:100%;height:100%;padding:5px;'+
                                        'width:' + (maxWidth) + 'px;" >' +
                                                mv_get_loading_img('position:absolute;top:30px;left:30px') +
                                '</div>'+
                                '<div id="clip_edit_ctrl" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;'+
                                        'left:' + ( maxWidth + 10 ) +'px;top:5px;bottom:10px;right:0px;overflow:auto;padding:5px;">'+
-                                               mv_get_loading_img() +                                   
+                                               mv_get_loading_img() +
                                '</div>'+
-                       '</div>');                      
+                       '</div>');
                //update add media wizard title:
-               $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')+': '+ gM('rsd_resource_edit', rObj.title ) );             
+               $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard')+': '+ gM('rsd_resource_edit', rObj.title ) );
                js_log('did append to: '+ _this.target_container );
-       
+
                $j('#rsd_resource_edit').css('opacity',0);
-       
+
                $j('#rsd_edit_img').remove();//remove any existing rsd_edit_img
-       
-               //left side holds the image right size the controls /                                                                                                           
+
+               //left side holds the image right size the controls /
                $j(rsdElement).clone().attr('id', 'rsd_edit_img').appendTo('#clip_edit_disp').css({
                        'position':'absolute',
                        'top':'40%',
                        'left':'20%',
                        'cursor':'default',
                        'opacity':0
-               });             
-                                                       
-       
-               //assume we keep aspect ratio for the thumbnail that we clicked:                
+               });
+
+
+               //assume we keep aspect ratio for the thumbnail that we clicked:
                var tRatio = $j(rsdElement).height() / $j(rsdElement).width();
-               if(     ! tRatio )      
+               if(     ! tRatio )
                        var tRatio = 1; //set ratio to 1 if the width of the thumbnail can't be found for some reason
-       
+
                js_log('set from ' +  $j('#rsd_edit_img').width()+'x'+ $j('#rsd_edit_img').height() + ' to init thumbimage to ' + maxWidth + ' x ' + parseInt( tRatio * maxWidth) );
                //scale up image and to swap with high res version
                $j('#rsd_edit_img').animate({
@@ -1046,10 +1046,10 @@ remoteSearchDriver.prototype = {
                        'width': maxWidth + 'px',
                        'height': parseInt( tRatio * maxWidth)  + 'px'
                }, "slow"); // do it slow to give it a chance to finish loading the HQ version
-       
+
                if( mediaType == 'image' ){
-                       _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){                           
-                               $j('.mv_loading_img').remove();                         
+                       _this.loadHQImg(rObj, {'width':maxWidth}, 'rsd_edit_img', function(){
+                               $j('.mv_loading_img').remove();
                        });
                }
                //also fade in the container:
@@ -1057,21 +1057,21 @@ remoteSearchDriver.prototype = {
                        'opacity':1,
                        'background-color':'#FFF',
                        'z-index':99
-               });             
+               });
                js_log('do load the media editor:');
                //do load the media Editor
                _this.doMediaEdit( rObj , mediaType );
        },
-       loadHQImg:function(rObj, size, target_img_id, callback){        
+       loadHQImg:function(rObj, size, target_img_id, callback){
                //get the HQ image url:
-               rObj.pSobj.getImageObj( rObj, size, function( imObj ){          
+               rObj.pSobj.getImageObj( rObj, size, function( imObj ){
                        rObj['edit_url'] = imObj.url;
-               
+
                        js_log("edit url: " + rObj.edit_url);
-                       //update the rObj                       
+                       //update the rObj
                        rObj['width'] = imObj.width;
                        rObj['height'] = imObj.height;
-                       
+
                        //see if we need to animate some transition
                        var newSize = false;
                        if( size.width != imObj.width ){
@@ -1079,117 +1079,117 @@ remoteSearchDriver.prototype = {
                                newSize={
                                        'width':imObj.width + 'px',
                                        'height':imObj.height + 'px'
-                               }               
+                               }
                                //set the target id to the new size:
                                $j('#'+target_img_id).animate( newSize );
-                       }else{  
+                       }else{
                                js_log('using req size: ' + imObj.width + 'x' + imObj.height);
                                $j('#'+target_img_id).animate( {'width':imObj.width+'px', 'height' : imObj.height + 'px'});
                        }
                        //don't swap it in until its loaded:
-                       var img = new Image();  
-                       // load the image image:                                
+                       var img = new Image();
+                       // load the image image:
                        $j(img).load(function () {
-                                        $j('#'+target_img_id).attr('src', rObj.edit_url );                             
+                                        $j('#'+target_img_id).attr('src', rObj.edit_url );
                                         //let the caller know we are done and what size we ended up with:
-                                        callback();                                    
+                                        callback();
                                }).error(function () {
                                        js_log("Error with:  " +  rObj.edit_url);
-                               }).attr('src', rObj.edit_url);  
-                       });     
+                               }).attr('src', rObj.edit_url);
+                       });
        },
-       cancelClipEditCB:function(){            
-               var _this = this;               
+       cancelClipEditCB:function(){
+               var _this = this;
                var b_target =   _this.target_container + '~ .ui-dialog-buttonpane';
                $j('#rsd_resource_edit').remove();
-               //restore the title: 
+               //restore the title:
                $j( _this.target_container ).dialog( 'option', 'title', gM('add_media_wizard'));
                js_log("should update: " + b_target + ' with: cancel');
-               //restore the buttons: 
+               //restore the buttons:
                $j(b_target).html( $j.btnHtml( 'Cancel' , 'mv_cancel_rsd', 'close'))
                        .children('.mv_cancel_rsd')
                        .btnBind()
                        .click(function(){
-                               $j( _this.target_container).dialog('close');                                                                                                    
+                               $j( _this.target_container).dialog('close');
                        })
-                                                                                       
+
        },
        /*set-up the control actions for clipEdit with relevent callbacks */
        getClipEditControlActions:function( cp ){
                var _this = this;
                var cConf= {};
-               
+
                cConf['insert'] = function(rObj){
                        _this.insertResource(rObj);
                }
                //if not directly inserting the resource is support a preview option:
-               if( _this.import_url_mode != 'remote_link'){                    
+               if( _this.import_url_mode != 'remote_link'){
                        cConf['preview'] = function(rObj){
                                _this.previewResource( rObj )
                        };
                }
-               cConf['cancel'] = function(){                   
+               cConf['cancel'] = function(){
                        _this.cancelClipEditCB()
-               }                                               
+               }
                return cConf;
        },
        //loads the media editor:
        doMediaEdit:function( rObj , mediaType){
-               var _this = this;       
-               var cp = rObj.pSobj.cp;                                                         
+               var _this = this;
+               var cp = rObj.pSobj.cp;
                var mvClipInit = {
                                'rObj':rObj, //the resource object
                                'parent_ct'                     : 'rsd_modal_target',
                                'clip_disp_ct'          : 'clip_edit_disp',
-                               'control_ct'            : 'clip_edit_ctrl',                                                             
+                               'control_ct'            : 'clip_edit_ctrl',
                                'media_type'            : mediaType,
-                               'p_rsdObj'                      : _this,                
-                               'controlActionsCb'      : _this.getClipEditControlActions( cp )                                                                                 
-               };      
-               
+                               'p_rsdObj'                      : _this,
+                               'controlActionsCb'      : _this.getClipEditControlActions( cp )
+               };
+
                var clibs = ['mvClipEdit'];
                if( mediaType == 'image'){
                        //display the mvClipEdit obj once we are done loading:
-                       mvJsLoader.doLoad( clibs, function(){                   
+                       mvJsLoader.doLoad( clibs, function(){
                                //run the image clip tools
                                _this.cEdit = new mvClipEdit( mvClipInit );
-                       });                     
+                       });
                }
                if( mediaType == 'video' || mediaType == 'audio'){
                        //get any additonal embedding helper meta data prior to doing the acutal embed
                        // normally this meta should be provided in the search result (but archive.org has a seperate query for more meida meta)
-                       rObj.pSobj.getEmbedTimeMeta( rObj, function(){                                                                                          
-                               //make sure we have the embedVideo libs:                        
+                       rObj.pSobj.getEmbedTimeMeta( rObj, function(){
+                               //make sure we have the embedVideo libs:
                                mvJsLoader.embedVideoCheck( function(){
                                        js_log('append html: ' + rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'}) );
                                        $j('#clip_edit_disp').html(
                                                rObj.pSobj.getEmbedHTML( rObj, {id:'embed_vid'})
                                        );
                                        //rewrite by id
-                                       rewrite_by_id('embed_vid',function(){                   
+                                       rewrite_by_id('embed_vid',function(){
                                                //grab any information that we got from the ROE xml or parsed from the media file
                                                rObj.pSobj.getEmbedObjParsedInfo( rObj, 'embed_vid' );
-                                               //add the re-sizable to the doLoad request:                     
+                                               //add the re-sizable to the doLoad request:
                                                clibs.push( '$j.ui.resizable');
                                                clibs.push( '$j.fn.hoverIntent');
-                                               mvJsLoader.doLoad(clibs, function(){                                                    
+                                               mvJsLoader.doLoad(clibs, function(){
                                                        //make sure the rsd_edit_img is hidden:
-                                                       $j('#rsd_edit_img').remove();                                                                                                                                                           
+                                                       $j('#rsd_edit_img').remove();
                                                        //run the image clip tools
                                                        _this.cEdit = new mvClipEdit( mvClipInit );
                                                });
                                        });
                                });
                        });
-               }               
+               }
        },
-       checkRepoLocal:function( cp ){                          
+       checkRepoLocal:function( cp ){
                if( cp.local ){
                        return true;
                }else{
-                       //check if we can embed the content locally per a domain name check:            
+                       //check if we can embed the content locally per a domain name check:
                        var local_host = parseUri( this.local_wiki_api_url ).host;
-                       if( cp.local_domains ) {                                                        
+                       if( cp.local_domains ) {
                                for(var i=0;i < cp.local_domains.length; i++){
                                        var ld = cp.local_domains[i];
                                         if( local_host.indexOf( ld ) != -1)
@@ -1197,35 +1197,35 @@ remoteSearchDriver.prototype = {
                                }
                        }
                        return false;
-               }       
+               }
        },
-       checkImportResource:function( rObj, cir_callback){      
+       checkImportResource:function( rObj, cir_callback){
                //@@todo get the localized File/Image namespace name or do a general {NS}:Title
                var cp = rObj.pSobj.cp;
-               var _this = this;                               
-               
-               //update base target_resource_title:            
+               var _this = this;
+
+               //update base target_resource_title:
                rObj.target_resource_title = rObj.titleKey.replace(/File:|Image:/,'')
-               
+
                //check if local repository
-               //or if import mode if just "linking" (we should alaredy have the 'url' 
-       
+               //or if import mode if just "linking" (we should alaredy have the 'url'
+
                if( this.checkRepoLocal( cp ) || this.import_url_mode == 'remote_link'){
                        //local repo jump directly to check Import Resource callback:
                         cir_callback( rObj );
-               }else{                                                                          
-                       //update target_resource_title with resource repository prefix:                         
-                       rObj.target_resource_title = cp.resource_prefix + rObj.target_resource_title; 
-               
-                       //check if the resource is not already on this wiki             
+               }else{
+                       //update target_resource_title with resource repository prefix:
+                       rObj.target_resource_title = cp.resource_prefix + rObj.target_resource_title;
+
+                       //check if the resource is not already on this wiki
                        reqObj={
-                               'action':'query', 
+                               'action':'query',
                                'titles': _this.cFileNS + ':' + rObj.target_resource_title,
                                'prop'          : 'imageinfo',
                                'iiprop'        : 'url',
-                               'iiurlwidth': '400'                             
-                       };                              
-               
+                               'iiurlwidth': '400'
+                       };
+
                        do_api_req( {
                                'data':reqObj,
                                'url':this.local_wiki_api_url
@@ -1235,56 +1235,56 @@ remoteSearchDriver.prototype = {
                                                if( i != '-1' && i != '-2' ){
                                                        js_log('found title: ' + i + ':' +  data.query.pages[i]['title']);
                                                        found_title=data.query.pages[i]['title'];
-                                                       //update to local src                                           
+                                                       //update to local src
                                                        rObj.local_src = data.query.pages[i]['imageinfo'][0].url;
-                                                       //@@todo maybe  update poster too?                      
-                                                       rObj.local_poster = data.query.pages[i]['imageinfo'][0].thumburl;                               
+                                                       //@@todo maybe  update poster too?
+                                                       rObj.local_poster = data.query.pages[i]['imageinfo'][0].thumburl;
                                                }
-                                       }               
-                                       if( found_title ){                      
-                                               js_log("checkImportResource:found title:" + found_title); 
+                                       }
+                                       if( found_title ){
+                                               js_log("checkImportResource:found title:" + found_title);
                                                //resource is already present (or resource with same name is already present)
-                                               rObj.target_resource_title = found_title.replace(/File:|Image:/,'');                                                            
+                                               rObj.target_resource_title = found_title.replace(/File:|Image:/,'');
                                                cir_callback( rObj );
                                        }else{
                                                js_log("resource not present: update:"+ _this.cFileNS + ':' + rObj.target_resource_title);
-                                       
+
                                                //update the rObj with import info
-                                               rObj.pSobj.updateDataForImport( rObj );                                                                 
-                               
-                                               //setup the resource description from resource description:                                     
+                                               rObj.pSobj.updateDataForImport( rObj );
+
+                                               //setup the resource description from resource description:
                                                var wt = '{{Information '+"\n";
-                                                                                               
-                                               if( rObj.desc ){                                                                        
+
+                                               if( rObj.desc ){
                                                        wt += '|Description= ' + rObj.desc + "\n";
                                                }else{
                                                        wt += '|Description= ' + gM('missing_desc_see_soruce', rObj.link ) + "\n";
                                                }
-                                                       
+
                                                //output person and bill info if
                                                wt+='|Source=' + rObj.pSobj.getImportResourceDescWiki( rObj ) + "\n";
-                                       
+
                                                if( rObj.author )
-                                                       wt+='|Author=' + rObj.author +"\n";                                                                     
-                                               
+                                                       wt+='|Author=' + rObj.author +"\n";
+
                                                if( rObj.date )
-                                                       wt+='|Date=' + rObj.date +"\n";                                                 
-                                       
-                                               //add the Permision info:                                               
+                                                       wt+='|Date=' + rObj.date +"\n";
+
+                                               //add the Permision info:
                                                wt+='|Permission=' + rObj.pSobj.getPermissionWikiTag( rObj ) +"\n";
-                                               
+
                                                if( rObj.other_versions )
                                                        wt+='|other_versions=' + rObj.other_versions + "\n";
-                                                                                       
+
                                                wt+='}}';
                                                //get any extra categories or helpful links
                                                wt+= rObj.pSobj.getExtraResourceDescWiki( rObj );
-                               
-                                       
+
+
                                                $j('#rsd_resource_import').remove();//remove any old resource imports
                                                //@@ show user dialog to import the resource
                                                $j( _this.target_container ).append('<div id="rsd_resource_import" '+
-                                               'class="ui-state-highlight ui-widget-content ui-state-error" ' + 
+                                               'class="ui-state-highlight ui-widget-content ui-state-error" ' +
                                                'style="position:absolute;top:50px;left:50px;right:50px;bottom:50px;z-index:5">' +
                                                        '<h3 style="color:red">Resource: <span style="color:black">' + rObj.title + '</span> needs to be imported</h3>'+
                                                                '<div id="rsd_preview_import_container" style="position:absolute;width:50%;bottom:0px;left:0px;overflow:auto;top:30px;">' +
@@ -1293,36 +1293,36 @@ remoteSearchDriver.prototype = {
                                                                        '<strong>Resource Page Description:</strong>'+
                                                                        '<div id="rsd_import_desc" syle="display:inline;">'+
                                                                                mv_get_loading_img('position:absolute;top:5px;left:5px') +
-                                                                       '</div>'+                                               
+                                                                       '</div>'+
                                                                '</div>'+
                                                                '<div id="rds_edit_import_container" style="position:absolute;left:50%;' +
                                                                        'bottom:0px;top:30px;right:0px;overflow:auto;">'+
                                                                        '<strong>Local Resource Title:</strong><br>'+
                                                                        '<input type="text" size="30" value="' + rObj.target_resource_title + '" readonly="true"><br>'+
-                                                                       '<strong>Edit WikiText Resource Description:</strong>(will be replaced by forms soon)' +                                                                                                                                                                                                
+                                                                       '<strong>Edit WikiText Resource Description:</strong>(will be replaced by forms soon)' +
                                                                        '<textarea id="rsd_import_ta" id="mv_img_desc" style="width:90%;" rows="8" cols="50">' +
                                                                                wt +
                                                                        '</textarea><br>' +
                                                                        '<input type="checkbox" value="true" id="wpWatchthis" name="wpWatchthis" tabindex="7"/>' +
                                                                        '<label for="wpWatchthis">Watch this page</label><br><br><br>' +
-                                                               
+
                                                                        $j.btnHtml('Do Import Resource', 'rsd_import_doimport', 'check' ) + ' ' +
-                                                                        
+
                                                                        $j.btnHtml('Update Preview', 'rsd_import_apreview', 'refresh' ) + '<div style="clear:both;height:20px;"/>' +
-                                                               
+
                                                                        $j.btnHtml('Cancel Import', 'rsd_import_acancel', 'close' ) + ' ' +
-                                                                                                                                                       
+
                                                                '</div>'+
                                                                //output the rendered and non-renderd version of description for easy swiching:
                                                '</div>');
-                                               //add hover:                                                            
+                                               //add hover:
                                                //update video tag
                                                rewrite_by_id(_this.target_container + '_rsd_pv_vid');
-                                               //load the preview text:                                        
-                                               _this.getParsedWikiText( wt, _this.cFileNS +':'+ rObj.target_resource_title, function( o ){                                     
+                                               //load the preview text:
+                                               _this.getParsedWikiText( wt, _this.cFileNS +':'+ rObj.target_resource_title, function( o ){
                                                        $j('#rsd_import_desc').html(o);
                                                });
-                                               //add bidings:                          
+                                               //add bidings:
                                                $j( _this.target_container + ' .rsd_import_apreview').btnBind().click(function(){
                                                        /*$j('#rsd_import_desc').show().html(
                                                                mv_get_loading_img()
@@ -1333,7 +1333,7 @@ remoteSearchDriver.prototype = {
                                                                $j('#rsd_import_desc').html(o);
                                                        });
                                                });
-                                               $j(_this.target_container + ' .rsd_import_doimport').btnBind().click(function(){                                                
+                                               $j(_this.target_container + ' .rsd_import_doimport').btnBind().click(function(){
                                                        //check import mode:
                                                        if(_this.import_url_mode=='form'){
                                                                _this.doImportSpecialPage( rObj, cir_callback );
@@ -1341,31 +1341,31 @@ remoteSearchDriver.prototype = {
                                                                _this.doImportAPI( rObj , cir_callback);
                                                        }else{
                                                                js_log("Error: import mode is not form or API (can not copy asset)");
-                                                       }                       
+                                                       }
                                                });
                                                $j( _this.target_container + ' .rsd_import_acancel').btnBind().click(function(){
                                                        $j('#rsd_resource_import').fadeOut("fast",function(){
                                                                $j(this).remove();
                                                        });
-                                               });     
-                                       }                       
+                                               });
+                                       }
                                }
-                       );                                                                                              
+                       );
                }
        },
        doImportAPI:function(rObj, cir_callback){
                var _this = this;
                //baseUploadInterface
                mvJsLoader.doLoad([
-                       'mvBaseUploadInterface',                
-                       '$j.ui.progressbar'     
-               ],function(){                           
+                       'mvBaseUploadInterface',
+                       '$j.ui.progressbar'
+               ],function(){
                        //initicate a download similar to url copy:
                        myUp = new mvBaseUploadInterface({
                                'api_url' : _this.local_wiki_api_url,
                                'done_upload_cb':function(){
                                   //we have finished the upload:
-                                 
+
                                   //close up the rsd_resource_import
                                   $j('#rsd_resource_import').remove();
                                   //run the parent callback:
@@ -1378,27 +1378,27 @@ remoteSearchDriver.prototype = {
                        _this.getEditToken(function( token ){
                                myUp.etoken = token;
                                myUp.doHttpUpload({
-                                       'url'       : rObj.src,         
+                                       'url'       : rObj.src,
                                        'filename'  : rObj.target_resource_title,
-                                       'comment'   : $j('#rsd_import_ta').val()                                
+                                       'comment'   : $j('#rsd_import_ta').val()
                                });
                        })
-                       
-                       
-               });                             
+
+
+               });
        },
        getEditToken:function(callback){
-               //first try the page form: 
+               //first try the page form:
                var etoken = $j("input[name='wpEditToken']").val();
-               if(etoken){             
+               if(etoken){
                        callback( etoken );
-                       return ; 
+                       return ;
                }
-               //@@todo try to load over ajax if( _this.local_wiki_api_url ) is set 
-               // (your on the api domain but are inserting from a normal page view) 
+               //@@todo try to load over ajax if( _this.local_wiki_api_url ) is set
+               // (your on the api domain but are inserting from a normal page view)
                if( _this.local_wiki_api_url){
-                               
-               }               
+
+               }
        },
        /**
         * doImportSpecialPage
@@ -1416,62 +1416,62 @@ remoteSearchDriver.prototype = {
                        'url':_this.local_wiki_api_url
                        }, function(data){
                                //could recheck if it has been created in the mean time
-                               if( data.query.pages[-1] ){                                                             
+                               if( data.query.pages[-1] ){
                                        var editToken = data.query.pages[-1]['edittoken'];
                                        if(!editToken){
-                                               //@@todo give an ajax login or be more friendly in some way: 
+                                               //@@todo give an ajax login or be more friendly in some way:
                                                js_error("You don't have permission to upload (are you logged in?)");
                                                //remove top level:
                                                $j('#modalbox').fadeOut("normal",function(){
                                                        $j(this).remove();
                                                        $j('#mv_overlay').remove();
                                                });
-                                       }else{                                                  
+                                       }else{
                                                //not sure if we can do remote url uploads (so just do a local post)
-                                               js_log('got token for new page:' +editToken);                                                                           
+                                               js_log('got token for new page:' +editToken);
                                                var postVars = {
                                                        'wpSourceType'                  :'web',
                                                        'wpUploadFileURL'               : rObj.src,
                                                        'wpDestFile'                    : rObj.target_resource_title,
                                                        'wpUploadDescription'   : $j('#rsd_import_ta').val(),
-                                                       'wpWatchthis'                   : $j('#wpWatchthis').val(),     
-                                                       'wpUpload'                              : 'Upload file'                                                                                                                                                                                                                                                                                                                         
+                                                       'wpWatchthis'                   : $j('#wpWatchthis').val(),
+                                                       'wpUpload'                              : 'Upload file'
                                                }
-                                               //set to uploading:                                                                                                                                                                                     
-                                               $j('#rsd_resource_import').append('<div id="rsd_import_progress"'+                                                                      
+                                               //set to uploading:
+                                               $j('#rsd_resource_import').append('<div id="rsd_import_progress"'+
                                                        'style="position:absolute;top:0px;'+
-                                                               'left:0px;width:100%;height:100%;'+                                                                             
+                                                               'left:0px;width:100%;height:100%;'+
                                                                'z-index:5;background:#FFF;overflow:auto;">'+
                                                                        '<div style="position:absolute;left:30%;right:30%"><h3>Importing Asset</h3><br>' +
                                                                                mv_get_loading_img('','mv_loading_bar_img') +
-                                                                       '</div>'+                               
-                                                       '</div>'                                                                                                                                                        
-                                               );                                                      
+                                                                       '</div>'+
+                                                       '</div>'
+                                               );
                                                $j.post(wgArticlePath.replace(/\$1/,'Special:Upload'),
                                                        postVars,
-                                                       function(data){                                                                         
+                                                       function(data){
                                                                //@@todo this will be replaced once we add upload image support to the api.
-                                                       
+
                                                                //very basic test to see if we got passed to the image page:
                                                                //@@todo more normalization stuff
                                                                var sstring ='var wgPageName = "' + _this.cFileNS + ':' + rObj.target_resource_title.replace(/ /g,'_') +'"';
                                                                if(data.indexOf( sstring ) !=-1){
                                                                        js_log('found: ' + sstring);
-                                                                       $j('#rsd_resource_import').remove();                                                                            
+                                                                       $j('#rsd_resource_import').remove();
                                                                        cir_callback( rObj );
-                                                               }else{                                                                                                  
+                                                               }else{
                                                                        js_log("Error or warning: (did not find: \"" + sstring + ' in output' );
                                                                        pos_etitle = '<h1 class="firstHeading">';
-                                                                       var error_txt = form_txt = '';                                                                                                                                                                                                                                                                                                                                                                                                          
+                                                                       var error_txt = form_txt = '';
                                                                        var res = grabWikiFormError( data );
-                                                               
+
                                                                        if( res.error_txt )
                                                                                error_txt = res.error_txt;
-                                                                               
+
                                                                        if( res.form_txt )
                                                                                form_txt = res.form_txt;
-                                                                       
-                                                                       js_log( 'error text is: ' + error_txt );        
+
+                                                                       js_log( 'error text is: ' + error_txt );
                                                                        $j( '#rsd_resource_import' ).html( '<h3>Error</h3>' + error_txt + '<br>' + form_txt +
                                                                                        '<br>'+
                                                                                '<a href="#" id="rsd_import_error" >Cancel import</a>'
@@ -1481,30 +1481,30 @@ remoteSearchDriver.prototype = {
                                                                                $j('#rsd_resource_import').remove();
                                                                        });
                                                                }
-                                                               
+
                                                        }
                                                );
-                                       }                                                       
+                                       }
                                }
                        }
-               );  
+               );
        },
        previewResource:function( rObj ){
                var _this = this;
-               this.checkImportResource( rObj, function(){     
+               this.checkImportResource( rObj, function(){
                        //put another window ontop:
                        $j( _this.target_container ).append('<div id="rsd_preview_display"' +
                                        'style="position:absolute;overflow:hidden;z-index:4;top:0px;bottom:75px;right:0px;left:0px;background-color:#FFF;">' +
                                                mv_get_loading_img('top:30px;left:30px') +
                                        '</div>');
-                                       
+
                        var bPlaneTarget = _this.target_container +'~ .ui-dialog-buttonpane';
-                       var pTitle = $j( _this.target_container ).dialog('option', 'title');                    
-                       
-                       //update title: 
-                       $j( _this.target_container ).dialog('option', 'title', 'Preview Insert of Resource: ' + rObj.title );   
-                                       
-                       //update buttons preview: 
+                       var pTitle = $j( _this.target_container ).dialog('option', 'title');
+
+                       //update title:
+                       $j( _this.target_container ).dialog('option', 'title', 'Preview Insert of Resource: ' + rObj.title );
+
+                       //update buttons preview:
                        $j(bPlaneTarget).html( $j.btnHtml( gM('rsd_do_insert'), 'preview_do_insert', 'check') + ' ' )
                                .children('.preview_do_insert')
                                .click(function(){
@@ -1515,14 +1515,14 @@ remoteSearchDriver.prototype = {
                                .children('.preview_close')
                                .click(function(){
                                        $j('#rsd_preview_display').remove();
-                                       //restore title: 
+                                       //restore title:
                                        $j( _this.target_container ).dialog('option', 'title', pTitle);
-                                       //restore buttons (from the clipEdit object::) 
+                                       //restore buttons (from the clipEdit object::)
                                        _this.cEdit.updateInsertControlActions();
                                });
-                                                                       
+
                        //update the preview_wtext
-                       _this.updatePreviewText( rObj );                        
+                       _this.updatePreviewText( rObj );
                        _this.getParsedWikiText(_this.preview_wtext, _this.target_title,
                                function(phtml){
                                        $j('#rsd_preview_display').html( phtml );
@@ -1530,17 +1530,17 @@ remoteSearchDriver.prototype = {
                                        mwdomReady(true);
                                }
                        );
-               });             
+               });
        },
        updatePreviewText:function( rObj ){
                var _this = this;
-                       
+
                if( _this.import_url_mode == 'remote_link' ){
                        _this.cur_embed_code = rObj.pSobj.getEmbedHTML(rObj);
                }else{
                        _this.cur_embed_code = rObj.pSobj.getEmbedWikiCode( rObj );
                }
-               
+
                //insert at start if textInput cursor has not been set (ie == length)
                if( _this.caret_pos &&  _this.caret_pos.text){
                        if( _this.caret_pos.text.length == _this.caret_pos.s)
@@ -1550,7 +1550,7 @@ remoteSearchDriver.prototype = {
                                                                   _this.caret_pos.text.substring( _this.caret_pos.s );
                }else{
                   _this.preview_wtext =  $j(_this.target_textbox).val() +  _this.cur_embed_code;
-               }               
+               }
                //check for missing </refrences>
                if( _this.preview_wtext.indexOf('<references/>') ==-1 &&  _this.preview_wtext.indexOf('<ref>') != -1 )
                         _this.preview_wtext =  _this.preview_wtext + '<references/>';
@@ -1561,34 +1561,34 @@ remoteSearchDriver.prototype = {
                                        'text':wikitext
                                   },
                        'url':this.local_wiki_api_url
-                       },function(data){                       
+                       },function(data){
                                callback( data.parse.text['*'] );
                        }
                );
        },
-       insertResource:function( rObj){ 
+       insertResource:function( rObj){
                js_log('insertResource: ' + rObj.title);
                var _this = this
                //dobule check that the resource is present:
                this.checkImportResource( rObj, function(){
-                       _this.updatePreviewText( rObj );                                        
+                       _this.updatePreviewText( rObj );
                        $j(_this.target_textbox).val( _this.preview_wtext );
-                       
-                       //update the render area (if present)  
-                       if(_this.target_render_area && _this.cur_embed_code){                   
-                                //output with some padding: 
+
+                       //update the render area (if present)
+                       if(_this.target_render_area && _this.cur_embed_code){
+                                //output with some padding:
                                 $j(_this.target_render_area).append( _this.cur_embed_code + '<div style="clear:both;height:10px">')
                                 //update if its video or audio:
-                                if( rObj.mime.indexOf('audio')!=-1 || 
+                                if( rObj.mime.indexOf('audio')!=-1 ||
                                         rObj.mime.indexOf('video')!=-1 ||
                                         rObj.mime.indexOf('/ogg') !=-1){
                                         mvJsLoader.embedVideoCheck(function(){
-                                               mv_video_embed();                                
+                                               mv_video_embed();
                                         });
                                 }
-                       }                                               
+                       }
                        _this.closeAll();
-               });             
+               });
        },
        closeAll:function(){
                 var _this = this;
@@ -1602,45 +1602,45 @@ remoteSearchDriver.prototype = {
                var box_light_url        = mv_skin_img_path + 'box_layout_icon.png';
                var list_dark_url        = mv_skin_img_path + 'list_layout_icon_dark.png';
                var list_light_url       = mv_skin_img_path + 'list_layout_icon.png';
-       
+
                var about_desc ='';
                if( this.content_providers[this.disp_item] ){
                        var cp = this.content_providers[this.disp_item];
                        about_desc ='<span style="position:relative;top:0px;font-style:italic;">' +
-                                       '<i>' + gM('results_from', [cp.homepage, cp.title]) + '</i></span>';    
-                       $j('#tab-'+this.disp_item).append( '<div id="rds_results_bar">'+                                                
+                                       '<i>' + gM('results_from', [cp.homepage, cp.title]) + '</i></span>';
+                       $j('#tab-'+this.disp_item).append( '<div id="rds_results_bar">'+
                                '<span style="float:left;top:0px;font-style:italic;">'+
-                                       gM('rsd_layout')+' '+                           
+                                       gM('rsd_layout')+' '+
                                        '<img id="msc_box_layout" ' +
                                                'title = "' + gM('rsd_box_layout') + '" '+
-                                               'src = "' +  ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) + '" ' +         
+                                               'src = "' +  ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) + '" ' +
                                                'style="width:20px;height:20px;cursor:pointer;"> ' +
                                        '<img id="msc_list_layout" '+
                                                'title = "' + gM('rsd_list_layout') + '" '+
-                                               'src = "' +  ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) + '" '+               
-                                               'style="width:20px;height:20px;cursor:pointer;">'+              
+                                               'src = "' +  ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) + '" '+
+                                               'style="width:20px;height:20px;cursor:pointer;">'+
                                        about_desc +
                                '</span>'+
-                               '<span id="rsd_paging_ctrl" style="float:right;"></span>'+              
+                               '<span id="rsd_paging_ctrl" style="float:right;"></span>'+
                                '</div>'
                        );
                        //get paging with bindings:
                        this.getPaging('#rsd_paging_ctrl');
-                               
-                       $j('#msc_box_layout').hover(function(){         
+
+                       $j('#msc_box_layout').hover(function(){
                                $j(this).attr("src", box_dark_url );
                        }, function(){
-                               $j(this).attr("src",  ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) );      
+                               $j(this).attr("src",  ( (_this.result_display_mode=='box')?box_dark_url:box_light_url ) );
                        }).click(function(){
                                $j(this).attr("src", box_dark_url);
                                $j('#msc_list_layout').attr("src", list_light_url);
                                _this.setDispMode('box');
                        });
-               
+
                        $j('#msc_list_layout').hover(function(){
                                $j(this).attr("src", list_dark_url);
                        }, function(){
-                               $j(this).attr("src", ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) );    
+                               $j(this).attr("src", ( (_this.result_display_mode=='list')?list_dark_url:list_light_url ) );
                        }).click(function(){
                                $j(this).attr("src", list_dark_url);
                                $j('#msc_box_layout').attr("src", box_light_url);
@@ -1651,19 +1651,19 @@ remoteSearchDriver.prototype = {
        getPaging:function(target){
                var _this = this;
                var cp_id = this.disp_item;
-               var cp = this.content_providers[ this.disp_item ];                                              
+               var cp = this.content_providers[ this.disp_item ];
                //js_log('getPaging:'+ cp_id + ' len: ' + cp.sObj.num_results);
                var to_num = ( cp.limit > cp.sObj.num_results )?
                                                (cp.offset + cp.sObj.num_results):
-                                               (cp.offset + cp.limit); 
+                                               (cp.offset + cp.limit);
                var out = gM('rsd_results_desc') + ' ' +  (cp.offset+1) + ' to ' + to_num;
                //check if we have more results (next prev link)
                if(  cp.offset >=  cp.limit )
                        out+=' <a href="#" id="rsd_pprev">' + gM('rsd_results_prev') + ' ' + cp.limit + '</a>';
-               
-               if( cp.sObj.more_results )                              
+
+               if( cp.sObj.more_results )
                        out+=' <a href="#" id="rsd_pnext">' + gM('rsd_results_next') + ' ' + cp.limit + '</a>';
-               
+
                $j(target).html(out);
                //set bindings
                $j('#rsd_pnext').click(function(){
@@ -1676,19 +1676,19 @@ remoteSearchDriver.prototype = {
                                cp.offset=0;
                        _this.runSearch();
                });
-       
-               return;                                                         
+
+               return;
 
        },
        selectTab:function( selected_cp_id ){
                js_log('select tab: ' + selected_cp_id);
-               this.disp_item = selected_cp_id;                                                
+               this.disp_item = selected_cp_id;
                if( this.disp_item == 'upload' ){
                        this.doUploadInteface();
                }else{
                        //update the search results:
                        this.runSearch();
-               }                       
+               }
        },
        setDispMode:function(mode){
                js_log('setDispMode:' + mode);
index 6781e02..f89c378 100644 (file)
@@ -1,21 +1,21 @@
-//base remote search obj 
+//base remote search obj
 
 loadGM({
-       "imported_from" : "$1 imported from [$2 $3]. See the original [$4 resource page] for more info
+       "imported_from" : "$1 imported from [$2 $3]. See the original [$4 resource page] for more information."
 })
-// @key is name of rObj variable 
+// @key is name of rObj variable
 // @value is where to find the value in the item xml
-// 
-// *format:*  
-// . indicates multiple tags @ seperates the tag from attribute list 
+//
+// *format:*
+// . indicates multiple tags @ seperates the tag from attribute list
 // {.}tag_name@{attribute1|attribute12}
-// @@todo should probably switch this over to something like Xpath if we end up parsing a lot of rss formats 
-var rsd_default_rss_item_mapping = {    
+// @@todo should probably switch this over to something like Xpath if we end up parsing a lot of rss formats
+var rsd_default_rss_item_mapping = {
        'poster'        : 'media:thumbnail@url',
        'roe_url'       : 'media:roe_embed@url',
-       'person'        : 'media:person@label|url',     
+       'person'        : 'media:person@label|url',
        'parent_clip':'media:parent_clip@url',
-       'bill'          : 'media:bill@label|url',       
+       'bill'          : 'media:bill@label|url',
        'title'         : 'title',
        'link'          : 'link',
        'desc'          : 'description',
@@ -27,81 +27,81 @@ var baseRemoteSearch = function(iObj) {
        return this.init(iObj);
 };
 baseRemoteSearch.prototype = {
-       
+
        completed_req:0,
-       num_req:0,      
-               
-       resultsObj:{},  
-       
-       //default search result values for paging: 
-       offset                   :0,    
+       num_req:0,
+
+       resultsObj:{},
+
+       //default search result values for paging:
+       offset                   :0,
        limit                     :20,
        more_results    :false,
-       num_results             :0,     
-       
-       //init the object: 
-       init: function( iObj ){         
+       num_results             :0,
+
+       //init the object:
+       init: function( iObj ){
                js_log('mvBaseRemoteSearch:init');
                for(var i in iObj){
                        this[i] = iObj[i];
                }
                return this;
-       },      
+       },
        getSearchResults:function(){
-               //empty out the current results before issuing a request 
+               //empty out the current results before issuing a request
                this.resultsObj = {};
                //do global getSearchResults bindings
                this.last_query = $j('#rsd_q').val();
                this.last_offset = this.cp.offset;
-               //@@todo its possible that video rss is the "default" format we could put that logic here: 
-       },      
+               //@@todo its possible that video rss is the "default" format we could put that logic here:
+       },
        /*
        * Parses and adds video rss based input format
        * @param $data XML data to parse
-       * @param provider_url    the source url (used to generate absolute links)  
+       * @param provider_url    the source url (used to generate absolute links)
        */
-       addRSSData:function( data , provider_url ){     
+       addRSSData:function( data , provider_url ){
                js_log('f:addRSSData');
                var _this = this;
                var http_host = '';
-               var http_path = '';             
+               var http_path = '';
                if(provider_url){
                        pUrl =  parseUri( provider_url );
-                       http_host = pUrl.protocol +'://'+ pUrl.authority;  
-                       http_path = pUrl.directory;     
-               }                       
+                       http_host = pUrl.protocol +'://'+ pUrl.authority;
+                       http_path = pUrl.directory;
+               }
                var items = data.getElementsByTagName('item');
                //js_log('found ' + items.length );
-               $j.each(items, function(inx, item){             
-                       var rObj = {};                  
-                       for(var i in rsd_default_rss_item_mapping){                                                                                                             
-                               var selector = rsd_default_rss_item_mapping[i].split('@');                                                              
-                               
+               $j.each(items, function(inx, item){
+                       var rObj = {};
+                       for(var i in rsd_default_rss_item_mapping){
+                               var selector = rsd_default_rss_item_mapping[i].split('@');
+
                                var flag_multiple = (  selector[0].substr(0,1) == '.' ) ? true : false;
                                if( flag_multiple ){
                                        rObj[i] = new Array();
                                        var tag_name = selector[0].substr(1);
-                               }else{                                  
+                               }else{
                                        var tag_name = selector[0];
                                }
-                               
-                               var attr_name = null;                                                                                           
+
+                               var attr_name = null;
                                if( typeof selector[1] != 'undefined'){
-                                       attr_name = selector[1];                                                                        
+                                       attr_name = selector[1];
                                        if( attr_name.indexOf('|') != -1 )
-                                               attr_name = attr_name.split('|');       
+                                               attr_name = attr_name.split('|');
                                }
-                                                                                                                                                                                                               
-                               $j.each( item.getElementsByTagName( tag_name ), function ( inx, node ){                                                 
-                                       var tag_val = '';                                                                                                
-                                       if( node!=null && attr_name == null ){                                  
-                                               if( node.childNodes[0] != null){                                                                        
+
+                               $j.each( item.getElementsByTagName( tag_name ), function ( inx, node ){
+                                       var tag_val = '';
+                                       if( node!=null && attr_name == null ){
+                                               if( node.childNodes[0] != null){
                                                        //trim and strip html:
-                                                       tag_val = $j.trim( node.firstChild.nodeValue ).replace(/(<([^>]+)>)/ig,"");                                                      
+                                                       tag_val = $j.trim( node.firstChild.nodeValue ).replace(/(<([^>]+)>)/ig,"");
                                                }
-                                       }                               
+                                       }
                                        if( node!=null && attr_name != null){
-                                               if( typeof attr_name == 'string' ){ 
+                                               if( typeof attr_name == 'string' ){
                                                        tag_val = $j.trim( $j( node ).attr( attr_name ) );
                                                }else{
                                                        var attr_vals = {};
@@ -111,64 +111,64 @@ baseRemoteSearch.prototype = {
                                                        }
                                                        tag_val = attr_vals ;
                                                }
-                                       }                                                                                                                                                                                                       
+                                       }
                                        if(flag_multiple){
                                                rObj[i].push( tag_val)
                                        }else{
                                                rObj[i] = tag_val;
-                                       }                                                                                                                                                        
-                               });             
-                               
-                                                                       
+                                       }
+                               });
+
+
                        } // done with property loop
-                                               
-                               
+
+
                        //make relative urls absolute:
-                       var url_param = new Array('src', 'poster'); 
+                       var url_param = new Array('src', 'poster');
                        for(var j=0; j < url_param.length; j++){
                                var p = url_param[j];
                                if(typeof rObj[p] != 'undefined'){
-                                       if( rObj[p].substr(0,1)=='/' ){                         
+                                       if( rObj[p].substr(0,1)=='/' ){
                                                rObj[p] = http_host + rObj[p];
                                        }
                                        if( parseUri( rObj[i] ).host ==  rObj[p]){
                                                rObj[p] = http_host + http_path + rObj[p];
                                        }
                                }
-                       }                       
-                       //force a mime type for now.. in the future generalize for other RSS feeds and conversions 
+                       }
+                       //force a mime type for now.. in the future generalize for other RSS feeds and conversions
                        rObj['mime'] = 'video/ogg';
                        //add pointer to parent search obj:( this.cp.limit )? this.cp.limit : this.limit,
-               
+
                        rObj['pSobj'] = _this;
-                       //add the result to the result set: 
-                       _this.resultsObj[ inx ] = rObj; 
+                       //add the result to the result set:
+                       _this.resultsObj[ inx ] = rObj;
                        _this.num_results++;
-               });             
-       },              
-       //by default just return the existing image with callback 
+               });
+       },
+       //by default just return the existing image with callback
        getImageObj:function( rObj, size, callback){
                callback( {'url':rObj.poster} );
        },
        //by default just return the rObj.desc
        getInlineDescWiki:function( rObj ){
-               //return striped html  & trim white space 
+               //return striped html  & trim white space
                if(rObj.desc)
                        return $j.trim( rObj.desc.replace(/(<([^>]+)>)/ig,"") );
-               //no desc avaliable: 
+               //no desc avaliable:
                return '';
        },
-       //default license permission wiki text is cc based template mapping (does not confirm the templates actually exist)  
+       //default license permission wiki text is cc based template mapping (does not confirm the templates actually exist)
        getPermissionWikiTag: function( rObj ){
-               if(!rObj.license)                               
+               if(!rObj.license)
                        return '';//no license info
-               //check that its a defined creative commons licnese key: 
+               //check that its a defined creative commons licnese key:
                if(  this.rsd.licenses.cc.licenses[ rObj.license.key ] != 'undefined' ){
                        return '{{Cc-' + rObj.license.key + '}}';
                }else if( rObj.license.lurl ) {
                        return '{{Template:External_License|' + rObj.license.lurl + '}}';
-               }               
-               
+               }
+
        },
        getImportResourceDescWiki:function(rObj){
                return gM('imported_from', [rObj.title,  this.cp.homepage, this.cp.title, rObj.link]);
@@ -177,7 +177,7 @@ baseRemoteSearch.prototype = {
        getExtraResourceDescWiki:function( rObj ){
                return '';
        },
-       //by default just return the poster (clients can overide) 
+       //by default just return the poster (clients can overide)
        getImageTransform:function(rObj, opt){
                return rObj.poster;
        },
@@ -187,25 +187,25 @@ baseRemoteSearch.prototype = {
        getEmbedTimeMeta:function(rObj, callback){
                callback();
        },
-       getEmbedWikiCode:function(rObj){                        
+       getEmbedWikiCode:function(rObj){
                var layout = ( rObj.layout)? rObj.layout:"right"
                var o= '[[' + this.rsd.cFileNS + ':' + rObj.target_resource_title + '|thumb|'+layout;
-               
+
                if(!rObj.target_width && rObj.width){
                        rObj.target_width = (rObj.width < 640)? rObj.width: '640';
                }
-               
+
                if(rObj.target_width)
                        o+='|' + rObj.target_width + 'px';
-               
-               if( rObj.inlineDesc ) 
+
+               if( rObj.inlineDesc )
                        o+='|' + rObj.inlineDesc;
-                       
+
                o+=']]';
                return o;
        },
        updateTargetResourceTitle:function(rObj){
-               rObj.target_resource_title = rObj.titleKey.replace(/File:|Image:/,'');                                                          
+               rObj.target_resource_title = rObj.titleKey.replace(/File:|Image:/,'');
                rObj.target_resource_title = this.cp.resource_prefix + rObj.target_resource_title;
        },
        updateDataForImport:function( rObj ){
index 8495a02..6f2ea37 100644 (file)
@@ -1,20 +1,20 @@
 /*
  * simple form output jquery binding
  * enables dynamic form output to a given target
- * 
+ *
  */
 
-loadGM({ 
-       "select_file"                   : "Select File",
-       "more_licence_options"  : "For more licence options view the <a href=\"$1\">normal upload page</a>",
-       "select_ownwork"                : "I am uploading entirely my own work, and licencing it under:",
-       "licence_cc-by-sa"              : "Creative Commons Share Alike (3.0)",         
-       "upload"                                : "Upload File",
-       "destfilename"                  : "Destination filename:",
-       "summary"                               : "Summary",
-       "error_not_loggedin"    : "You don't appear to be logged in or don't have upload privlages."
+loadGM({
+       "select_file" : "Select file",
+       "more_licence_options" : "For more licence options, view the <a href=\"$1\">normal upload page</a>",
+       "select_ownwork": "I am uploading entirely my own work, and licencing it under:",
+       "licence_cc-by-sa": "Creative Commons Share Alike (3.0)",
+       "upload": "Upload file",
+       "destfilename": "Destination filename:",
+       "summary": "Summary",
+       "error_not_loggedin": "You do not appear to be logged in or do not have upload privlages."
 });
+
 var default_form_options = {
        'enable_fogg'    : true,
        'licence_options':['cc-by-sa'],
@@ -25,86 +25,86 @@ var default_form_options = {
 (function($) {
        $.fn.simpleUploadForm = function( opt , callback){
                var _this = this;
-               //set the options: 
+               //set the options:
                for(var i in default_form_options){
                        if(!opt[i])
                                opt[i] = default_form_options[i];
                }
-               
-               //first do a reality check on the options: 
+
+               //first do a reality check on the options:
                if(!opt.api_target){
                        $(this.selector).html('Error: Missing api target');
                        return false;
-               }               
-                                       
+               }
+
                //@@todo this is just a proof of concept
                //much todo to improved this web form
-               get_mw_token('File:MyRandomFileTokenCheck', opt.api_target, function(eToken){   
-                               
+               get_mw_token('File:MyRandomFileTokenCheck', opt.api_target, function(eToken){
+
                        if( !eToken || eToken == '+\\' ){
                                $(this.selector).html( gM('error_not_loggedin') );
                                return false;
                        }
-                       
-                       //build the api based upload form: 
+
+                       //build the api based upload form:
                        var o = '<div style="margin: 0 auto;width:450px;">'+
                                '<form id="suf-upload" enctype="multipart/form-data" action="' + opt.api_target + '" method="post">'  +
-                               //hidden input: 
+                               //hidden input:
                                '<input type="hidden" name="action" value="upload">'+
                                '<input type="hidden" name="format" value="jsonfm">'+
                                '<input type="hidden" name="token" value="'+ eToken +'">' +
-                               
+
                                //api form name set:
-                               '<label for="file">' + gM('select_file') + '</label><br>'+                                                                      
-                               '<input type="file" style="display: inline;" name="file" size="15"/><br>' +             
-                               
+                               '<label for="file">' + gM('select_file') + '</label><br>'+
+                               '<input type="file" style="display: inline;" name="file" size="15"/><br>' +
+
                                '<label for="filename">' +gM('destfilename') + '</label><br>'+
                                '<input type="text" name="filename" size="30" /><br>'+
-                               
+
                                '<label for="comment">' + gM('summary') + ':</label><br>' +
                                '<textarea cols="30" rows="3" name="comment" tabindex="3"/><br>'+
-                                
-                               gM('select_ownwork') + '<br>' + 
-                               '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('licence_cc-by-sa') + '<br>' +                  
-                                                       
+
+                               gM('select_ownwork') + '<br>' +
+                               '<input type="checkbox" id="wpLicence" name="wpLicence" value="cc-by-sa">' + gM('licence_cc-by-sa') + '<br>' +
+
                                '<input type="submit" accesskey="s" value="' + gM('upload') + '" name="wpUploadBtn" id="wpUploadBtn"  tabindex="9"/>' +
-                               //close the form and div  
-                               '</form></div>';                                        
-                               
+                               //close the form and div
+                               '</form></div>';
+
                        //set the target with the form output:
-                       $( _this.selector ).html( o );                  
-                       //by default dissable: 
+                       $( _this.selector ).html( o );
+                       //by default dissable:
                        $j('#wpUploadBtn').attr('disabled', 'disabled');
-                       
+
                        //set up basic binding:
                        $j('#wpLicence').click(function(){
                                if( $j(this).is(':checked') ){
-                                       $j('#wpUploadBtn').removeAttr('disabled');                              
-                               }else{                          
+                                       $j('#wpUploadBtn').removeAttr('disabled');
+                               }else{
                                        $j('#wpUploadBtn').attr('disabled', 'disabled');
-                               }                       
+                               }
                        });
-                       
+
                        if(typeof opt.ondone_cb == 'undefined')
                                opt.ondone_cb = false;
-                               
+
                        //set up the binding per the config
                        if( opt.enable_fogg ){
-                               $j('#wpUploadFile').firefogg({ 
+                               $j('#wpUploadFile').firefogg({
                                        //an api url (we won't submit directly to action of the form)
                                        'api_url' : opt.api_target,
-                                       'form_rewrite': true,   
-                                       'target_edit_from' : '#suf-upload',                     
-                                       'new_source_cb' : function( orgFilename, oggName ){                                                                                     
+                                       'form_rewrite': true,
+                                       'target_edit_from' : '#suf-upload',
+                                       'new_source_cb' : function( orgFilename, oggName ){
                                                        $j('#wpDestFile').val( oggName );
-                                                       //@@TODO: 
+                                                       //@@TODO:
                                                        //mwUploadHelper.doDestCheck();
                                        },
                                        'done_upload_cb' : opt.ondone_cb
-                               });             
+                               });
                        }else{
-                               //simple web form rewrite               
+                               //simple web form rewrite
                        }
-               });                     
+               });
        }
 })(jQuery);
\ No newline at end of file
index a2cf3ea..cf8db1d 100644 (file)
@@ -1,36 +1,36 @@
 /*
-       hanndles clip edit controls 
+       hanndles clip edit controls
        'inoutpoints':0,        //should let you set the in and out points of clip
-       'panzoom':0,             //should allow setting keyframes and tweenning modes                   
-       'overlays':0,            //should allow setting "locked to clip" overlay tracks 
-       'audio':0                       //should allow controlling the audio volume (with keyframes) 
+       'panzoom':0,             //should allow setting keyframes and tweenning modes
+       'overlays':0,            //should allow setting "locked to clip" overlay tracks
+       'audio':0                       //should allow controlling the audio volume (with keyframes)
 */
 //set gMsg object:
-loadGM( { 
-       "mv_crop":"Crop Image",
-       "mv_apply_crop":"Apply Crop to Image",
-       "mv_reset_crop":"Rest Crop",
-       "mv_insert_image_page":"Insert Into page",
-       "mv_insert_into_sequence": "Insert Into Sequence",
-       "mv_preview_insert":"Preview Insert",
-       "mv_cancel_image_insert": "Cancel Insert",
-       
-       "sc_fileopts":"Clip Detail Edit",
-       "sc_inoutpoints":"Set In-Out points",   
-       "sc_overlays":"Overlays",
-       "sc_audio":"Audio Control",
-       "sc_duration":"Duration",               
-               
-       "mv_template_properties":"Template Properties",
-       "mv_custom_title":"Custom Title",
-       "mv_edit_properties":"Edit Properties",
-       "mv_other_properties":"Other Properties",
-       "mv_resource_page" : "Resource Page:",
-       
+loadGM( {
+       "mv_crop": "Crop image",
+       "mv_apply_crop": "Apply crop to image",
+       "mv_reset_crop": "Reset crop",
+       "mv_insert_image_page": "Insert into page",
+       "mv_insert_into_sequence": "Insert into sequence",
+       "mv_preview_insert": "Preview insert",
+       "mv_cancel_image_insert": "Cancel insert",
+
+       "sc_fileopts": "Clip detail edit",
+       "sc_inoutpoints": "Set in-out points",
+       "sc_overlays": "Overlays",
+       "sc_audio": "Audio control",
+       "sc_duration": "Duration",
+
+       "mv_template_properties": "Template properties",
+       "mv_custom_title": "Custom title",
+       "mv_edit_properties": "Edit properties",
+       "mv_other_properties": "Other properties",
+       "mv_resource_page": "Resource page:",
+
        "mv_set_in_out_points": "Set in-out points",
-       "mv_start_time": "Start Time",
-       "mv_end_time": "End Time",
-       "mv_preview_inout": "Preview/Play In-out points"
+       "mv_start_time": "Start time",
+       "mv_end_time": "End time",
+       "mv_preview_inout": "Preview/play in-out points"
 });
 
 var default_clipedit_values = {
@@ -39,34 +39,34 @@ var default_clipedit_values = {
        'control_ct':null,       //control container
        'media_type': null, //media type
        'parent_ct': null,       //parent container
-                       
+
        'p_rsdObj': null,       //parent remote search object
        'p_seqObj': null,        //parent sequence Object
-       
+
        'controlActionsCb' : null, //the object that configures control Action callbacks
-       
+
        'edit_action': null, //the requested edit action
-       'profile': 'inpage' //the given profile either "inpage" or "sequence"                                           
+       'profile': 'inpage' //the given profile either "inpage" or "sequence"
 }
-var mvClipEdit = function(iObj) {              
+var mvClipEdit = function(iObj) {
        return this.init(iObj);
 };
 mvClipEdit.prototype = {
-       
+
        selTool:null, //selected tool
        crop: null, //the crop values
        base_img_src:null,
-       
+
        init:function( iObj){
-               //init object: 
+               //init object:
                for(var i in default_clipedit_values){
-                       if( iObj[i] ){   
+                       if( iObj[i] ){
                                this[i] = iObj[i];
                        }
                }
 
                //if media type was not supplied detect for resource if possible:
-               //@@todo more advanced detection.                
+               //@@todo more advanced detection.
                if(!this.media_type && this.rObj && this.rObj.type ){
                        if( this.rObj.type.indexOf("image/") === 0){
                                this.media_type = 'image';
@@ -75,15 +75,15 @@ mvClipEdit.prototype = {
                        }else if( this.rObj.type.indexOf("text/") === 0){
                                this.media_type = 'template';
                        }
-               }                               
-               
+               }
+
                //display control:
-               if(this.profile == 'sequence'){                 
+               if(this.profile == 'sequence'){
                        this.doEditTypesMenu();
                        this.doDisplayEdit();
-               }else{                          
+               }else{
                        //check the media_type:
-                       //js_log('mvClipEdit:: media type:' + this.media_type + ' base width: ' + this.rObj.width + ' bh: ' + this.rObj.height);                
+                       //js_log('mvClipEdit:: media type:' + this.media_type + ' base width: ' + this.rObj.width + ' bh: ' + this.rObj.height);
                        //could seperate out into media Types objects for now just call method
                        if(this.media_type == 'image'){
                                this.setUpImageCtrl();
@@ -92,67 +92,67 @@ mvClipEdit.prototype = {
                        }
                }
        },
-       
+
        //master edit types object:
-       //maybe we should refactor these into their own classes  
+       //maybe we should refactor these into their own classes
        //more refactor each media type should be its own class inheriting the shared baseEditType object
-       edit_types:{            
-               'duration':{                    
+       edit_types:{
+               'duration':{
                        'media':['image','template'],
                        'doEdit':function( _this, target ){
                                //(_this is a smilClip instance)
                                //do clock mouse scroll duration editor
-                               $j(target).html(                                                                        
-                                               '<label for="ce_dur">Duration: </label>' +                                              
+                               $j(target).html(
+                                               '<label for="ce_dur">Duration: </label>' +
                                                '<input name="ce_dur" tabindex="1" maxlength="11" value="'+
                                                        seconds2npt( _this.rObj.getDuration() )+
-                                                       '" size="10"/>'+                                                        
-                                       '</div>'        
+                                                       '" size="10"/>'+
+                                       '</div>'
                                ).children("input[name='ce_dur']").change(function(){
                                         js_log("update duration:" + $j(this).val() );
-                                        //update the parent sequence object: 
+                                        //update the parent sequence object:
                                         _this.rObj.dur = smilParseTime( $j(this).val() );
-                                        //update the playlist: 
-                                        _this.p_seqObj.do_refresh_timeline( true );                                     
+                                        //update the playlist:
+                                        _this.p_seqObj.do_refresh_timeline( true );
                                });
-                               
-                       }                       
+
+                       }
                },
                'inoutpoints':{
                        'media':['video'],
-                       'doEdit':function( _this, target ){                                                             
+                       'doEdit':function( _this, target ){
                                //do clock mouse scroll duration editor
                                var end_ntp = ( _this.rObj.embed.end_ntp) ? _this.rObj.embed.end_ntp : _this.rObj.embed.getDuration();
                                if(!end_ntp)
                                        end_ntp = seconds2npt( _this.rObj.dur );
-                                       
+
                                var start_ntp = (_this.rObj.embed.start_ntp) ? _this.rObj.embed.start_ntp : seconds2npt( 0 );
                                if(!start_ntp)
                                        seconds2npt( 0 );
-                                       
+
                                $j(target).html(
                                        _this.getSetInOutHtml({
-                                               'start_ntp'     : start_ntp, 
+                                               'start_ntp'     : start_ntp,
                                                'end_ntp'       : end_ntp
-                                       })              
+                                       })
                                );
                                _this.setInOutBindings();
-                       }               
+                       }
                },
                'fileopts':{
                        'media':['image','video','template'],
-                       'doEdit':function(_this, target ){                                                      
+                       'doEdit':function(_this, target ){
                                //if media type is template we have to query to get its URI to get its paramaters
-                               if(_this.media_type == 'template' && !_this.rObj.tVars){                
+                               if(_this.media_type == 'template' && !_this.rObj.tVars){
                                        mv_set_loading('#sub_cliplib_ic');
                                        var reqObj ={   'action':'query',
                                                                        'prop':'revisions',
                                                                        'titles': _this.rObj.uri,
-                                                                       'rvprop':'content' 
+                                                                       'rvprop':'content'
                                                                };
                                        //get the interface uri from the plObject
-                                       var api_url = _this.p_seqObj.plObj.interface_url; 
-                                       //first check                                    
+                                       var api_url = _this.p_seqObj.plObj.interface_url;
+                                       //first check
                                        do_api_req( {
                                                'data':reqObj,
                                                'url':api_url
@@ -162,13 +162,13 @@ mvClipEdit.prototype = {
                                                        for(var i in data.query.pages){
                                                                var page = data.query.pages[i];
                                                                if(!page['revisions'] || !page['revisions'][0]['*']){
-                                                                       return _this.doEditOpts(target);        
+                                                                       return _this.doEditOpts(target);
                                                                }else{
                                                                        var template_rev = page['revisions'][0]['*'];
                                                                }
-                                                       }                                               
-                                                       
-                                                       //do a regular ex to get the ~likely~ template values 
+                                                       }
+
+                                                       //do a regular ex to get the ~likely~ template values
                                                        //(of course this sucks)
                                                        //but maybe this will make its way into the api sometime soon to support wysiwyg type editors
                                                        //idealy it would expose a good deal of info about the template params
@@ -178,11 +178,11 @@ mvClipEdit.prototype = {
                                                        _this.rObj.tVars = new Array();
                                                        for(var i=0; i < tempVars.length; i++){
                                                                var tvar = tempVars[i].replace('{{{','').replace('}}}','');
-                                                               //strip anything after a | 
+                                                               //strip anything after a |
                                                                if(tvar.indexOf('|') != -1){
                                                                        tvar = tvar.substr(0, tvar.indexOf('|'));
-                                                               }                                                                                                               
-                                                               //check for duplicates: 
+                                                               }
+                                                               //check for duplicates:
                                                                var do_add=true;
                                                                for(var j=0; j < _this.rObj.tVars.length; j++){
                                                                        js_log('checking: ' + _this.rObj.tVars[j] + ' against:' + tvar);
@@ -192,30 +192,30 @@ mvClipEdit.prototype = {
                                                                //add the template vars to the output obj
                                                                if(do_add)
                                                                        _this.rObj.tVars.push( tvar );
-                                                       }                                       
+                                                       }
                                                        _this.doEditOpts(target);
                                                }
                                        );
                                }else{
                                        _this.doEditOpts(target);
                                }
-                       }               
+                       }
                },
-               'overlays':{                    
+               'overlays':{
                        'media':['image','video'],
                        'doEdit':function(_this, target){
                                //do clock mouse scroll duration editor
                                $j(target).html('<h3>Current Overlays:</h3>Add,Remove,Modify');
-                       }       
+                       }
                },
                'audio':{
                        'media':['image','video', 'template'],
                        'doEdit':function(_this, target){
                                //do clock mouse scroll duration editor
                                $j(target).html('<h3>Audio Volume:</h3>');
-                       }       
-               }               
-       },      
+                       }
+               }
+       },
        doEditOpts:function(target){
                var _this = this;
                //add html for rObj resource:
@@ -224,15 +224,15 @@ mvClipEdit.prototype = {
                                        '<td colspan="2"><b>'+gM('mv_edit_properties')+'</b></td>'+
                                '</tr>'+
                                '<tr>'+
-                                       '<td>' + 
-                                               gM('mv_custom_title') + 
+                                       '<td>' +
+                                               gM('mv_custom_title') +
                                        '</td>'+
                                        '<td><input type="text" size="15" maxwidth="255" value="';
                                                if(_this.rObj.title != null)
                                                        o+=_this.rObj.title;
                                                o+='">'+
                                        '</td>'+
-                               '</tr>';                
+                               '</tr>';
                if( _this.rObj.tVars){
                        var existing_p = _this.rObj.params;
                        var testing_a = _this.rObj.tVars;
@@ -242,62 +242,62 @@ mvClipEdit.prototype = {
                                '</tr>';
                        for(var i =0; i < _this.rObj.tVars.length ; i++){
                                o+='<tr>'+
-                                       '<td>' + 
-                                               _this.rObj.tVars[i] + 
+                                       '<td>' +
+                                               _this.rObj.tVars[i] +
                                        '</td>' +
                                        '<td><input name="'+_this.rObj.tVars[i]+'" class="ic_tparam" type="text" size="15" maxwidth="255" value="';
                                if(_this.rObj.params[ _this.rObj.tVars[i] ]){
                                        o+= _this.rObj.params[ _this.rObj.tVars[i] ];
                                }
-                               o+='">'+ 
+                               o+='">'+
                                        '</td>'+
-                               '</tr>';                
+                               '</tr>';
                        }
-               }               
+               }
                if(typeof wgArticlePath != 'undefined' ){
                        var res_src = wgArticlePath.replace(/\$1/, _this.rObj.uri );
                        var res_title = _this.rObj.uri;
                }else{
-                       //var res_page = 
-                       var res_src = _this.rObj.src;                                                           
-                       var res_title = parseUri(_this.rObj.src).file;                  
-               } 
+                       //var res_page =
+                       var res_src = _this.rObj.src;
+                       var res_title = parseUri(_this.rObj.src).file;
+               }
                o+=     '<tr>'+
                                        '<td colspan="2"><b>'+gM('mv_other_properties')+'</b></td>'+
                                '</tr>'+
                                '<tr>'+
-                                       '<td>' + 
-                                               gM('mv_resource_page') + 
+                                       '<td>' +
+                                               gM('mv_resource_page') +
                                        '</td>' +
                                        '<td><a href="' + res_src  +'" '+
                                                ' target="new">'+
                                                        res_title + '</a>'+
                                        '</td>'+
                                '</tr>';
-               o+='</table>'; 
-               
+               o+='</table>';
+
                $j(target).html ( o );
-               
+
                //add update bindings
                $j(target + ' .ic_tparam').change(function(){
                        js_log("updated tparam::" + $j(this).attr("name"));
-                       //update param value: 
+                       //update param value:
                        _this.rObj.params[ $j(this).attr("name") ] = $j(this).val();
                        //re-parse & update template
                        var template_wiki_text = '{{' + _this.rObj.uri;
-                       for(var i =0;i < _this.rObj.tVars.length ; i++){        
-                               
+                       for(var i =0;i < _this.rObj.tVars.length ; i++){
+
                                template_wiki_text += "\n|"+_this.rObj.tVars[i] + ' = ' +  _this.rObj.params[ _this.rObj.tVars[i] ]  ;
-                       }               
-                       template_wiki_text += "\n}}";                           
-                       var reqObj ={   
+                       }
+                       template_wiki_text += "\n}}";
+                       var reqObj ={
                                        'action':'parse',
                                        'title' : _this.p_seqObj.plObj.mTitle,
-                                       'text'  :       template_wiki_text                                                              
+                                       'text'  :       template_wiki_text
                        };
                        $j( _this.rObj.embed ).html( mv_get_loading_img() );
-                       
-                       var api_url = _this.p_seqObj.plObj.interface_url; 
+
+                       var api_url = _this.p_seqObj.plObj.interface_url;
                        do_api_req({
                                'data':reqObj,
                                'url':api_url
@@ -308,7 +308,7 @@ mvClipEdit.prototype = {
                                }
                        })
                })
-                               
+
                //update doFocusBindings
                if( _this.p_seqObj )
                        _this.p_seqObj.doFocusBindings();
@@ -316,51 +316,51 @@ mvClipEdit.prototype = {
        doEditTypesMenu:function(){
                var _this = this;
                //add in subMenus if set
-               //check for submenu and add to item container           
-               var o='';               
-               var tabc ='';                                   
+               //check for submenu and add to item container
+               var o='';
+               var tabc ='';
                o+= '<div id="mv_submenu_clipedit">';
-               o+='<ul>';               
+               o+='<ul>';
                var first_tab = false;
-               $j.each(this.edit_types, function(sInx, editType){                      
+               $j.each(this.edit_types, function(sInx, editType){
                        //check if the given editType is valid for our given media type
                        var include = false;
                        for(var i =0; i < editType.media.length;i++){
                                if( editType.media[i] == _this.media_type){
-                                       include = true; 
+                                       include = true;
                                        if(!first_tab)
                                                first_tab = sInx;
                                }
                        }
-                       if(include){                            
-                               o+=     '<li>'+ 
+                       if(include){
+                               o+=     '<li>'+
                                                '<a id="mv_smi_'+sInx+'" href="#sc_' + sInx + '">' + gM('sc_' + sInx ) + '</a>'+
-                                       '</li>';                                                                                                                        
-                               tabc += '<div id="sc_' + sInx + '" style="overflow:auto;" ></div>';                                                                                                                                                                                                     
-                       }        
+                                       '</li>';
+                               tabc += '<div id="sc_' + sInx + '" style="overflow:auto;" ></div>';
+                       }
                });
                o+= '</ul>' + tabc;
                o+= '</div>';
-               //add sub menu container with menu html:                
-               $j('#'+this.control_ct).html( o ) ;                     
-               //set up bindings:       
+               //add sub menu container with menu html:
+               $j('#'+this.control_ct).html( o ) ;
+               //set up bindings:
                $j('#mv_submenu_clipedit').tabs({
                        selected: 0,
-                       select: function(event, ui) {                                                                   
+                       select: function(event, ui) {
                                _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_smi_', '') );
-                       }                               
+                       }
                }).addClass('ui-tabs-vertical ui-helper-clearfix');
-               //close left: 
-               $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left');          
-               //update the default edit display: 
+               //close left:
+               $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left');
+               //update the default edit display:
                _this.doDisplayEdit( first_tab );
        },
        doDisplayEdit:function( edit_type ){
                if(!edit_type)
                        return false;
-               js_log('doDisplayEdit: ' + edit_type );                 
-               
-               //do edit interface for that edit type: 
+               js_log('doDisplayEdit: ' + edit_type );
+
+               //do edit interface for that edit type:
                if( this.edit_types[ edit_type ].doEdit )
                        this.edit_types[ edit_type ].doEdit(this, '#sc_'+edit_type );
        },
@@ -371,36 +371,36 @@ mvClipEdit.prototype = {
                //turn on preview to avoid onDone actions
                eb.preview_mode = true;
                $j('#'+this.control_ct).html('<h3>Edit Video Tools:</h3>');
-               if( eb.supportsURLTimeEncoding() ){                     
-                       $j('#'+this.control_ct).append( 
+               if( eb.supportsURLTimeEncoding() ){
+                       $j('#'+this.control_ct).append(
                                _this.getSetInOutHtml({
-                                       'start_ntp'     : eb.start_ntp, 
-                                       'end_ntp'       : eb.end_ntp   
-                               }) 
+                                       'start_ntp'     : eb.start_ntp,
+                                       'end_ntp'       : eb.end_ntp
+                               })
                        );
-                       _this.setInOutBindings();                       
+                       _this.setInOutBindings();
                }
                //if in a sequence we have no need for insertDesc
                if( !_this.p_seqObj){
                        $j('#'+this.control_ct).append( _this.getInsertDescHtml() );
                }
-               //update control actions                                                                                
-               this.updateInsertControlActions();                                                                              
+               //update control actions
+               this.updateInsertControlActions();
        },
        setInOutBindings:function(){
                var _this = this;
-               
+
                var start_sec = npt2seconds($j('#'+this.control_ct + ' .startInOut').val() );
                var end_sec   = npt2seconds($j('#'+this.control_ct + ' .endInOut').val() );
-               
-               //if we don't have 0 as start then assume we are in a range request and give some buffer area:            
+
+               //if we don't have 0 as start then assume we are in a range request and give some buffer area:
                var min_slider =  (start_sec - 60 < 0 ) ? 0 : start_sec - 60;
                if(min_slider!=0){
                        var max_slider =  end_sec+60;
                }else{
                        max_slider = end_sec;
-               }               
-               
+               }
+
                $j('#'+this.control_ct + ' .inOutSlider').slider({
                        range: true,
                        min: min_slider,
@@ -413,9 +413,9 @@ mvClipEdit.prototype = {
                        },
                        change:function(event, ui){
                                do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) );
-                       }                       
+                       }
                });
-               
+
                //preview button:
                $j('#'+this.control_ct + ' .inOutPreviewClip').hover(
                        function(){
@@ -424,45 +424,45 @@ mvClipEdit.prototype = {
                        function(){
                                $j(this).removeClass('ui-state-hover');
                        }
-               ).click(function(){                     
+               ).click(function(){
                        $j('#embed_vid').get(0).stop();
                        $j('#embed_vid').get(0).play();
-               });       
-               //simple hover: 
-                 
+               });
+               //simple hover:
+
        },
        getSetInOutHtml:function( setInt ){
                return '<strong>' + gM('mv_set_in_out_points') + '</strong>'+
                        '<table border="0" style="background: transparent; width:94%;height:50px;">'+
                                '<tr>' +
                                        '<td style="width:55px">'+
-                                               gM('mv_start_time') + 
+                                               gM('mv_start_time') +
                                                '<input class="ui-widget-content ui-corner-all startInOut" size="9" value="' + setInt.start_ntp +'">'+
                                        '</td>' +
                                        '<td>' +
                                                '<div class="inOutSlider"></div>'+
                                        '</td>' +
                                        '<td style="width:55px">'+
-                                               gM('mv_end_time') + 
+                                               gM('mv_end_time') +
                                                '<input class="ui-widget-content ui-corner-all endInOut" size="9" value="'+ setInt.end_ntp +'">'+
                                        '</td>' +
                                '</tr>' +
                        '</table>'+
-                       '<a href="#" class="ui-state-default ui-corner-all ui-icon_link inOutPreviewClip"><span class="ui-icon ui-icon-video"></span>'+ gM('mv_preview_inout') +'</a>';                            
+                       '<a href="#" class="ui-state-default ui-corner-all ui-icon_link inOutPreviewClip"><span class="ui-icon ui-icon-video"></span>'+ gM('mv_preview_inout') +'</a>';
        },
-       getInsertDescHtml:function(){   
-               var o= '<h3>Inline Description</h3>'+                            
-                                       '<textarea style="width:95%" id="mv_inline_img_desc" rows="5" cols="30">';                              
+       getInsertDescHtml:function(){
+               var o= '<h3>Inline Description</h3>'+
+                                       '<textarea style="width:95%" id="mv_inline_img_desc" rows="5" cols="30">';
                if( this.p_rsdObj ){
-                       //if we have a parent remote search driver let it parse the inline description          
+                       //if we have a parent remote search driver let it parse the inline description
                        o+= this.rObj.pSobj.getInlineDescWiki( this.rObj );
                }
-               o+='</textarea><br>';           
+               o+='</textarea><br>';
                //js_log('getInsertDescHtml: ' + o );
                return o;
        },
        updateInsertControlActions:function(){
-               var _this = this;               
+               var _this = this;
                var b_target =   _this.p_rsdObj.target_container + '~ .ui-dialog-buttonpane';
                //empty the ui-dialog-buttonpane bar:
                $j(b_target).empty();
@@ -473,39 +473,39 @@ mvClipEdit.prototype = {
                                                .children('.mv_insert_sequence')
                                                .btnBind()
                                                .click(function(){
-                                                       _this.applyEdit();                                                      
-                                                       _this.controlActionsCb['insert_seq'](  _this.rObj );            
+                                                       _this.applyEdit();
+                                                       _this.controlActionsCb['insert_seq'](  _this.rObj );
                                                });
-                               break;                          
-                               case 'insert': 
+                               break;
+                               case 'insert':
                                        $j(b_target).append(  $j.btnHtml(gM('mv_insert_image_page'), 'mv_insert_image_page', 'check' ) + ' ' )
                                                .children('.mv_insert_image_page')
                                                .btnBind()
                                                .click(function(){
                                                        _this.applyEdit();
-                                                       _this.controlActionsCb['insert'](  _this.rObj );                                                                                                                                                
-                                               }).show('slow');                                        
+                                                       _this.controlActionsCb['insert'](  _this.rObj );
+                                               }).show('slow');
                                break;
                                case 'preview':
                                        $j(b_target).append( $j.btnHtml( gM('mv_preview_insert'), 'mv_preview_insert', 'refresh') + ' ' )
                                                .children('.mv_preview_insert')
                                                .btnBind()
-                                               .click(function(){      
+                                               .click(function(){
                                                        _this.applyEdit();
                                                        _this.controlActionsCb['preview'](  _this.rObj );
-                                               }).show('slow');                                        
-                               break;          
+                                               }).show('slow');
+                               break;
                                case 'cancel':
                                        $j(b_target).append( $j.btnHtml( gM('mv_cancel_image_insert'), 'mv_cancel_img_edit', 'close') + ' ')
                                                .children('.mv_cancel_img_edit')
                                                .btnBind()
                                                .click(function(){
-                                                       //no cancel action; 
-                                                       _this.controlActionsCb['cancel'](  _this.rObj );                                                        
-                                               }).show('slow');                                        
+                                                       //no cancel action;
+                                                       _this.controlActionsCb['cancel'](  _this.rObj );
+                                               }).show('slow');
                                break;
-                       }                               
-               }               
+                       }
+               }
        },
        applyEdit:function(){
                var _this = this;
@@ -517,42 +517,42 @@ mvClipEdit.prototype = {
                }
                //copy over the desc text to the resource object
                _this.rObj['inlineDesc']= $j('#mv_inline_img_desc').val();
-       },      
+       },
        setUpImageCtrl:function(){
-               var _this = this;               
-               //by default apply Crop tool 
+               var _this = this;
+               //by default apply Crop tool
                $j('#'+this.control_ct).html(
-                       '<h3>Edit tools</h3>' +                          
+                       '<h3>Edit tools</h3>' +
                                        '<div class="mv_edit_button mv_crop_button_base" id="mv_crop_button" alt="crop" title="'+gM('mv_crop')+'"/>'+
                                        '<a href="#" class="mv_crop_msg">' + gM('mv_crop') + '</a> '+
                                        '<span style="display:none" class="mv_crop_msg_load">' + gM('loading_txt') + '</span> '+
                                        '<a href="#" style="display:none" class="mv_apply_crop">' + gM('mv_apply_crop') + '</a> '+
                                        '<a href="#" style="display:none" class="mv_rest_crop">' + gM('mv_reset_crop') + '</a> '+
-                               '<hr style="clear:both"/><br>'+                         
+                               '<hr style="clear:both"/><br>'+
                        '<span style="float:left;">Layout:</span>' +
                                '<input type="radio" name="mv_layout" id="mv_layout_left" style="float:left"><div id="mv_layout_left_img" title="'+gM('mv_layout_left')+'"/>'+
-                               '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mv_layout_left')+'"/>'+        
-                       '<hr style="clear:both" /><br>' +                                                                        
-                               _this.getInsertDescHtml()                                                       
+                               '<input type="radio" name="mv_layout" id="mv_layout_right" style="float:left"><div id="mv_layout_right_img" title="'+gM('mv_layout_left')+'"/>'+
+                       '<hr style="clear:both" /><br>' +
+                               _this.getInsertDescHtml()
                );
                //add the actions to the 'button bar'
-               _this.updateInsertControlActions()      
-               
-               /*scale: 
-                '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mv_scale')+'"></div>'+                          
+               _this.updateInsertControlActions()
+
+               /*scale:
+                '<div class="mv_edit_button mv_scale_button_base" id="mv_scale_button" alt="crop" title="'+gM('mv_scale')+'"></div>'+
                                '<a href="#" class="mv_scale_msg">' + gM('mv_scale') + '</a><br>'+
                                '<a href="#" style="display:none" class="mv_apply_scale">' + gM('mv_apply_scale') + '</a> '+
                                '<a href="#" style="display:none" class="mv_rest_scale">' + gM('mv_reset_scale') + '</a><br> '+
-               
+
                */
                //add bindings:
-               
+
                //make sure the default is reflected:
                if( ! _this.rObj.layout )
                        _this.rObj.layout = 'right';
                $j('#mv_layout_' + _this.rObj.layout)[0].checked = true;
-               
-               //left radio click 
+
+               //left radio click
                $j('#mv_layout_left,#mv_layout_left_img').click(function(){
                        $j('#mv_layout_right')[0].checked = false;
                        $j('#mv_layout_left')[0].checked = true;
@@ -566,14 +566,14 @@ mvClipEdit.prototype = {
                });
                $j('#mv_crop_button,.mv_crop_msg,.mv_apply_crop').click(function(){
                        js_log('click:mv_crop_button: base width: ' + _this.rObj.width + ' bh: ' + _this.rObj.height);
-                       if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){                          
+                       if($j('#mv_crop_button').hasClass('mv_crop_button_selected')){
                                _this.applyCrop();
                        }else{
                                js_log('click:turn on');
                                _this.enableCrop();
                        }
-               });             
-               $j('.mv_rest_crop').click(function(){   
+               });
+               $j('.mv_rest_crop').click(function(){
                        $j('.mv_apply_crop,.mv_rest_crop').hide();
                        $j('.mv_crop_msg').show();
                        $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mv_crop'));
@@ -581,21 +581,21 @@ mvClipEdit.prototype = {
                        $j('#' + _this.clip_disp_ct ).empty().html(
                                '<img src="' + _this.rObj.edit_url + '" id="rsd_edit_img">'
                        );
-               });                             
+               });
        },
-       applyVideoAdj:function(){               
-               js_log('applyVideoAdj::');      
-               
-               //be sure to "stop the video (some plugins can't have DOM elements on top of them) 
-               $j('#embed_vid').get(0).stop(); 
-               
-               //update video related keys:            
+       applyVideoAdj:function(){
+               js_log('applyVideoAdj::');
+
+               //be sure to "stop the video (some plugins can't have DOM elements on top of them)
+               $j('#embed_vid').get(0).stop();
+
+               //update video related keys:
                ;
                this.rObj['start_time'] = $j('#'+this.control_ct + ' .startInOut').val();
-               this.rObj['end_time']   = $j('#'+this.control_ct + ' .endInOut').val() ; 
-               
+               this.rObj['end_time']   = $j('#'+this.control_ct + ' .endInOut').val() ;
+
                //do the local video adjust
-               if(typeof this.rObj.pSobj['applyVideoAdj'] != 'undefined'){                     
+               if(typeof this.rObj.pSobj['applyVideoAdj'] != 'undefined'){
                        this.rObj.pSobj.applyVideoAdj( this.rObj );
                }
        },
@@ -605,8 +605,8 @@ mvClipEdit.prototype = {
                $j('.mv_crop_msg').show();
                $j('#mv_crop_button').removeClass('mv_crop_button_selected').addClass('mv_crop_button_base').attr('title',gM('mv_crop'));
                js_log( 'click:turn off' );
-               var cat = _this.rObj;           
-               if(_this.rObj.crop){                    
+               var cat = _this.rObj;
+               if(_this.rObj.crop){
                        //empty out and display croped:
                        $j('#'+_this.clip_disp_ct ).empty().html(
                                '<div id="mv_cropcotainer" style="overflow:hidden;position:absolute;'+
@@ -617,41 +617,41 @@ mvClipEdit.prototype = {
                                                'left:-' + _this.rObj.crop.x + 'px;">'+
                                                '<img src="' + _this.rObj.edit_url  + '">'+
                                        '</div>'+
-                               '</div>'                                                
-                       );                      
+                               '</div>'
+                       );
                }
                return true;
        },
-       //right now enableCrop loads "just in time" 
-       //@@todo we really need an "auto loader" type system. 
+       //right now enableCrop loads "just in time"
+       //@@todo we really need an "auto loader" type system.
        enableCrop:function(){
                var _this = this;
                $j('.mv_crop_msg').hide();
                $j('.mv_crop_msg_load').show();
-               var doEnableCrop = function(){  
+               var doEnableCrop = function(){
                        $j('.mv_crop_msg_load').hide();
-                       $j('.mv_rest_crop,.mv_apply_crop').show();                              
-                       $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',gM('mv_crop_done'));                          
+                       $j('.mv_rest_crop,.mv_apply_crop').show();
+                       $j('#mv_crop_button').removeClass('mv_crop_button_base').addClass('mv_crop_button_selected').attr('title',gM('mv_crop_done'));
                        $j('#' + _this.clip_disp_ct + ' img').Jcrop({
                                 onSelect: function(c){
                                         js_log('on select:' + c.x +','+ c.y+','+ c.x2+','+ c.y2+','+ c.w+','+ c.h);
                                         _this.rObj.crop = c;
                                 },
-                                onChange: function(c){                                                 
-                                }                                              
-                       });                     
+                                onChange: function(c){
+                                }
+                       });
                        //temporary hack (@@todo need to debug why rsd_res_item gets moved )
                        $j('#clip_edit_disp .rsd_res_item').css({
-                               'top':'0px', 
+                               'top':'0px',
                                'left':'0px'
-                       });                     
-               }                       
+                       });
+               }
                //load the jcrop library if needed:
                mvJsLoader.doLoad([
                        '$j.Jcrop'
                ],function(){
                        doEnableCrop();
-               });                                     
+               });
        }
 }
 
@@ -665,22 +665,22 @@ function add_adjust_hooks(mvd_id, adj_callback){
        });
        $j('#mvd_form_'+mvd_id).html(
                mvClipEdit.getSetInOutHtml({
-                       'start_ntp'     :  $j('#mv_start_hr_' + mvd_id).val(), 
-                       'end_ntp'       :  $j('#mv_end_hr_' + mvd_id).val() 
-               })              
+                       'start_ntp'     :  $j('#mv_start_hr_' + mvd_id).val(),
+                       'end_ntp'       :  $j('#mv_end_hr_' + mvd_id).val()
+               })
        );
        mvClipEdit.setInOutBindings();*/
-       
+
        var start_sec = npt2seconds($j('#mv_start_hr_' + mvd_id).val() );
        var end_sec   = npt2seconds($j('#mv_end_hr_' + mvd_id).val()  );
-               
-       //if we don't have 0 as start then assume we are in a range request and give some buffer area:            
+
+       //if we don't have 0 as start then assume we are in a range request and give some buffer area:
        var min_slider =  (start_sec - 60 < 0 ) ? 0 : start_sec - 60;
        if(min_slider!=0){
                var max_slider =  end_sec+60;
        }else{
                max_slider = end_sec;
-       }               
+       }
        //pre-destroy just in case:
        $j('#mvd_form_' + mvd_id + ' .inOutSlider').slider( 'destroy' ).slider({
                range: true,
@@ -694,7 +694,7 @@ function add_adjust_hooks(mvd_id, adj_callback){
                },
                change:function(event, ui){
                        do_video_time_update( seconds2npt( ui.values[0]), seconds2npt( ui.values[1] ) );
-               }                       
+               }
        });
        $j('.mv_adj_hr').change(function(){
                //preserve track duration for nav and seq:
@@ -713,7 +713,7 @@ function add_adjust_hooks(mvd_id, adj_callback){
 
 function do_video_time_update(start_time, end_time, mvd_id)    {
        js_log('do_video_time_update: ' +start_time +' '+ end_time);
-       
+
        if(mv_lock_vid_updates==false){
                //update the vid title:
                $j('#mv_videoPlayerTime').html( start_time + ' to ' + end_time );
@@ -722,7 +722,7 @@ function do_video_time_update(start_time, end_time, mvd_id) {
                        if(ebvid.isPaused())
                                ebvid.stop();
                        ebvid.updateVideoTime(start_time, end_time);
-                       js_log('update thumb: '+ start_time);           
+                       js_log('update thumb: '+ start_time);
                        ebvid.updateThumbTimeNTP( start_time );
                }
        }
index 22e957d..f5dffff 100644 (file)
@@ -3,66 +3,66 @@
 */
 
 loadGM({
-       "loading_plugin" : "loading plugin<blink>...</blink>",
-
-       "select_playback" : "Set Playback Preference",
-       "link_back" : "Link Back",
-       "error_load_lib" : "mv_embed: Unable to load required javascript libraries\n insert script via DOM has failed, try reloading?  ",
-                                        
-       "error_swap_vid" : "Error:mv_embed was unable to swap the video tag for the mv_embed interface",
-       
-       "add_to_end_of_sequence" : "Add to End of Sequence",
-       
-       "missing_video_stream" : "The video file for this stream is missing",   
-       
-       "play_clip" : "Play Clip",
-       "pause_clip": "Pause Clip",
-       "volume_control": "Volume Control",
-       "player_options": "Player Options",
-       "closed_captions": "Close Captions",
-       "player_fullscreen": "Fullscreen",      
-
-       "next_clip_msg" : "Play Next Clip",
-       "prev_clip_msg" : "Play Previous Clip",
-       "current_clip_msg" : "Continue Playing this Clip",      
+       "loading_plugin" : "loading plugin <blink>...</blink>",
+
+       "select_playback" : "Set playback preference",
+       "link_back" : "Link back",
+       "error_load_lib" : "Error: mv_embed was unable to load required JavaScript libraries.\nInsert script via DOM has failed. Please try reloading this page.",
+
+       "error_swap_vid" : "Error: mv_embed was unable to swap the video tag for the mv_embed interface",
+
+       "add_to_end_of_sequence" : "Add to end of sequence",
+
+       "missing_video_stream" : "The video file for this stream is missing",
+
+       "play_clip" : "Play clip",
+       "pause_clip": "Pause clip",
+       "volume_control": "Volume control",
+       "player_options": "Player options",
+       "closed_captions": "Close captions",
+       "player_fullscreen": "Fullscreen",
+
+       "next_clip_msg" : "Play next clip",
+       "prev_clip_msg" : "Play previous clip",
+       "current_clip_msg" : "Continue playing this clip",
        "seek_to" : "Seek to",
-       
-       "download_segment" : "Download Selection:",
-       "download_full" : "Download Full Video File:",
-       "download_right_click": "To download right click and select <i>save target as</i>",
-       "download_clip" : "Download Video",
-       "download_text" : "Download Text (<a style=\"color:white\" title=\"cmml\" href=\"http://wiki.xiph.org/index.php/CMML\">cmml</a> xml):",
+
+       "download_segment" : "Download selection:",
+       "download_full" : "Download full video file:",
+       "download_right_click": "To download right click and select <i>Save target as...</i>",
+       "download_clip" : "Download video",
+       "download_text" : "Download text (<a style=\"color:white\" title=\"cmml\" href=\"http://wiki.xiph.org/index.php/CMML\">CMML</a> xml):",
        "download"              : "Download",
-       
+
        "share"                 : "Share",
        "credits"               : "Credits",
-       
-       "clip_linkback" : "Clip Source Page",
-       "chose_player"  : "Choose Video Player", 
-       
-       "share_this_video" : "Share This Video",
-       "video_credits" : "Video Credits",
-       
-       "menu_btn"      : "MENU",
-       "close_btn"     : "CLOSE",
-
-       
-       "mv_ogg-player-vlc-mozilla" : "VLC Plugin",
-       "mv_ogg-player-videoElement" : "Native Ogg Video Support",
-       "mv_ogg-player-vlc-activex" : "VLC ActiveX",    
-       "mv_ogg-player-oggPlugin" : "Generic Ogg Plugin",
-       "mv_ogg-player-quicktime-mozilla" : "Quicktime Plugin",
+
+       "clip_linkback" : "Clip source page",
+       "chose_player"  : "Choose video player",
+
+       "share_this_video" : "Share this video",
+       "video_credits" : "Video credits",
+
+       "menu_btn"      : "Menu",
+       "close_btn"     : "Close",
+
+
+       "mv_ogg-player-vlc-mozilla" : "VLC plugin",
+       "mv_ogg-player-videoElement" : "Native Ogg video support",
+       "mv_ogg-player-vlc-activex" : "VLC ActiveX",
+       "mv_ogg-player-oggPlugin" : "Generic Ogg plugin",
+       "mv_ogg-player-quicktime-mozilla" : "Quicktime plugin",
        "mv_ogg-player-quicktime-activex" : "Quicktime ActiveX",
        "mv_ogg-player-cortado" : "Java Cortado",
        "mv_ogg-player-flowplayer" : "Flowplayer",
        "mv_ogg-player-selected" : " (selected)",
        "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis",
-       "mv_generic_missing_plugin" : "You browser does not appear to support playback type: <b>$1</b><br> visit the <a href=\"http://commons.wikimedia.org/wiki/Commons:Media_help\">Playback Methods</a> page to download a player<br>",
-       
-       "mv_for_best_experience": "For a better video playback experience we recommend:<br> <b><a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed\">Firefox 3.5</a></b>",
+       "mv_generic_missing_plugin" : "You browser does not appear to support the following playback type: <b>$1</b><br />Visit the <a href=\"http://commons.wikimedia.org/wiki/Commons:Media_help\">Playback Methods</a> page to download a player.<br />",
+
+       "mv_for_best_experience": "For a better video playback experience we recommend:<br /><b><a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed\">Firefox 3.5</a>.</b>",
        "mv_do_not_warn_again": "Dissmiss for now.",
-       
-       "players": "Players"            
+
+       "players": "Players"
 });
 
 var default_video_attributes = {
@@ -81,7 +81,7 @@ var default_video_attributes = {
        "end":null,
        "controls":true,
        "muted":false,
-       
+
        //roe url (for xml based metadata)
        "roe":null,
        //if roe includes metadata tracks we can expose a link to metadata
@@ -95,15 +95,15 @@ var default_video_attributes = {
        "duration":null,   //media duration (read from file or the temporal url)
        "networkState":0,
 
-       "startOffset":null, //if serving an ogg_chop segment use this to offset the presentation time 
+       "startOffset":null, //if serving an ogg_chop segment use this to offset the presentation time
 
        //custom attributes for mv_embed:
-       "play_button":true,     
+       "play_button":true,
        "thumbnail":null,
        "linkback":null,
        "embed_link":true,
        "download_link":true,
-       "type":null      //the content type of the media 
+       "type":null      //the content type of the media
 };
 /*
  * the base source attibute checks
@@ -116,51 +116,51 @@ var mv_default_source_attr= new Array(
        'startOffset',
        'durationHint',
        'start',
-       'end',  
+       'end',
        'default',
        'lang'
 );
-//set the dismissNativeWarn flag: 
+//set the dismissNativeWarn flag:
 _global['dismissNativeWarn'] = false;
 
 
 var ctrlBuilder = {
        height:29,
        supports:{
-                 'options':true,                                
-                 'borders':true                           
+                 'options':true,
+                 'borders':true
        },
        getControls:function( embedObj ){
-               js_log('f:controlsBuilder:: opt:');     
+               js_log('f:controlsBuilder:: opt:');
                this.id = (embedObj.pc)?embedObj.pc.pp.id:embedObj.id;
                this.available_width = embedObj.playerPixelWidth();
                //make pointer to the embedObj
                this.embedObj = embedObj;
-               var _this = this;               
-               for(var i in embedObj.supports){                        
+               var _this = this;
+               for(var i in embedObj.supports){
                        _this.supports[i] = embedObj.supports[i];
                };
-                                       
+
                //check for close_captions tracks:
                if( ( embedObj.roe || embedObj.timedTextSources() )
                        && embedObj.show_meta_link  )
-                       this.supports['closed_captions']=true;                  
-               
-               var o='';       
+                       this.supports['closed_captions']=true;
+
+               var o='';
                for( var i in this.components ){
                        if( this.supports[i] ){
                                if( this.available_width > this.components[i].w ){
                                        //special case with playhead don't add unless we have 60px
                                        if( i == 'play_head' && ctrlBuilder.available_width < 60 )
-                                               continue;                                               
+                                               continue;
                                        o+=this.components[i].o();
                                        this.available_width -= this.components[i].w;
                                }else{
                                        js_log('not enough space for control component:' + i);
                                }
                        }
-               }               
-               //add the options menu                  
+               }
+               //add the options menu
                o+=this.components['mv_embedded_options'].o( embedObj );
                return o;
        },
@@ -168,11 +168,11 @@ var ctrlBuilder = {
         * addControlHooks
         * to be run once controls are attached to the dom
         */
-       addControlHooks:function( embedObj ){                                                           
-               //add in drag/seek hooks: 
+       addControlHooks:function( embedObj ){
+               //add in drag/seek hooks:
                if(!embedObj.base_seeker_slider_offset &&  $j('#mv_seeker_slider_'+embedObj.id).get(0))
-                       embedObj.base_seeker_slider_offset = $j('#mv_seeker_slider_'+embedObj.id).get(0).offsetLeft;                      
-               
+                       embedObj.base_seeker_slider_offset = $j('#mv_seeker_slider_'+embedObj.id).get(0).offsetLeft;
+
                //js_log('looking for: #mv_seeker_slider_'+embedObj.id + "\n " +
                //              'start sec: '+embedObj.start_time_sec + ' base offset: '+embedObj.base_seeker_slider_offset);
 
@@ -181,22 +181,22 @@ var ctrlBuilder = {
                //@todo: which object is being play()'d (or whatever) ?
                //We select the element to attach the event to this way:
                //$tp.find('.ui-icon-play').parent().click(function(){alert(0)}); or we can give the button itself a class - probably better.
-               
+
                //add play hook for play-btn and large_play_button
                $tp.find('.play-btn,.play-btn-large').unbind().btnBind().click(function(){
                        $j('#' + embedObj.id).get(0).play();
-               })      
+               })
                //add recomend firefox if non-native playback:
-               if( embedObj.doNativeWarningCheck() ){                                                                                                                  
+               if( embedObj.doNativeWarningCheck() ){
                        $j('#dc_'+ embedObj.id).hover(
-                               function(){                                                                             
+                               function(){
                                        if($j('#gnp_' + embedObj.id).length==0){
                                                $j(this).append('<div id="gnp_' + embedObj.id + '" class="ui-state-highlight ui-corner-all" ' +
                                                        'style="position:absolute;display:none;background:#FFF;top:10px;left:10px;right:10px;height:60px;">' +
-                                                       gM('mv_for_best_experience') + 
-                                               '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' + 
-                                                       gM('mv_do_not_warn_again') + 
-                                               '</div>');                                                      
+                                                       gM('mv_for_best_experience') +
+                                               '<br><input id="ffwarn_'+embedObj.id+'" type=\"checkbox\">' +
+                                                       gM('mv_do_not_warn_again') +
+                                               '</div>');
                                                $j('#ffwarn_'+embedObj.id).click(function(){
                                                        if( $j(this).is(':checked') ){
                                                                //set up a cookie for 5 days:
@@ -208,9 +208,9 @@ var ctrlBuilder = {
                                                                _global['adismissNativeWarn'] = false;
                                                                $j.cookie('dismissNativeWarn', false);
                                                        }
-                                                       
-                                               });     
-                                       }                                       
+
+                                               });
+                                       }
                                        if( ($j.cookie('dismissNativeWarn') !== true) &&
                                                _global['dismissNativeWarn'] === false  ){
                                                $j('#gnp_' + embedObj.id).fadeIn('slow');
@@ -221,26 +221,26 @@ var ctrlBuilder = {
                                }
                        );
                }
-               
-               if( $j.browser.msie  &&  $j.browser.version <= 6){                      
+
+               if( $j.browser.msie  &&  $j.browser.version <= 6){
                        $j('#big_play_link_' + embedObj.id).pngFix();
                }
-               
+
                //captions binding:
                $j('#timed_text_'  + embedObj.id).unbind().btnBind().click(function(){
                        $j('#' + embedObj.id).get(0).showTextInterface();
                });
-               
-               //options binding: 
+
+               //options binding:
                $j('#options_button_' + embedObj.id).unbind().btnBind().click(function(){
                        $j('#' +embedObj.id).get(0).doOptionsHTML();
                });
-                               
-               //fullscreen binding: 
+
+               //fullscreen binding:
                $j('#fullscreen_'+embedObj.id).unbind().btnBind().click(function(){
                        $j('#' +embedObj.id).get(0).fullscreen();
-               });                             
-               
+               });
+
                js_log(" should add slider binding: " + $j('#mv_play_head_'+embedObj.id).length) ;
 //             $j('#mv_play_head_'+embedObj.id).slider({
                $tp.find( '.j-scrubber' ).slider({
@@ -254,31 +254,31 @@ var ctrlBuilder = {
                                $j('#big_play_link_'+id).fadeOut('fast');
                                //if playlist always start at 0
                                embedObj.start_time_sec = (embedObj.instanceOf == 'mvPlayList')?0:
-                                                               npt2seconds(embedObj.getTimeReq().split('/')[0]);        
+                                                               npt2seconds(embedObj.getTimeReq().split('/')[0]);
                        },
-                       slide: function(event, ui) {                                                                    
-                               var perc = ui.value/1000;                                                                                                                                                                                                                                                                                       
-                               embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);   
+                       slide: function(event, ui) {
+                               var perc = ui.value/1000;
+                               embedObj.jump_time = seconds2npt( parseFloat( parseFloat(embedObj.getDuration()) * perc ) + embedObj.start_time_sec);
                                //js_log('perc:' + perc + ' * ' + embedObj.getDuration() + ' jt:'+  this.jump_time);
-                               embedObj.setStatus( gM('seek_to')+' '+embedObj.jump_time );     
-                               //update the thumbnail / frame 
+                               embedObj.setStatus( gM('seek_to')+' '+embedObj.jump_time );
+                               //update the thumbnail / frame
                                if(embedObj.isPlaying==false){
                                        embedObj.updateThumbPerc( perc );
                                }
                        },
                        change:function(event, ui){
-                               //only run the onChange event if done by a user slide: 
+                               //only run the onChange event if done by a user slide:
                                if(embedObj.userSlide){
                                        embedObj.userSlide=false;
                                        embedObj.seeking=true;
                                        //stop the monitor timer (if we can)
-                                       if(embedObj.stopMonitor)                                 
-                                               embedObj.stopMonitor();                 
-                                                       
-                                       var perc = ui.value/1000;                                                                                                                 
-                                       //set seek time (in case we have to do a url seek)                              
-                                       embedObj.seek_time_sec = npt2seconds( embedObj.jump_time, true );   
-                                       js_log('do jump to: '+embedObj.jump_time + ' perc:' +perc + ' sts:' + embedObj.seek_time_sec);                                                          
+                                       if(embedObj.stopMonitor)
+                                               embedObj.stopMonitor();
+
+                                       var perc = ui.value/1000;
+                                       //set seek time (in case we have to do a url seek)
+                                       embedObj.seek_time_sec = npt2seconds( embedObj.jump_time, true );
+                                       js_log('do jump to: '+embedObj.jump_time + ' perc:' +perc + ' sts:' + embedObj.seek_time_sec);
                                        embedObj.doSeek(perc);
                                }
                        }
@@ -308,33 +308,33 @@ var ctrlBuilder = {
                                }
                        }
                });
-               //up the z-index of the default status indicator: 
+               //up the z-index of the default status indicator:
 //             $j('#mv_play_head_'+embedObj.id + ' .ui-slider-handle').css('z-index', 4);
 //             $j('#mv_play_head_'+embedObj.id + ' .ui-slider-range').addClass('ui-corner-all').css('z-index', 2);
-               //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highliter) 
+               //extended class list for jQuery ui themeing (we can probably refactor this with custom buffering highliter)
                $j('#' + embedObj.id + ' .j-scrubber').prepend( ctrlBuilder.getMvBufferHtml() );
 
-               
-               //options menu          
-               $tp.find('.k-menu').hide();       
-               $tp.find('.k-options').click(function(){                
+
+               //options menu
+               $tp.find('.k-menu').hide();
+               $tp.find('.k-options').click(function(){
                        var $ktxt = $j(this).find('.ui-icon-k-menu');
                        var $kmenu = $tp.find('.k-menu');
                        if( $kmenu.is(':visible') ){
                                $kmenu.fadeOut("fast",function(){
-                                       $ktxt.html ( gM('menu_btn') );                                           
+                                       $ktxt.html ( gM('menu_btn') );
                                });
                                $tp.find('.play-btn-large').fadeIn('fast');
                        }else{
                                $kmenu.fadeIn("fast", function(){
                                        $ktxt.html ( gM('close_btn') );
                                });
-                               $tp.find('.play-btn-large').fadeOut('fast');                            
-                       }               
+                               $tp.find('.play-btn-large').fadeOut('fast');
+                       }
         });
 
 
-               //videoOptions: 
+               //videoOptions:
         $tp.find('.k-player-btn').click(function(){
                        embedObj.selectPlaybackMethod();
             return false;
@@ -344,7 +344,7 @@ var ctrlBuilder = {
                        embedObj.showVideoDownload();
             return false;
                });
-               
+
                $tp.find('.k-share-btn').click(function(){
                        embedObj.showEmbedCode();
             return false;
@@ -358,7 +358,7 @@ var ctrlBuilder = {
                $tp.find('.k-volume').unbind().btnBind().click(function(){
                        $tp.toggleMute();
                });
-               
+
                var hoverOverDelay=false;
                /*$j('#volume_control_'+embedObj.id).unbind().btnBind().click(function(){
                        $j('#' +embedObj.id).get(0).toggleMute();
@@ -411,7 +411,7 @@ var ctrlBuilder = {
                                }
                        }
                });*/
-               
+
        },
        getMvBufferHtml:function(){
                return '<div class="ui-slider-horizontal ui-corner-all ui-slider-buffer" />';
@@ -425,7 +425,7 @@ var ctrlBuilder = {
                },
                'mv_embedded_options':{
                        'w':0,
-                       'o':function( embedObj ){                                                       
+                       'o':function( embedObj ){
                                var o= '' +
                                '<div class="k-menu ui-widget-content" ' +
                                        'style="width:' + embedObj.playerPixelWidth() + 'px; height:' + embedObj.playerPixelHeight() + 'px;">' +
@@ -456,7 +456,7 @@ var ctrlBuilder = {
                'pause':{
                        'w':147, //28 147
                        'o':function(){
-                               return '<button class="play-btn ui-state-default ui-corner-all" title="' + 
+                               return '<button class="play-btn ui-state-default ui-corner-all" title="' +
                                        gM('play_clip') + '" ><span class="ui-icon ui-icon-play"></span></button>'
                        }
                },
@@ -470,7 +470,7 @@ var ctrlBuilder = {
                'time_display':{
                        'w':36,
                        'o':function(){
-                               return '<div class="k-timer">' + seconds2npt ( ctrlBuilder.embedObj.getDuration() ) + '</div>';                 
+                               return '<div class="k-timer">' + seconds2npt ( ctrlBuilder.embedObj.getDuration() ) + '</div>';
                        }
                },
                'volume_control':{
@@ -480,7 +480,7 @@ var ctrlBuilder = {
                                                        '<span class="ui-icon ui-icon-volume-on"></span>' +
                                                '</button>' +
                                                '<div class="ui-slider ui-slider-horizontal k-volume-slider"></div>';
-                               
+
                                //vertical volume control:
                                /* return '<div title="' + gM('volume_control') + '" id="volume_control_'+ctrlBuilder.id+'" class="ui-state-default ui-corner-all ui-icon_link rButton">' +
                                        '<span class="ui-icon ui-icon-volume-on"></span>' +
@@ -510,11 +510,11 @@ var ctrlBuilder = {
                        'w':50,
                        'o':function(){
                                return '<button class="ui-state-default ui-corner-bl k-options" title="'+ gM('player_options') + '" >' +
-                                                       '<span class="ui-icon ui-icon-k-menu">'+ gM('menu_btn') + '</span>'                                                     
-                                               '</button>'                             
+                                                       '<span class="ui-icon ui-icon-k-menu">'+ gM('menu_btn') + '</span>'
+                                               '</button>'
                        }
                }
-       }       
+       }
 }
 
 /*
@@ -523,79 +523,79 @@ var ctrlBuilder = {
 function mv_video_embed(swap_done_callback, force_id){
        mvEmbed.init( swap_done_callback, force_id );
 }
-mvEmbed = {    
-       //flist stores the set of functions to run after the video has been swaped in. 
+mvEmbed = {
+       //flist stores the set of functions to run after the video has been swaped in.
        flist:new Array(),
        init:function( swap_done_callback, force_id ){
-               
+
                if(swap_done_callback)
                        mvEmbed.flist.push( swap_done_callback );
-                       
+
                //get mv_embed location if it has not been set
-               js_log('mv_embed ' + MV_EMBED_VERSION);                         
-               
-               var loadPlaylistLib=false;                                              
-               
+               js_log('mv_embed ' + MV_EMBED_VERSION);
+
+               var loadPlaylistLib=false;
+
                var eAction = function(this_elm){
                        js_log( "Do SWAP: " + $j(this_elm).attr("id") + ' tag: '+ this_elm.tagName.toLowerCase() );
-                                       
+
                        if( $j(this_elm).attr("id") == '' ){
                                $j(this_elm).attr("id", 'v'+ global_player_list.length);
-                       }                       
-                       //stre a global reference to the id     
+                       }
+                       //stre a global reference to the id
                   global_player_list.push( $j(this_elm).attr("id") );
                   //if video doSwap
                   switch( this_elm.tagName.toLowerCase()){
                           case 'video':
-                                   var videoInterface = new embedVideo(this_elm);       
+                                   var videoInterface = new embedVideo(this_elm);
                                        mvEmbed.swapEmbedVideoElement( this_elm, videoInterface );
                           break;
                           case 'audio':
-                                  var videoInterface = new embedVideo(this_elm);        
+                                  var videoInterface = new embedVideo(this_elm);
                                   videoInterface.type ='audio';
                                   mvEmbed.swapEmbedVideoElement( this_elm, videoInterface );
                           break;
                           case 'playlist':
                                   loadPlaylistLib=true;
                           break;
-                  }            
+                  }
                }
-               
+
                if( force_id == null && force_id != '' ){
-                       var j_selector = 'video,audio,playlist';                                
+                       var j_selector = 'video,audio,playlist';
                }else{
                        var j_selector = '#' + force_id;
                }
-               //process selected elements: 
-               //ie8 does not play well with the jQuery video,audio,playlist selector use native: 
+               //process selected elements:
+               //ie8 does not play well with the jQuery video,audio,playlist selector use native:
                if($j.browser.msie && $j.browser.version >= 8){
-                       jtags = j_selector.split(',');                          
-                       for( var i=0; i < jtags.length; i++){                           
+                       jtags = j_selector.split(',');
+                       for( var i=0; i < jtags.length; i++){
                                $j( document.getElementsByTagName( jtags[i] )).each(function(){
                                        eAction(this);
                                });
-                       }                               
-               }else{                  
+                       }
+               }else{
                        $j( j_selector ).each(function(){
                                eAction(this);
-                       });     
-               }                               
-               if(loadPlaylistLib){            
-                       mvJsLoader.doLoad([ 
+                       });
+               }
+               if(loadPlaylistLib){
+                       mvJsLoader.doLoad([
                                'mvPlayList',
                                '$j.ui',        //include dialog for pop-ing up thigns
-                               '$j.ui.dialog'  
+                               '$j.ui.dialog'
                        ], function(){
-                               $j('playlist').each(function(){                                                                                                                                                                                                                                                                 
+                               $j('playlist').each(function(){
                                        //create new playlist interface:
                                        var plObj = new mvPlayList( this );
                                        mvEmbed.swapEmbedVideoElement(this, plObj);
                                        var added_height = plObj.pl_layout.title_bar_height + plObj.pl_layout.control_height;
-                                       //move into a blocking display container with height + controls + title height: 
-                                       $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>');                                                                             
+                                       //move into a blocking display container with height + controls + title height:
+                                       $j('#'+plObj.id).wrap('<div style="display:block;height:' + (plObj.height + added_height) + 'px;"></div>');
                                });
                        });
-               }          
+               }
                this.checkClipsReady();
        },
        /*
@@ -607,13 +607,13 @@ mvEmbed = {
                js_log('do swap ' + videoInterface.id + ' for ' + video_element);
                embed_video = document.createElement('div');
                //make sure our div has a hight/width set:
-                       
+
                $j(embed_video).css({
                        'width':videoInterface.width,
                        'height':videoInterface.height
-               }).html( mv_get_loading_img() );                
+               }).html( mv_get_loading_img() );
                //inherit the video interface
-               for(var method in videoInterface){ //for in loop oky in Element context 
+               for(var method in videoInterface){ //for in loop oky in Element context
                        if(method!='readyState'){ //readyState crashes IE
                                if(method=='style'){
                                                embed_video.setAttribute('style', videoInterface[method]);
@@ -630,32 +630,32 @@ mvEmbed = {
                        //string -> boolean:
                        if(embed_video[method]=="false")embed_video[method]=false;
                        if(embed_video[method]=="true")embed_video[method]=true;
-               }       
-               ///js_log('did vI style');  
-               //now swap out the video element for the embed_video obj:         
-               $j(video_element).after(embed_video).remove();  
-               //js_log('did swap');             
-               $j('#'+embed_video.id).get(0).on_dom_swap();    
-                         
+               }
+               ///js_log('did vI style');
+               //now swap out the video element for the embed_video obj:
+               $j(video_element).after(embed_video).remove();
+               //js_log('did swap');
+               $j('#'+embed_video.id).get(0).on_dom_swap();
+
                // now that "embed_video" is stable, do more initialization (if we are ready)
-               if($j('#'+embed_video.id).get(0).loading_external_data == false && 
+               if($j('#'+embed_video.id).get(0).loading_external_data == false &&
                           $j('#'+embed_video.id).get(0).init_with_sources_loadedDone == false){
-                       //load and set ready state since source are available: 
+                       //load and set ready state since source are available:
                        $j('#'+embed_video.id).get(0).init_with_sources_loaded();
                }
-               
+
                js_log('done with child: ' + embed_video.id + ' len:' + global_player_list.length);
                return true;
        },
        //this should not be needed.
        checkClipsReady : function(){
                //js_log('checkClipsReady');
-               var is_ready=true;        
+               var is_ready=true;
                  for(var i=0; i < global_player_list.length; i++){
                          if( $j('#'+global_player_list[i]).length !=0){
-                                 var cur_vid =  $j('#'+global_player_list[i]).get(0);            
+                                 var cur_vid =  $j('#'+global_player_list[i]).get(0);
                                is_ready = ( cur_vid.ready_to_play ) ? is_ready : false;
-                               if( !is_ready && cur_vid.load_error ){ 
+                               if( !is_ready && cur_vid.load_error ){
                                        is_ready=true;
                                        $j(cur_vid).html( cur_vid.load_error );
                                }
@@ -663,15 +663,15 @@ mvEmbed = {
                }
                if( is_ready ){
                        mvEmbed.allClipsReady = true;
-                       // run queued functions 
+                       // run queued functions
                        //js_log('run queded functions:' + mvEmbed.flist[0]);
                        mvEmbed.runFlist();
-               }else{                           
+               }else{
                         setTimeout( 'mvEmbed.checkClipsReady()', 25 );
-                }                        
+                }
        },
        runFlist:function(){
-               while (this.flist.length){                              
+               while (this.flist.length){
                        this.flist.shift()();
                }
        }
@@ -714,37 +714,37 @@ mediaSource.prototype =
 
        init : function(element)
        {
-               //js_log('adding mediaSource: ' + element);                             
+               //js_log('adding mediaSource: ' + element);
                this.src = $j(element).attr('src');
                this.marked_default = false;
                if ( element.tagName.toLowerCase() == 'video')
-                       this.marked_default = true;             
-               
+                       this.marked_default = true;
+
                //set default URLTimeEncoding if we have a time  url:
-               //not ideal way to discover if content is on an oggz_chop server. 
-               //should check some other way. 
+               //not ideal way to discover if content is on an oggz_chop server.
+               //should check some other way.
                var pUrl = parseUri ( this.src );
                if(typeof pUrl['queryKey']['t'] != 'undefined'){
-                       this['URLTimeEncoding']=true;                   
-               }                               
+                       this['URLTimeEncoding']=true;
+               }
                for(var i=0; i < mv_default_source_attr.length; i++){ //array loop:
-                       var attr = mv_default_source_attr[ i ];                 
+                       var attr = mv_default_source_attr[ i ];
                        if( $j(element).attr( attr ) ) {
                                this[ attr ] =  $j(element).attr( attr );
                        }
-               }                               
-               //update duration from hit if present: 
+               }
+               //update duration from hit if present:
                if(this.durationHint)
-                       this.duration = this.durationHint;              
-                                       
-                       
+                       this.duration = this.durationHint;
+
+
                if ( $j(element).attr('type'))
                        this.mime_type = $j(element).attr('type');
                else if ($j(element).attr('content-type'))
                        this.mime_type = $j(element).attr('content-type');
-               else                    
+               else
                        this.mime_type = this.detectType(this.src);
-               
+
                //set the title if unset:
                if( !this.title )
                        this.title = this.mime_type;
@@ -752,9 +752,9 @@ mediaSource.prototype =
                this.parseURLDuration();
        },
        updateSource:function(element){
-               //for now just update the title: 
+               //for now just update the title:
                if ($j(element).attr("title"))
-                       this.title = $j(element).attr("title");         
+                       this.title = $j(element).attr("title");
        },
        /** updates the src time and start & end
         *  @param {String} start_time in NTP format
@@ -765,18 +765,18 @@ mediaSource.prototype =
                //js_log("pre uri:" + this.src);
                //if we have time we can use:
                if( this.URLTimeEncoding ){
-                       //make sure its a valid start time / end time (else set default) 
-                       if( !npt2seconds(start_ntp) ) 
+                       //make sure its a valid start time / end time (else set default)
+                       if( !npt2seconds(start_ntp) )
                                start_ntp = this.start_ntp;
-                               
+
                        if( !npt2seconds(end_ntp) )
                                end_ntp = this.end_ntp;
-                                                                                 
-                       this.src = getURLParamReplace(this.src, { 't': start_ntp +'/'+ end_ntp } );                
-                       
+
+                       this.src = getURLParamReplace(this.src, { 't': start_ntp +'/'+ end_ntp } );
+
                        //update the duration
                        this.parseURLDuration();
-               }                
+               }
        },
        setDuration:function (duration)
        {
@@ -794,20 +794,20 @@ mediaSource.prototype =
                return this.mime_type;
        },
        /** URI accessor function.
-        *       @param int seek_time_sec (used to adjust the URI for url based seeks) 
+        *       @param int seek_time_sec (used to adjust the URI for url based seeks)
                @return the URI of the source.
                @type String
        */
        getURI : function( seek_time_sec )
-       {                               
-          if( !seek_time_sec || !this.URLTimeEncoding ){                       
-                          return this.src;                                               
-          }                            
+       {
+          if( !seek_time_sec || !this.URLTimeEncoding ){
+                          return this.src;
+          }
           if(!this.end_ntp){
                  var endvar = '';
           }else{
                  var endvar = '/'+ this.end_ntp;
-          }            
+          }
           return getURLParamReplace(this.src,  { 't': seconds2npt( seek_time_sec )+endvar } ); ;
        },
        /** Title accessor function.
@@ -831,9 +831,9 @@ mediaSource.prototype =
         * special case derive duration from request url
         * supports media_url?t=ntp_start/ntp_end url request format
         */
-       parseURLDuration : function(){                    
-               //check if we have a URLTimeEncoding: 
-               if( this.URLTimeEncoding ){               
+       parseURLDuration : function(){
+               //check if we have a URLTimeEncoding:
+               if( this.URLTimeEncoding ){
                        var annoURL = parseUri( this.src );
                        if( annoURL.queryKey['t'] ){
                                var times = annoURL.queryKey['t'].split('/');
@@ -845,15 +845,15 @@ mediaSource.prototype =
                                //look for this info as attributes
                                if(this.startOffset){
                                        this.start_offset = this.startOffset;
-                                       this.start_ntp = seconds2npt( this.startOffset);                                        
-                               } 
+                                       this.start_ntp = seconds2npt( this.startOffset);
+                               }
                                if(this.duration){
                                        this.end_ntp = seconds2npt( parseInt(this.duration) + parseInt(this.start_offset) );
-                               }                               
-                       }                                               
+                               }
+                       }
                }
                //else nothing to parse just keep whatever info we already have
-               
+
                //js_log('f:parseURLDuration() for:' + this.src  + ' d:' + this.duration);
        },
        /** Attempts to detect the type of a media file based on the URI.
@@ -893,12 +893,12 @@ function mediaElement(video_element)
 mediaElement.prototype =
 {
        /** The array of mediaSource elements. */
-       sources:null,   
-       addedROEData:false,     
+       sources:null,
+       addedROEData:false,
        /** Selected mediaSource element. */
        selected_source:null,
        thumbnail:null,
-       linkback:null,  
+       linkback:null,
 
        /** @private */
        init:function( video_element )
@@ -909,20 +909,20 @@ mediaElement.prototype =
                this.thumbnail = mv_default_thumb_url;
                // Process the source element:
                if($j(video_element).attr("src"))
-                       this.tryAddSource(video_element);                         
-               
+                       this.tryAddSource(video_element);
+
                if($j(video_element).attr('thumbnail'))
                        this.thumbnail = $j(video_element).attr('thumbnail');
-                       
+
                if($j(video_element).attr('poster'))
                        this.thumbnail = $j(video_element).attr('poster');
-                       
-               // Process all inner <source> elements  
+
+               // Process all inner <source> elements
                //js_log("inner source count: " + video_element.getElementsByTagName('source').length );
-               
-               $j(video_element).find('source,text').each(function(inx, inner_source){                 
+
+               $j(video_element).find('source,text').each(function(inx, inner_source){
                        _this.tryAddSource( inner_source );
-               });                                               
+               });
        },
        /** Updates the time request for all sources that have a standard time request argument (ie &t=start_time/end_time)
         */
@@ -934,10 +934,10 @@ mediaElement.prototype =
        },
        /*timed Text check*/
        timedTextSources:function(){
-               for(var i=0; i < this.sources.length; i++){                     
+               for(var i=0; i < this.sources.length; i++){
                        if(     this.sources[i].mime_type == 'text/cmml' ||
                                this.sources[i].mime_type == 'text/x-srt')
-                                       return true;                                                            
+                                       return true;
                };
                return false;
        },
@@ -948,7 +948,7 @@ mediaElement.prototype =
        {
                if(!mime_filter)
                        return this.sources;
-               //apply mime filter: 
+               //apply mime filter:
                   var source_set = new Array();
                for(var i=0; i < this.sources.length ; i++){
                        if( this.sources[i].mime_type.indexOf( mime_filter ) != -1 )
@@ -956,7 +956,7 @@ mediaElement.prototype =
                }
                return source_set;
        },
-       getSourceById:function( source_id ){            
+       getSourceById:function( source_id ){
                for(var i=0; i < this.sources.length ; i++){
                        if( this.sources[i].id ==  source_id)
                                return this.sources[i];
@@ -972,70 +972,70 @@ mediaElement.prototype =
                for(var i=0; i < playable_sources.length; i++){
                        if( i==index ){
                                this.selected_source = playable_sources[i];
-                               //update the user selected format: 
+                               //update the user selected format:
                                embedTypes.players.userSelectFormat( playable_sources[i].mime_type );
                                break;
                        }
-               }               
+               }
        },
        /** selects the default source via cookie preference, default marked, or by id order
         * */
-       autoSelectSource:function(){ 
-               js_log('f:autoSelectSource:');  
-               //@@todo read user preference for source                
+       autoSelectSource:function(){
+               js_log('f:autoSelectSource:');
+               //@@todo read user preference for source
                // Select the default source
-               var playable_sources = this.getPlayableSources();                                                       
-               var flash_flag=ogg_flag=false;            
+               var playable_sources = this.getPlayableSources();
+               var flash_flag=ogg_flag=false;
                //debugger;
                for(var source=0; source < playable_sources.length; source++){
                        var mime_type =playable_sources[source].mime_type;
                        if( playable_sources[source].marked_default ){
                                js_log('set via marked default: ' + playable_sources[source].marked_default);
-                               this.selected_source = playable_sources[source];                                
+                               this.selected_source = playable_sources[source];
                                return true;
                        }
                        //set via user-preference
                        if(embedTypes.players.preference['format_prefrence'] == mime_type){
                                 js_log('set via preference: '+playable_sources[source].mime_type);
                                 this.selected_source = playable_sources[source];
-                                return true; 
-                       }                                                                                                                       
-               }          
-               //set Ogg via player support            
+                                return true;
+                       }
+               }
+               //set Ogg via player support
                for(var source=0; source < playable_sources.length; source++){
                        js_log('f:autoSelectSource:' + playable_sources[source].mime_type);
-                       var mime_type =playable_sources[source].mime_type;                                      
-                          //set source via player                               
-                       if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='application/ogg'){                             
+                       var mime_type =playable_sources[source].mime_type;
+                          //set source via player
+                       if(mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='application/ogg'){
                                for(var i=0; i < embedTypes.players.players.length; i++){ //for in loop on object oky
-                                       var player = embedTypes.players.players[i];                                     
+                                       var player = embedTypes.players.players[i];
                                        if(player.library=='vlc' || player.library=='native'){
-                                               js_log('set via ogg via order');                                                
-                                               this.selected_source = playable_sources[source];        
+                                               js_log('set via ogg via order');
+                                               this.selected_source = playable_sources[source];
                                                return true;
-                                       }                                       
+                                       }
                                }
                        }
                }
                //set basic flash
-               for(var source=0; source < playable_sources.length; source++){  
-                       var mime_type =playable_sources[source].mime_type;                                                                              
+               for(var source=0; source < playable_sources.length; source++){
+                       var mime_type =playable_sources[source].mime_type;
                        if( mime_type=='video/x-flv' ){
                                js_log('set via by player preference normal flash')
                                this.selected_source = playable_sources[source];
                                return true;
-                       }                                               
+                       }
                }
-               //set h264 flash 
-               for(var source=0; source < playable_sources.length; source++){  
-                       var mime_type =playable_sources[source].mime_type;                                                                              
+               //set h264 flash
+               for(var source=0; source < playable_sources.length; source++){
+                       var mime_type =playable_sources[source].mime_type;
                        if( mime_type=='video/h264' ){
                                js_log('set via playable_sources preference h264 flash')
                                this.selected_source = playable_sources[source];
                                return true;
-                       }                          
-               }               
-               //select first source           
+                       }
+               }
+               //select first source
                if (!this.selected_source)
                {
                        js_log('set via first source:' + playable_sources[0]);
@@ -1074,48 +1074,48 @@ mediaElement.prototype =
                //return mime_type=='video/ogg' || mime_type=='ogg/video' || mime_type=='video/annodex' || mime_type=='video/x-flv';
        },
        /** Adds a single mediaSource using the provided element if
-               the element has a 'src' attribute.              
+               the element has a 'src' attribute.
                @param element {element} <video>, <source> or <mediaSource> element.
        */
        tryAddSource:function(element)
        {
-               js_log('f:tryAddSource:'+ $j(element).attr("src"));             
+               js_log('f:tryAddSource:'+ $j(element).attr("src"));
                if (! $j(element).attr("src")){
                        //js_log("element has no src");
                        return false;
                }
                var new_src = $j(element).attr('src');
-               //make sure an existing element with the same src does not already exist:                
-               for( var i=0; i < this.sources.length; i++ ){                           
+               //make sure an existing element with the same src does not already exist:
+               for( var i=0; i < this.sources.length; i++ ){
                        if(this.sources[i].src == new_src){
-                               //js_log('checking existing: '+this.sources[i].getURI() + ' != '+ new_src);      
-                               //can't add it all but try to update any additional attr: 
+                               //js_log('checking existing: '+this.sources[i].getURI() + ' != '+ new_src);
+                               //can't add it all but try to update any additional attr:
                                this.sources[i].updateSource(element);
                                return false;
                        }
                }
-               var source = new mediaSource( element );                
-               this.sources.push(source);              
+               var source = new mediaSource( element );
+               this.sources.push(source);
                //alert('pushed source to stack'+ source + 'sl:'+this.sources.length);
        },
-       getPlayableSources: function(){          
+       getPlayableSources: function(){
                 var playable_sources= new Array();
-                for(var i=0; i < this.sources.length; i++){                                                               
-                        if( this.isPlayableType( this.sources[i].mime_type ) ){                                 
+                for(var i=0; i < this.sources.length; i++){
+                        if( this.isPlayableType( this.sources[i].mime_type ) ){
                                 playable_sources.push( this.sources[i] );
                         }else{
                                 js_log("type "+ this.sources[i].mime_type + 'is not playable');
                         }
-                };              
+                };
                 return playable_sources;
        },
        /* Imports media sources from ROE data.
         *   @param roe_data ROE data.
        */
-       addROE:function(roe_data){              
+       addROE:function(roe_data){
                js_log('f:addROE');
                this.addedROEData=true;
-               var _this = this;               
+               var _this = this;
                if( typeof roe_data == 'string' )
                {
                        var parser=new DOMParser();
@@ -1142,7 +1142,7 @@ mediaElement.prototype =
                        });
                }else{
                        js_log('ROE data empty.');
-               }                               
+               }
        }
 };
 
@@ -1158,7 +1158,7 @@ var embedVideo = function(element) {
 embedVideo.prototype = {
        /** The mediaElement object containing all mediaSource objects */
        media_element:null,
-       preview_mode:false,                
+       preview_mode:false,
        ready_to_play:false, //should use html5 ready state
        load_error:false, //used to set error in case of error
        loading_external_data:false,
@@ -1166,19 +1166,19 @@ embedVideo.prototype = {
        thumbnail_disp:true,
        init_with_sources_loadedDone:false,
        inDOM:false,
-       //for onClip done stuff: 
+       //for onClip done stuff:
        anno_data_cache:null,
        seek_time_sec:0,
        base_seeker_slider_offset:null,
        onClipDone_disp:false,
-       supports:{},    
+       supports:{},
        //for seek thumb updates:
        cur_thumb_seek_time:0,
        thumb_seek_interval:null,
-       
+
        seeking:false,
-       //set the buffered percent:     
-       bufferedPercent:0,      
+       //set the buffered percent:
+       bufferedPercent:0,
        //utility functions for property values:
        hx : function ( s ) {
                if ( typeof s != 'String' ) {
@@ -1207,7 +1207,7 @@ embedVideo.prototype = {
                else
                        return parseInt(this.height);
        },
-       init: function(element){                
+       init: function(element){
                //this.element_pointer = element;
 
                //inherit all the default video_attributes
@@ -1220,16 +1220,16 @@ embedVideo.prototype = {
                                //js_log('attr:' + attr + ' val: ' + video_attributes[attr] +" "+ 'elm_val:' + element.getAttribute(attr) + "\n (set by attr)");
                        }
                }
-               //make sure startOffset is cast as an int                  
+               //make sure startOffset is cast as an int
                if( this.startOffset && this.startOffset.split(':').length >= 2)
                        this.startOffset = npt2seconds(this.startOffset);
-               //make sure offset is in float: 
+               //make sure offset is in float:
                this.startOffset = parseFloat(this.startOffset);
-                
+
                if( this.duration && this.duration.split(':').length >= 2)
-                       this.duration = npt2seconds( this.duration );    
-                  //make sure duration is in float:  
-               this.duration = parseFloat(this.duration);  
+                       this.duration = npt2seconds( this.duration );
+                  //make sure duration is in float:
+               this.duration = parseFloat(this.duration);
                js_log("duration is: " +  this.duration);
                //if style is set override width and height
                var dwh = mwConfig['video_size'].split('x');
@@ -1243,114 +1243,114 @@ embedVideo.prototype = {
                if(element.innerHTML!='' && element.getElementsByTagName('source').length==0){
                        js_log('innerHTML: ' + element.innerHTML);
                        this.user_missing_plugin_html=element.innerHTML;
-               }                                 
+               }
                // load all of the specified sources
-               this.media_element = new mediaElement(element);                                                  
+               this.media_element = new mediaElement(element);
        },
        on_dom_swap: function(){
-               js_log('f:on_dom_swap');                                
+               js_log('f:on_dom_swap');
                // Process the provided ROE file... if we don't yet have sources
                if(this.roe && this.media_element.sources.length==0 ){
                        js_log('loading external data');
                        this.loading_external_data=true;
-                       var _this = this;                                       
+                       var _this = this;
                        do_request(this.roe, function(data)
-                       {                                                       
-                               //continue                                         
-                               _this.media_element.addROE( data );                                                                       
-                               js_log('added_roe::' + _this.media_element.sources.length);                                                        
-                                                                                                          
-                               js_log('set loading_external_data=false');       
-                               _this.loading_external_data=false;                                                         
-                               
-                               _this.init_with_sources_loaded();               
+                       {
+                               //continue
+                               _this.media_element.addROE( data );
+                               js_log('added_roe::' + _this.media_element.sources.length);
+
+                               js_log('set loading_external_data=false');
+                               _this.loading_external_data=false;
+
+                               _this.init_with_sources_loaded();
                        });
                }
        },
        init_with_sources_loaded : function()
-       {       
+       {
                js_log('f:init_with_sources_loaded');
                //set flag that we have run this function:
-               this.init_with_sources_loadedDone=true;                          
+               this.init_with_sources_loadedDone=true;
                //autoseletct the source
-               this.media_element.autoSelectSource();          
+               this.media_element.autoSelectSource();
                //auto select player based on prefrence or default order
                if( !this.media_element.selected_source )
                {
-                       //check for parent clip: 
-                       if( typeof this.pc != 'undefined' ){                    
-                               js_log('no sources, type:' +this.type + ' check for html');     
-                               //debugger;                     
-                               //do load player if just displaying innerHTML: 
+                       //check for parent clip:
+                       if( typeof this.pc != 'undefined' ){
+                               js_log('no sources, type:' +this.type + ' check for html');
+                               //debugger;
+                               //do load player if just displaying innerHTML:
                                if( this.pc.type == 'text/html' ){
                                        this.selected_player = embedTypes.players.defaultPlayer( 'text/html' );
-                                       js_log('set selected player:'+ this.selected_player.mime_type); 
+                                       js_log('set selected player:'+ this.selected_player.mime_type);
                                }
                        }
-               }else{          
+               }else{
                        this.selected_player = embedTypes.players.defaultPlayer( this.media_element.selected_source.mime_type );
-               }                                                 
+               }
                if( this.selected_player ){
                        js_log('selected ' + this.selected_player.getName());
                        js_log("PLAYBACK TYPE: "+this.selected_player.library);
-                       this.thumbnail_disp = true;             
-                       this.inheritEmbedObj();            
-               }else{                                                   
+                       this.thumbnail_disp = true;
+                       this.inheritEmbedObj();
+               }else{
                        //no source's playable
                        var missing_type ='';
-                       var or ='';  
+                       var or ='';
                        for( var i=0; i < this.media_element.sources.length; i++){
                                missing_type+= or + this.media_element.sources[i].mime_type;
                                or=' or ';
-                       }                       
+                       }
                        if( this.pc )
-                               var missing_type = this.pc.type;                                                                                
+                               var missing_type = this.pc.type;
                           js_log('no player found for given source type ' + missing_type);
-                          this.load_error= this.getPluginMissingHTML(missing_type);                                                                               
-               }               
+                          this.load_error= this.getPluginMissingHTML(missing_type);
+               }
        },
-       inheritEmbedObj:function(){             
-               js_log("inheritEmbedObj:duration is: " +  this.duration);  
+       inheritEmbedObj:function(){
+               js_log("inheritEmbedObj:duration is: " +  this.duration);
                //@@note: tricky cuz direct overwrite is not so ideal.. since the extended object is already tied to the dom
                //clear out any non-base embedObj stuff:
                if(this.instanceOf){
                        eval('tmpObj = '+this.instanceOf);
-                       for(var i in tmpObj){ //for in loop oky for object  
+                       for(var i in tmpObj){ //for in loop oky for object
                                if(this['parent_'+i]){
                                        this[i]=this['parent_'+i];
                                }else{
                                        this[i]=null;
                                }
                        }
-               }                                 
+               }
                //set up the new embedObj
                js_log('f: inheritEmbedObj: embedding with ' + this.selected_player.library);
-               var _this = this;               
+               var _this = this;
                this.selected_player.load( function()
                {
-                        js_log("selected_player::load:duration is: " +  _this.duration);  
+                        js_log("selected_player::load:duration is: " +  _this.duration);
                        //js_log('inheriting '+_this.selected_player.library +'Embed to ' + _this.id + ' ' + $j('#'+_this.id).length);
                        //var _this = $j('#'+_this.id).get(0);
                        //js_log( 'type of ' + _this.selected_player.library +'Embed + ' +
-                       //              eval('typeof '+_this.selected_player.library +'Embed')); 
+                       //              eval('typeof '+_this.selected_player.library +'Embed'));
                        eval('embedObj = ' +_this.selected_player.library +'Embed;');
-                       for(var method in embedObj){ //for in loop oky for object  
+                       for(var method in embedObj){ //for in loop oky for object
                                //parent method preservation for local overwritten methods
                                if(_this[method])
                                        _this['parent_' + method] = _this[method];
                                _this[method]=embedObj[method];
                        }
                        js_log('TYPEOF_ppause: ' + typeof _this['parent_pause']);
-                       
+
                        if(_this.inheritEmbedOverride){
                                _this.inheritEmbedOverride();
                        }
                        //update controls if possible
                        if(!_this.loading_external_data)
-                               _this.refreshControlsHTML();                                                                                            
-                       
-                       //js_log("READY TO PLAY:"+_this.id);                    
-                       _this.ready_to_play=true;                               
+                               _this.refreshControlsHTML();
+
+                       //js_log("READY TO PLAY:"+_this.id);
+                       _this.ready_to_play=true;
                        _this.getDuration();
                        _this.getHTML();
                });
@@ -1361,61 +1361,61 @@ embedVideo.prototype = {
                if(this.selected_player.id != player.id){
                        this.selected_player = player;
                        this.inheritEmbedObj();
-               }                       
+               }
        },
-       doNativeWarningCheck:function(){                        
+       doNativeWarningCheck:function(){
                if( $j.cookie('dismissNativeWarn') && $j.cookie('dismissNativeWarn')===true){
                        return false;
-               }else{                  
-                       //see if we have native support for ogg: 
-                       var supporting_players = embedTypes.players.getMIMETypePlayers( 'video/ogg' );          
+               }else{
+                       //see if we have native support for ogg:
+                       var supporting_players = embedTypes.players.getMIMETypePlayers( 'video/ogg' );
                        for(var i=0; i < supporting_players.length; i++){
                                if(supporting_players[i].id == 'videoElement'){
                                        return false;
-                               }                       
-                       }       
-                       //see if we are using mv_embed without a ogg source in which case no point in promoting firefox :P                      
+                               }
+                       }
+                       //see if we are using mv_embed without a ogg source in which case no point in promoting firefox :P
                        if(this.media_element && this.media_element.sources){
                                var foundOgg = false;
                                var playable_sources = this.media_element.getPlayableSources();
-                               for(var sInx=0; sInx < playable_sources.length; sInx++){  
+                               for(var sInx=0; sInx < playable_sources.length; sInx++){
                                        var mime_type = playable_sources[sInx].mime_type;
                                        if( mime_type=='video/ogg' ){
-                                               //they  have flash / h.264 fallback no need to push firefox :( 
+                                               //they  have flash / h.264 fallback no need to push firefox :(
                                                foundOgg = true;
                                        }
                                }
                                //no ogg no point in download firefox
                                if(!foundOgg)
                                        return false;
-                                                                               
+
                        }
                }
-               return true;    
+               return true;
        },
        getTimeReq:function(){
                var default_time_req = '0:00:00/' + seconds2npt(this.getDuration());
                if(!this.media_element)
                        return default_time_req;
                if(!this.media_element.selected_source)
-                       return default_time_req;                
+                       return default_time_req;
                if(!this.media_element.selected_source.end_ntp)
-                       return default_time_req;                
+                       return default_time_req;
                return this.media_element.selected_source.start_ntp+'/'+this.media_element.selected_source.end_ntp;
-       },      
-       getDuration:function(){                                                 
-               //update some local pointers for the selected source:   
-               if(this.media_element && this.media_element.selected_source && this.media_element.selected_source.duration){                                                                     
-                       this.duration = this.media_element.selected_source.duration;                                            
+       },
+       getDuration:function(){
+               //update some local pointers for the selected source:
+               if(this.media_element && this.media_element.selected_source && this.media_element.selected_source.duration){
+                       this.duration = this.media_element.selected_source.duration;
                        this.start_offset = this.media_element.selected_source.start_offset;
                        this.start_ntp = this.media_element.selected_source.start_ntp;
-                       this.end_ntp = this.media_element.selected_source.end_ntp;                                      
+                       this.end_ntp = this.media_element.selected_source.end_ntp;
                }
-               //update start end_ntp if duration !=0 (set from plugin) 
+               //update start end_ntp if duration !=0 (set from plugin)
                if(!this.start_ntp)
                        this.start_ntp = '0:0:0';
                if(!this.end_ntp && this.duration)
-                       this.end_ntp = seconds2npt( this.duration );            
+                       this.end_ntp = seconds2npt( this.duration );
                //return the duration
                return this.duration;
        },
@@ -1428,48 +1428,48 @@ embedVideo.prototype = {
         * wrapEmebedContainer
         * wraps the embed code into a container to better support playlist function
         *  (where embed element is swapped for next clip
-        *  (where plugin method does not support playlsits) 
+        *  (where plugin method does not support playlsits)
         */
        wrapEmebedContainer:function(embed_code){
                //check if parent clip is set( ie we are in a playlist so name the embed container by playlistID)
                var id = (this.pc!=null)?this.pc.pp.id:this.id;
-               return '<div id="mv_ebct_'+id+'" style="width:'+this.width+'px;height:'+this.height+'px;">' + 
-                                       embed_code + 
+               return '<div id="mv_ebct_'+id+'" style="width:'+this.width+'px;height:'+this.height+'px;">' +
+                                       embed_code +
                                '</div>';
-       },      
+       },
        getEmbedHTML : function(){
                //return this.wrapEmebedContainer( this.getEmbedObj() );
                return 'function getEmbedHTML should be overitten by embedLib ';
        },
        //do seek function (should be overwritten by implementing embedLibs)
-       // first check if seek can be done on locally downloaded content. 
-       doSeek : function( perc ){              
-               if( this.supportsURLTimeEncoding() ){                   
+       // first check if seek can be done on locally downloaded content.
+       doSeek : function( perc ){
+               if( this.supportsURLTimeEncoding() ){
                        //make sure this.seek_time_sec is up-to-date:
                        this.seek_time_sec = npt2seconds( this.start_ntp ) + parseFloat( perc * this.getDuration() );
                        js_log('updated seek_time_sec: ' + seconds2npt ( this.seek_time_sec) );
-                       this.stop();                                    
+                       this.stop();
                        this.didSeekJump=true;
                        //update the slider
-                       this.setSliderValue( perc ); 
-               }               
-               //do play in 100ms (give things time to clear) 
+                       this.setSliderValue( perc );
+               }
+               //do play in 100ms (give things time to clear)
                setTimeout('$j(\'#' + this.id + '\').get(0).play()',100);
        },
        /*
-        * seeks to the requested time and issues a callback when ready 
+        * seeks to the requested time and issues a callback when ready
         * (should be overwitten by client that supports frame serving)
-        */     
+        */
        setCurrentTime:function( time, callback){
                js_log('error: base embed setCurrentTime can not frame serve (overide via plugin)');
        },
        addPresTimeOffset:function(){
-          //add in the offset:         
+          //add in the offset:
           if(this.seek_time_sec && this.seek_time_sec!=0){
                        this.currentTime+=this.seek_time_sec;
-          }else if(this.start_offset && this.start_offset!=0){    
-                  this.currentTime = parseFloat(this.currentTime) + parseFloat(this.start_offset);                      
-          }               
+          }else if(this.start_offset && this.start_offset!=0){
+                  this.currentTime = parseFloat(this.currentTime) + parseFloat(this.start_offset);
+          }
        },
        doEmbedHTML:function()
        {
@@ -1479,90 +1479,90 @@ embedVideo.prototype = {
                this.closeDisplayedHTML();
 
 //             if(!this.selected_player){
-//                     return this.getPluginMissingHTML();             
+//                     return this.getPluginMissingHTML();
                //Set "loading" here
                $j('#dc_'+_this.id).html(''+
-                       '<div style="color:black;width:'+this.width+'px;height:'+this.height+'px;">' + 
-                               gM('loading_plugin') + 
-                       '</div>'                                        
+                       '<div style="color:black;width:'+this.width+'px;height:'+this.height+'px;">' +
+                               gM('loading_plugin') +
+                       '</div>'
                );
                // schedule embedding
                this.selected_player.load(function()
                {
-                       js_log('performing embed for ' + _this.id);                     
-                       var embed_code = _this.getEmbedHTML();                  
+                       js_log('performing embed for ' + _this.id);
+                       var embed_code = _this.getEmbedHTML();
                        //js_log('shopuld embed:' + embed_code);
-                       $j('#dc_'+_this.id).html(embed_code);   
+                       $j('#dc_'+_this.id).html(embed_code);
                });
        },
        onClipDone:function(){
                js_log('base:onClipDone');
-               //stop the clip (load the thumbnail etc) 
+               //stop the clip (load the thumbnail etc)
                this.stop();
                this.seek_time_sec = 0;
                this.setSliderValue(0);
                var _this = this;
-               
-               //if the clip resolution is < 320 don't do fancy onClipDone stuff 
+
+               //if the clip resolution is < 320 don't do fancy onClipDone stuff
                if(this.width < 300){
                        return ;
                }
                this.onClipDone_disp=true;
                this.thumbnail_disp=true;
-               //make sure we are not in preview mode( no end clip actions in preview mode) 
+               //make sure we are not in preview mode( no end clip actions in preview mode)
                if( this.preview_mode )
                        return ;
-                       
+
                $j('#img_thumb_'+this.id).css('zindex',1);
                $j('#big_play_link_'+this.id).hide();
-               //add the liks_info_div black back 
+               //add the liks_info_div black back
                $j('#dc_'+this.id).append('<div id="liks_info_'+this.id+'" ' +
-                                       'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+                
+                                       'style="width:' +parseInt(parseInt(this.width)/2)+'px;'+
                                        'height:'+ parseInt(parseInt(this.height)) +'px;'+
-                                       'position:absolute;top:10px;overflow:auto'+                             
+                                       'position:absolute;top:10px;overflow:auto'+
                                        'width: '+parseInt( ((parseInt(this.width)/2)-15) ) + 'px;'+
-                                       'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+                                    
+                                       'left:'+ parseInt( ((parseInt(this.width)/2)+15) ) +'px;">'+
                                '</div>' +
                                '<div id="black_back_'+this.id+'" ' +
                                        'style="z-index:-2;position:absolute;background:#000;' +
                                        'top:0px;left:0px;width:'+parseInt(this.width)+'px;' +
                                        'height:'+parseInt(this.height)+'px;">' +
                                '</div>'
-                  );           
-               
-               //start animation (make thumb small in upper left add in div for "loading"                      
-               $j('#img_thumb_'+this.id).animate({                             
+                  );
+
+               //start animation (make thumb small in upper left add in div for "loading"
+               $j('#img_thumb_'+this.id).animate({
                                width:parseInt(parseInt(_this.width)/2),
                                height:parseInt(parseInt(_this.height)/2),
                                top:20,
                                left:10
                        },
-                       1000, 
+                       1000,
                        function(){
-                               //animation done.. add "loading" to div if empty                
+                               //animation done.. add "loading" to div if empty
                                if($j('#liks_info_'+_this.id).html()==''){
                                        $j('#liks_info_'+_this.id).html(gM('loading_txt'));
-                               }               
+                               }
                        }
-               )                                  
+               )
                //now load roe if run the showNextPrevLinks
                if(this.roe && this.media_element.addedROEData==false){
                        do_request(this.roe, function(data)
-                       {                                                                                                                          
+                       {
                                _this.media_element.addROE(data);
                                _this.getNextPrevLinks();
-                       });     
+                       });
                }else{
                        this.getNextPrevLinks();
                }
        },
-       //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them. 
+       //@@todo we should merge getNextPrevLinks with textInterface .. there is repeated code between them.
        getNextPrevLinks:function(){
                js_log('f:getNextPrevLinks');
                var anno_track_url = null;
-               var _this = this; 
+               var _this = this;
                //check for annoative track
-               $j.each(this.media_element.sources, function(inx, n){                   
+               $j.each(this.media_element.sources, function(inx, n){
                        if(n.mime_type=='text/cmml'){
                                if( n.id == 'Anno_en'){
                                        anno_track_url = n.src;
@@ -1574,28 +1574,28 @@ embedVideo.prototype = {
                        //zero out seconds (should improve cache hit rate and generally expands metadata search)
                        //@@todo this could be repalced with a regExp
                        var annoURL = parseUri(anno_track_url);
-                       var times = annoURL.queryKey['t'].split('/');                     
-                       var stime_parts = times[0].split(':');   
-                       var etime_parts = times[1].split(':');                                           
+                       var times = annoURL.queryKey['t'].split('/');
+                       var stime_parts = times[0].split(':');
+                       var etime_parts = times[1].split(':');
                        //zero out the hour:
                        var new_start = stime_parts[0]+':'+'0:0';
                        //zero out the end sec
                        var new_end   = (etime_parts[0]== stime_parts[0])? (etime_parts[0]+1)+':0:0' :etime_parts[0]+':0:0';
-                                        
+
                        var etime_parts = times[1].split(':');
-                       
+
                        var new_anno_track_url = annoURL.protocol +'://'+ annoURL.host + annoURL.path +'?';
                        $j.each(annoURL.queryKey, function(i, val){
                                new_anno_track_url +=(i=='t')?'t='+new_start+'/'+new_end +'&' :
                                                                                 i+'='+ val+'&';
                        });
                        var request_key = new_start+'/'+new_end;
-                       //check the anno_data cache: 
-                       //@@todo search cache see if current is in range.  
+                       //check the anno_data cache:
+                       //@@todo search cache see if current is in range.
                        if(this.anno_data_cache){
                                js_log('anno data found in cache: '+request_key);
                                this.showNextPrevLinks();
-                       }else{                                                          
+                       }else{
                                do_request(new_anno_track_url, function(cmml_data){
                                        js_log('raw response: '+ cmml_data);
                                        if(typeof cmml_data == 'string')
@@ -1606,8 +1606,8 @@ embedVideo.prototype = {
                                        }
                                        //init anno_data_cache
                                        if(!_this.anno_data_cache)
-                                               _this.anno_data_cache={};                                       
-                                       //grab all metadata and put it into the anno_data_cache:                                         
+                                               _this.anno_data_cache={};
+                                       //grab all metadata and put it into the anno_data_cache:
                                        $j.each(cmml_data.getElementsByTagName('clip'), function(inx, clip){
                                                _this.anno_data_cache[ $j(clip).attr("id") ]={
                                                                'start_time_sec':npt2seconds($j(clip).attr("start").replace('npt:','')),
@@ -1616,32 +1616,32 @@ embedVideo.prototype = {
                                                        };
                                                //grab all its meta
                                                _this.anno_data_cache[ $j(clip).attr("id") ]['meta']={};
-                                               $j.each(clip.getElementsByTagName('meta'),function(imx, meta){                                                  
+                                               $j.each(clip.getElementsByTagName('meta'),function(imx, meta){
                                                        //js_log('adding meta: '+ $j(meta).attr("name")+ ' = '+ $j(meta).attr("content"));
                                                        _this.anno_data_cache[$j(clip).attr("id")]['meta'][$j(meta).attr("name")]=$j(meta).attr("content");
                                                });
                                        });
-                                       _this.showNextPrevLinks();                                      
+                                       _this.showNextPrevLinks();
                                });
                        }
                }else{
                        js_log('no annotative track found');
                        $j('#liks_info_'+this.id).html('no metadata found for related links');
                }
-               //query current request time +|- 60s to get prev next speech links. 
+               //query current request time +|- 60s to get prev next speech links.
        },
        showNextPrevLinks:function(){
                //js_log('f:showNextPrevLinks');
-               //int requested links: 
+               //int requested links:
                var link = {
                        'prev':'',
                        'current':'',
                        'next':''
-               }               
+               }
                var curTime = this.getTimeReq().split('/');
-               
+
                var s_sec = npt2seconds(curTime[0]);
-               var e_sec = npt2seconds(curTime[1]); 
+               var e_sec = npt2seconds(curTime[1]);
                js_log('showNextPrevLinks: req time: '+ s_sec + ' to ' + e_sec);
                //now we have all the data in anno_data_cache
                var current_done=false;
@@ -1653,52 +1653,52 @@ embedVideo.prototype = {
                                link.prev = clip_id;
                                js_log('showNextPrevLinks: ' + s_sec + ' < ' + clip.end_time_sec + ' set prev');
                        }
-                               
+
                        if(e_sec==clip.end_time_sec && s_sec== clip.start_time_sec)
                                current_done = true;
                        //current clip is not done:
                        if(  e_sec < clip.end_time_sec  && link.current=='' && !current_done){
                                link.current = clip_id;
-                               js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current'); 
+                               js_log('showNextPrevLinks: ' + e_sec + ' < ' + clip.end_time_sec + ' set current');
                        }
-                       
+
                        //set end clip (first clip where start time is > end_time of req
                        if( e_sec <  clip.start_time_sec && link.next==''){
                                link.next = clip_id;
                                js_log('showNextPrevLinks: '+  e_sec + ' < '+ clip.start_time_sec + ' && ' + link.next );
                        }
-               }   
-               var html='';   
+               }
+               var html='';
                if(link.prev=='' && link.current=='' && link.next==''){
                        html='<p><a href="'+this.media_element.linkbackgetMsg+'">clip page</a>';
-               }else{          
+               }else{
                        for(var link_type in link){
-                               var link_id = link[link_type];                  
+                               var link_id = link[link_type];
                                if(link_id!=''){
-                                       var clip = this.anno_data_cache[link_id];                               
+                                       var clip = this.anno_data_cache[link_id];
                                        var title_msg='';
                                        for(var j in clip['meta']){
                                                title_msg+=j.replace(/_/g,' ') +': ' +clip['meta'][j].replace(/_/g,' ') +" <br>";
-                                       }               
+                                       }
                                        var time_req =   clip.time_req;
-                                       if(link_type=='current') //if current start from end of current clip play to end of current meta:                                
+                                       if(link_type=='current') //if current start from end of current clip play to end of current meta:
                                                time_req = curTime[1]+ '/' + seconds2npt( clip.end_time_sec );
-                                       
-                                       //do special linkbacks for metavid content: 
-                                       var regTimeCheck = new RegExp(/[0-9]+:[0-9]+:[0-9]+\/[0-9]+:[0-9]+:[0-9]+/);                            
+
+                                       //do special linkbacks for metavid content:
+                                       var regTimeCheck = new RegExp(/[0-9]+:[0-9]+:[0-9]+\/[0-9]+:[0-9]+:[0-9]+/);
                                        html+='<p><a  ';
                                        if( regTimeCheck.test( this.media_element.linkback ) ){
-                                               html+=' href="'+ this.media_element.linkback.replace(regTimeCheck,time_req) +'" '; 
+                                               html+=' href="'+ this.media_element.linkback.replace(regTimeCheck,time_req) +'" ';
                                        }else{
-                                               html+=' href="#" onClick="$j(\'#'+this.id+'\').get(0).playByTimeReq(\''+ 
-                                                               time_req + '\'); return false; "';                              
+                                               html+=' href="#" onClick="$j(\'#'+this.id+'\').get(0).playByTimeReq(\''+
+                                                               time_req + '\'); return false; "';
                                        }
-                                       html+=' title="' + title_msg + '">' + 
-                                                gM(link_type+'_clip_msg') +                              
+                                       html+=' title="' + title_msg + '">' +
+                                                gM(link_type+'_clip_msg') +
                                        '</a><br><span style="font-size:small">'+ title_msg +'<span></p>';
-                               }                                                       
+                               }
                        }
-               }       
+               }
                //js_og("should set html:"+ html);
                $j('#liks_info_'+this.id).html(html);
        },
@@ -1706,15 +1706,15 @@ embedVideo.prototype = {
                js_log('f:playByTimeReq: '+time_req );
                this.stop();
                this.updateVideoTimeReq(time_req);
-               this.play();            
+               this.play();
        },
        doThumbnailHTML:function()
-       {         
+       {
                var _this = this;
-               js_log('f:doThumbnailHTML'+ this.thumbnail_disp);               
-               this.closeDisplayedHTML();         
+               js_log('f:doThumbnailHTML'+ this.thumbnail_disp);
+               this.closeDisplayedHTML();
                $j( '#dc_' + this.id ).html( this.getThumbnailHTML() );
-               this.paused = true;             
+               this.paused = true;
                this.thumbnail_disp = true;
        },
        refreshControlsHTML:function(){
@@ -1725,37 +1725,37 @@ embedVideo.prototype = {
                        return;
                }else{
                        $j('#mv_embedded_controls_'+this.id).html( this.getControlsHTML() );
-                       ctrlBuilder.addControlHooks(this);                                              
-               }               
-       },   
+                       ctrlBuilder.addControlHooks(this);
+               }
+       },
        getControlsHTML:function()
-       {                       
+       {
                return ctrlBuilder.getControls( this );
-       },      
-       getHTML : function (){          
-               js_log('f:getHTML : ' + this.id );                      
+       },
+       getHTML : function (){
+               js_log('f:getHTML : ' + this.id );
                var _this = this;
                var html_code = '';
-               
-               //get the thumbnail: 
+
+               //get the thumbnail:
                html_code = this.getThumbnailHTML();
-                                                                       
+
                if(this.controls){
                        js_log("f:getHTML:AddControls");
                        html_code +='<div class="k-control-bar ui-widget-header ui-helper-clearfix">';
-                       html_code += this.getControlsHTML();       
-                       html_code +='</div>';     
-                       //block out some space by encapulating the top level div 
+                       html_code += this.getControlsHTML();
+                       html_code +='</div>';
+                       //block out some space by encapulating the top level div
                        $j(this).wrap('<div style="width:'+parseInt(this.width)+'px;height:'
                                        + (parseInt(this.height) + ctrlBuilder.height )+'px" id="k-player_' + this.id + '" class="k-player"></div>');
-               }               
+               }
 
                //js_log('should set: '+this.id);
-               $j(this).html( html_code );                                     
+               $j(this).html( html_code );
                //add hooks once Controls are in DOM
-               ctrlBuilder.addControlHooks(this);              
-                                                 
-               //js_log('set this to: ' + $j(this).html() );   
+               ctrlBuilder.addControlHooks(this);
+
+               //js_log('set this to: ' + $j(this).html() );
                //alert('stop');
                //if auto play==true directly embed the plugin
                if(this.autoplay)
@@ -1785,7 +1785,7 @@ embedVideo.prototype = {
                this.updateVideoTime(time_parts[0], time_parts[1]);
        },
        //update video time
-       updateVideoTime:function(start_ntp, end_ntp){                                   
+       updateVideoTime:function(start_ntp, end_ntp){
                //update media
                this.media_element.updateSourceTimes( start_ntp, end_ntp );
                //update mv_time
@@ -1797,11 +1797,11 @@ embedVideo.prototype = {
                        this.seek_time_sec=0;
                else
                        this.seek_time_sec=npt2seconds(start_ntp);
-       },              
-       //@@todo overwite by embed library if we can render frames natavily 
+       },
+       //@@todo overwite by embed library if we can render frames natavily
        renderTimelineThumbnail:function( options ){
                var my_thumb_src = this.media_element.getThumbnailURL();
-               //check if our thumbnail has a time attribute: 
+               //check if our thumbnail has a time attribute:
                if( my_thumb_src.indexOf('t=') !== -1){
                        var time_ntp =  seconds2npt ( options.time + parseInt(this.start_offset) );
                        my_thumb_src = getURLParamReplace( my_thumb_src, { 't':time_ntp, 'size': options.size } );
@@ -1809,7 +1809,7 @@ embedVideo.prototype = {
                var thumb_class = (typeof options['thumb_class'] != 'undefined' ) ? options['thumb_class'] : '';
                return '<div class="ui-corner-all ' + thumb_class + '" src="' + my_thumb_src + '" '+
                                'style="height:' + options.height + 'px;' +
-                               'width:' + options.width + 'px" >' + 
+                               'width:' + options.width + 'px" >' +
                                         '<img src="' + my_thumb_src +'" '+
                                                'style="height:' + options.height + 'px;' +
                                                'width:' + options.width + 'px">' +
@@ -1820,58 +1820,58 @@ embedVideo.prototype = {
        },
        updateThumbTime:function( float_sec ){
                //js_log('updateThumbTime:'+float_sec);
-               var _this = this;                                                                                                          
-               if( typeof this.org_thum_src=='undefined' ){            
+               var _this = this;
+               if( typeof this.org_thum_src=='undefined' ){
                        this.org_thum_src = this.media_element.getThumbnailURL();
-               }                                                       
+               }
                if( this.org_thum_src.indexOf('t=') !== -1){
-                       this.last_thumb_url = getURLParamReplace(this.org_thum_src, 
-                               { 't' : seconds2npt( float_sec + parseInt(this.start_offset)) } );                                                                      
-                       if(!this.thumbnail_updating){                           
+                       this.last_thumb_url = getURLParamReplace(this.org_thum_src,
+                               { 't' : seconds2npt( float_sec + parseInt(this.start_offset)) } );
+                       if(!this.thumbnail_updating){
                                this.updateThumbnail(this.last_thumb_url ,false);
                                this.last_thumb_url =null;
                        }
                }
        },
        //for now provide a src url .. but need to figure out how to copy frames from video for plug-in based thumbs
-       updateThumbPerc:function( perc ){       
+       updateThumbPerc:function( perc ){
                return this.updateThumbTime( (this.getDuration() * perc) );
        },
        //updates the thumbnail if the thumbnail is being displayed
-       updateThumbnail : function(src, quick_switch){                          
-               //make sure we don't go to the same url if we are not already updating: 
+       updateThumbnail : function(src, quick_switch){
+               //make sure we don't go to the same url if we are not already updating:
                if( !this.thumbnail_updating && $j('#img_thumb_'+this.id).attr('src')== src )
                        return false;
-               //if we are already updating don't issue a new update: 
+               //if we are already updating don't issue a new update:
                if( this.thumbnail_updating && $j('#new_img_thumb_'+this.id).attr('src')== src )
                        return false;
-               
+
                js_log('update thumb: ' + src);
-               
+
                if(quick_switch){
                        $j('#img_thumb_'+this.id).attr('src', src);
                }else{
-                       var _this = this;                       
+                       var _this = this;
                        //if still animating remove new_img_thumb_
                        if(this.thumbnail_updating==true)
-                               $j('#new_img_thumb_'+this.id).stop().remove();          
-                                       
+                               $j('#new_img_thumb_'+this.id).stop().remove();
+
                        if(this.thumbnail_disp){
                                js_log('set to thumb:'+ src);
                                this.thumbnail_updating=true;
                                $j('#dc_'+this.id).append('<img src="'+src+'" ' +
                                        'style="display:none;position:absolute;zindex:2;top:0px;left:0px;" ' +
                                        'width="'+this.width+'" height="'+this.height+'" '+
-                                       'id = "new_img_thumb_'+this.id+'" />');                                         
-                               //js_log('appended: new_img_thumb_');           
-                               $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){                                                
+                                       'id = "new_img_thumb_'+this.id+'" />');
+                               //js_log('appended: new_img_thumb_');
+                               $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){
                                                //once faded in remove org and rename new:
                                                $j('#img_thumb_'+_this.id).remove();
                                                $j('#new_img_thumb_'+_this.id).attr('id', 'img_thumb_'+_this.id);
                                                $j('#img_thumb_'+_this.id).css('zindex','1');
-                                               _this.thumbnail_updating=false;                                         
+                                               _this.thumbnail_updating=false;
                                                //js_log("done fadding in "+ $j('#img_thumb_'+_this.id).attr("src"));
-                                               
+
                                                //if we have a thumb queued update to that
                                                if(_this.last_thumb_url){
                                                        var src_url =_this.last_thumb_url;
@@ -1888,7 +1888,7 @@ embedVideo.prototype = {
                download, and embed code.
        */
        getThumbnailHTML : function ()
-       {               
+       {
                js_log('embedVideo:getThumbnailHTML::' + this.id);
                var thumb_html = '';
                var class_atr='';
@@ -1901,13 +1901,13 @@ embedVideo.prototype = {
                //put it all in the div container dc_id
                thumb_html+= '<div id="dc_'+this.id+'" rel="emdded_play" style="position:relative;'+
                        ' overflow:hidden; top:0px; left:0px; width:'+this.playerPixelWidth()+'px; height:'+this.playerPixelHeight()+'px; z-index:0;">'+
-                       '<img width="' + this.playerPixelWidth() + '" height="' + this.playerPixelHeight() + 
+                       '<img width="' + this.playerPixelWidth() + '" height="' + this.playerPixelHeight() +
                        '" style="position:relative;width:'+this.playerPixelWidth()+';height:'+this.playerPixelHeight()+'"' +
                        ' id="img_thumb_' + this.id+'" src="' + this.thumbnail + '">';
-               
+
                if( this.play_button == true && this.controls == true )
                          thumb_html+=this.getPlayButton();
-                         
+
                thumb_html+='</div>';
                return thumb_html;
        },
@@ -1960,16 +1960,16 @@ embedVideo.prototype = {
                        this.displayHTML(gM('loading_txt'));
                        do_request(this.roe, function(data)
                           {
-                                 _this.media_element.addROE(data);                                                      
+                                 _this.media_element.addROE(data);
                                  _this.doLinkBack();
-                          });                     
+                          });
                }else{
-                       if(this.media_element.linkback){                        
+                       if(this.media_element.linkback){
                                window.location = this.media_element.linkback;
                        }else{
                                this.displayHTML(gM('could_not_find_linkback'));
                        }
-               }          
+               }
        },
        //display the code to remotely embed this video:
        showEmbedCode : function(embed_code){
@@ -1994,42 +1994,42 @@ embedVideo.prototype = {
                this.displayHTML(o);
        },
        copyText:function(){
-         $j('#embedding_user_html_'+this.id).focus().select();                 
-         if(document.selection){         
-                 CopiedTxt = document.selection.createRange(); 
+         $j('#embedding_user_html_'+this.id).focus().select();
+         if(document.selection){
+                 CopiedTxt = document.selection.createRange();
                  CopiedTxt.execCommand("Copy");
          }
        },
-       showTextInterface:function(){   
+       showTextInterface:function(){
                var _this = this;
-               //display the text container with loading text: 
+               //display the text container with loading text:
                //@@todo support position config
-               var loc = $j(this).position();                  
+               var loc = $j(this).position();
                if($j('#metaBox_'+this.id).length==0){
                        $j(this).after('<div class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;z-index:10;'+
                                                'top:' + (loc.top) + 'px;' +
                                                'left:' + (parseInt( loc.left ) + parseInt(this.width) + 10 )+'px;' +
-                                               'height:'+ parseInt( this.height )+'px;width:400px;' +                                          
+                                               'height:'+ parseInt( this.height )+'px;width:400px;' +
                                                'display:none;" ' +
                                                'id="metaBox_' + this.id + '">'+
                                                        gM('loading_txt') +
-                                               '</div>');                                      
+                                               '</div>');
                }
                //fade in the text display
-               $j('#metaBox_'+this.id).fadeIn("fast"); 
+               $j('#metaBox_'+this.id).fadeIn("fast");
                //check if textObj present:
                if(typeof this.textInterface == 'undefined' ){
                        //load the default text interface:
                        mvJsLoader.doLoad([
-                                       'mvTextInterface', 
+                                       'mvTextInterface',
                                        '$j.fn.hoverIntent'
-                               ], function(){                                  
-                                       _this.textInterface = new mvTextInterface( _this );                                                     
+                               ], function(){
+                                       _this.textInterface = new mvTextInterface( _this );
                                        //show interface
                                        _this.textInterface.show();
                                        js_log("NEW TEXT INTERFACE");
                                        for(var i in _this.textInterface.availableTracks){
-                                               js_log("tracks in new interface: "+_this.id+ ' tid:' + i);                                              
+                                               js_log("tracks in new interface: "+_this.id+ ' tid:' + i);
                                        }
                                }
                        );
@@ -2046,26 +2046,26 @@ embedVideo.prototype = {
        },
        /** Generic function to display custom HTML inside the mv_embed element.
                The code should call the closeDisplayedHTML function to close the
-               display of the custom HTML and restore the regular mv_embed display.            
+               display of the custom HTML and restore the regular mv_embed display.
                @param {String} HTML code for the selection list.
        */
        displayHTML:function(html_code)
        {
                var sel_id = (this.pc!=null)?this.pc.pp.id:this.id;
-               
+
                if(!this.supports['overlays'])
                        this.stop();
-               
+
                //put select list on-top
                //make sure the parent is relatively positioned:
                $j('#'+sel_id).css('position', 'relative');
                //set height width (check for playlist container)
                var width = (this.pc)?this.pc.pp.width:this.playerPixelWidth();
                var height = (this.pc)?this.pc.pp.height:this.playerPixelHeight();
-               
+
                if(this.pc)
                        height+=(this.pc.pp.pl_layout.title_bar_height + this.pc.pp.pl_layout.control_height);
-         
+
                var fade_in = true;
                if($j('#blackbg_'+sel_id).length!=0)
                {
@@ -2077,11 +2077,11 @@ embedVideo.prototype = {
                         'style="height:'+parseInt(height)+'px;width:'+parseInt(width)+'px;">'+
                          '<div class="videoOptionsComplete">'+
                        //@@TODO: this style should go to .css
-                       '<span style="float:right;margin-right:10px">' +                        
+                       '<span style="float:right;margin-right:10px">' +
                                        '<a href="#" style="color:white;" onClick="$j(\'#'+sel_id+'\').get(0).closeDisplayedHTML();return false;">close</a>' +
                        '</span>'+
                        '<div id="mv_disp_inner_'+sel_id+'" style="padding-top:10px;">'+
-                                html_code 
+                                html_code
                           +'</div>'+
                           '</div></div>';
                $j('#'+sel_id).prepend(div_code);
@@ -2101,33 +2101,33 @@ embedVideo.prototype = {
                 });
                 return false; //onclick action return false
        },
-       selectPlaybackMethod:function(){                
+       selectPlaybackMethod:function(){
                //get id (in case where we have a parent container)
                var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
-               
-               var _this=this;                    
+
+               var _this=this;
 //             var out= '<span style="color:#FFF;background-color:black;"><blockquote style="background-color:black;">';
                var out= '';
                var _this=this;
                //js_log('selected src'+ _this.media_element.selected_source.url);
-               $j.each( this.media_element.getPlayableSources(), function(source_id, source){                   
-                       var default_player = embedTypes.players.defaultPlayer( source.getMIMEType() );                                                             
-                       
+               $j.each( this.media_element.getPlayableSources(), function(source_id, source){
+                       var default_player = embedTypes.players.defaultPlayer( source.getMIMEType() );
+
                        var is_selected = (source == _this.media_element.selected_source);
                        var image_src =  mv_skin_img_path ;
-                       
-                       //set the Playable source type: 
+
+                       //set the Playable source type:
                        if( source.mime_type == 'video/x-flv' ){
                                image_src += 'flash_icon_';
                        }else if( source.mime_type == 'video/h264'){
-                               //for now all mp4 content is pulled from archive.org (so use archive.org icon) 
+                               //for now all mp4 content is pulled from archive.org (so use archive.org icon)
                                image_src += 'archive_org_';
                        }else{
                                image_src += 'fish_xiph_org_';
                        }
                        image_src += is_selected ? 'color':'bw';
-                       image_src += '.png';                                       
-                       
+                       image_src += '.png';
+
                        if (default_player)
                        {
 //                             out += '<img src="'+image_src+'"/>';
@@ -2137,11 +2137,11 @@ embedVideo.prototype = {
 //                             if( ! is_selected )
 //                                     out+='<a href="#" class="sel_source" id="sc_' + source_id + '_' + default_player.id +'">';
 //                             out += source.getTitle()+ (is_selected?'</a>':'') + ' ';
-                               
-                               //output the player select code: 
+
+                               //output the player select code:
                                var supporting_players = embedTypes.players.getMIMETypePlayers( source.getMIMEType() );
 //                             out+='<div id="player_select_list_' + source_id + '" class="player_select_list"><ul>';
-                               for(var i=0; i < supporting_players.length ; i++){                              
+                               for(var i=0; i < supporting_players.length ; i++){
                                        if( _this.selected_player.id == supporting_players[i].id && is_selected ){
 //                                             out+='<li style="border-style:dashed;margin-left:20px;">'+
 //                                                        '<img border="0" width="16" height="16" src="' + mv_skin_img_path + 'plugin.png">' +
@@ -2154,41 +2154,41 @@ embedVideo.prototype = {
 //                                                                     '<img border="0" width="16" height="16" src="' + mv_skin_img_path + 'plugin_disabled.png">'+
 //                                                                     supporting_players[i].getName() +
 //                                                             '</a>'+
-                                            out+='<li>' + 
+                                            out+='<li>' +
                                                  '<a href="#" id="dc_' + source_id + '_' + supporting_players[i].id +'">' +
                                                  supporting_players[i].getName() + '</a><li>';
                                        }
                                 }
-                                out+='</ul></div>';               
+                                out+='</ul></div>';
                        }else
                                out+= source.getTitle() + ' - no player available';
                });
 //             out+='</blockquote></span>';
                this.displayHTML(out);
-               
+
                //set up the click bindings:
                $j('.sel_source').each(function(){
                        $j(this).click(function(){
                                var iparts = $j(this).attr( 'id' ).replace(/sc_/,'').split('_');
                                var source_id = iparts[0];
                                var default_player_id = iparts[1];
-                               js_log('source id: ' +  source_id + ' player id: ' + default_player_id);                                
-                                
-                               $j('#' + this_id  ).get(0).closeDisplayedHTML();                                
+                               js_log('source id: ' +  source_id + ' player id: ' + default_player_id);
+
+                               $j('#' + this_id  ).get(0).closeDisplayedHTML();
                                $j('#' + _this.id ).get(0).media_element.selectSource( source_id );
-                               
+
                                embedTypes.players.userSelectPlayer( default_player_id,
                                         _this.media_element.sources[ source_id ].getMIMEType() );
-                                        
+
                                //be sure to issue a stop
                                $j('#' + this_id  ).get(0).stop();
-                               
+
                                //don't follow the empty # link:
                                return false;
                        });
                });
-       },      
-       showVideoDownload:function(){           
+       },
+       showVideoDownload:function(){
                //load the roe if available (to populate out download options:
                //js_log('f:showVideoDownload '+ this.roe + ' ' + this.media_element.addedROEData);
                if(this.roe && this.media_element.addedROEData == false){
@@ -2196,14 +2196,14 @@ embedVideo.prototype = {
                        this.displayHTML(gM('loading_txt'));
                        do_request(this.roe, function(data)
                        {
-                          _this.media_element.addROE(data);                                                     
+                          _this.media_element.addROE(data);
                           $j('#mv_disp_inner_'+_this.id).html( _this.getShowVideoDownload() );
-                       });                        
+                       });
                }else{
                        this.displayHTML( this.getShowVideoDownload() );
-               }          
+               }
        },
-       getShowVideoDownload:function(){ 
+       getShowVideoDownload:function(){
 //             var out='<div style="color:white">' +
 //                             '<b style="color:white;">'+gM('download_segment')+'</b><br>';
 //             out+='<blockquote style="background:#000">'+
@@ -2226,7 +2226,7 @@ embedVideo.prototype = {
                         else {
                             dl_list+=dl_line;
                        }
-               });             
+               });
 //             if(dl_list!='')
 //                     out+=gM('download_full') + '<blockquote style="background:#000">' + dl_list + '</blockquote>';
 //             if(dl_txt_list!='')
@@ -2240,11 +2240,11 @@ embedVideo.prototype = {
        */
        play:function(){
                var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
-                               
-               //js_log( "mv_embed play:" + this.id);          
+
+               //js_log( "mv_embed play:" + this.id);
                //js_log('thum disp:'+this.thumbnail_disp);
                //check if thumbnail is being displayed and embed html
-               if( this.thumbnail_disp ){                      
+               if( this.thumbnail_disp ){
                        if( !this.selected_player ){
                                js_log('no selected_player');
                                //this.innerHTML = this.getPluginMissingHTML();
@@ -2252,21 +2252,21 @@ embedVideo.prototype = {
                                $j('#'+this.id).html( this.getPluginMissingHTML() );
                        }else{
                                this.doEmbedHTML();
-                               this.onClipDone_disp=false;                        
-                               this.paused=false;         
-                               this.thumbnail_disp=false;               
+                               this.onClipDone_disp=false;
+                               this.paused=false;
+                               this.thumbnail_disp=false;
                        }
                }else{
-                       //the plugin is already being displayed                 
+                       //the plugin is already being displayed
                        this.paused=false; //make sure we are not "paused"
                        this.seeking=false;
-               }                               
-       
-               $j('#'+ this_id + ' .play-btn .ui-icon').removeClass('ui-icon-play').addClass('ui-icon-pause');                    
-               $j('#'+ this_id + ' .play-btn').unbind().btnBind().click(function(){                                    
+               }
+
+               $j('#'+ this_id + ' .play-btn .ui-icon').removeClass('ui-icon-play').addClass('ui-icon-pause');
+               $j('#'+ this_id + ' .play-btn').unbind().btnBind().click(function(){
                        $j('#' + this_id ).get(0).pause();
                }).attr('title', gM('pause_clip'));
-                  
+
        },
        load:function(){
                //should be done by child (no base way to load assets)
@@ -2274,41 +2274,41 @@ embedVideo.prototype = {
        },
        getSrc:function(){
           return this.media_element.selected_source.getURI( this.seek_time_sec );
-       }, 
+       },
        /*
         * base embed pause
         *  there is no general way to pause the video
         *  must be overwritten by embed object to support this functionality.
         */
        pause: function(){
-               var this_id = (this.pc!=null)?this.pc.pp.id:this.id;                                                      
-               //js_log('mv_embed:do pause');          
-               //(playing) do pause            
-               this.paused = true; 
-               //update the ctrl "paused state"                                
+               var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
+               //js_log('mv_embed:do pause');
+               //(playing) do pause
+               this.paused = true;
+               //update the ctrl "paused state"
                $j('#'+ this_id + ' .play-btn .ui-icon').removeClass('ui-icon-pause').addClass('ui-icon-play');
-               $j('#'+ this_id + ' .play-btn').unbind().btnBind().click(function(){                                                     
+               $j('#'+ this_id + ' .play-btn').unbind().btnBind().click(function(){
                                $j('#'+this_id).get(0).play();
                }).attr('title', gM('play_clip'));
-       },      
+       },
        /*
         * base embed stop (can be overwritten by the plugin)
         */
        stop: function(){
                var _this = this;
                js_log('mvEmbed:stop:'+this.id);
-               
+
                //no longer seeking:
                this.didSeekJump=false;
-               
-               //first issue pause to update interface (only call the parent) 
+
+               //first issue pause to update interface (only call the parent)
                if(this['parent_pause']){
                        this.parent_pause();
                }else{
                        this.pause();
-               }       
-               
-               //reset the currentTime: 
+               }
+
+               //reset the currentTime:
                this.currentTime=0;
                //check if thumbnail is being displayed in which case do nothing
                if( this.thumbnail_disp ){
@@ -2321,12 +2321,12 @@ embedVideo.prototype = {
                        this.setSliderValue(0);
                        this.setStatus( this.getTimeReq() );
                }
-               
-               //make sure the big playbutton is has click action: 
+
+               //make sure the big playbutton is has click action:
                $j('#'+ _this.id +' .play-btn-large').unbind('click').btnBind().click(function(){
                        $j('#' +_this.id).get(0).play();
                });
-               
+
                if(this.update_interval)
                {
                        clearInterval(this.update_interval);
@@ -2334,19 +2334,19 @@ embedVideo.prototype = {
                }
        },
        toggleMute:function(){
-               var this_id = (this.pc!=null)?this.pc.pp.id:this.id;    
+               var this_id = (this.pc!=null)?this.pc.pp.id:this.id;
                if(this.muted){
                        this.muted=false;
                        $j( '#volume_control_' + this_id + ' span').removeClass('ui-icon-volume-off').addClass('ui-icon-volume-on');
-                       $j( '#volume_bar_' + this_id).slider('value', 100); 
+                       $j( '#volume_bar_' + this_id).slider('value', 100);
                        this.updateVolumen(1);
                }else{
                        this.muted=true;
                        $j('#volume_control_'+this_id + ' span').removeClass('ui-icon-volume-on').addClass('ui-icon-volume-off');
                        $j('#volume_bar_'+this_id).slider('value', 0);
-                       this.updateVolumen(0); 
+                       this.updateVolumen(0);
                }
-               js_log('f:toggleMute::' + this.muted);          
+               js_log('f:toggleMute::' + this.muted);
        },
        updateVolumen:function(perc){
                js_log('update volume not supported with current playback type');
@@ -2380,19 +2380,19 @@ embedVideo.prototype = {
        postEmbedJS:function(){
                return '';
        },
-       //do common monitor code like update the playhead and play status 
+       //do common monitor code like update the playhead and play status
        //plugin objects are responsible for updating currentTime
        monitor:function(){
                if( this.currentTime && this.currentTime > 0 && this.duration){
                        if( !this.userSlide ){
-                               if( this.start_offset  ){ 
-                                       //if start offset include that calculation 
-                                       this.setSliderValue( ( this.currentTime - this.start_offset ) / this.duration );                        
-                                       this.setStatus( seconds2npt(this.currentTime) + '/'+ seconds2npt(parseFloat(this.start_offset)+parseFloat(this.duration) ));            
+                               if( this.start_offset  ){
+                                       //if start offset include that calculation
+                                       this.setSliderValue( ( this.currentTime - this.start_offset ) / this.duration );
+                                       this.setStatus( seconds2npt(this.currentTime) + '/'+ seconds2npt(parseFloat(this.start_offset)+parseFloat(this.duration) ));
                                }else{
                                        this.setSliderValue( this.currentTime / this.duration );
                                        this.setStatus( seconds2npt(this.currentTime) + '/' + seconds2npt(this.duration ));
-                               }                               
+                               }
                        }
                }else{
                        //js_log(' ct:' + this.currentTime + ' dur: ' + this.duration);
@@ -2401,25 +2401,25 @@ embedVideo.prototype = {
                        }else if( this.isPaused() ){
                                this.setStatus( "paused" );
                        }else if( this.isPlaying() ){
-                               if( this.currentTime && ! this.duration ) 
+                               if( this.currentTime && ! this.duration )
                                        this.setStatus( seconds2npt( this.currentTime ) + ' /' );
-                               else   
+                               else
                                        this.setStatus(" - - - ");
                        }else{
                                this.setStatus( this.getTimeReq() );
-                       }                       
+                       }
                }
-               //update buffer information 
+               //update buffer information
                this.updateBufferStatus();
-               
+
                //update monitorTimerId to call child monitor
                if( ! this.monitorTimerId ){
-                       //make sure an instance of this.id exists: 
+                       //make sure an instance of this.id exists:
                        if( document.getElementById(this.id) ){
                                this.monitorTimerId = setInterval('$j(\'#'+this.id+'\').get(0).monitor()', 250);
                        }
                }
-       },              
+       },
        stopMonitor:function(){
                if( this.monitorTimerId != 0 )
                {
@@ -2427,18 +2427,18 @@ embedVideo.prototype = {
                        this.monitorTimerId = 0;
                }
        },
-       updateBufferStatus: function(){                 
-               //build the buffer targeet based for playlist vs clip 
-               var buffer_select = (this.pc) ? 
-                       '#cl_status_' + this.id + ' .ui-slider-buffer': 
+       updateBufferStatus: function(){
+               //build the buffer targeet based for playlist vs clip
+               var buffer_select = (this.pc) ?
+                       '#cl_status_' + this.id + ' .ui-slider-buffer':
                        '#' + this.id + ' .ui-slider-buffer';
-                       
+
                //update the buffer progress bar (if available )
                if( this.bufferedPercent != 0 ){
-                       //js_log('bufferedPercent: ' + this.bufferedPercent);                   
+                       //js_log('bufferedPercent: ' + this.bufferedPercent);
                        if(this.bufferedPercent > 1)
-                               this.bufferedPercent=1;                                                 
-                       
+                               this.bufferedPercent=1;
+
                        $j(buffer_select).css("width", (this.bufferedPercent*100) +'%' );
                }else{
                        $j(buffer_select).css("width", '0px' );
@@ -2448,7 +2448,7 @@ embedVideo.prototype = {
                if(!this.start_offset)
                        this.start_offset =0;
                var rt = this.currentTime - this.start_offset;
-               if( rt < 0 ) //should not happen but does. 
+               if( rt < 0 ) //should not happen but does.
                        return 0;
                return rt;
        },
@@ -2464,7 +2464,7 @@ embedVideo.prototype = {
                }
                return null;
        },
-       //HELPER Functions for selected source  
+       //HELPER Functions for selected source
        /*
        * returns the selected source url for players to play
        */
@@ -2476,56 +2476,56 @@ embedVideo.prototype = {
                return this.media_element.selected_source.URLTimeEncoding;
        },
        setSliderValue: function(perc, hide_progress){
-               if(this.controls){              
+               if(this.controls){
                        var this_id = (this.pc)?this.pc.pp.id:this.id;
                        var val = parseInt( perc*1000 );
-                       $j('#'+this.id + ' .j-scrubber').slider('value', val);                  
+                       $j('#'+this.id + ' .j-scrubber').slider('value', val);
                }
                //js_log('set#mv_seeker_slider_'+this_id + ' perc in: ' + perc + ' * ' + $j('#mv_seeker_'+this_id).width() + ' = set to: '+ val + ' - '+ Math.round(this.mv_seeker_width*perc) );
                //js_log('op:' + offset_perc + ' *('+perc+' * ' + $j('#slider_'+id).width() + ')');
        },
        highlightPlaySection:function(options){
-               js_log('highlightPlaySection');         
+               js_log('highlightPlaySection');
                var this_id = (this.pc)?this.pc.pp.id:this.id;
                var dur = this.getDuration();
-               var hide_progress = true;               
-               //set the left percet and update the slider: 
+               var hide_progress = true;
+               //set the left percet and update the slider:
                rel_start_sec = npt2seconds( options['start']);
-               //remove the start_offset if relevent: 
+               //remove the start_offset if relevent:
                if(this.start_offset)
                        rel_start_sec = rel_start_sec - this.start_offset
-               
+
                var slider_perc=0;
                if( rel_start_sec <= 0 ){
-                       left_perc =0;                    
+                       left_perc =0;
                        options['start'] = seconds2npt( this.start_offset );
-                       rel_start_sec=0;                        
+                       rel_start_sec=0;
                        this.setSliderValue( 0 , hide_progress);
                }else{
-                       left_perc = parseInt( (rel_start_sec / dur)*100 ) ;             
+                       left_perc = parseInt( (rel_start_sec / dur)*100 ) ;
                        slider_perc = (left_perc / 100);
-               }               
-               js_log("slider perc:" + slider_perc);   
+               }
+               js_log("slider perc:" + slider_perc);
                if( ! this.isPlaying() ){
-                       this.setSliderValue( slider_perc , hide_progress);              
+                       this.setSliderValue( slider_perc , hide_progress);
                }
-               
-               width_perc = parseInt( (( npt2seconds( options['end'] ) - npt2seconds( options['start'] ) ) / dur)*100 ) ;                                                       
+
+               width_perc = parseInt( (( npt2seconds( options['end'] ) - npt2seconds( options['start'] ) ) / dur)*100 ) ;
                if( (width_perc + left_perc) > 100 ){
-                       width_perc = 100 - left_perc; 
-               }               
-               //js_log('should hl: '+rel_start_sec+ '/' + dur + ' re:' + rel_end_sec+' lp:'  + left_perc + ' width: ' + width_perc);  
+                       width_perc = 100 - left_perc;
+               }
+               //js_log('should hl: '+rel_start_sec+ '/' + dur + ' re:' + rel_end_sec+' lp:'  + left_perc + ' width: ' + width_perc);
                $j('#mv_seeker_' + this_id + ' .mv_highlight').css({
                        'left':left_perc+'%',
-                       'width':width_perc+'%'                  
-               }).show();                              
-               
+                       'width':width_perc+'%'
+               }).show();
+
                this.jump_time =  options['start'];
                this.seek_time_sec = npt2seconds( options['start']);
-               //trim output to 
+               //trim output to
                this.setStatus( gM('seek_to')+' '+ seconds2npt( this.seek_time_sec ) );
                js_log('DO update: ' +  this.jump_time);
-               this.updateThumbTime( rel_start_sec );  
+               this.updateThumbTime( rel_start_sec );
        },
        hideHighlight:function(){
                var this_id = (this.pc)?this.pc.pp.id:this.id;
@@ -2538,7 +2538,7 @@ embedVideo.prototype = {
                //update status:
                //$j('#mv_time_'+id).html(value);
                $j('#'+this.id + ' .k-timer').html(value);
-       }       
+       }
 }
 
 
@@ -2565,9 +2565,9 @@ mediaPlayer.prototype =
        supported_types:null,
        library:null,
        loaded:false,
-       loading_callbacks:null, 
+       loading_callbacks:null,
        supportsMIMEType : function(type)
-       {               
+       {
                for (var i=0; i < this.supported_types.length; i++)
                        if(this.supported_types[i] == type)
                                return true;
@@ -2583,17 +2583,17 @@ mediaPlayer.prototype =
                        js_log('plugin loaded, do callback:');
                        callback();
                }else{
-                       var _this = this;                                                                                       
-                       //jQuery based get script does not work so well.                                                        
-                       mvJsLoader.doLoad([ 
+                       var _this = this;
+                       //jQuery based get script does not work so well.
+                       mvJsLoader.doLoad([
                                libName
                        ],function(){
-                               callback();                                                     
+                               callback();
                        });
                }
-       }       
+       }
 }
-/* players and supported mime types 
+/* players and supported mime types
 @@todo ideally we query the plugin to get what mime types it supports in practice not always reliable/avaliable
 */
 var flowPlayer = new mediaPlayer('flowplayer',['video/x-flv', 'video/h264'],'flash');
@@ -2610,7 +2610,7 @@ var vlcActiveXPlayer = new mediaPlayer('vlc-activex',vlcMineList,'vlc');
 //add generic
 var oggPluginPlayer = new mediaPlayer('oggPlugin',['video/ogg'],'generic');
 
-//depricate quicktime in favor of safari native 
+//depricate quicktime in favor of safari native
 //var quicktimeMozillaPlayer = new mediaPlayer('quicktime-mozilla',['video/ogg'],'quicktime');
 //var quicktimeActiveXPlayer = new mediaPlayer('quicktime-activex',['video/ogg'],'quicktime');
 
@@ -2635,24 +2635,24 @@ mediaPlayers.prototype =
        {
                this.players = new Array();
                this.loadPreferences();
-               
-               //set up default players order for each library type            
+
+               //set up default players order for each library type
                this.default_players['video/x-flv'] = ['flash','vlc'];
                this.default_players['video/h264'] = ['flash', 'vlc'];
-               
-               this.default_players['video/ogg'] = ['native','vlc','java', 'generic'];         
-               this.default_players['application/ogg'] = ['native','vlc','java', 'generic'];           
-               this.default_players['audio/ogg'] = ['native','vlc', 'java', 'omtk' ];          
+
+               this.default_players['video/ogg'] = ['native','vlc','java', 'generic'];
+               this.default_players['application/ogg'] = ['native','vlc','java', 'generic'];
+               this.default_players['audio/ogg'] = ['native','vlc', 'java', 'omtk' ];
                this.default_players['video/mp4'] = ['vlc'];
-               
+
                this.default_players['text/html'] = ['html'];
                this.default_players['image/jpeg'] = ['html'];
                this.default_players['image/png'] = ['html'];
                this.default_players['image/svg'] = ['html'];
-               
+
        },
        addPlayer : function(player, mime_type)
-       {               
+       {
                //js_log('Adding ' + player.id + ' with mime_type ' + mime_type);
                for (var i =0; i < this.players.length; i++){
                        if (this.players[i].id == player.id)
@@ -2660,52 +2660,52 @@ mediaPlayers.prototype =
                                if(mime_type!=null)
                                {
                                        //make sure the mime_type is not already there:
-                                       var add_mime = true; 
+                                       var add_mime = true;
                                        for(var j=0; j < this.players[i].supported_types.length; j++ ){
                                                if( this.players[i].supported_types[j]== mime_type)
                                                        add_mime=false;
-                                       }                                       
+                                       }
                                        if(add_mime)
                                                this.players[i].supported_types.push(mime_type);
                                }
                                return;
                        }
                }
-               //player not found: 
+               //player not found:
                if(mime_type!=null)
-                       player.supported_types.push(mime_type);   
-                                
+                       player.supported_types.push(mime_type);
+
                this.players.push( player );
        },
        getMIMETypePlayers : function(mime_type)
-       {                               
+       {
                var mime_players = new Array();
                var _this = this;
                var inx = 0;
-               if( this.default_players[mime_type] ){                                          
-                       $j.each( this.default_players[mime_type], function(d, lib){                             
-                               var library = _this.default_players[mime_type][d];                              
-                               for ( var i=0; i < _this.players.length; i++ ){                                 
+               if( this.default_players[mime_type] ){
+                       $j.each( this.default_players[mime_type], function(d, lib){
+                               var library = _this.default_players[mime_type][d];
+                               for ( var i=0; i < _this.players.length; i++ ){
                                        if ( _this.players[i].library == library && _this.players[i].supportsMIMEType(mime_type) ){
-                                               mime_players[ inx ] = _this.players[i];                                         
+                                               mime_players[ inx ] = _this.players[i];
                                                inx++;
                                        }
                                }
                        });
-               }               
+               }
                return mime_players;
        },
        defaultPlayer : function(mime_type)
-       {                               
-               js_log("get defaultPlayer for " + mime_type);           
-               var mime_players = this.getMIMETypePlayers(mime_type);                          
+       {
+               js_log("get defaultPlayer for " + mime_type);
+               var mime_players = this.getMIMETypePlayers(mime_type);
                if( mime_players.length > 0)
                {
                        // check for prior preference for this mime type
                        for( var i=0; i < mime_players.length; i++ ){
                                if( mime_players[i].id==this.preference[mime_type] )
                                        return mime_players[i];
-                       }                                       
+                       }
                        // otherwise just return the first compatible player
                        // (it will be chosen according to the default_players list
                        return mime_players[0];
@@ -2745,7 +2745,7 @@ mediaPlayers.prototype =
        },
        loadPreferences : function()
        {
-               this.preference = new Object();                         
+               this.preference = new Object();
                // see if we have a cookie set to a clientSupported type:
                var cookieVal = $j.cookie( 'ogg_player_exp' );
                if (cookieVal)
@@ -2761,11 +2761,11 @@ mediaPlayers.prototype =
        },
        savePreferences : function()
        {
-               var cookieVal = '';             
+               var cookieVal = '';
                for(var i in this.preference)
                        cookieVal+= i + '='+ this.preference[i] + '&';
-                       
-               cookieVal=cookieVal.substr(0, cookieVal.length-1);              
+
+               cookieVal=cookieVal.substr(0, cookieVal.length-1);
                var week = 7*86400*1000;
                $j.cookie( 'ogg_player_exp', cookieVal, { 'expires':week } );
        }
@@ -2779,7 +2779,7 @@ mediaPlayers.prototype =
 var embedTypes = {
         // List of players
         players: null,
-        detect_done:false,      
+        detect_done:false,
         init: function(){
                //detect supported types
                this.detect();
@@ -2799,7 +2799,7 @@ var embedTypes = {
                 js_log("running detect");
                this.players = new mediaPlayers();
                //every browser supports html rendering:
-               this.players.addPlayer( htmlPlayer );                   
+               this.players.addPlayer( htmlPlayer );
                 // In Mozilla, navigator.javaEnabled() only tells us about preferences, we need to
                 // search navigator.mimeTypes to see if it's installed
                 var javaEnabled = navigator.javaEnabled();
@@ -2811,28 +2811,28 @@ var embedTypes = {
                 // And it doesn't register an application/x-java-applet mime type like Mozilla does.
                 if ( invisibleJava && javaEnabled )
                         this.players.addPlayer( cortadoPlayer );
-               
+
                 // ActiveX plugins
                 if($j.browser.msie){
-                         // check for flash             
-                          if ( this.testActiveX( 'ShockwaveFlash.ShockwaveFlash')){                               
-                                  //try to get the flash version for omtk include: 
+                         // check for flash
+                          if ( this.testActiveX( 'ShockwaveFlash.ShockwaveFlash')){
+                                  //try to get the flash version for omtk include:
                                   try {
                                        a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
                                        d = a.GetVariable("$version");  // Will crash fp6.0.21/23/29
                                        if (d) {
-                                               d = d.split(" ")[1].split(",");                                         
+                                               d = d.split(" ")[1].split(",");
                                                //we need flash version 10 or greater:
                                                if(parseInt( d[0]) >=10){
                                                        this.players.addPlayer( omtkPlayer );
                                                }
-                                               
-                                       }                                       
-                               }catch(e) {}                            
-                               
-                                  //flowplayer has pretty good compatiablity 
+
+                                       }
+                               }catch(e) {}
+
+                                  //flowplayer has pretty good compatiablity
                                   // (but if we wanted to be fancy we would check for version of flash and update the mp4/h.264 support
-                                  this.players.addPlayer( flowPlayer );                                   
+                                  this.players.addPlayer( flowPlayer );
                           }
                         // VLC
                         if ( this.testActiveX( 'VideoLAN.VLCPlugin.2' ) )
@@ -2842,14 +2842,14 @@ var embedTypes = {
                                 this.players.addPlayer(cortadoPlayer);
                         // quicktime
                         //if ( this.testActiveX( 'QuickTimeCheckObject.QuickTimeCheck.1' ) )
-                        //     this.players.addPlayer(quicktimeActiveXPlayer);                  
-                }                               
+                        //     this.players.addPlayer(quicktimeActiveXPlayer);
+                }
                // <video> element
                if ( typeof HTMLVideoElement == 'object' // Firefox, Safari
                                || typeof HTMLVideoElement == 'function' ) // Opera
                {
-                       //do another test for safari: 
-                       if( $j.browser.safari ){                                
+                       //do another test for safari:
+                       if( $j.browser.safari ){
                                try{
                                        var dummyvid = document.createElement("video");
                                        if (dummyvid.canPlayType && dummyvid.canPlayType("video/ogg;codecs=\"theora,vorbis\"") == "probably")
@@ -2860,7 +2860,7 @@ var embedTypes = {
                                                   but xiph qt registers mimetype via quicktime plugin */
                                                this.players.addPlayer( videoElementPlayer );
                                        } else {
-                                               //@@todo add some user nagging to install the xiph qt 
+                                               //@@todo add some user nagging to install the xiph qt
                                        }
                                }catch(e){
                                        js_log('could not run canPlayType in safari');
@@ -2868,8 +2868,8 @@ var embedTypes = {
                        }else{
                                this.players.addPlayer( videoElementPlayer );
                        }
-               }                
-               
+               }
+
                 // Mozilla plugins
                if( navigator.mimeTypes && navigator.mimeTypes.length > 0) {
                        for ( var i = 0; i < navigator.mimeTypes.length; i++ ) {
@@ -2883,17 +2883,17 @@ var embedTypes = {
                                if ( !pluginName ) {
                                        // In case it is null or undefined
                                        pluginName = '';
-                               }                               
+                               }
                                if ( pluginName.toLowerCase() == 'vlc multimedia plugin' || pluginName.toLowerCase() == 'vlc multimedia plug-in' ) {
                                        this.players.addPlayer(vlcMozillaPlayer, type);
                                        continue;
                                }
-               
+
                                if ( javaEnabled && type == 'application/x-java-applet' ) {
                                        this.players.addPlayer(cortadoPlayer);
                                        continue;
-                               }                               
-               
+                               }
+
                                if ( type == 'application/ogg' ) {
                                        if ( pluginName.toLowerCase() == 'vlc multimedia plugin' ){
                                                this.players.addPlayer(vlcMozillaPlayer, type);
@@ -2912,14 +2912,14 @@ var embedTypes = {
                                                continue;
                                        }
                                }
-               
+
                                /*if ( type == 'video/quicktime' ) {
                                        this.players.addPlayer(vlcMozillaPlayer, type);
                                        continue;
                                }*/
                                if(type=='application/x-shockwave-flash'){
                                        this.players.addPlayer( flowPlayer );
-                                       
+
                                        //check version to add omtk:
                                        var flashDescription = navigator.plugins["Shockwave Flash"].description;
                                        var descArray = flashDescription.split(" ");
@@ -2928,7 +2928,7 @@ var embedTypes = {
                                        //js_log("version of flash: " + versionMajor);
                                        if(versionMajor >= 10){
                                                this.players.addPlayer( omtkPlayer );
-                                       }                                       
+                                       }
                                        continue;
                                }
                        }
@@ -2947,5 +2947,5 @@ var embedTypes = {
                         hasObj = false;
                 }
                 return hasObj;
-       }        
+       }
 };
index 67eb04e..b6f0ec6 100644 (file)
  *
  * All Metavid Wiki code is Released under the GPL2
  * for more info visit http://metavid.org/wiki/Code
- * 
+ *
  * @author Michael Dale
  * @email mdale@wikimedia.org
- * 
- * further developed in open source development partnership with kaltura. 
+ *
+ * further developed in open source development partnership with kaltura.
  * more info at http://kaltura.com & http://kaltura.org
- * 
- * mv_sequencer.js 
- *      is a basic embeddeble sequencer. 
+ *
+ * mv_sequencer.js
+ *      is a basic embeddeble sequencer.
  *  extends the playlist with drag/drop/sortable/add/remove functionality
  *  editing of annotative content (mostly for wiki)
  *  enables more dynamic layouts
  *  exports back out to json or inline format
  */
 
-loadGM({ 
-       "menu_clipedit" : "Edit Media",
-       "menu_transition" : "Transitions & Effects",    
-       "menu_cliplib" : "Add Media",   
-       "menu_resource_overview" : "Resource Overview",
+loadGM({
+       "menu_clipedit" : "Edit media",
+       "menu_transition" : "Transitions and effects",
+       "menu_cliplib" : "Add media",
+       "menu_resource_overview" : "Resource overview",
        "menu_options" : "Options",
-       
-       "loading_timeline" : "Loading TimeLine <blink>...</blink>",
+
+       "loading_timeline" : "Loading timeline <blink>...</blink>",
        "loading_user_rights" : "Loading user rights <blink>...</blink>",
-       
-       "no_edit_permissions" : "You don't have permissions to save changes to this sequence", 
-       
-       "edit_clip" : "Edit Clip",
-       "edit_save" : "Save Sequence Changes",
-       "saving_wait": "Save in Progress (please wait)",
-       "save_done"     :       "Save Done",
-       "edit_cancel" : "Cancel Sequence Edit",
-       "edit_cancel_confirm" : "Are you sure you want to cancel your edit. Changes will be lost",
-                       
-       "zoom_in" : "Zoom In",
-       "zoom_out" : "Zoom Out",
-       "cut_clip" : "Cut Clips",
-       "expand_track" : "Expand Track",
-       "colapse_track" : "Collapse Track",
-       "play_from_position" : "Play From Playline Position",
+
+       "no_edit_permissions" : "You do not have permissions to save changes to this sequence",
+
+       "edit_clip" : "Edit clip",
+       "edit_save" : "Save sequence changes",
+       "saving_wait": "Save in progress (please wait)",
+       "save_done"     :       "Save complete",
+       "edit_cancel" : "Cancel sequence edit",
+       "edit_cancel_confirm" : "Are you sure you want to cancel your edit? Changes will be lost.",
+
+       "zoom_in" : "Zoom in",
+       "zoom_out" : "Zoom out",
+       "cut_clip" : "Cut clips",
+       "expand_track" : "Expand track",
+       "colapse_track" : "Collapse track",
+       "play_from_position" : "Play from playline position",
        "pixle2sec" : "pixles to seconds",
-       "rmclip" : "Remove Clip",
+       "rmclip" : "Remove clip",
        "clip_in" : "clip in",
        "clip_out" : "clip out",
-               
-       "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3> very <b>limited</b> functionality right now. Not much documentation yet either",
-       
-       "no_selected_resource" : "<h3>No Resource Selected</h3> Select a Clip to enable editing",
-       "error_edit_multiple" : "<h3>Multiple Resources Selected</h3> Select a single clip to edit it", 
-       
+
+       "mv_welcome_to_sequencer" : "<h3>Welcome to the sequencer demo</h3> Very <b>limited</b> functionality right now. Not much documentation yet either.",
+
+       "no_selected_resource" : "<h3>No resource selected</h3> Select a clip to enable editing.",
+       "error_edit_multiple" : "<h3>Multiple resources selected</h3> Select a single clip to edit it.",
+
        "mv_editor_options" : "Editor options",
        "mv_editor_mode" : "Editor mode",
        "mv_simple_editor_desc" : "simple editor (iMovie style)",
        "mv_advanced_editor_desc" : "advanced editor (Final Cut style)",
-       "mv_other_options" : "Other Options",   
-       "mv_contextmenu_opt" : "Enable Context Menus",
-       
-       "mv_sequencer_credit_line":"Developed by <a href=\"http://kaltura.com\">Kaltura, Inc.</a>  in partnership with the <a href=\"http://wikimediafoundation.org/wiki/Home\">Wikimedia Foundation</a> ( <a href=\"#\">more info</a> )"
+       "mv_other_options" : "Other options",
+       "mv_contextmenu_opt" : "Enable context menus",
+
+       "mv_sequencer_credit_line":"Developed by <a href=\"http://kaltura.com\">Kaltura, Inc.</a> in partnership with the <a href=\"http://wikimediafoundation.org/wiki/Home\">Wikimedia Foundation</a> (<a href=\"#\">more information</a>)."
 });
  //used to set default values and validate the passed init object
 var sequencerDefaultValues = {
-       
-       instance_name:'mvSeq', //for now only one instance by name mvSeq is allowed     
-       
-       target_sequence_container:null,//text value (so that its a valid property) 
+
+       instance_name:'mvSeq', //for now only one instance by name mvSeq is allowed
+
+       target_sequence_container:null,//text value (so that its a valid property)
        target_form_text: null,
-       
+
        //what is our save mode:
-       // can save to 'api' url or 'form'      
+       // can save to 'api' url or 'form'
        saveMode : 'api',
-       
+
        video_container_id:'mv_video_container',
-       
+
        video_width : 400,
-       video_height: 300,      
-       
+       video_height: 300,
+
        sequence_tools_id:'mv_sequence_tools',
        timeline_id:'mv_timeline',
        plObj_id:'seq_pl',
-       plObj:'null',   
-       
+       plObj:'null',
+
        timeline_scale:.06, //in pixel to second ratio ie 100pixles for every ~30seconds
        timeline_duration:500, //default timeline length in seconds
        playline_time:0,
        track_thumb_height:60,
-       track_text_height:20,   
-               
-       //default timeline mode: "story" (i-movie like) or "time" (finalCut like) 
-       timeline_mode:'storyboard', 
-       
+       track_text_height:20,
+
+       //default timeline mode: "story" (i-movie like) or "time" (finalCut like)
+       timeline_mode:'storyboard',
+
        track_clipThumb_height:80, // how large are the i-movie type clips
-       
-       base_adj_duration:.5, //default time to subtract or add when adjusting clips.    
-       
+
+       base_adj_duration:.5, //default time to subtract or add when adjusting clips.
+
        //default clipboard is empty:
        clipboard:new Array(),
-       //stores the clipboard edit token (if user has rights to edit their User page) 
+       //stores the clipboard edit token (if user has rights to edit their User page)
        clipboardEditToken:null,
-       //stores the sequence edit token (if user has rights to edit the current sequence)      
+       //stores the sequence edit token (if user has rights to edit the current sequence)
        sequenceEditToken:null,
-       //the time the sequence was last touched (grabbed at time of startup)   
-       sequenceTouchedTime:null,               
-               
-       
-       
-       //Msg are all the language specific values ... 
-       // (@@todo overwrite by msg values preloaded in the page)       
+       //the time the sequence was last touched (grabbed at time of startup)
+       sequenceTouchedTime:null,
+
+
+
+       //Msg are all the language specific values ...
+       // (@@todo overwrite by msg values preloaded in the page)
        //tack/clips can be pushed via json or inline playlist format
-       inline_playlist:'null', //text value so its a valid property 
+       inline_playlist:'null', //text value so its a valid property
        inline_playlist_id:'null',
        mv_pl_src:'null',
        //the edit stack:
        edit_stack:new Array(),
        disp_menu_item:null,
-       //trackObj used to payload playlist Track Object (when inline not present) 
-       tracks:{}       
+       //trackObj used to payload playlist Track Object (when inline not present)
+       tracks:{}
 }
-var mvSequencer = function(iObj) {             
+var mvSequencer = function(iObj) {
        return this.init(iObj);
 };
 //set up the mvSequencer object
@@ -128,9 +128,9 @@ mvSequencer.prototype = {
        //the menu_items Object contains: default html, js setup/loader functions
        menu_items : {
                'clipedit':{
-                       'd':0,                  
+                       'd':0,
                        'html':'',
-                       'js': function(this_seq){                               
+                       'js': function(this_seq){
                                this_seq.doEditSelectedClip();
                        },
                        'click_js':function( this_seq ){
@@ -140,47 +140,47 @@ mvSequencer.prototype = {
                'transition':{
                        'd':0,
                        'html' : '<h3>' + gM('menu_transition') + '</h3>',
-                       'js':function(this_seq){                                
+                       'js':function(this_seq){
                                this_seq.doEditTransitionSelectedClip();
                        },
-                       'click_js':function(this_seq){                                                          
-                               //highlight the transition of the selected clip: 
+                       'click_js':function(this_seq){
+                               //highlight the transition of the selected clip:
                                this_seq.doEditTransitionSelectedClip();
                        }
-               },      
+               },
                'cliplib':{
-                       'd':0,  
-                       'html': gM('loading_txt'),                      
-                       'js':function( this_seq ){                              
-                               //load the search interface with sequence tool targets           
+                       'd':0,
+                       'html': gM('loading_txt'),
+                       'js':function( this_seq ){
+                               //load the search interface with sequence tool targets
                                mvJsLoader.doLoad( [
                                        'remoteSearchDriver',
                                        'seqRemoteSearchDriver'
-                               ], function(){                                  
+                               ], function(){
                                         this_seq.mySearch = new seqRemoteSearchDriver(this_seq);
-                                        this_seq.mySearch.doInitDisplay();                                      
+                                        this_seq.mySearch.doInitDisplay();
                                });
                        }
-               },      
+               },
                'options':{
-                       'd':0,  
+                       'd':0,
                        'html' : '<h3>' + gM('menu_options') + '</h3>' +
                                gM('mv_editor_mode') + '<br> ' +
-                               '<blockquote><input type="radio" value="simple_editor" name="opt_editor">' + 
+                               '<blockquote><input type="radio" value="simple_editor" name="opt_editor">' +
                                                gM('mv_simple_editor_desc') + ' </blockquote>' +
                                '<blockquote><input type="radio" value="advanced_editor" name="opt_editor">' +
                                                gM('mv_advanced_editor_desc') + ' </blockquote>'+
-                               gM('mv_other_options') + '<br>' + 
-                               '<blockquote><input type="checkbox" value="contextmenu_opt" name="contextmenu_opt">' + 
-                                               gM('mv_contextmenu_opt') + ' </blockquote>',            
+                               gM('mv_other_options') + '<br>' +
+                               '<blockquote><input type="checkbox" value="contextmenu_opt" name="contextmenu_opt">' +
+                                               gM('mv_contextmenu_opt') + ' </blockquote>',
                        'js':function(this_seq){
                                $j('#options_ic input[value=\'simple_editor\']').attr({
-                                       'checked':(this_seq.timeline_mode=='storyboard')?true:false                                     
+                                       'checked':(this_seq.timeline_mode=='storyboard')?true:false
                                }).click(function(){
                                        this_seq.doSimpleTl();
                                });
                                $j('#options_ic input[value=\'advanced_editor\']').attr({
-                                       'checked':( this_seq.timeline_mode=='time' )?true:false                                 
+                                       'checked':( this_seq.timeline_mode=='time' )?true:false
                                }).click(function(){
                                        this_seq.doAdvancedTl();
                                });
@@ -188,14 +188,14 @@ mvSequencer.prototype = {
                        }
                }
        },
-       
-       //set up initial key states: 
-       key_shift_down:false, 
+
+       //set up initial key states:
+       key_shift_down:false,
        key_ctrl_down:false,
        inputFocus:false,
-       
-       init:function( iObj ){  
-               //set up pointer to this_seq for current scope:          
+
+       init:function( iObj ){
+               //set up pointer to this_seq for current scope:
                var this_seq = this;
                //set the default values:
                for(var i in sequencerDefaultValues){
@@ -213,21 +213,21 @@ mvSequencer.prototype = {
                        js_log("Error: missing target_sequence_container");
                        return false;
                }
-               
+
                //$j(this.target_sequence_container).css('position', 'relative');
                this['base_width']  = $j(this.target_sequence_container).width();
-               this['base_height'] = $j(this.target_sequence_container).height();                              
-               
-               //add the container divs (with basic layout ~universal~ 
+               this['base_height'] = $j(this.target_sequence_container).height();
+
+               //add the container divs (with basic layout ~universal~
                $j(this.target_sequence_container).html(''+
                        '<div id="' + this.video_container_id + '" style="position:absolute;right:0px;top:0px;' +
-                               'width:' + this.video_width + 'px;height:'+this.video_height+'px;border:solid thin blue;background:#FFF;font-color:black;"/>'+                  
-                       '<div id="' + this.timeline_id + '" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' + 
+                               'width:' + this.video_width + 'px;height:'+this.video_height+'px;border:solid thin blue;background:#FFF;font-color:black;"/>'+
+                       '<div id="' + this.timeline_id + '" class="ui-widget ui-widget-content ui-corner-all" style="position:absolute;' +
                                'left:0px;right:0px;top:'+(this.video_height+34)+'px;bottom:35px;overflow:auto;">'+
                                        gM('loading_timeline')+ '</div>'+
                        '<div class="seq_status" style="position:absolute;left:0px;width:300px;"></div>'+
                        '<div class="seq_save_cancel" style="position:absolute;'+
-                               'left:5px;bottom:0px;height:25px;">'+                                   
+                               'left:5px;bottom:0px;height:25px;">'+
                                        gM('loading_user_rights') +
                        '</div>'+
                        '<div class="about_editor" style="position:absolute;right:5px;bottom:7px;">' +
@@ -238,16 +238,16 @@ mvSequencer.prototype = {
                ).css({
                        'min-width':'850px'
                });
-               
+
                /*js_log('set: '+this.target_sequence_container + ' html to:'+ "\n"+
                        $j(this.target_sequence_container).html()
-               );*/            
+               );*/
                //first check if we got a cloned PL object:
-               //(when the editor is invoked with the plalylist already on the page) 
-               //@@NOT WORKING... (need a better "clone" function) 
+               //(when the editor is invoked with the plalylist already on the page)
+               //@@NOT WORKING... (need a better "clone" function)
                /*if( this.plObj != 'null' ){
-                       js_log('found plObj clone');                    
-                       //extend with mvSeqPlayList object:                     
+                       js_log('found plObj clone');
+                       //extend with mvSeqPlayList object:
                        this.plObj = new mvSeqPlayList(this.plObj);
                        js_log('mvSeqPlayList added: ' + this.plObj.org_control_height );
                        $j('#'+this.video_container_id).get(0).attachNode( this.plObj );
@@ -255,28 +255,28 @@ mvSequencer.prototype = {
                        this.checkReadyPlObj();
                        return ;
                }*/
-                               
-               //else check for source based sequence editor (a clean page load of the editor) 
+
+               //else check for source based sequence editor (a clean page load of the editor)
                if( this.mv_pl_src != 'null' ) {
-                       js_log( ' pl src:: ' + this.mv_pl_src );                        
-                       var src_attr=' src="' + this.mv_pl_src+'" ';            
+                       js_log( ' pl src:: ' + this.mv_pl_src );
+                       var src_attr=' src="' + this.mv_pl_src+'" ';
                }else{
-                       js_log( ' null playlist src .. (start empty) '); 
+                       js_log( ' null playlist src .. (start empty) ');
                        var src_attr='';
-               }                       
+               }
                $j('#'+this.video_container_id).html('<playlist ' + src_attr +
                        ' style="width:' + this.video_width + 'px;height:' + this.video_height + 'px;" '+
-                       ' controls="false" id="' + this.plObj_id + '" />');             
-               rewrite_by_id( this.plObj_id ); 
-               setTimeout(this.instance_name +'.checkReadyPlObj()', 25);               
+                       ' controls="false" id="' + this.plObj_id + '" />');
+               rewrite_by_id( this.plObj_id );
+               setTimeout(this.instance_name +'.checkReadyPlObj()', 25);
        },
-       updateSeqSaveButtons:function(){                
-               var _this = this;       
+       updateSeqSaveButtons:function(){
+               var _this = this;
                if( this.sequenceEditToken ){
-                       $j(this.target_sequence_container+' .seq_save_cancel').html( 
+                       $j(this.target_sequence_container+' .seq_save_cancel').html(
                                $j.btnHtml( gM('edit_save'), 'seq_edit_save', 'close') + ' ' +
-                               $j.btnHtml( gM('edit_cancel'), 'seq_edit_cancel', 'close')                              
-                       );                      
+                               $j.btnHtml( gM('edit_cancel'), 'seq_edit_cancel', 'close')
+                       );
                }else{
                        $j(this.target_sequence_container+' .seq_save_cancel').html( cancel_button + gM('no_edit_permissions') );
                }
@@ -286,23 +286,23 @@ mvSequencer.prototype = {
                        if( x ){
                                _this.closeModEditor();
                        }else{
-                               //close request canceled. 
+                               //close request canceled.
                        }
                });
                $j(this.target_sequence_container +' .seq_edit_save').unbind().click(function(){
                        //pop up progress dialog ~requesting edit line summary~
-                       //remove any other save dialog 
+                       //remove any other save dialog
                        $j('#seq_save_dialog').remove();
                        $j('body').append('<div id="seq_save_dialog" title="'+ gM('edit_save') +'">' +
                                                '<span class="mw-summary">'+
                                                        '<label for="seq_save_summary">Edit summary: </label>' +
                                                '</span>'+
-                                               '<input id="seq_save_summary" tabindex="1" maxlength="200" value="" size="30" name="seq_save_summary"/>'+                                                       
+                                               '<input id="seq_save_summary" tabindex="1" maxlength="200" value="" size="30" name="seq_save_summary"/>'+
                                        '</div>');
-                       //dialog: 
+                       //dialog:
                        $j('#seq_save_dialog').dialog({
                                bgiframe: true,
-                               autoOpen: true,           
+                               autoOpen: true,
                                modal: true,
                                buttons:{
                                        "Save":function(){
@@ -310,32 +310,32 @@ mvSequencer.prototype = {
                                                        'action'        : 'edit',
                                                        'title'         : _this.plObj.mTitle,
                                                        //the text is the sequence XML + the description
-                                                       'text'          : _this.getSeqOutputHLRDXML() + "\n" + 
+                                                       'text'          : _this.getSeqOutputHLRDXML() + "\n" +
                                                                                  _this.plObj.wikiDesc,
                                                        'token'         : _this.sequenceEditToken,
                                                        'summary'       : $j('#seq_save_summary').val()
-                                               };              
-                                               //change to progress bar and save:      
+                                               };
+                                               //change to progress bar and save:
                                                $j('#seq_save_dialog').html('<div class="progress" /><br>' +
                                                        gM('saving_wait')
-                                               )                                       
+                                               )
                                                $j('#seq_save_dialog .progress').progressbar({
                                                        value: 100
                                                });
-                                               //run the Seq Save Request:                                                                     
+                                               //run the Seq Save Request:
                                                do_api_req( {
                                                        'data': saveReq,
                                                        'url' : _this.getLocalApiUrl()
-                                               },function(data){                                                       
+                                               },function(data){
                                                        $j('#seq_save_dialog').html( gM('save_done') );
-                                                       $j('#seq_save_dialog').dialog('option', 
-                                                               'buttons', { 
-                                                                       "Done":function(){                                                                              
+                                                       $j('#seq_save_dialog').dialog('option',
+                                                               'buttons', {
+                                                                       "Done":function(){
                                                                                //refresh the page?
                                                                                window.location.reload();
                                                                        },
-                                                                       "Do More Edits": function() { 
-                                                                               $j(this).dialog("close"); 
+                                                                       "Do More Edits": function() {
+                                                                               $j(this).dialog("close");
                                                                        }
                                                        });
                                                });
@@ -347,63 +347,63 @@ mvSequencer.prototype = {
                        });
                })
        },
-       //display a menu item (hide the rest) 
+       //display a menu item (hide the rest)
        disp:function( item, dispCall ){
                js_log('menu_item disp: ' + item);
-               this.disp_menu_item = item;             
-               //update the display and item state:            
-               if(this.menu_items[item]){              
-                       //update the tabs display: 
+               this.disp_menu_item = item;
+               //update the display and item state:
+               if(this.menu_items[item]){
+                       //update the tabs display:
                        if(!dispCall)
                                $j("#seq_menu").tabs('select', this.menu_items[item].inx);
-                               
+
                        this.menu_items[item].d = 1;
                        //do any click_js actions:getInsertControl
-                       if( this.menu_items[item].click_js ) 
-                               this.menu_items[item].click_js( this );                                                                 
-               }               
+                       if( this.menu_items[item].click_js )
+                               this.menu_items[item].click_js( this );
+               }
        },
-       //setup the menu items:  
-       setupMenuItems:function(){      
-               js_log('loadInitMenuItems');            
+       //setup the menu items:
+       setupMenuItems:function(){
+               js_log('loadInitMenuItems');
                var this_seq = this;
                //do all the menu_items setup:   @@we could defer this to once the menu item is requested
-               for( var i in this.menu_items ){        
-                       if(     this.menu_items[i].js ) 
+               for( var i in this.menu_items ){
+                       if(     this.menu_items[i].js )
                                this.menu_items[i].js( this );
-               }                                                                               
+               }
        },
        renderTimeLine:function(){
-               //empty out the top level html: 
+               //empty out the top level html:
                $j('#'+this.timeline_id).html('');
-               //add html general for timeline         
+               //add html general for timeline
                if( this.timeline_mode == 'time'){
                        $j('#'+this.timeline_id).html(''+
                                '<div id="'+this.timeline_id+'_left_cnt" class="mv_tl_left_cnt">'+
                                        '<div id="'+this.timeline_id+'_head_control" style="position:absolute;top:0px;left:0px;right:0px;height:30px;">' +
                                                '<a title="'+gM('play_from_position')+'" href="javascript:'+this.instance_name+'.play_jt()">'+
-                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/control_play_blue.png">'+                                                                                                
+                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/control_play_blue.png">'+
                                                '</a>'+
                                                '<a title="'+gM('zoom_in')+'" href="javascript:'+this.instance_name+'.zoom_in()">'+
-                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_in.png">'+                                                                                                                  
+                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_in.png">'+
                                                '</a>'+
                                                '<a title="'+gM('zoom_out')+'" href="javascript:'+this.instance_name+'.zoom_out()">'+
-                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_out.png">'+                                 
+                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/zoom_out.png">'+
                                                '</a>'+
                                                '<a title="'+gM('cut_clip')+'" href="javascript:'+this.instance_name+'.cut_mode()">'+
-                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/cut.png">'+              
-                                                       '</a>'+                                 
-                                       '</div>' +                      
-                               '</div>' + 
+                                                       '<img style="width:16px;height:16px;border:0" src="' + mv_embed_path + 'images/cut.png">'+
+                                                       '</a>'+
+                                       '</div>' +
+                               '</div>' +
                                '<div id="'+this.timeline_id+'_tracks" class="mv_seq_tracks">' +
                                        '<div id="'+this.timeline_id+'_head_jump" class="mv_head_jump" style="position:absolute;top:0px;left:0px;height:20px;"></div>'+
                                        '<div id="'+this.timeline_id+'_playline" class="mv_playline"></div>'+
                                '</div>'
-                       );                              
+                       );
                        //add playlist hook to update timeline
-                       this.plObj.update_tl_hook = this.instance_name+'.update_tl_hook';               
+                       this.plObj.update_tl_hook = this.instance_name+'.update_tl_hook';
                        var this_sq = this;
-                       var top_pos=25;         
+                       var top_pos=25;
                        //add tracks:
                        for(var i in this.plObj.tracks){
                                var track = this.plObj.tracks[i];
@@ -427,7 +427,7 @@ mvSequencer.prototype = {
                                $j('#'+this.timeline_id+'_left_cnt').append(
                                        '<div id="track_cnt_'+i+'" style="top:'+top_pos+'px;height:'+track_height+'px;" class="track_name">'+
                                                '<a id="mv_exc_'+i+'" title="'+exc_msg+'" href="javascript:'+this_sq.instance_name+'.exc_track('+i+',\''+exc_action+'\')">'+
-                                                       '<img id="'+this_sq.timeline_id+'_close_expand" style="width:16px;height:16px;border:0" '+ 
+                                                       '<img id="'+this_sq.timeline_id+'_close_expand" style="width:16px;height:16px;border:0" '+
                                                                ' src="'+mv_embed_path + 'images/'+exc_img+'.png">'+
                                                '</a>'+
                                        track.title+'</div>'
@@ -435,9 +435,9 @@ mvSequencer.prototype = {
                                //also render the clips in the trackset container: (thumb or text view)
                                $j('#'+this.timeline_id+'_tracks').append(
                                        '<div id="container_track_'+i+'" style="top:'+top_pos+'px;height:'+(track_height+2)+'px;left:0px;right:0px;" class="container_track" />'
-                               );              
+                               );
                                top_pos+=track_height+20;
-                       }               
+                       }
                }
                if( this.timeline_mode=='storyboard'){
                        var top_pos=this.plObj.org_control_height;
@@ -451,7 +451,7 @@ mvSequencer.prototype = {
                                        '       style="position:absolute;top:25px;height:'+(track_height+30)+'px;left:10px;right:0px;"' +
                                        '>'+
                                                '<div id="container_track_'+i+'" style="position:relative;top:0px;' +
-                                                       'height:'+(track_height+30)+'px;left:0px;right:0px;" class="container_track">' +                                                                                        
+                                                       'height:'+(track_height+30)+'px;left:0px;right:0px;" class="container_track">' +
                                                '</div>'+
                                                '<div id="' + timeline_id + '_playline" class="mv_story_playline">' +
                                                        '<div class="mv_playline_top"/>'+
@@ -462,77 +462,77 @@ mvSequencer.prototype = {
                        }
                }
        },
-       //once playlist is ready continue 
-       checkReadyPlObj:function(){             
-               //set up pointers from sequencer to pl obj 
+       //once playlist is ready continue
+       checkReadyPlObj:function(){
+               //set up pointers from sequencer to pl obj
                this.plObj = $j('#'+ this.plObj_id ).get(0);
                //& from seq obj to sequencer
                this.plObj.pSeq = this;
-               
+
                if( this.plObj )
                        if( ! this.plObj.loading )
                                this.plReadyInit();
-                                               
-               //else keep checking for the playlist to be ready 
-               if( this.plObj.loading ){ 
+
+               //else keep checking for the playlist to be ready
+               if( this.plObj.loading ){
                        if(this.plReadyTimeout==200){
                                js_error('error playlist never ready');
                        }else{
                                this.plReadyTimeout++;
                                setTimeout(this.instance_name +'.checkReadyPlObj()', 25);
                        }
-               }               
+               }
        },
        getLocalApiUrl:function(){
-               return this.plObj.interface_url; 
+               return this.plObj.interface_url;
        },
        plReadyInit:function(){
-               var _this = this;               
-               js_log('plReadyInit');          
-               js_log( this.plObj );                           
-               //give the playlist a pointer to its parent seq: 
+               var _this = this;
+               js_log('plReadyInit');
+               js_log( this.plObj );
+               //give the playlist a pointer to its parent seq:
                this.plObj['seqObj'] = this;
-                                                       
+
                //update playlist (if its empty right now)
                if(this.plObj.getClipCount()==0){
                        $j('#'+this.plObj_id).html('empty playlist');
-               }       
-               
-               //propagate the edit tokens 
-               //if on an edit page just grab from the form:           
+               }
+
+               //propagate the edit tokens
+               //if on an edit page just grab from the form:
                this.sequenceEditToken = $j('input[wpEditToken]').val();
-               
+
                if(typeof this.sequenceEditToken == 'undefined' && this.getLocalApiUrl()!=null){
-                       get_mw_token(_this.plObj.mTitle, _this.getLocalApiUrl(), 
+                       get_mw_token(_this.plObj.mTitle, _this.getLocalApiUrl(),
                                function(token){
                                        if(token){
                                                _this.sequenceEditToken = token;
                                                _this.updateSeqSaveButtons();
-                                       }       
+                                       }
                                }
-                       );                      
-                       get_mw_token(_this.plObj.mTalk, _this.getLocalApiUrl(), 
+                       );
+                       get_mw_token(_this.plObj.mTalk, _this.getLocalApiUrl(),
                                function(token){
                                        _this.clipboardEditToken = token;
                                }
                        );
                        //also grab permissions for sending clipboard commands to the server
-                       
-                       //(calling the sequencer inline) try and get edit token via api call:                   
-                       //(somewhat fragile way to get at the api... should move to config 
+
+                       //(calling the sequencer inline) try and get edit token via api call:
+                       //(somewhat fragile way to get at the api... should move to config
                        /*var token_url = this.plObj.interface_url.replace(/index\.php/, 'api.php');
-                       token_url += '?action=query&format=xml&prop=info&intoken=edit&titles=';                 
+                       token_url += '?action=query&format=xml&prop=info&intoken=edit&titles=';
                        $j.ajax({
                                type: "GET",
-                               url: token_url + this_seq.plObj.mTitle,                         
-                               success:function(data){                                                 
+                               url: token_url + this_seq.plObj.mTitle,
+                               success:function(data){
                                        var pageElm = data.getElementsByTagName('page')[0];
                                        if( $j(pageElm).attr('edittoken') ){
                                                this_seq.sequenceEditToken = $j(pageElm).attr('edittoken');
                                        }
-                                       
+
                                }
-                       });*/                   
+                       });*/
                        //also grab permissions for sending clipboard commands to the server
                        /*$j.ajax({
                                type:"GET",
@@ -541,19 +541,19 @@ mvSequencer.prototype = {
                                        var pageElm = data.getElementsByTagName('page')[0];
                                        if( $j(pageElm).attr('edittoken') ){
                                                this_seq.clipboardEditToken = $j(pageElm).attr('edittoken');
-                                       }                                                               
-                               } 
-                       });*/                   
+                                       }
+                               }
+                       });*/
                }
-               
-               
-               //render the menu tabs::                
+
+
+               //render the menu tabs::
                var item_containers ='';
                var inx = 0;
-               var selected_tab = 0;           
+               var selected_tab = 0;
                var tabc ='';
                var o='<div id="seq_menu" style="width:100%;height:100%">';
-               o+='<ul>';                      
+               o+='<ul>';
                for(var tab_id in this.menu_items){
                        menu_item = this.menu_items[tab_id];
                        menu_item.inx = inx;
@@ -561,94 +561,94 @@ mvSequencer.prototype = {
                                selected_tab=inx;
                                _this.disp_menu_item =tab_id;
                        }
-                                               
-                       o+='<li>' + 
+
+                       o+='<li>' +
                                '<a id="mv_menu_item_'+tab_id+'" href="#' + tab_id + '_ic">'+gM('menu_' + tab_id ) + '</a>' +
-                       '</li>';                                                
-                       
-                       tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:268px;" >';                                                                                                    
+                       '</li>';
+
+                       tabc += '<div id="' + tab_id + '_ic" style="overflow:auto;height:268px;" >';
                                tabc += (menu_item.html) ? menu_item.html : '<h3>' + gM('menu_'+tab_id) + '</h3>';
-                       tabc +='</div>';                                
+                       tabc +='</div>';
                        inx++;
                };
                o+='</ul>';
-               o+=tabc;                                
+               o+=tabc;
                $j('#'+this.sequence_tools_id).html( o );
-                               
-                 
+
+
                $j("#seq_menu").tabs({
                        selected:selected_tab,
-                       select: function(event, ui) {                                                                   
+                       select: function(event, ui) {
                                _this.disp( $j(ui.tab).attr('id').replace('mv_menu_item_', ''), true );
-                       }               
+                       }
                //add sorting
                }).find(".ui-tabs-nav").sortable({ axis : 'x' });
-                                       
-               
-               //render the timeline                                   
-               this.renderTimeLine();                  
+
+
+               //render the timeline
+               this.renderTimeLine();
                this.do_refresh_timeline();
-               
-               //load init content into containers 
-               this.setupMenuItems();          
-               
-               this.doFocusBindings();         
-               
+
+               //load init content into containers
+               this.setupMenuItems();
+
+               this.doFocusBindings();
+
                //set up key bidnings
                $j(window).keydown(function(e){
-                       js_log('pushed down on:' + e.which);                    
+                       js_log('pushed down on:' + e.which);
                        if( e.which == 16 )
                                _this.key_shift_down = true;
-                                               
+
                        if( e.which == 17)
                                _this.key_ctrl_down = true;
-                               
+
                        if( (e.which == 67 && _this.key_ctrl_down) && !_this.inputFocus)
                                _this.copySelectedClips();
-                               
+
                        if( (e.which == 88 && _this.key_ctrl_down) && !_this.inputFocus)
                                _this.cutSelectedClips();
-                       
-                       //paste cips on v + ctrl while not focused on a text area: 
-                       if( (e.which == 86 && _this.key_ctrl_down) && !_this.inputFocus)                                
+
+                       //paste cips on v + ctrl while not focused on a text area:
+                       if( (e.which == 86 && _this.key_ctrl_down) && !_this.inputFocus)
                                _this.pasteClipBoardClips();
-                               
+
                });
-               $j(window).keyup(function(e){                   
-                       js_log('key up on ' + e.which);                 
+               $j(window).keyup(function(e){
+                       js_log('key up on ' + e.which);
                        //user let go of "shift" turn off multi-select
                        if( e.which == 16 )
                                _this.key_shift_down = false;
-                               
+
                        if( e.which == 17 )
-                               _this.key_ctrl_down = false;                                                    
-                       
-                       //escape key (for now deselect)  
+                               _this.key_ctrl_down = false;
+
+                       //escape key (for now deselect)
                        if( e.which == 27 )
                                _this.deselectClip();
-                       
-                       
-                       //backspace or delete key while not focused on a text area: 
-                       if( (e.which == 8 || e.which == 46) && !_this.inputFocus)                                                               
-                               _this.removeSelectedClips();                                    
+
+
+                       //backspace or delete key while not focused on a text area:
+                       if( (e.which == 8 || e.which == 46) && !_this.inputFocus)
+                               _this.removeSelectedClips();
                });
        },
-       //check all nodes for focus 
+       //check all nodes for focus
        //@@todo it would probably be faster to search a given subnode instead of all text
        doFocusBindings:function(){
                var _this = this;
                //if an input or text area has focus disable delete key binding
                $j("input,textarea").focus(function () {
                        js_log("inputFocus:true");
-                       _this.inputFocus = true;        
+                       _this.inputFocus = true;
                });
                $j("input,textarea").blur( function () {
                        js_log("inputFocus:blur");
                        _this.inputFocus = false;
                })
        },
-       update_tl_hook:function(jh_time_ms){                    
-               //put into seconds scale: 
+       update_tl_hook:function(jh_time_ms){
+               //put into seconds scale:
                var jh_time_sec_float = jh_time_ms/1000;
                //render playline at given time
                //js_log('tl scale: '+this.timeline_scale);
@@ -659,10 +659,10 @@ mvSequencer.prototype = {
        getSeqOutputJSON:function(){
                js_log('json output:');
        },
-       getSeqOutputHLRDXML:function(){         
+       getSeqOutputHLRDXML:function(){
                var o='<sequence_hlrd>' +"\n";
-               o+="\t<head>\n";                
-               //get transitions 
+               o+="\t<head>\n";
+               //get transitions
                for(var i in this.plObj.transitions){
                        if( this.plObj.transitions[i] ){
                                var tObj = this.plObj.transitions[i].getAttributeObj();
@@ -673,83 +673,83 @@ mvSequencer.prototype = {
                                o+='/>'+"\n"; //transitions don't have children
                        }
                }
-               o+="\t</head>\n";       
-                       
-               //get clips 
+               o+="\t</head>\n";
+
+               //get clips
                o+="\t<body>\n";
-               //output each track: 
+               //output each track:
                for(var i in this.plObj.tracks){
-                       var curTrack = this.plObj.tracks[i];                    
+                       var curTrack = this.plObj.tracks[i];
                        o+="\t<seq";
                                var tAttr = curTrack.getAttributeObj();
                                for(var j in  tAttr){
                                        o+=' '+j+'="' + tAttr[j] + '"\n\t\t\t';
                                }
-                       o+=">\n";                       
+                       o+=">\n";
                        for( var k in curTrack.clips ){
-                               var curClip = curTrack.clips[k];                                
+                               var curClip = curTrack.clips[k];
                                o+="\t\t<ref ";
                                        var cAttr = curClip.getAttributeObj();
                                        var lt = '';
                                        for(var j in  cAttr){
-                                               var val =  (j=='transIn' || j=='transOut') ? cAttr[j].id : cAttr[j];                                                                                                    
+                                               var val =  (j=='transIn' || j=='transOut') ? cAttr[j].id : cAttr[j];
                                                o+=lt + j+'="' + val + '"';
                                                lt ="\n\t\t";
-                                       }                                       
-                               o+=">\n" //close the clip                               
+                                       }
+                               o+=">\n" //close the clip
                                for(var pName in curClip.params){
                                        var pVal = curClip.params[pName];
                                        o+="\t\t\t" + '<param name="'+ pName + '">' + pVal + '</param>' + "\n";
-                               } 
+                               }
                                o+="\t\t</ref>\n\n";
                        }
                        o+="\n</seq>\n";
                }
-               o+="\t</body>\n";               
+               o+="\t</body>\n";
                //close the tag
-               o+='</sequence_hlrd>';          
-               
-               return o;               
-       },              
+               o+='</sequence_hlrd>';
+
+               return o;
+       },
        editClip:function(track_inx, clip_inx){
                var cObj = this.plObj.tracks[ track_inx ].clips[ clip_inx ];
                this.doEditClip( cObj );
        },
        doEditTransitionSelectedClip:function(){
                var _this = this;
-               js_log("f:doEditTransitionSelectedClip:" + $j('.mv_selected_clip').length);                             
-               if( $j('.mv_selected_clip').length == 1){                       
+               js_log("f:doEditTransitionSelectedClip:" + $j('.mv_selected_clip').length);
+               if( $j('.mv_selected_clip').length == 1){
                        _this.doEditTransition( _this.getClipFromSeqID( $j('.mv_selected_clip').parent().attr('id') ) );
                }else if( $j('.mv_selected_clip').length === 0){
-                       //no clip selected warning: 
+                       //no clip selected warning:
                        $j('#transition_ic').html( gM('no_selected_resource') );
                }else{
-                       //multiple clip selected warning: 
+                       //multiple clip selected warning:
                        $j('#transition_ic').html( gM('error_edit_multiple') );
                }
        },
-       doEditSelectedClip:function(){  
-               js_log("f:doEditSelectedClip:"); 
-               //and only one clip selected                    
-               if( $j('.mv_selected_clip').length == 1){                       
+       doEditSelectedClip:function(){
+               js_log("f:doEditSelectedClip:");
+               //and only one clip selected
+               if( $j('.mv_selected_clip').length == 1){
                        this.doEditClip( this.getClipFromSeqID( $j('.mv_selected_clip').parent().attr('id') ) );
                }else if( $j('.mv_selected_clip').length === 0){
-                       //no clip selected warning: 
+                       //no clip selected warning:
                        $j('#clipedit_ic').html( gM('no_selected_resource') );
                }else{
-                       //multiple clip selected warning: 
+                       //multiple clip selected warning:
                        $j('#clipedit_ic').html( gM('error_edit_multiple') );
-               }               
+               }
        },
        doEditTransition:function( cObj ){
                js_log("sequence:doEditTransition");
-               var _this = this;               
+               var _this = this;
                mv_get_loading_img( '#transitions_ic' );
-               mvJsLoader.doLoad([             
+               mvJsLoader.doLoad([
                        '$j.fn.ColorPicker',
-                       'mvTimedEffectsEdit'                    
+                       'mvTimedEffectsEdit'
                ],function(){
-                       //no idea why this works / is needed. 
+                       //no idea why this works / is needed.
                        var localSeqRef = _this;
                        _this.myEffectEdit = new mvTimedEffectsEdit({
                                'rObj'           : cObj,
@@ -760,11 +760,11 @@ mvSequencer.prototype = {
        },
        //updates the clip details div if edit resource is set
        doEditClip:function( cObj){
-               var _this = this;               
+               var _this = this;
 
                //set default edit action (maybe edit_action can be sent via by context click)
-               var edit_action = 'fileopts'; 
-               
+               var edit_action = 'fileopts';
+
                mv_get_loading_img( '#clipedit_ic' );
                //load the clipEdit library if not already loaded:
                mvJsLoader.doLoad( [
@@ -775,122 +775,122 @@ mvSequencer.prototype = {
                        _this.myClipEditor = new mvClipEdit({
                                'rObj'                  : cObj,
                                'control_ct'    : 'clipedit_ic',
-                               'clip_disp_ct'  : cObj.id,      
+                               'clip_disp_ct'  : cObj.id,
                                'edit_action'   : edit_action,
                                'p_seqObj'              : _this,
                                'profile'               : 'sequence'
-                       }); 
+                       });
                });
        },
        //save new clip segment
        saveClipEdit:function(){
                //saves the clip updates
-       }, 
+       },
        closeModEditor:function(){
                //unset the sequencer
-               _global['mvSeq'] = null;                
+               _global['mvSeq'] = null;
                $j(this.target_sequence_container + ',.ui-widget-overlay').remove();
        },
        pasteClipBoardClips:function(){
                js_log('f:pasteClipBoardClips');
-               //@@todo query the server for updated clipboard         
-               //paste before the "current clip"       
-               this.addClips( this.clipboard, this.plObj.cur_clip.order );             
+               //@@todo query the server for updated clipboard
+               //paste before the "current clip"
+               this.addClips( this.clipboard, this.plObj.cur_clip.order );
        },
        copySelectedClips:function(){
                var this_seq = this;
                //set all the selected clips
                this.clipboard = new Array();
                $j('.mv_selected_clip').each(function(){
-                       //add each clip to the clip board:                                              
+                       //add each clip to the clip board:
                        var cur_clip = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
-                       this_seq.clipboard.push( cur_clip.getAttributeObj() );                                                                   
+                       this_seq.clipboard.push( cur_clip.getAttributeObj() );
                });
-               //upload clipboard to the server (if possible) 
+               //upload clipboard to the server (if possible)
                if( parseUri(  document.URL ).host != parseUri( this_seq.plObj.interface_url ).host ){
-                       js_log('error: presently we can\'t copy clips across domains'); 
-               }else{                                  
+                       js_log('error: presently we can\'t copy clips across domains');
+               }else{
                        //@@we need a api entry point to store a "clipboard"
-                       if( this_seq.clipboardEditToken && this_seq.plObj.interface_url ){                                                      
+                       if( this_seq.clipboardEditToken && this_seq.plObj.interface_url ){
                                var req_url = this_seq.plObj.interface_url.replace(/api.php/, 'index.php') + '?action=ajax&rs=mv_seqtool_clipboard&rsargs[]=copy';
                                $j.ajax({
                                        type: "POST",
                                        url:req_url,
-                                       data: $j.param( { 
+                                       data: $j.param( {
                                                "clipboard_data": $j.toJSON( this_seq.clipboard ),
-                                               "clipboardEditToken": this_seq.clipboardEditToken 
+                                               "clipboardEditToken": this_seq.clipboardEditToken
                                        }),
-                                       success:function(data){         
+                                       success:function(data){
                                                //callback( data );
                                                js_log('did clipboard push ' + $j.toJSON( this_seq.clipboard ) );
                                        }
                                });
                        }else{
-                               js_log('error: no clipboardEditToken to uplaod clipboard to server');   
+                               js_log('error: no clipboardEditToken to uplaod clipboard to server');
                        }
-               }       
+               }
        },
        cutSelectedClips:function(){
-               this.copySelectedClips();               
+               this.copySelectedClips();
                this.removeSelectedClips();
-       },      
+       },
        removeSelectedClips:function(){
-               var remove_clip_ary=new Array();        
+               var remove_clip_ary=new Array();
                //remove selected clips from display
-               $j('.container_track .mv_selected_clip').each(function(){                                       
-                       //grab the track index from the id (assumes track_#_clip_#                                       
-                       remove_clip_ary.push ( $j(this).parent().attr('id').replace('track_','').replace('clip_','').split('_') );                                                                                                                                                              
-               });             
+               $j('.container_track .mv_selected_clip').each(function(){
+                       //grab the track index from the id (assumes track_#_clip_#
+                       remove_clip_ary.push ( $j(this).parent().attr('id').replace('track_','').replace('clip_','').split('_') );
+               });
                if(remove_clip_ary.length !=0 )
                        this.removeClips(remove_clip_ary);
-                       
-               //doEdit selected clips (updated selected resource)     
-               //@@todo refresh menu of current                
-               this.doEditSelectedClip();              
+
+               //doEdit selected clips (updated selected resource)
+               //@@todo refresh menu of current
+               this.doEditSelectedClip();
        },
        addClip:function( clip, before_clip_pos, track_inx){
                this.addClips([clip],  before_clip_pos, track_inx)
        },
        //add a single or set of clips
-       //to a given position and track_inx 
+       //to a given position and track_inx
        addClips:function( clipSet, before_clip_pos, track_inx){
-               this_seq = this;        
-               
+               this_seq = this;
+
                if(!track_inx)
                        track_inx = this.plObj.default_track.inx;
-                       
-               if(!before_clip_pos)    
+
+               if(!before_clip_pos)
                        before_clip_pos= this.plObj.default_track.getClipCount();
-                       
-               js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx);                     
-               var cur_pos = before_clip_pos;          
-                        
+
+               js_log("seq: add clip: at: "+ before_clip_pos + ' in track: ' + track_inx);
+               var cur_pos = before_clip_pos;
+
                $j.each(clipSet, function(inx, clipInitDom){
                        var mediaElement = document.createElement('ref');
                        for(var i in clipInitDom){
                                js_log("set: " + i + ' to ' + clipInitDom[i]);
                                if(i!='id')
                                        $j(mediaElement).attr(i, clipInitDom[i]);
-                       }                                               
-                       if( this_seq.plObj.tryAddMedia( mediaElement, cur_pos, track_inx ) )    
+                       }
+                       if( this_seq.plObj.tryAddMedia( mediaElement, cur_pos, track_inx ) )
                                cur_pos++;
-               });              
-               //debugger; 
+               });
+               //debugger;
                this.do_refresh_timeline();
        },
-       removeClips:function( remove_clip_ary ){                                        
+       removeClips:function( remove_clip_ary ){
                var this_seq = this;
                var jselect = coma ='';
-               js_log('clip count before removal : ' + this_seq.plObj.default_track.clips.length + ' should remove ' + remove_clip_ary.length );               
+               js_log('clip count before removal : ' + this_seq.plObj.default_track.clips.length + ' should remove ' + remove_clip_ary.length );
                var afected_tracks = new Array();
-               //add order to track_clip before we start removing:             
-               $j.each( remove_clip_ary, function(inx, track_clip){            
+               //add order to track_clip before we start removing:
+               $j.each( remove_clip_ary, function(inx, track_clip){
                        remove_clip_ary[inx]['order'] = this_seq.plObj.tracks[ track_clip[0] ].clips[ track_clip[1] ].order;
-               });             
+               });
                $j.each( remove_clip_ary, function(inx, track_clip){
                        var track_inx = track_clip[0];
-                       var clip_inx = track_clip[1];   
-                       var clip_rm_order = track_clip['order'];                                                                                                         
+                       var clip_inx = track_clip[1];
+                       var clip_rm_order = track_clip['order'];
                        js_log('remove t:' + track_inx + ' c:'+ clip_inx + ' id:' +' #track_'+track_inx+'_clip_'+clip_inx + ' order:' + clip_rm_order);
                        //remove the clips from the base tracks
                        for(var i in this_seq.plObj.tracks[ track_inx ].clips){
@@ -899,38 +899,38 @@ mvSequencer.prototype = {
                                        this_seq.plObj.tracks[ track_clip[0] ].clips.splice( i, 1);
                                }
                        }
-                       //add track to affected track list: 
+                       //add track to affected track list:
                        afected_tracks[ track_inx ]=true;
                        jselect += coma + '#track_' +track_inx + '_clip_' + clip_inx;
                        coma=',';
                });
                //update/ reorder:
                $j.each(afected_tracks, function(track_inx, affected){
-                       this_seq.plObj.tracks[track_inx].reOrderClips();                                
+                       this_seq.plObj.tracks[track_inx].reOrderClips();
                });
-               
+
                js_log('clip count after removal : ' + this_seq.plObj.default_track.clips.length);
-               //animate the removal (@@todo should be able to call the resulting fadeOut only once without a flag) 
+               //animate the removal (@@todo should be able to call the resulting fadeOut only once without a flag)
                var done_with_refresh=false;
-               $j(jselect).fadeOut("slow", function(){                 
-                       if( !done_with_refresh )                                                
+               $j(jselect).fadeOut("slow", function(){
+                       if( !done_with_refresh )
                                this_seq.do_refresh_timeline();
                        done_with_refresh=true;
-               }).empty(); //empty to remove any persistent bindings                                             
+               }).empty(); //empty to remove any persistent bindings
        },
        doEdit:function( editObj ){
                //add the current editObj to the edit stack (should allow for "undo")
                this.edit_stack.push( editObj );
                //make the adjustments
-               this.makeAdjustment( editObj );         
+               this.makeAdjustment( editObj );
        },
        /*
-       * takes adjust ment object with options: 
+       * takes adjust ment object with options:
        * track_inx, clip_inx, start, end delta
        */
-       makeAdjustment:function(e){     
+       makeAdjustment:function(e){
                switch(e.type){
-                       case 'resize_start':                            
+                       case 'resize_start':
                                this.plObj.tracks[e.track_inx].clips[e.clip_inx].doAdjust('start', e.delta);
                        break;
                        case 'resize_end':
@@ -945,10 +945,10 @@ mvSequencer.prototype = {
        undoEdit:function(){
                var editObj = this.edit_stack.pop();
                //invert the delta
-               
+
        },
-       exc_track:function(inx,req){    
-               this_seq = this;                        
+       exc_track:function(inx,req){
+               this_seq = this;
                if(req=='close'){
                        $j('#mv_exc_'+inx).attr('href', 'javascript:'+this.instance_name+'.exc_track('+inx+',\'open\')');
                        $j('#mv_exc_'+inx + ' > img').attr('src',mv_embed_path + 'images/closed.png');
@@ -965,12 +965,12 @@ mvSequencer.prototype = {
                                        this_seq.plObj.tracks[inx].disp_mode='timeline_thumb';
                                        this_seq.render_tracks(inx);
                                });
-                       
+
                }
        },
-       //adds tracks 
+       //adds tracks
        add_track:function(inx, track){
-       
+
        },
        //toggle cut mode (change icon to cut)
        cut_mode:function(){
@@ -980,202 +980,202 @@ mvSequencer.prototype = {
        doAdvancedTl:function(){
                this.timeline_mode='time';
                this.renderTimeLine();
-               this.do_refresh_timeline();                             
+               this.do_refresh_timeline();
                return false;
        },
-       doSimpleTl:function(){          
+       doSimpleTl:function(){
                this.timeline_mode='storyboard';
                this.renderTimeLine();
-               this.do_refresh_timeline();     
+               this.do_refresh_timeline();
                return false;
        },
        //renders updates the timeline based on the current scale
-       render_tracks:function( track_inx ){            
+       render_tracks:function( track_inx ){
                js_log("f::render track: "+track_inx);
                var this_seq = this;
                //inject the tracks into the timeline (if not already there)
-               for(var track_id in this.plObj.tracks){ 
+               for(var track_id in this.plObj.tracks){
                        if( track_inx==track_id || typeof track_inx=='undefined' ){
-                               //empty out the track container: 
+                               //empty out the track container:
                                //$j('#container_track_'+track_id).empty();
-                               var track_html=droppable_html='';               
+                               var track_html=droppable_html='';
                                //set up per track vars:
                                var track = this.plObj.tracks[track_id];
                                var cur_clip_time=0;
-                       
-                               //set up some constants for timeline_mode == storyboard:         
-                               if(this.timeline_mode == 'storyboard'){                 
+
+                               //set up some constants for timeline_mode == storyboard:
+                               if(this.timeline_mode == 'storyboard'){
                                        var frame_width = Math.round( this.track_clipThumb_height * 1.3333333 );
                                        var container_width = frame_width+60;
                                }
-                               
-                               //for each clip: 
+
+                               //for each clip:
                                for(var j in track.clips){
-                                       clip = track.clips[j];                                  
+                                       clip = track.clips[j];
                                        //var img = clip.getClipImg('icon');
-                                       if( this.timeline_mode == 'storyboard' ){                                                                                               
+                                       if( this.timeline_mode == 'storyboard' ){
                                                clip.left_px = j*container_width;
                                                clip.width_px = container_width;
                                                var base_id = 'track_'+track_id+'_clip_'+j;
                                                track_html += '<span id="'+base_id+'" '+
-                                                                               'class="mv_storyboard_container mv_clip_drag" '+  
-                                                                               'style="'+                                                                              
-                                                                               'left:'+clip.left_px+'px;'+                                                                     
-                                                                               'height:' + (this.track_clipThumb_height+30) + 'px;' +                                                                                                                                                          
-                                                                               'width:'+(container_width)+'px;" >';                                                                                                                            
+                                                                               'class="mv_storyboard_container mv_clip_drag" '+
+                                                                               'style="'+
+                                                                               'left:'+clip.left_px+'px;'+
+                                                                               'height:' + (this.track_clipThumb_height+30) + 'px;' +
+                                                                               'width:'+(container_width)+'px;" >';
                                                track_html += clip.embed.renderTimelineThumbnail({
                                                                                'width' : frame_width,
                                                                                'thumb_class' : 'mv_clip_thumb',
                                                                                'height':this.track_clipThumb_height,
                                                                                'time':0
-                                                                       });                     
+                                                                       });
                                                //render out edit button
                                                /*track_html+='<div class="clip_edit_button clip_edit_base clip_control"/>';*/
-                                               
-                                               //check if the clip has transitions                                             
-                                               var imgHtml = '';                                       
+
+                                               //check if the clip has transitions
+                                               var imgHtml = '';
                                                var imsrc = '';
-                                               var cat = clip;                                                 
+                                               var cat = clip;
                                                if(clip.transIn || clip.transOut){
                                                        if( clip.transIn && clip.transIn.getIconSrc )
                                                                imsrc = clip.transIn.getIconSrc();
                                                        //@@todo put transOut somewhere else
                                                        if( clip.transOut && clip.transOut.getIconSrc )
-                                                               imsrc = clip.transOut.getIconSrc();                             
+                                                               imsrc = clip.transOut.getIconSrc();
                                                        if(imsrc != '')
-                                                               imgHtml = '<img style="width:32px;height:32px" src="' + imsrc + '" />';                                                 
-                                               }                                                       
-                                               //render out transition edit box 
-                                               track_html +=   '<div id="tb_' + base_id + '"  class="clip_trans_box">' + 
+                                                               imgHtml = '<img style="width:32px;height:32px" src="' + imsrc + '" />';
+                                               }
+                                               //render out transition edit box
+                                               track_html +=   '<div id="tb_' + base_id + '"  class="clip_trans_box">' +
                                                                                        imgHtml +
                                                                                '</div>'
-                                               
+
                                                //render out adjustment text
                                                /*track_html+='<div id="' + base_id + '_adj' + '" class="mv_adj_text" style="top:'+ (this.track_clipThumb_height+10 )+'px;">'+
                                                                                '<span class="mv_adjust_click" onClick="'+this.instance_name+'.adjClipDur(' + track_id + ',' + j + ',\'-\')" /> - </span>'+
                                                                                  ( (clip.getDuration() > 60 )? seconds2npt(clip.getDuration()): clip.getDuration() )  +
-                                                                               '<span class="mv_adjust_click" onClick="'+this.instance_name+'.adjClipDur(' + track_id + ',' + j + ',\'+\')" /> + </span>'+ 
-                                                                       '</div>';                                                                                                                                                                               
-                                               */                                              
+                                                                               '<span class="mv_adjust_click" onClick="'+this.instance_name+'.adjClipDur(' + track_id + ',' + j + ',\'+\')" /> + </span>'+
+                                                                       '</div>';
+                                               */
                                                track_html+='</span>';
-                                                                                                       
-                                       }                                                                                                               
+
+                                       }
                                        //do timeline_mode rendering:
-                                       if(this.timeline_mode == 'time'){               
-                                               clip.left_px = Math.round( cur_clip_time/this.timeline_scale);                                                                                                                  
+                                       if(this.timeline_mode == 'time'){
+                                               clip.left_px = Math.round( cur_clip_time/this.timeline_scale);
                                                clip.width_px = Math.round( Math.round( clip.getDuration() )/this.timeline_scale);
                                                clip.height_px = 60;
                                                js_log('at time:' + cur_clip_time + ' left: ' +clip.left_px + ' clip dur: ' +  Math.round( clip.getDuration() ) + ' clip width:' + clip.width_px);
-                                                                                                                               
-                                               //for every clip_width pixle output image 
+
+                                               //for every clip_width pixle output image
                                                if(track.disp_mode=='timeline_thumb'){
                                                        track_html+='<span id="track_'+track_id+'_clip_'+j+'" '+
-                                                                                       'class="mv_tl_clip mv_clip_drag" '+ 
+                                                                                       'class="mv_tl_clip mv_clip_drag" '+
                                                                                        'style="'+
                                                                                                'left:' + clip.left_px + 'px;'+
                                                                                                'width:'+ clip.width_px + 'px;'+
-                                                                                               'height:'+ clip.height_px + 'px" >';    
-                                                       track_html+= this.render_clip_frames( clip );                                                                                                                                                           
+                                                                                               'height:'+ clip.height_px + 'px" >';
+                                                       track_html+= this.render_clip_frames( clip );
                                                }else if(track.disp_mode=='text'){
                                                        //'+left_px+
                                                        track_html+='<span id="track_'+track_id+'_clip_'+j+'" style="left:'+clip.left_px+'px;'+
                                                                'width:'+clip.width_px+'px;background:'+clip.getColor()+
-                                                                       '" class="mv_time_clip_text mv_clip_drag">'+clip.title; 
-                                               }                                                                                                                                                                                                                                                                                                                                               
+                                                                       '" class="mv_time_clip_text mv_clip_drag">'+clip.title;
+                                               }
                                                //add in per clip controls
                                                track_html+='<div title="'+gM('clip_in')+' '+clip.embed.start_ntp+'" class="ui-resizable-w ui-resizable-handle" style="width: 16px; height: 16px; left: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_contract.png\');" ></div>'+"\n";
                                                track_html+='<div title="'+gM('clip_out')+' '+clip.embed.end_ntp+'" class="ui-resizable-e ui-resizable-handle" style="width: 16px; height: 16px; right: 0px; top: 2px;background:url(\''+mv_embed_path+'images/application_side_expand.png\');" ></div>'+"\n";
                                                track_html+='<div title="'+gM('rmclip')+'" onClick="'+this.instance_name + '.removeClips(new Array([' + track_id + ',' + j + ']))" style="position:absolute;cursor:pointer;width: 16px; height: 16px; left: 0px; bottom:2px;background:url(\''+mv_embed_path+'images/delete.png\');"></div>'+"\n";
-                                               track_html+='<span style="display:none;" class="mv_clip_stats"></span>';        
-                                                                                                                                                                                                                                       
-                                               track_html+='</span>';  
+                                               track_html+='<span style="display:none;" class="mv_clip_stats"></span>';
+
+                                               track_html+='</span>';
                                                //droppable_html+='<div id="dropBefore_'+i+'_c_'+j+'" class="mv_droppable" style="height:'+this.track_thumb_height+'px;left:'+clip.left_px+'px;width:'+Math.round(clip.width_px/2)+'px"></div>';
                                                //droppable_html+='<div id="dropAfter_'+i+'_c_'+j+'" class="mv_droppable" style="height:'+this.track_thumb_height+'px;left:'+(clip.left_px+Math.round(clip.width_px/2))+'px;width:'+(clip.width_px/2)+'px"></div>';
-                                               cur_clip_time+=Math.round( clip.getDuration() ); //increment cur_clip_time      
-                                       }                               
-                                       
-                               }       
-                               
+                                               cur_clip_time+=Math.round( clip.getDuration() ); //increment cur_clip_time
+                                       }
+
+                               }
+
                                //js_log("new htmL for track i: "+track_id + ' html:'+track_html);
-                               $j('#container_track_'+track_id).html( track_html );                                                            
-                               
+                               $j('#container_track_'+track_id).html( track_html );
+
                                //apply transition click action
                                $j('.clip_trans_box').click(function(){
                                        if($j(this).hasClass('mv_selected_transition')){
                                                $j(this).removeClass('mv_selected_transition');
                                                this_seq.deselectClip( $j(this).siblings('.mv_clip_thumb').get(0) );
                                        }else{
-                                               //deselect others 
+                                               //deselect others
                                                this_seq.deselectClip();
                                                $j('.clip_trans_box').removeClass('mv_selected_transition');
                                                $j(this).addClass("mv_selected_transition");
-                                               $j(this).siblings('.mv_clip_thumb').addClass("mv_selected_clip");       
+                                               $j(this).siblings('.mv_clip_thumb').addClass("mv_selected_clip");
                                                var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
                                                //jump to the current clip
-                                               this_seq.plObj.updateCurrentClip( sClipObj  );          
-                                               //display the transition edit tab:                                              
-                                               this_seq.disp( 'transition' );                                                          
+                                               this_seq.plObj.updateCurrentClip( sClipObj  );
+                                               //display the transition edit tab:
+                                               this_seq.disp( 'transition' );
                                        }
                                });
-                               
+
                                //apply edit button mouse over effect:
                                $j('.clip_edit_button').hover(function(){
                                        $j(this).removeClass("clip_edit_base").addClass("clip_edit_over");
                                },function(){
                                        $j(this).removeClass("clip_edit_over").addClass("clip_edit_base");
-                               }).click(function(){                            
-                                       //deselect everything else: 
+                               }).click(function(){
+                                       //deselect everything else:
                                        $j('.mv_selected_clip').each(function(inx, selected_clip){
                                                this_seq.deselectClip( this );
                                        });
-                                       
+
                                        var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
                                        this_seq.plObj.updateCurrentClip( sClipObj  );
-                                       //get the clip (siblings with mv_clip_thumb class) 
+                                       //get the clip (siblings with mv_clip_thumb class)
                                        var cur_clip_elm =  $j(this).siblings('.mv_clip_thumb');
-                                       //select the clip (add mv_selected_clip if not already selected) 
-                                       if( ! $j( cur_clip_elm ).hasClass("mv_selected_clip") ){                                                                                                                                                                        
-                                               $j( cur_clip_elm ).addClass('mv_selected_clip');                                                
-                                               $j('#' + $j( cur_clip_elm ).parent().attr("id") + '_adj').fadeIn("fast");                                                                                               
+                                       //select the clip (add mv_selected_clip if not already selected)
+                                       if( ! $j( cur_clip_elm ).hasClass("mv_selected_clip") ){
+                                               $j( cur_clip_elm ).addClass('mv_selected_clip');
+                                               $j('#' + $j( cur_clip_elm ).parent().attr("id") + '_adj').fadeIn("fast");
                                        }
                                        //display the edit tab:
                                        this_seq.disp( 'clipedit' );
-                                       //display edit dialog: 
-                                       this_seq.doEditClip( sClipObj );                                
-                               });                                                             
-                               
-                               //apply onClick edit controls: 
-                               $j('.mv_clip_thumb').click(function(){                                                          
+                                       //display edit dialog:
+                                       this_seq.doEditClip( sClipObj );
+                               });
+
+                               //apply onClick edit controls:
+                               $j('.mv_clip_thumb').click(function(){
                                        var cur_clip_click = this;
-                                       //if not in multi select mode remove all existing selections 
+                                       //if not in multi select mode remove all existing selections
                                        //(except for the current click which is handled down below)
                                        js_log(' ks: ' + this_seq.key_shift_down + '  ctrl_down:' +this_seq.key_ctrl_down);
-                                       if( ! this_seq.key_shift_down && ! this_seq.key_ctrl_down){                                                                                     
-                                               $j('.mv_selected_clip').each(function(inx, selected_clip){                                                      
-                                                       if( $j(this).parent().attr('id') != $j(cur_clip_click).parent().attr('id') 
+                                       if( ! this_seq.key_shift_down && ! this_seq.key_ctrl_down){
+                                               $j('.mv_selected_clip').each(function(inx, selected_clip){
+                                                       if( $j(this).parent().attr('id') != $j(cur_clip_click).parent().attr('id')
                                                                || ( $j('.mv_selected_clip').length > 1 ) ){
-                                                                       this_seq.deselectClip( this );                                                                  
+                                                                       this_seq.deselectClip( this );
                                                        }
-                                               });     
-                                       }                                               
-                                                                                                                               
-                                       //jump to clip time 
-                                       var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );                                                                                                
-                                       this_seq.plObj.updateCurrentClip( sClipObj  );                                  
+                                               });
+                                       }
+
+                                       //jump to clip time
+                                       var sClipObj = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
+                                       this_seq.plObj.updateCurrentClip( sClipObj  );
                                        if( $j(this).hasClass("mv_selected_clip") ){
                                                $j(this).removeClass("mv_selected_clip");
                                                $j('#' + $j(this).parent().attr("id") + '_adj').fadeOut("fast");
-                                       }else{                                                                                                                  
-                                               $j(this).addClass('mv_selected_clip');                                          
-                                               $j('#' + $j(this).parent().attr("id") + '_adj').fadeIn("fast");                                                                                         
-                                       }       
-                                       //if shift select is down select the in-between clips 
+                                       }else{
+                                               $j(this).addClass('mv_selected_clip');
+                                               $j('#' + $j(this).parent().attr("id") + '_adj').fadeIn("fast");
+                                       }
+                                       //if shift select is down select the in-between clips
                                        if( this_seq.key_shift_down ){
                                                //get the min max of current selection (within the current track)
                                                var max_order = 0;
                                                var min_order = 999999999;
                                                $j('.mv_selected_clip').each(function(){
-                                                       var cur_clip = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );                                                       
+                                                       var cur_clip = this_seq.getClipFromSeqID( $j(this).parent().attr('id') );
                                                        //get min max
                                                        if(cur_clip.order < min_order)
                                                                min_order = cur_clip.order;
@@ -1183,84 +1183,84 @@ mvSequencer.prototype = {
                                                                max_order = cur_clip.order;
                                                });
                                                //select all non-selected between max or min
-                                               js_log('sOrder: ' + sClipObj.order + ' min:' + min_order + ' max:'+ max_order);                 
-                                               if( sClipObj.order <= min_order ){                                                      
-                                                       for( var i = sClipObj.order; i <= max_order; i++ ){                                                                                     
-                                                               $j('#track_' + track_id + '_clip_' + i + ' > .mv_clip_thumb' ).addClass('mv_selected_clip');    
-                                                       }                                                                                                        
+                                               js_log('sOrder: ' + sClipObj.order + ' min:' + min_order + ' max:'+ max_order);
+                                               if( sClipObj.order <= min_order ){
+                                                       for( var i = sClipObj.order; i <= max_order; i++ ){
+                                                               $j('#track_' + track_id + '_clip_' + i + ' > .mv_clip_thumb' ).addClass('mv_selected_clip');
+                                                       }
                                                }
                                                if( sClipObj.order >= max_order ){
-                                                       for( var i =min_order; i <= max_order; i++ ){                                                                                   
-                                                               $j('#track_' + track_id + '_clip_' + i + ' > .mv_clip_thumb' ).addClass('mv_selected_clip');    
-                                                       }                                       
+                                                       for( var i =min_order; i <= max_order; i++ ){
+                                                               $j('#track_' + track_id + '_clip_' + i + ' > .mv_clip_thumb' ).addClass('mv_selected_clip');
+                                                       }
                                                }
-                                       }                                                                       
-                                       this_seq.doEditSelectedClip();                                                                  
-                               });                                                                                             
-                               //add in control for time based display                                                                                  
-                               //debugger;                     
-                               if(this.timeline_mode == 'time'){                       
+                                       }
+                                       this_seq.doEditSelectedClip();
+                               });
+                               //add in control for time based display
+                               //debugger;
+                               if(this.timeline_mode == 'time'){
                                        $j('.ui-resizable-handle').mousedown( function(){
                                                js_log('hid: ' +  $j(this).attr('class'));
                                                this_seq.resize_mode = ($j(this).attr('class').indexOf('ui-resizable-e')!=-1)?
                                                                                'resize_end':'resize_start';
                                        });
-                               }                       
+                               }
                                var insert_key='na';
                                // drag hooks:
-                               //@@todo support multiple clips                                 
-                               for(var j in track.clips){                      
-                                       $j('#track_'+track_id+'_clip_'+j).draggable({            
-                                               axis:'x', 
+                               //@@todo support multiple clips
+                               for(var j in track.clips){
+                                       $j('#track_'+track_id+'_clip_'+j).draggable({
+                                               axis:'x',
                                                containment:'#container_track_'+track_id,
                                                opacity:50,
                                                handle: ":not(.clip_control)",
                                                scroll:true,
                                                drag:function(e, ui){
                                                        //debugger;
-                                                       insert_key = this_seq.clipDragUpdate(ui, this);                                                 
+                                                       insert_key = this_seq.clipDragUpdate(ui, this);
                                                },
                                                start:function(e,ui){
                                                        js_log('start drag:' + this.id);
                                                        //make sure we are ontop
-                                                       $j(this).css({top:'0px',zindex:10});            
+                                                       $j(this).css({top:'0px',zindex:10});
                                                },
                                                stop:function(e, ui){
                                                        $j(this).css({top:'0px',zindex:0});
-                                                       
-                                                       var id_parts = this.id.split('_');                                              
+
+                                                       var id_parts = this.id.split('_');
                                                        var track_inx = id_parts[1];
                                                        var clip_inx = id_parts[3];
-                                                       var clips = this_seq.plObj.tracks[track_inx].clips;     
-                                                       var cur_drag_clip = clips[clip_inx];    
-                                                                                                               
-                                                       if(insert_key!='na' && insert_key!='end' ){                                             
-                                                               cur_drag_clip.order=insert_key-.5;                                                      
+                                                       var clips = this_seq.plObj.tracks[track_inx].clips;
+                                                       var cur_drag_clip = clips[clip_inx];
+
+                                                       if(insert_key!='na' && insert_key!='end' ){
+                                                               cur_drag_clip.order=insert_key-.5;
                                                        }else if (insert_key=='end'){
                                                                cur_drag_clip.order=clips.length;
-                                                       }                                                       
+                                                       }
                                                        //reorder array based on new order
                                                        clips.sort(sort_func);
-                                                       function sort_func(a, b){                                                               
+                                                       function sort_func(a, b){
                                                                return a.order - b.order;
-                                                       }                                                       
+                                                       }
                                                        //assign keys back to order:
-                                                       this_seq.plObj.tracks[track_inx].reOrderClips();                                                                                                                                                                                                                        
-                                                       //redraw:                                                                                                                                                                         
+                                                       this_seq.plObj.tracks[track_inx].reOrderClips();
+                                                       //redraw:
                                                        this_seq.do_refresh_timeline();
                                                }
                                        });
-                                       //add in resize hook if in time mode: 
-                                       if(this.timeline_mode == 'time'){       
-                                               $j('#track_'+track_id+'_clip_'+j).resizable({           
+                                       //add in resize hook if in time mode:
+                                       if(this.timeline_mode == 'time'){
+                                               $j('#track_'+track_id+'_clip_'+j).resizable({
                                                        minWidth:10,
                                                        maxWidth:6000,
-                                                       start: function(e,ui) {                                                                 
+                                                       start: function(e,ui) {
                                                                //set border to red
                                                                $j(this).css({'border':'solid thin red'});
-                                                               //fade In Time stats (end or start based on handle)                                                      
-                                                               //dragging east (adjusting end time)     
-                                                               js_log( 'append to: '+ this.id);                                                                                                
+                                                               //fade In Time stats (end or start based on handle)
+                                                               //dragging east (adjusting end time)
+                                                               js_log( 'append to: '+ this.id);
                                                                $j('#' + this.id + ' > .mv_clip_stats').fadeIn("fast");
                                                        },
                                                        stop: function(e,ui) {
@@ -1270,41 +1270,41 @@ mvSequencer.prototype = {
                                                                //remove stats
                                                                var clip_drag = this;
                                                                $j('#'+this.id+' > .mv_clip_stats').fadeOut("fast",function(){
-                                                                       var id_parts = clip_drag.id.split('_');         
+                                                                       var id_parts = clip_drag.id.split('_');
                                                                        var track_inx = id_parts[1];
                                                                        var clip_inx = id_parts[3];
-                                                                       //update clip 
+                                                                       //update clip
                                                                        this_seq.doEdit({
                                                                                type:this_seq.resize_mode,
                                                                                delta:this_seq.edit_delta,
                                                                                track_inx:track_inx,
                                                                                clip_inx:clip_inx})
-                                                                       });                                                     
+                                                                       });
                                                        },
-                                                       resize: function(e,ui) {                                                                                                
-                                                               //update time stats & render images: 
+                                                       resize: function(e,ui) {
+                                                               //update time stats & render images:
                                                                this_seq.update_clip_resize(this);
                                                        }
                                                });
                                        }
-                               }                       
+                               }
                                $j('#container_track_'+track_id).width(Math.round(      this.timeline_duration / this.timeline_scale));
                        }
                        //debugger;
                }
        },
        clipDragUpdate:function( ui, clipElm){
-               var this_seq = this; 
-               
+               var this_seq = this;
+
                var insert_key='na';
-               //animate re-arrange by left position: 
+               //animate re-arrange by left position:
                //js_log('left: '+ui.position.left);
-               //locate clip (based on clip duration not animate)       
-               var id_parts = clipElm.id.split('_');                                           
+               //locate clip (based on clip duration not animate)
+               var id_parts = clipElm.id.split('_');
                var track_inx = id_parts[1];
                var clip_inx = id_parts[3];
                var clips = this_seq.plObj.tracks[track_inx].clips;
-               var cur_drag_clip = clips[clip_inx];            
+               var cur_drag_clip = clips[clip_inx];
                var return_org = true;
                $j(clipElm).css('zindex',10);
                //find out where we are inserting and set left border to solid red thick
@@ -1314,7 +1314,7 @@ mvSequencer.prototype = {
                                if(clip_inx!=k){
                                        //also make sure we are not where we started
                                        if(k-1!=clip_inx){
-                                               $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thick red');                                                                       
+                                               $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thick red');
                                                insert_key=k;
                                        }else{
                                                insert_key='na';
@@ -1325,8 +1325,8 @@ mvSequencer.prototype = {
                        }else{
                                $j('#track_'+track_inx+'_clip_'+k).css('border-left', 'solid thin white');
                        }
-               }       
-               //if greater than the last k insert after       
+               }
+               //if greater than the last k insert after
                if(ui.position.left > (clips[k].left_px + clips[k].width_px) &&
                        k!=clip_inx ){
                                $j('#track_'+track_inx+'_clip_'+k).css('border-right', 'solid thick red');
@@ -1338,7 +1338,7 @@ mvSequencer.prototype = {
        },
        deselectClip:function( clipElm ){
                if(!clipElm){
-                       $j('.mv_selected_clip').removeClass("mv_selected_clip");        
+                       $j('.mv_selected_clip').removeClass("mv_selected_clip");
                }else{
                        $j(clipElm).removeClass("mv_selected_clip");
                        //make sure the transition sibling is removed:
@@ -1348,19 +1348,19 @@ mvSequencer.prototype = {
        },
        getClipFromSeqID:function( clip_seq_id ){
                js_log('get id from: ' + clip_seq_id);
-               var ct = clip_seq_id.replace('track_','').replace('clip_','').split('_');               
+               var ct = clip_seq_id.replace('track_','').replace('clip_','').split('_');
                return this.plObj.tracks[ ct[0] ].clips[ ct[1] ];
        },
        //renders clip frames
        render_clip_frames:function(clip, frame_offset_count){
-               js_log('f:render_clip_frames: ' + clip.id + ' foc:' + frame_offset_count); 
-               var clip_frames_html='';                                        
+               js_log('f:render_clip_frames: ' + clip.id + ' foc:' + frame_offset_count);
+               var clip_frames_html='';
                var frame_width = Math.round(this.track_thumb_height*1.3333333);
 
-               var pint = (frame_offset_count==null)?0:frame_offset_count*frame_width;         
-               
+               var pint = (frame_offset_count==null)?0:frame_offset_count*frame_width;
+
                //js_log("pinit: "+ pint+ ' < '+clip.width_px+' ++'+frame_width);
-               for(var p=pint;p<clip.width_px;p+=frame_width){                                                         
+               for(var p=pint;p<clip.width_px;p+=frame_width){
                        var clip_time = (p==0)?0:Math.round(p*this.timeline_scale);
                        js_log('rendering clip frames: p:' +p+' pts:'+ (p*this.timeline_scale)+' time:' + clip_time + ' height:'+this.track_thumb_height);
                        clip_frames_html+=clip.embed.renderTimelineThumbnail({
@@ -1370,71 +1370,71 @@ mvSequencer.prototype = {
                                'size' : "icon", //set size to "icon" preset
                                'time':   clip_time
                        });
-               }       
+               }
                js_log('render_clip_frames:'+clip_frames_html);
                return clip_frames_html;
        },
        update_clip_resize:function(clip_element){
                //js_log('update_clip_resize');
                var this_seq = this;
-               var id_parts = clip_element.id.split('_');              
+               var id_parts = clip_element.id.split('_');
                track_inx = id_parts[1];
                clip_inx = id_parts[3];
                //set clip:
-               var clip = this.plObj.tracks[ track_inx ].clips[ clip_inx ];            
+               var clip = this.plObj.tracks[ track_inx ].clips[ clip_inx ];
                var clip_desc ='';
                //would be nice if getting the width did not flicker the border
                //@@todo do a work around e in resize function has some screen based offset values
                clip.width_px = $j(clip_element).width();
-               var width_dif = clip.width_px - Math.round( Math.round( clip.getDuration() )/this.timeline_scale);              
+               var width_dif = clip.width_px - Math.round( Math.round( clip.getDuration() )/this.timeline_scale);
                //var left_px = $j(clip_element).css('left');
-               
+
                var new_clip_dur = Math.round( clip.width_px*this.timeline_scale );
                var clip_dif = (new_clip_dur - clip.getDuration() );
                var clip_dif_str = (clip_dif >0)?'+'+clip_dif:clip_dif;
                //set the edit global delta
                this.edit_delta = clip_dif;
-               
-               //get new length: 
-               clip_desc+='length: ' + seconds2npt(new_clip_dur) +'('+clip_dif_str+')';        
-               if(this_seq.resize_mode=='resize_end'){ 
-                       //expanding right               
+
+               //get new length:
+               clip_desc+='length: ' + seconds2npt(new_clip_dur) +'('+clip_dif_str+')';
+               if(this_seq.resize_mode=='resize_end'){
+                       //expanding right
                        var new_end = seconds2npt(npt2seconds(clip.embed.end_ntp)+clip_dif);
-                       clip_desc+='<br>end time: ' + new_end;          
-                       //also shift all the other clips (after the current) 
+                       clip_desc+='<br>end time: ' + new_end;
+                       //also shift all the other clips (after the current)
                        //js_log("track_inx: " + track_inx + ' clip inx:'+clip_inx);
                        //$j('#container_track_'+track_inx+' > .mv_clip_drag :gt('+clip_inx+')').each(function(){
                        $j('#container_track_'+track_inx+' > :gt('+clip_inx+')').each(function(){
-                               var move_id_parts = this.id.split('_'); 
-                               var move_clip = this_seq.plObj.tracks[move_id_parts[1]].clips[move_id_parts[3]];                
+                               var move_id_parts = this.id.split('_');
+                               var move_clip = this_seq.plObj.tracks[move_id_parts[1]].clips[move_id_parts[3]];
                                //js_log('should move:'+ this.id);
                                $j(this).css('left', move_clip.left_px + width_dif);
                        });
                }else{
                        //expanding left (resize_start)
                        var new_start = seconds2npt(npt2seconds(clip.embed.start_ntp)+clip_dif);
-                       clip_desc+='<br>start time: ' + new_start;                                      
+                       clip_desc+='<br>start time: ' + new_start;
                }
-                       
+
                //update clip stats:
                $j('#'+clip_element.id+' > .mv_clip_stats').html(clip_desc);
                var frame_width = Math.round(this.track_thumb_height*1.3333333);
                //check if we need to append some images:
                var frame_count = $j('#'+clip_element.id+' > img').length;
                if(clip.width_px > (frame_count *  frame_width) ){
-                       //if dragging left append 
+                       //if dragging left append
                        js_log('width_px:'+clip.width_px+' framecount:'+frame_count+' Xcw='+(frame_count *  frame_width));
-                       $j('#'+clip_element.id).append(this.render_clip_frames(clip, frame_count));                                             
-               }               
+                       $j('#'+clip_element.id).append(this.render_clip_frames(clip, frame_count));
+               }
        },
        //renders cnt_time
-       render_playheadhead_seeker:function(){          
-               js_log('render_playheadhead_seeker'); 
-               //render out time stamps and time "jump" links 
+       render_playheadhead_seeker:function(){
+               js_log('render_playheadhead_seeker');
+               //render out time stamps and time "jump" links
                //first get total width
-               
-               //remove the old one if its still there         
-               $j('#'+this.timeline_id +'_pl_control').remove();               
+
+               //remove the old one if its still there
+               $j('#'+this.timeline_id +'_pl_control').remove();
                //render out a playlist clip wide and all the way to the right (only playhead and play button) (outside of timeline)
                $j(this.target_sequence_container).append('<div id="'+ this.timeline_id +'_pl_control"'+
                        ' style="position:absolute;top:' + (this.plObj.height) +'px;'+
@@ -1442,30 +1442,30 @@ mvSequencer.prototype = {
                        'class="videoPlayer"><div class="ui-widget ui-corner-bottom ui-state-default controls">'+
                                         this.plObj.getControlsHTML() +
                                 '</div>'+
-                       '</div>');              
+                       '</div>');
                //update time and render out clip dividers .. should be used to show load progress
                this.plObj.updateBaseStatus();
-               
-               //once the controls are in the DOM add hooks: 
+
+               //once the controls are in the DOM add hooks:
                ctrlBuilder.addControlHooks(this.plObj);
-               
-               //render out the "jump" div     
-               if(this.timeline_mode=='time'){                                         
+
+               //render out the "jump" div
+               if(this.timeline_mode=='time'){
                        /*$j('#'+this.timeline_id+'_head_jump').width(pixle_length);
-                       //output times every 50pixles 
+                       //output times every 50pixles
                        var out='';
                        //output time-desc every 50pixles and jump links every 10 pixles
                        var n=0;
                        for(i=0;i<pixle_length;i+=10){
                                out+='<div onclick="'+this.instance_name+'.jt('+i*this.timeline_scale+');"' +
-                                               ' style="z-index:2;position:absolute;left:'+i+'px;width:10px;height:20px;top:0px;"></div>';                     
-                               if(n==0)                                
-                                       out+='<span style="position:absolute;left:'+i+'px;">|'+seconds2npt(Math.round(i*this.timeline_scale))+'</span>';                                                
+                                               ' style="z-index:2;position:absolute;left:'+i+'px;width:10px;height:20px;top:0px;"></div>';
+                               if(n==0)
+                                       out+='<span style="position:absolute;left:'+i+'px;">|'+seconds2npt(Math.round(i*this.timeline_scale))+'</span>';
                                n++;
                                if(n==10)n=0;
-                       }*/     
-                       
-               }               
+                       }*/
+
+               }
        },
        jt:function( jh_time ){
                js_log('jt:' + jh_time);
@@ -1473,47 +1473,47 @@ mvSequencer.prototype = {
                this.playline_time = jh_time;
                js_log('time: ' + seconds2npt(jh_time) + ' ' + Math.round(jh_time/this.timeline_scale));
                //render playline at given time
-               $j('#'+this.timeline_id+'_playline').css('left', Math.round(jh_time/this.timeline_scale)+'px' );                 
+               $j('#'+this.timeline_id+'_playline').css('left', Math.round(jh_time/this.timeline_scale)+'px' );
                cur_pl_time=0;
-               //update the thumb with the requested time:              
-               this.plObj.updateThumbTime( jh_time );          
+               //update the thumb with the requested time:
+               this.plObj.updateThumbTime( jh_time );
        },
        //adjusts the current scale
        zoom_in:function(){
                this.timeline_scale = this.timeline_scale*.75;
                this.do_refresh_timeline();
                js_log('zoomed in:'+this.timeline_scale);
-       },      
-       zoom_out:function(){            
+       },
+       zoom_out:function(){
                this.timeline_scale = this.timeline_scale*(1+(1/3));
                this.do_refresh_timeline();
                js_log('zoom out: '+this.timeline_scale);
        },
-       do_refresh_timeline:function( preserve_selection ){             
+       do_refresh_timeline:function( preserve_selection ){
                js_log('Sequencer:do_refresh_timeline()');
                //@@todo should "lock" interface while refreshing timeline
                var pSelClips = [];
                if(preserve_selection){
-                       $j('.mv_selected_clip').each(function(){                                
+                       $j('.mv_selected_clip').each(function(){
                                pSelClips.push( $j(this).parent().attr('id') );
                        });
                }
-               //regen duration 
+               //regen duration
                this.plObj.getDuration( true );
-               //refresh player:                
+               //refresh player:
                this.plObj.getHTML();
-               
+
                this.render_playheadhead_seeker();
                this.render_tracks();
                this.jt(this.playline_time);
-                               
+
                if(preserve_selection){
                        for(var i=0;i < pSelClips.length; i++){
-                               $j('#' + pSelClips[i] + ' .mv_clip_thumb').addClass('mv_selected_clip');                                
+                               $j('#' + pSelClips[i] + ' .mv_clip_thumb').addClass('mv_selected_clip');
                        }
                }
        }
-               
+
 }
 /* extension to mvPlayList to support sequencer features properties */
 var mvSeqPlayList = function( element ){
@@ -1522,52 +1522,52 @@ var mvSeqPlayList = function( element ){
 mvSeqPlayList.prototype = {
        init:function(element){
                var myPlObj = new mvPlayList(element);
-               
-               //inherit mvClip                
-               for(var method in myPlObj){                     
-                       if(typeof this[method] != 'undefined' ){                                
-                               this[ 'parent_' + method ]=myPlObj[method];                             
-                       }else{          
+
+               //inherit mvClip
+               for(var method in myPlObj){
+                       if(typeof this[method] != 'undefined' ){
+                               this[ 'parent_' + method ]=myPlObj[method];
+                       }else{
                                this[method] = myPlObj[method];
-                       }               
-               }               
-               
-               this.org_control_height = this.pl_layout.control_height;                
-               //do specific mods:(controls and title are managed by the sequencer)  
+                       }
+               }
+
+               this.org_control_height = this.pl_layout.control_height;
+               //do specific mods:(controls and title are managed by the sequencer)
                this.pl_layout.title_bar_height=0;
-               this.pl_layout.control_height=0;                                
-       },      
+               this.pl_layout.control_height=0;
+       },
        setSliderValue:function( perc ){
                js_log('setSliderValue::'+ perc);
-               //get the track_clipThumb_height from parent mvSequencer        
+               //get the track_clipThumb_height from parent mvSequencer
                var frame_width = Math.round( this.pSeq.track_clipThumb_height * 1.3333333 );
                var container_width = frame_width+60;
-               
+
                var perc_clip = this.cur_clip.embed.currentTime / this.cur_clip.getDuration();
-               
-               var left_px = parseInt( (this.cur_clip.order * container_width) + (frame_width*perc_clip) ) + 'px';     
+
+               var left_px = parseInt( (this.cur_clip.order * container_width) + (frame_width*perc_clip) ) + 'px';
                js_log("set " + perc + ' of cur_clip: ' + this.cur_clip.order + ' lp:'+left_px);
-                                       
-                               
-               //update the timeline playhead and                       
+
+
+               //update the timeline playhead and
                $j('#' + this.seqObj.timeline_id + '_playline').css('left', left_px);
-                       
+
                //pass update request to parent:
                this.parent_setSliderValue( perc );
        },
-       getControlsHTML:function(){                             
-               //get controls from current clip add some playlist specific controls:             
-               this.cur_clip.embed.supports['prev_next'] = true;       
+       getControlsHTML:function(){
+               //get controls from current clip add some playlist specific controls:
+               this.cur_clip.embed.supports['prev_next'] = true;
                this.cur_clip.embed.supports['options']   = false;
                return ctrlBuilder.getControls( this.cur_clip.embed );
-       },      
+       },
        //override renderDisplay
        renderDisplay:function(){
                js_log('mvSequence:renderDisplay');
-               //setup layout for title and dc_ clip container  
+               //setup layout for title and dc_ clip container
                $j(this).html('<div id="dc_'+this.id+'" style="width:'+this.width+'px;' +
-                               'height:'+(this.height)+'px;position:relative;" />');                   
-                               
+                               'height:'+(this.height)+'px;position:relative;" />');
+
                this.setupClipDisplay();
        }
 };
index 8659e99..fa2956e 100644 (file)
@@ -1,18 +1,18 @@
 /*
 * mvTimedEffectsEdit
-* 
+*
 * for now just simple single stack transition control
-*  
+*
 */
 
 //add our local msgs
-loadGM({ 
-       "transition_in"         : "Transition In",
-       "transition_out"        : "Transition Out",
-       "effects"                       : "Effects Stack",
-       "remove_transition"     : "Remove Transition",
-       "edit_transin"          : "Edit Transition Into Clip",
-       "edit_transout"         : "Edit Transition Out of Clip"
+loadGM({
+       "transition_in": "Transition in",
+       "transition_out": "Transition out",
+       "effects": "Effects stack",
+       "remove_transition": "Remove transition",
+       "edit_transin": "Edit transition into clip",
+       "edit_transout": "Edit transition out of clip"
 });
 
 
@@ -20,14 +20,14 @@ var default_timed_effect_values = {
        'rObj': null,            // the resource object
        'clip_disp_ct':null, //target clip disp
        'control_ct':null,       //control container
-               
+
        'parent_ct': null,       //parent container
        'pSeq': null,    //parent sequence Object
-       
-       'edit_action': null, //the requested edit action                                                
+
+       'edit_action': null, //the requested edit action
 };
 
-var mvTimedEffectsEdit =function(iObj) {               
+var mvTimedEffectsEdit =function(iObj) {
        return this.init(iObj);
 };
 //set up the mvSequencer object
@@ -39,114 +39,114 @@ mvTimedEffectsEdit.prototype = {
                        'clip_attr':'transIn',
                        'doEdit':function(_this){
                                _this.doTransitionDisplayEdit('transin');
-                       }                                               
+                       }
                },
                'transout':{
                        'title':gM('transition_out'),
                        'clip_attr':'transOut',
                        'doEdit':function(_this){
-                               _this.doTransitionDisplayEdit('transout');      
-                       }                               
+                               _this.doTransitionDisplayEdit('transout');
+                       }
                },
                'effects':{
                        'title':gM('effects'),
                        'clip_attr':'Effects',
                        'doEdit':function(_this){
-                               //display       
+                               //display
                                _this.doEditEffectDisplayEdit();
-                       }       
+                       }
                }
        },
        init:function(iObj){
-               //init object:          
-               for(var i in default_timed_effect_values){                      
-                       if( iObj[i] ){   
+               //init object:
+               for(var i in default_timed_effect_values){
+                       if( iObj[i] ){
                                this[i] = iObj[i];
                        }
-               }                                               
+               }
                this.doEditMenu();
-       },      
+       },
        doEditMenu:function(){
                js_log('mvTimedEffects : doEditMenu::');
                var _this = this;
                //add in subMenus if set
                //check for submenu and add to item container
-               
+
                //update the default edit display (if we have a target)
                var tTarget = 'transin';
                if(this.rObj.transOut)
                        tTarget = 'transout';
                if(this.rObj.effects)
-                       tTarget = 'effects';            
-                       
-               var o='';               
-               var tabc ='';                                   
+                       tTarget = 'effects';
+
+               var o='';
+               var tabc ='';
                o+= '<div id="mv_submenu_timedeffect">';
-               o+='<ul>';                
-               var inx =0;             
+               o+='<ul>';
+               var inx =0;
                var selected_tab=0;
-               $j.each(this.menu_items, function(sInx, mItem){                         
+               $j.each(this.menu_items, function(sInx, mItem){
                        if( sInx == tTarget){
                                selected_tab = inx;
-                       }       
-                       //check if the given editType is valid for our given media type         
-                       o+=     '<li>'+ 
+                       }
+                       //check if the given editType is valid for our given media type
+                       o+=     '<li>'+
                                        '<a id="mv_te_'+sInx+'" href="#te_' + sInx + '">' + mItem.title + '</a>'+
-                               '</li>';                                                                                                                        
+                               '</li>';
                        tabc += '<div id="te_' + sInx + '" style="overflow:auto;" ></div>';
-                       inx++;                                                                                                                                                                                                  
+                       inx++;
                });
                o+= '</ul>' + tabc;
                o+= '</div>';
-               //add sub menu container with menu html:                        
-               $j('#'+this.control_ct).html( o ) ;             
-               js_log('should have set: #'+this.control_ct + ' to: ' + o);                                                             
-               //set up bindins:        
+               //add sub menu container with menu html:
+               $j('#'+this.control_ct).html( o ) ;
+               js_log('should have set: #'+this.control_ct + ' to: ' + o);
+               //set up bindins:
                $j('#mv_submenu_timedeffect').tabs({
                        selected: selected_tab,
-                       select: function(event, ui) {                                                                   
+                       select: function(event, ui) {
                                _this.doDisplayEdit( $j(ui.tab).attr('id').replace('mv_te_', '') );
-                       }                               
-               }).addClass('ui-tabs-vertical ui-helper-clearfix');                     
-               //close left: 
+                       }
+               }).addClass('ui-tabs-vertical ui-helper-clearfix');
+               //close left:
                $j("#mv_submenu_clipedit li").removeClass('ui-corner-top').addClass('ui-corner-left');
-               _this.doDisplayEdit(tTarget);                                                                                           
+               _this.doDisplayEdit(tTarget);
        },
        doDisplayEdit:function( tab_id ){
-               //@@todo fix the double display of doDisplayEdit                
+               //@@todo fix the double display of doDisplayEdit
                js_log("doDisplayEdit::");
                if( !this.menu_items[ tab_id ] ){
-                       js_log('error: doDisplayEdit missing item:' + tab_id);          
+                       js_log('error: doDisplayEdit missing item:' + tab_id);
                }else{
                        //use the menu_item config to map to function display
                        this.menu_items[tab_id].doEdit(this);
-               }                                       
+               }
        },
        doEditEffectDisplayEdit:function(){
                var _this = this;
                var appendTarget = '#te_effects';
                js_log('type:' + _this.rObj['type']);
                $j(appendTarget).html(gM('loading_txt'));
-               //@@todo integrate into core and loading system:  
+               //@@todo integrate into core and loading system:
                loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/editor.js?' + getMvUniqueReqId() );
                loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/pixastic.all.js?' + getMvUniqueReqId() );
                loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/ui.js?' + getMvUniqueReqId() );
                loadExternalJs(mv_embed_path + 'libClipEdit/pixastic-editor/uidata.js?' + getMvUniqueReqId() );
-               loadExternalCss(mv_embed_path + 'libClipEdit/pixastic-editor/pixastic.all.js?' + getMvUniqueReqId() );          
-                
+               loadExternalCss(mv_embed_path + 'libClipEdit/pixastic-editor/pixastic.all.js?' + getMvUniqueReqId() );
+
                var isPixasticReady = function(){
                        if(typeof PixasticEditor != 'undefined'){
                                $j(appendTarget).html('<a href="#" class="run_effect_demo">Run Pixastic Editor Demo</a> (not yet fully integrated/ super alpha)<br> best to view <a href="http://www.pixastic.com/editor-test/">stand alone</a>');
                                $j(appendTarget + ' .run_effect_demo').click(function(){
                                        var cat = _this;
-                                       var imgElm = $j( '.clip_container:visible  img').get(0);                                        
-                                       PixasticEditor.load(imgElm);                            
+                                       var imgElm = $j( '.clip_container:visible  img').get(0);
+                                       PixasticEditor.load(imgElm);
                                });
                        }else{
-                               setTimeout(isPixasticReady, 100)                
+                               setTimeout(isPixasticReady, 100)
                        }
                }
-               isPixasticReady();                      
+               isPixasticReady();
        },
        doTransitionDisplayEdit:function(target_item){
                var _this = this;
@@ -162,40 +162,40 @@ mvTimedEffectsEdit.prototype = {
                var o='<h3>' + gM('edit_'+target_item ) + '</h3>';
                o+='Type: ' +
                        '<select class="te_select_type">';
-               for(var typeKey in mvTransLib.type){                    
+               for(var typeKey in mvTransLib.type){
                        var selAttr = (cTran.type == typeKey)?' selected':'';
                        o+='<option     value="'+typeKey+'"'+ selAttr +'>'+typeKey+'</option>';
                }
-               o+='</select><br>';             
-               o+='<span class="te_subtype_container"></span>';                                                                                
-               
+               o+='</select><br>';
+               o+='<span class="te_subtype_container"></span>';
+
                //add html and select bindings
                $j(apendTarget).html(o).children('.te_select_type')
                        .change(function(){
                                var selectedType = $j(this).val();
-                               //update subtype listing:                                                                               
+                               //update subtype listing:
                                _this.getSubTypeControl(target_item, selectedType, apendTarget + ' .te_subtype_container' );
                        });
                //add subtype control
                _this.getSubTypeControl( target_item, cTran.type, apendTarget + ' .te_subtype_container' );
-               
+
                //add remove transition button:
                $j(apendTarget).append( '<br><br>' + $j.btnHtml(gM('remove_transition'), 'te_remove_transition', 'close'  ) )
                        .children('.te_remove_transition')
-                       .click(function(){                                                              
+                       .click(function(){
                                //remove the transtion from the playlist
                                _this.pSeq.plObj.transitions[cTran.id] = null;
                                //remove the transtion from the clip:
-                               _this.rObj[ _this.menu_items[ target_item ].clip_attr ] = null;                         
-                               //update the interface: 
+                               _this.rObj[ _this.menu_items[ target_item ].clip_attr ] = null;
+                               //update the interface:
                                _this.doTransitionDisplayEdit( target_item );
                                //update the sequence
                                _this.pSeq.do_refresh_timeline();
-                       });             
-       },      
+                       });
+       },
        getSubTypeControl:function(target_item, transition_type, htmlTarget){
-               var _this = this;                                               
-               var cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ];      
+               var _this = this;
+               var cTran = this.rObj[ this.menu_items[ target_item ].clip_attr ];
                var o='Sub Type:<select class="te_subtype_select">';
                for(var subTypeKey in mvTransLib.type[ transition_type ]){
                        var selAttr = (cTran.subtype == subTypeKey) ? ' selected' : '';
@@ -206,62 +206,62 @@ mvTimedEffectsEdit.prototype = {
                        .children('.te_subtype_select')
                        .change(function(){
                                //update the property
-                               cTran.subtype = $j(this).val(); 
+                               cTran.subtype = $j(this).val();
                                //re-gen timeline / playlist
                                _this.pSeq.do_refresh_timeline();
-                               //(re-select self?) 
+                               //(re-select self?)
                                _this.getSubTypeControl(target_item, transition_type, htmlTarget);
-               });     
+               });
                var o='';
-               //check for extra properties control: 
+               //check for extra properties control:
                for(var i=0; i < mvTransLib.type[ transition_type ][ cTran.subtype ].attr.length; i++){
                        var tAttr =mvTransLib.type[ transition_type ][ cTran.subtype ].attr[i]
                        switch(tAttr){
                                case 'fadeColor':
                                        var cColor = (cTran['fadeColor'])?cTran['fadeColor']:'';
-                                       $j(htmlTarget).append('Select Color: <div class="colorSelector"><div class="colorIndicator" style="background-color: '+cColor+'"></div></div>');                        
+                                       $j(htmlTarget).append('Select Color: <div class="colorSelector"><div class="colorIndicator" style="background-color: '+cColor+'"></div></div>');
                                        js_log('cs target: '+htmlTarget +' .colorSelector' );
-                               
-                               
-                                       $j(htmlTarget + ' .colorSelector').ColorPicker({                                                
+
+
+                                       $j(htmlTarget + ' .colorSelector').ColorPicker({
                                                color: cColor,
                                                onShow: function (colpkr) {
                                                        //make sure its ontop:
-                                                       $j(colpkr).css("zIndex", "12");                                                         
+                                                       $j(colpkr).css("zIndex", "12");
                                                        $j(colpkr).fadeIn(500);
                                                        return false;
                                                },
                                                onHide: function (colpkr) {
-                                                       $j(colpkr).fadeOut(500);                                                                                                
+                                                       $j(colpkr).fadeOut(500);
                                                        _this.pSeq.plObj.setCurrentTime(0, function(){
                                                                js_log("render ready");
-                                                       });     
+                                                       });
                                                        return false;
                                                },
                                                onChange: function (hsb, hex, rgb) {
                                                        $j(htmlTarget + ' .colorIndicator').css('backgroundColor', '#' + hex);
-                                                       //update the transition 
-                                                       cTran['fadeColor'] =  '#' + hex;                                                                                                                                                                                                                        
+                                                       //update the transition
+                                                       cTran['fadeColor'] =  '#' + hex;
                                                }
                                        })
                                break;
                        }
                }
                //and finally add effect timeline scrubber (for timed effects this also stores keyframes)
-                               
+
        },
        getTransitionListControl : function(target_out){
                js_log("getTransitionListControl");
                var o= '<h3>Add a Transition:</h3>';
                for(var type in mvTransLib['type']){
-                       js_log('on tran type: ' + i);                   
+                       js_log('on tran type: ' + i);
                        var base_trans_name = i;
                        var tLibSet = mvTransLib['type'][ type ];
-                       for(var subtype in tLibSet){                    
+                       for(var subtype in tLibSet){
                                o+='<img style="float:left;padding:10px;" '+
-                                       'src="' + mvTransLib.getTransitionIcon(type, subtype)+ '">';            
+                                       'src="' + mvTransLib.getTransitionIcon(type, subtype)+ '">';
                        }
-               }       
+               }
                $j(target_out).html(o);
-       }               
+       }
 };
index 6d67536..a74cbf4 100644 (file)
@@ -1,13 +1,13 @@
 
 loadGM({
-    
-    "select_transcript_set" : "Select Layers",
+
+       "select_transcript_set" : "Select layers",
        "auto_scroll" : "auto scroll",
        "close" : "close",
        "improve_transcript" : "Improve"
-       
+
 })
-// text interface object (for inline display captions) 
+// text interface object (for inline display captions)
 var mvTextInterface = function( parentEmbed ){
        return this.init( parentEmbed );
 }
@@ -18,87 +18,87 @@ mvTextInterface.prototype = {
        transcript_set:null,
        autoscroll:true,
        add_to_end_on_this_pass:false,
-       scrollTimerId:0,        
+       scrollTimerId:0,
        init:function( parentEmbed ){
                   //init a new availableTracks obj:
-               this.availableTracks={};        
+               this.availableTracks={};
                //set the parent embed object:
                this.pe=parentEmbed;
                //parse roe if not already done:
-               this.getTimedTextTracks();              
+               this.getTimedTextTracks();
        },
        //@@todo separate out data loader & data display
        getTimedTextTracks:function(){
                js_log("load timed text from roe: "+ this.pe.roe);
                var _this = this;
-               //if roe not yet loaded do load it: 
+               //if roe not yet loaded do load it:
                if(this.pe.roe){
                        if(!this.pe.media_element.addedROEData){
                                js_log("load roe data!");
                                $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon
                                do_request( _this.pe.roe, function(data)
-                               {                                                
-                                       //continue                       
-                                       _this.pe.media_element.addROE(data);                                                                                                                                                                            
-                                       _this.getParseTimedText_rowReady();                                        
+                               {
+                                       //continue
+                                       _this.pe.media_element.addROE(data);
+                                       _this.getParseTimedText_rowReady();
                                });
                        }else{
                                js_log('row data ready (no roe request)');
                                _this.getParseTimedText_rowReady();
-                       }                                               
-               }else{                  
+                       }
+               }else{
                        if( this.pe.media_element.timedTextSources() ){
                                _this.getParseTimedText_rowReady();
                        }else{
                                js_log('no roe data or timed text sources');
                        }
-               }               
+               }
        },
        getParseTimedText_rowReady: function (){
-               var _this = this;               
-               //create timedTextObj           
+               var _this = this;
+               //create timedTextObj
                var default_found=false;
                js_log("mv_txt_load_:SHOW mv_txt_load_");
                $j('#mv_txt_load_'+_this.pe.id).show(); //show the loading icon
-               
+
                $j.each( this.pe.media_element.sources, function(inx, source){
-                       
+
                        if( typeof source.id == 'undefined' || source.id == null ){
-                               source.id = 'tt_' + inx;                        
+                               source.id = 'tt_' + inx;
                        }
-                       var tObj = new timedTextObj( source );                  
-                       //make sure its a valid timed text format (we have not loaded or parsed yet) : ( 
+                       var tObj = new timedTextObj( source );
+                       //make sure its a valid timed text format (we have not loaded or parsed yet) : (
                        if( tObj.lib != null ){
-                               js_log('adding Track: ' + source.id + ' to ' + _this.pe.id); 
-                               _this.availableTracks[ source.id ] = tObj;                      
-                               //js_log( 'is : ' + source.id + ' default: ' + source.default );                                                                                                        
-                               //display if requested:                 
+                               js_log('adding Track: ' + source.id + ' to ' + _this.pe.id);
+                               _this.availableTracks[ source.id ] = tObj;
+                               //js_log( 'is : ' + source.id + ' default: ' + source.default );
+                               //display if requested:
                                if( source['default'] == "true" ){
                                        //we did set at least one track by default tag
-                                       default_found=true;                                                                                     
+                                       default_found=true;
                                        js_log('do load timed text: ' + source.id );
-                                       _this.loadAndDisplay( source.id );      
+                                       _this.loadAndDisplay( source.id );
                                }else{
-                                       //don't load the track and don't display                                                                                                                
+                                       //don't load the track and don't display
                                }
                        }
                });
-               
+
                //no default clip found take the first_id
                if(!default_found){
-                       $j.each( _this.availableTracks, function(inx, sourceTrack){                             
-                               _this.loadAndDisplay( sourceTrack.id );                         
+                       $j.each( _this.availableTracks, function(inx, sourceTrack){
+                               _this.loadAndDisplay( sourceTrack.id );
                                default_found=true;
                                //retun after loading first available
                                return false;
                        });
                }
-               
+
                //if nothing found anywhere update the loading icon to say no tracks found
                if(!default_found)
                        $j('#mv_txt_load_'+_this.pe.id).html( gM('no_text_tracks_found') );
-               
-               
+
+
        },
        loadAndDisplay: function ( track_id){
                var _this = this;
@@ -106,7 +106,7 @@ mvTextInterface.prototype = {
                _this.availableTracks[ track_id ].load(_this.default_time_range, function(){
                        $j('#mv_txt_load_'+_this.pe.id).hide();
                        _this.addTrack( track_id );
-               });     
+               });
        },
        addTrack: function( track_id ){
                js_log('f:displayTrack:'+ track_id);
@@ -116,38 +116,38 @@ mvTextInterface.prototype = {
                //setup the layout:
                this.setup_layout();
                js_log("SHOULD ADD: "+ track_id + ' count:' +  _this.availableTracks[ track_id ].textNodes.length);
-               
-               //a flag to avoid checking all clips if we know we are adding to the end: 
+
+               //a flag to avoid checking all clips if we know we are adding to the end:
                _this.add_to_end_on_this_pass = false;
-               
+
                //run clip adding on a timed interval to not lock the browser on large srt file merges (should use worker threads)
                var i =0;
                var track_id = track_id;
-               var addNextClip = function(){                                           
-                       var text_clip = _this.availableTracks[ track_id ].textNodes[i];         
+               var addNextClip = function(){
+                       var text_clip = _this.availableTracks[ track_id ].textNodes[i];
                        _this.add_merge_text_clip(text_clip);
-                       i++;    
-                       if(i < _this.availableTracks[ track_id ].textNodes.length){                                             
-                               setTimeout(addNextClip, 1);                             
+                       i++;
+                       if(i < _this.availableTracks[ track_id ].textNodes.length){
+                               setTimeout(addNextClip, 1);
                        }
                }
                addNextClip();
-       },      
-       add_merge_text_clip: function( text_clip ){             
+       },
+       add_merge_text_clip: function( text_clip ){
                var _this = this;
                //make sure the clip does not already exist:
                if($j('#tc_'+text_clip.id).length==0){
                        var inserted = false;
                        var text_clip_start_time = npt2seconds( text_clip.start );
-                       
+
                        var insertHTML = '<div id="tc_'+text_clip.id+'" ' +
-                               'start_sec="' + text_clip_start_time + '" ' + 
+                               'start_sec="' + text_clip_start_time + '" ' +
                                'start="'+text_clip.start+'" end="'+text_clip.end+'" class="mvtt tt_'+text_clip.type_id+'">' +
-                                       '<div class="mvttseek" style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+                                                
+                                       '<div class="mvttseek" style="top:0px;left:0px;right:0px;height:20px;font-size:small">'+
                                                text_clip.start + ' to ' +text_clip.end+
                                        '</div>'+
                                        text_clip.body +
-                       '</div>';                       
+                       '</div>';
                        //js_log("ADDING CLIP: "  + text_clip_start_time + ' html: ' + insertHTML);
                        if(!_this.add_to_end_on_this_pass){
                                $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){
@@ -160,13 +160,13 @@ mvTextInterface.prototype = {
                                        }else{
                                                _this.add_to_end = true;
                                        }
-                               });             
+                               });
                        }
                        //js_log('should just add to end: '+insertHTML);
                        if(!inserted){
                                $j('#mmbody_'+this.pe.id ).append(insertHTML);
                        }
-                       
+
                        //apply the mouse over transcript seek/click functions:
                        $j(".mvttseek").click( function() {
                                _this.pe.doSeek( $j(this).parent().attr("start_sec") / _this.pe.getDuration() );
@@ -182,32 +182,32 @@ mvTextInterface.prototype = {
                                                'start' : $j(this).parent().attr("start"),
                                                'end'   : $j(this).parent().attr("end")
                                        });
-                               }, 
-                               out:function () {       
-                                         js_log('mvttseek: out');                
-                                         $j(this).parent().removeClass('tt_highlight');        
-                                         //de highlight section  
+                               },
+                               out:function () {
+                                         js_log('mvttseek: out');
+                                         $j(this).parent().removeClass('tt_highlight');
+                                         //de highlight section
                                        _this.pe.hideHighlight();
                                }
                          }
                        );
                }
        },
-       setup_layout:function(){                                                        
-               //check if we have already loaded the menu/body: 
+       setup_layout:function(){
+               //check if we have already loaded the menu/body:
                if($j('#tt_mmenu_'+this.pe.id).length==0){
-                       $j('#metaBox_'+this.pe.id).html(                        
+                       $j('#metaBox_'+this.pe.id).html(
                                this.getMenu() +
-                               this.getBody() 
+                               this.getBody()
                        );
                        this.doMenuBindings();
-               }                                               
+               }
        },
        show:function(){
                //setup layout if not already done:
                this.setup_layout();
-               //display the interface if not already displayed:  
-               $j('#metaBox_'+this.pe.id).fadeIn("fast");              
+               //display the interface if not already displayed:
+               $j('#metaBox_'+this.pe.id).fadeIn("fast");
                //start the autoscroll timer:
                if( this.autoscroll )
                        this.setAutoScroll();
@@ -229,23 +229,23 @@ mvTextInterface.prototype = {
        },
        getTsSelect:function(){
                var _this = this;
-               js_log('getTsSelect');          
+               js_log('getTsSelect');
                var selHTML = '<div id="mvtsel_' + this.pe.id + '" style="position:absolute;background:#FFF;top:30px;left:0px;right:0px;bottom:0px;overflow:auto;">';
                selHTML+='<b>' + gM('select_transcript_set') + '</b><ul>';
                //debugger;
-               for(var i in _this.availableTracks){ //for in loop ok on object                 
+               for(var i in _this.availableTracks){ //for in loop ok on object
                        var checked = ( _this.availableTracks[i].display ) ? 'checked' : '';
                        selHTML+='<li><input name="'+i+'" class="mvTsSelect" type="checkbox" ' + checked + '>'+
                                _this.availableTracks[i].getTitle() + '</li>';
                }
                selHTML+='</ul>' +
                                        '<a href="#" onClick="document.getElementById(\'' + this.pe.id + '\').textInterface.applyTsSelect();return false;">'+gM('close')+'</a>'+
-                               '</div>';               
+                               '</div>';
                $j('#metaBox_'+_this.pe.id).append( selHTML );
        },
        applyTsSelect:function(){
-               var _this = this;                               
-               //update availableTracks                
+               var _this = this;
+               //update availableTracks
                $j('#mvtsel_'+this.pe.id+' .mvTsSelect').each(function(){
                        if(this.checked){
                                var track_id = this.name;
@@ -254,7 +254,7 @@ mvTextInterface.prototype = {
                                        _this.loadAndDisplay( track_id);
                                }else{
                                        _this.availableTracks[this.name].display=true;
-                                       //display the named class: 
+                                       //display the named class:
                                        $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeIn("fast");
                                }
                        }else{
@@ -264,7 +264,7 @@ mvTextInterface.prototype = {
                                        $j('#mmbody_'+_this.pe.id +' .tt_'+this.name ).fadeOut("fast");
                                }
                        }
-               });             
+               });
                $j('#mvtsel_'+_this.pe.id).fadeOut("fast").remove();
        },
        monitor:function(){
@@ -273,33 +273,33 @@ mvTextInterface.prototype = {
                var cur_time = this.pe.currentTime ;
                if( cur_time!=0 ){
                        var search_for_range = true;
-                       //check if the current transcript is already where we want: 
+                       //check if the current transcript is already where we want:
                        if($j('#mmbody_'+this.pe.id +' .tt_scroll_highlight').length != 0){
                                var curhl = $j('#mmbody_'+this.pe.id +' .tt_scroll_highlight').get(0);
                                if(npt2seconds($j(curhl).attr('start') ) < cur_time &&
                                   npt2seconds($j(curhl).attr('end') ) > cur_time){
-                                       /*js_log('in range of current hl: ' + 
+                                       /*js_log('in range of current hl: ' +
                                                npt2seconds($j(curhl).attr('start')) +  ' to ' +  npt2seconds($j(curhl).attr('end')));
                                        */
-                                       search_for_range = false;                                       
+                                       search_for_range = false;
                                }else{
                                        search_for_range = true;
-                                       //remove the highlight from all: 
+                                       //remove the highlight from all:
                                        $j('#mmbody_'+this.pe.id +' .tt_scroll_highlight').removeClass('tt_scroll_highlight');
                                }
-                       };                      
+                       };
                        /*js_log('search_for_range:'+search_for_range +  ' for: '+ cur_time);*/
-                       if( search_for_range ){                         
-                               //search for current time: add tt_scroll_highlight to clip              
+                       if( search_for_range ){
+                               //search for current time: add tt_scroll_highlight to clip
                                // optimize:
-                               //  should do binnary search not iterative 
-                               //  avoid jquery function calls do native loops 
+                               //  should do binnary search not iterative
+                               //  avoid jquery function calls do native loops
                                $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){
                                        if(npt2seconds($j(this).attr('start') ) < cur_time &&
-                                          npt2seconds($j(this).attr('end') ) > cur_time){                                                                                                                                              
+                                          npt2seconds($j(this).attr('end') ) > cur_time){
                                                _this.prevTimeScroll=cur_time;
                                                $j('#mmbody_'+_this.pe.id).animate({
-                                                       scrollTop: $j(this).get(0).offsetTop                                            
+                                                       scrollTop: $j(this).get(0).offsetTop
                                                }, 'slow');
                                                $j(this).addClass('tt_scroll_highlight');
                                                //js_log('should add class to: ' + $j(this).attr('id'));
@@ -312,10 +312,10 @@ mvTextInterface.prototype = {
        },
        setAutoScroll:function( timer ){
                var _this = this;
-               this.autoscroll = ( typeof timer=='undefined' )?this.autoscroll:timer;           
+               this.autoscroll = ( typeof timer=='undefined' )?this.autoscroll:timer;
                if(this.autoscroll){
                        //start the timer if its not already running
-                       if(!this.scrollTimerId){                                                                
+                       if(!this.scrollTimerId){
                                this.scrollTimerId = setInterval('$j(\'#'+_this.pe.id+'\').get(0).textInterface.monitor()', 500);
                        }
                        //jump to the current position:
@@ -327,8 +327,8 @@ mvTextInterface.prototype = {
                        $j('#mmbody_'+this.pe.id +' .mvtt').each(function(){
                                if(cur_time > npt2seconds($j(this).attr('start'))  ){
                                        _this.prevTimeScroll=cur_time;
-                                       if( $j(this).attr('id') )       
-                                               scroll_to_id = $j(this).attr('id');     
+                                       if( $j(this).attr('id') )
+                                               scroll_to_id = $j(this).attr('id');
                                }
                        });
                        if(scroll_to_id != '')
@@ -343,39 +343,39 @@ mvTextInterface.prototype = {
                var out='';
                //add in loading icon:
                var as_checked = (this.autoscroll)?'checked':'';
-               out+= '<div id="tt_mmenu_'+this.pe.id+'" class="ui-widget-header" style="font-size:.6em;position:absolute;top:0;height:30px;left:0px;right:0px;">' +                   
-                               $j.btnHtml(gM('select_transcript_set'), 'tt-select', 'shuffle');                                                                
+               out+= '<div id="tt_mmenu_'+this.pe.id+'" class="ui-widget-header" style="font-size:.6em;position:absolute;top:0;height:30px;left:0px;right:0px;">' +
+                               $j.btnHtml(gM('select_transcript_set'), 'tt-select', 'shuffle');
                if(this.pe.media_element.linkback){
-                       out+=' ' + $j.btnHtml(gM('improve_transcript'), 'tt-improve', 'document', {href:this.pe.media_element.linkback, target:'_new'});                        
+                       out+=' ' + $j.btnHtml(gM('improve_transcript'), 'tt-improve', 'document', {href:this.pe.media_element.linkback, target:'_new'});
                }
                out+='<input onClick="document.getElementById(\''+this.pe.id+'\').textInterface.setAutoScroll(this.checked);return false;" ' +
-                               'type="checkbox" '+as_checked +'>'+gM('auto_scroll') + ' ' + 
-              $j.btnHtml(gM('close'), 'tt-close', 'circle-close');                             
-               out+='</div>';          
+                               'type="checkbox" '+as_checked +'>'+gM('auto_scroll') + ' ' +
+              $j.btnHtml(gM('close'), 'tt-close', 'circle-close');
+               out+='</div>';
                return out;
        },
        doMenuBindings:function(){
            var _this = this;
            var mt = '#tt_mmenu_'+ _this.pe.id;
            $j(mt + ' .tt-close').unbind().btnBind().click(function(){
-              $j( '#' + _this.pe.id).get(0).closeTextInterface();  
+              $j( '#' + _this.pe.id).get(0).closeTextInterface();
               return false;
            });
            $j(mt + ' .tt-select').unbind().btnBind().click(function(){
               $j( '#' +  _this.pe.id).get(0).textInterface.getTsSelect();
               return false;
            });
-           //use hard-coded link: 
+           //use hard-coded link:
            $j(mt + ' .tt-improve').btnBind();
        }
 }
 
 /* text format objects
-*  @@todo allow loading from external lib set 
-*/ 
-var timedTextObj = function( source ){ 
+*  @@todo allow loading from external lib set
+*/
+var timedTextObj = function( source ){
        //@@todo in the future we could support timed text in oggs if they can be accessed via javascript
-       //we should be able to do a HEAD request to see if we can read transcripts from the file.   
+       //we should be able to do a HEAD request to see if we can read transcripts from the file.
        switch( source.mime_type ){
                case 'text/cmml':
                        this.lib = 'CMML';
@@ -383,13 +383,13 @@ var timedTextObj = function( source ){
                case 'text/srt':
                case 'text/x-srt':
                        this.lib = 'SRT';
-               break;          
-               default:                        
+               break;
+               default:
                        js_log( source.mime_type + ' is not suported timed text fromat');
                        return ;
                break;
-       }       
-       //extend with the per-mime type lib:    
+       }
+       //extend with the per-mime type lib:
        eval('var tObj = timedText' + this.lib + ';');
        for( var i in tObj ){
                this[ i ] = tObj[i];
@@ -397,21 +397,21 @@ var timedTextObj = function( source ){
        return this.init( source );
 }
 
-//base timedText object 
+//base timedText object
 timedTextObj.prototype = {
        loaded: false,
        lib:null,
        display: false,
        textNodes:new Array(),
-       init: function( source ){                       
-               //copy source properties        
+       init: function( source ){
+               //copy source properties
                this.source = source;
                this.id = source.id;
        },
        getTitle:function(){
                return this.source.title;
        },
-       getSRC:function(){              
+       getSRC:function(){
                return this.source.src;
        }
 }
@@ -422,16 +422,16 @@ timedTextCMML = {
        load: function( range, callback ){
                var _this = this;
                js_log('textCMML: loading track: '+ this.src);
-               
-               //:: Load transcript range ::  
-               
+
+               //:: Load transcript range ::
+
                var pcurl =  parseUri( _this.getSRC() );
-               //check for urls without time keys: 
+               //check for urls without time keys:
                if( typeof pcurl.queryKey['t'] == 'undefined'){
-                       //in which case just get the full time req: 
-                       do_request( this.getSRC(), function(data){                                                                                                      
-                               _this.doParse( data );          
-                               _this.loaded=true;      
+                       //in which case just get the full time req:
+                       do_request( this.getSRC(), function(data){
+                               _this.doParse( data );
+                               _this.loaded=true;
                                callback();
                        });
                        return ;
@@ -445,17 +445,17 @@ timedTextCMML = {
                }
                //set up request url:
                url = pcurl.protocol + '://' + pcurl.authority + pcurl.path +'?';
-               $j.each(pcurl.queryKey, function(key, val){                                             
+               $j.each(pcurl.queryKey, function(key, val){
                        if( key != 't'){
                                url+=key+'='+val+'&';
                        }else{
                                url+= 't=' + seconds2npt(req_time[0]) + '/' + seconds2npt(req_time[1]) + '&';
                        }
-               });                                                     
-               do_request( url, function(data){                        
-                       js_log("load track clip count:" + data.getElementsByTagName('clip').length );                                           
-                       _this.doParse( data );          
-                       _this.loaded=true;      
+               });
+               do_request( url, function(data){
+                       js_log("load track clip count:" + data.getElementsByTagName('clip').length );
+                       _this.doParse( data );
+                       _this.loaded=true;
                        callback();
                });
        },
@@ -475,37 +475,37 @@ timedTextCMML = {
                                }else if(bn.text){
                                        text_clip.body = bn.text;
                                }
-                       });                     
+                       });
                        _this.textNodes.push( text_clip );
-               });     
+               });
        }
 }
 timedTextSRT = {
        load: function( range, callback ){
                var _this = this;
                js_log('textSRT: loading : '+ _this.getSRC() );
-               do_request( _this.getSRC() , function(data){                    
+               do_request( _this.getSRC() , function(data){
                        _this.doParse( data );
-                       _this.loaded=true;      
+                       _this.loaded=true;
                        callback();
                });
        },
        doParse:function( data ){
-               //split up the transcript chunks:               
-               //strip any \r's                                                
-               var tc = data.split(/[\r]?\n[\r]?\n/);                                  
-               //pushing can take time 
-               for(var s=0; s < tc.length ; s++) {                     
+               //split up the transcript chunks:
+               //strip any \r's
+               var tc = data.split(/[\r]?\n[\r]?\n/);
+               //pushing can take time
+               for(var s=0; s < tc.length ; s++) {
                        var st = tc[s].split('\n');
                        if(st.length >=2) {
-                               var n = st[0];                   
-                               var i = st[1].split(' --> ')[0].replace(/^\s+|\s+$/g,"");                       
+                               var n = st[0];
+                               var i = st[1].split(' --> ')[0].replace(/^\s+|\s+$/g,"");
                                var o = st[1].split(' --> ')[1].replace(/^\s+|\s+$/g,"");
                                var t = st[2];
                                if(st.length > 2) {
                                        for(j=3; j<st.length;j++)
                                                t += '\n'+st[j];
-                               }                         
+                               }
                                var text_clip = {
                                        "start": i,
                                        "end": o,
@@ -515,6 +515,6 @@ timedTextSRT = {
                                }
                                this.textNodes.push( text_clip );
                         }
-               }                       
-       }       
+               }
+       }
 };
index 8011fdb..1149bdd 100644 (file)
  * (in cases where media will be hosted in a different place than the embedding page)
  *
  */
-//fix multiple instances of mv_embed (ie include twice from two different servers) 
+//fix multiple instances of mv_embed (ie include twice from two different servers)
 var MV_DO_INIT=true;
-if( MV_EMBED_VERSION ){        
-       MV_DO_INIT=false;       
+if( MV_EMBED_VERSION ){
+       MV_DO_INIT=false;
 }
-//used to grab fresh copies of scripts. (should be changed on commit)  
+//used to grab fresh copies of scripts. (should be changed on commit)
 var MV_EMBED_VERSION = '1.0r19';
 
 /*
- * Configuration variables (can be set from some precceding script) 
+ * Configuration variables (can be set from some precceding script)
  * set up mwConfig global overide any of the defaultMwConfig values:
  * @@ more config valuse on the way ;)
  */
 var defaultMwConfig = {
        'skin_name': 'kskin',
-       'video_size':'400x300' 
+       'video_size':'400x300'
 }
 
 if(!mwConfig)
          var mwConfig = {};
-         
+
 //install the default config values for anything not set in  mwConfig
 checkDefaultMwConfig();
 
@@ -42,7 +42,7 @@ checkDefaultMwConfig();
 //note: this is necessary for remote embedding because of java security model)
 if(!mv_java_iframe)
        var mv_java_iframe = true;
-       
+
 //for when useing mv_embed with script-loader in root mediawiki path
 var mediaWiki_mvEmbed_path = 'js2/mwEmbed/';
 
@@ -61,7 +61,7 @@ if( !mv_embed_path ){
        var mv_embed_path = getMvEmbedPath();
 }
 
-//setup the skin path: 
+//setup the skin path:
 var mv_jquery_skin_path = mv_embed_path + 'jquery/jquery.ui/themes/redmond/';
 var mv_skin_img_path = mv_embed_path + 'skins/' + mwConfig['skin_name'] + '/images/';
 var mv_default_thumb_url = mv_skin_img_path + 'vid_default_thumb.jpg';
@@ -78,36 +78,35 @@ function loadGM( msgSet ){
 }
 
 //all default msg in [English] should be overwritten by the CMS language msg system.
-loadGM({ 
-       "loading_txt":"loading <blink>...</blink>",     
-       "loading_title"  : "Loading...",                                        
-       
+loadGM({
+       "loading_txt":"loading <blink>...</blink>",
+       "loading_title"  : "Loading...",
+
        "size-gigabytes" : "$1 GB",
        "size-megabytes" : "$1 MB",
        "size-kilobytes" : "$1 K",
        "size-bytes" : "$1 B"
-       
 });
 
-/** 
- * AutoLoader paths (this should mirror the file: jsAutoloadLocalClasses.php ) 
- * any file _not_ listed here won't be auto-loadable 
+/**
+ * AutoLoader paths (this should mirror the file: jsAutoloadLocalClasses.php )
+ * any file _not_ listed here won't be auto-loadable
  * @path the path to the file (or set of files) with ending slash
- * @gClasses the set of classes 
+ * @gClasses the set of classes
  *             if an array $j.className become jquery.className.js
  *             if an asssociative object then key => value paris are used
  */
 if(typeof mvAutoLoadClasses == 'undefined')
        mvAutoLoadClasses = {};
-       
+
 //the script that loads the classet
 function lcPaths( classSet){
        for(var i in classSet){
                mvAutoLoadClasses[i] = classSet[i];
        }
 }
-       
-function mvGetClassPath(k){            
+
+function mvGetClassPath(k){
        if( mvAutoLoadClasses[k] ){
                //js_log('got classpath:' + k +  ' : '+ mvClassPaths[k]);
                return mvAutoLoadClasses[k];
@@ -117,7 +116,7 @@ function mvGetClassPath(k){
 }
 if(typeof mvCssPaths == 'undefined')
        mvCssPaths = {};
-       
+
 function lcCssPath(cssSet){
        for(var i in cssSet){
                mvCssPaths[i]= mv_embed_path + cssSet[i];
@@ -126,39 +125,39 @@ function lcCssPath(cssSet){
 
 /*
  * --  Load Class Paths --
- * 
- * MUST BE VALID JSON (NOT JS) 
- * is used by the scriptloader to autoLoad classes (so we only define this once for php & javascript) 
- * 
+ *
+ * MUST BE VALID JSON (NOT JS)
+ * is used by the scriptloader to autoLoad classes (so we only define this once for php & javascript)
+ *
  * this is more verbose than earlier version that compressed paths
  * but its all good gziping help compress repetative path strings
- * grouped by 
- * 
+ * grouped by
+ *
  * right now php AutoLoader only reads this mv_embed.js file
- * in the future we could have multiple lcPath calls that php reads 
- * (if our autoloading class list becomes too long) just have to add thouse 
- * files to the jsAutoLoader file list. 
- */   
+ * in the future we could have multiple lcPath calls that php reads
+ * (if our autoloading class list becomes too long) just have to add thouse
+ * files to the jsAutoLoader file list.
+ */
 lcPaths({
        "mv_embed"                      : "mv_embed.js",
-       "window.jQuery"         : "jquery/jquery-1.3.2.js",     
+       "window.jQuery"         : "jquery/jquery-1.3.2.js",
        "$j.fn.pngFix"          : "jquery/plugins/jquery.pngFix.js",
        "$j.fn.autocomplete": "jquery/plugins/jquery.autocomplete.js",
        "$j.fn.hoverIntent"     : "jquery/plugins/jquery.hoverIntent.js",
        "$j.fn.datePicker"      : "jquery/plugins/jquery.datePicker.js",
-       "$j.ui"                         : "jquery/jquery.ui/ui/ui.core.js",     
+       "$j.ui"                         : "jquery/jquery.ui/ui/ui.core.js",
        "$j.fn.ColorPicker"     : "libClipEdit/colorpicker/js/colorpicker.js",
        "$j.Jcrop"                      : "libClipEdit/Jcrop/js/jquery.Jcrop.js",
        "$j.fn.simpleUploadForm": "libAddMedia/simpleUploadForm.js",
-       
+
        "baseSkin"      : "skins/baseSkin.js",
        "kskin"         : "skins/kskin/kskin.js",
        "mvpcf"         : "skins/mvpcf/mvpcf.js",
-       
-       "$j.secureEvalJSON"     : "jquery/plugins/jquery.secureEvalJSON.js",            
+
+       "$j.secureEvalJSON"     : "jquery/plugins/jquery.secureEvalJSON.js",
        "$j.cookie"                     : "jquery/plugins/jquery.cookie.js",
        "$j.contextMenu"        : "jquery/plugins/jquery.contextMenu.js",
-       
+
        "$j.effects.blind"              : "jquery/jquery.ui/ui/effects.blind.js",
        "$j.effects.drop"               : "jquery/jquery.ui/ui/effects.drop.js",
        "$j.effects.pulsate"    : "jquery/jquery.ui/ui/effects.pulsate.js",
@@ -183,21 +182,21 @@ lcPaths({
        "$j.ui.accordion"               : "jquery/jquery.ui/ui/ui.accordion.js",
        "$j.ui.draggable"               : "jquery/jquery.ui/ui/ui.draggable.js",
        "$j.ui.selectable"              : "jquery/jquery.ui/ui/ui.selectable.js",
-       
+
        "mvFirefogg"                    : "libAddMedia/mvFirefogg.js",
        "mvAdvFirefogg"                 : "libAddMedia/mvAdvFirefogg.js",
     "mvBaseUploadInterface"    : "libAddMedia/mvBaseUploadInterface.js",
        "remoteSearchDriver"    : "libAddMedia/remoteSearchDriver.js",
-       "seqRemoteSearchDriver" : "libAddMedia/seqRemoteSearchDriver.js",       
-       
+       "seqRemoteSearchDriver" : "libAddMedia/seqRemoteSearchDriver.js",
+
        "baseRemoteSearch"              : "libAddMedia/searchLibs/baseRemoteSearch.js",
        "mediaWikiSearch"               : "libAddMedia/searchLibs/mediaWikiSearch.js",
        "metavidSearch"                 : "libAddMedia/searchLibs/metavidSearch.js",
        "archiveOrgSearch"              : "libAddMedia/searchLibs/archiveOrgSearch.js",
        "baseRemoteSearch"              : "libAddMedia/searchLibs/baseRemoteSearch.js",
-       
+
        "mvClipEdit"                    : "libClipEdit/mvClipEdit.js",
-       
+
        "embedVideo"            : "libEmbedVideo/embedVideo.js",
        "flashEmbed"            : "libEmbedVideo/flashEmbed.js",
        "genericEmbed"          : "libEmbedVideo/genericEmbed.js",
@@ -206,54 +205,54 @@ lcPaths({
        "nativeEmbed"           : "libEmbedVideo/nativeEmbed.js",
        "quicktimeEmbed"        : "libEmbedVideo/quicktimeEmbed.js",
        "vlcEmbed"                      : "libEmbedVideo/vlcEmbed.js",
-       
+
        "mvPlayList"            : "libSequencer/mvPlayList.js",
        "mvSequencer"           : "libSequencer/mvSequencer.js",
        "mvFirefoggRender"      : "libSequencer/mvFirefoggRender.js",
        "mvTimedEffectsEdit": "libSequencer/mvTimedEffectsEdit.js",
-       
-       "libTimedText"          : "libTimedText/mvTextInterface.js"     
-       
-});    
+
+       "libTimedText"          : "libTimedText/mvTextInterface.js"
+
+});
 
 //depencency mapping for css files for self contained included plugins:
-lcCssPath({    
+lcCssPath({
        '$j.Jcrop'                      : 'libClipEdit/Jcrop/css/jquery.Jcrop.css',
        '$j.fn.ColorPicker'     : 'libClipEdit/colorpicker/css/colorpicker.css'
 })
 
 /**
  * Language Functions:
- * 
+ *
  * These functions try to losely mirro the functionality of Language.php in mediaWiki
- */ 
+ */
 function gM( key , args ) {
-       var ms ='';     
+       var ms ='';
        if ( key in gMsg ) {
                ms = gMsg[ key ];
-               if(typeof args == 'object' || typeof args == 'array'){                           
+               if(typeof args == 'object' || typeof args == 'array'){
                         for(var v in args){
-                               //msg test replace arguments start at 1 insted of zero: 
-                                var rep = '\$'+ ( parseInt(v) + 1 );                            
+                               //msg test replace arguments start at 1 insted of zero:
+                                var rep = '\$'+ ( parseInt(v) + 1 );
                                 ms = ms.replace( rep, args[v]);
-                        }                       
+                        }
                }else if(typeof args =='string' || typeof args =='number'){
                        ms = ms.replace(/\$1/, args);
                 }
                 return ms;
        } else{
-               //key is missing return indication: 
+               //key is missing return indication:
                return '&lt;' + key + '&gt;';
-       }        
+       }
 }
 /*
  * msgSet is either a string corresponding to a single msg to load
  * or msgSet is an array with set of msg to load
  */
-function gMsgLoadRemote(msgSet, callback){     
+function gMsgLoadRemote(msgSet, callback){
        var ammessages = '';
        if(typeof msgSet == 'object' ){
-               for(var i in msgSet){                   
+               for(var i in msgSet){
                        ammessages +=  msgSet[i] + '|';
                }
        }else if(typeof msgSet == 'string'){
@@ -262,12 +261,12 @@ function gMsgLoadRemote(msgSet, callback){
        if(ammessages == ''){
                js_log('gMsgLoadRemote::no msg set requested');
                return false;
-       }                       
+       }
        do_api_req({
                'data':{
-                       'meta':'allmessages', 
+                       'meta':'allmessages',
                        'ammessages':ammessages
-               }               
+               }
        },function(data){
                if(data.query.allmessages){
                        var msgs = data.query.allmessages;
@@ -279,7 +278,7 @@ function gMsgLoadRemote(msgSet, callback){
                }
                //load the result into local msg var
                callback();
-       });             
+       });
 }
 
 /**
@@ -314,7 +313,7 @@ function formatSize( size ) {
        //javascript does not let you do precession points in rounding
        var p =  Math.pow(10,round);
        var size = Math.round( size * p  ) / p;
-       //@@todo we need a formatNum and we need to request some special packaged info to deal with that case. 
+       //@@todo we need a formatNum and we need to request some special packaged info to deal with that case.
        return  gM( msg , size );
 }
 
@@ -328,13 +327,13 @@ function mv_get_loading_img( style , class_attr ){
 function mv_set_loading(target, load_id){
        var id_attr = ( load_id )?' id="' + load_id + '" ':'';
        $j(target).append('<div '+id_attr+' style="position:absolute;top:0px;left:0px;height:100%;width:100%;'+
-               'background-color:#FFF;">' +                     
-                       mv_get_loading_img('top:30px;left:30px') + 
-               '</div>');      
+               'background-color:#FFF;">' +
+                       mv_get_loading_img('top:30px;left:30px') +
+               '</div>');
 }
 
 /**
-  * mvJsLoader class handles initialization and js file loads 
+  * mvJsLoader class handles initialization and js file loads
   */
 var mvJsLoader = {
         libreq : {},
@@ -343,25 +342,25 @@ var mvJsLoader = {
         onReadyEvents:new Array(),
         doneReadyEvents:false,
         jQueryCheckFlag:false,
-        //to keep consistency across threads: 
+        //to keep consistency across threads:
         ptime:0,
-        ctime:0,        
+        ctime:0,
         load_error:false, //load error flag (false by default)
-        load_time:0,    
+        load_time:0,
         callbacks:new Array(),
         cur_path: null,
-        missing_path : null,                           
-        doLoad:function(loadLibs, callback){            
-                this.ctime++;           
-                if( loadLibs && loadLibs.length!=0 ){ //setup this.libs:               
-                                                               
+        missing_path : null,
+        doLoad:function(loadLibs, callback){
+                this.ctime++;
+                if( loadLibs && loadLibs.length!=0 ){ //setup this.libs:
+
                         //first check if we already have this lib loaded
                         var all_libs_loaded=true;
                         for(var i=0; i< loadLibs.length; i++){
-                                //check if the lib is already loaded: 
+                                //check if the lib is already loaded:
                                if( ! this.checkObjPath( loadLibs[i] ) ){
-                                       all_libs_loaded=false;                                                  
-                               }               
+                                       all_libs_loaded=false;
+                               }
                         }
                         if( all_libs_loaded ){
                                js_log('all libs already loaded skipping... load req');
@@ -369,51 +368,51 @@ var mvJsLoader = {
                                return ;
                        }
                        //do a check for any css we may need and get it:
-                       for(var i=0; i< loadLibs.length; i++){                          
+                       for(var i=0; i< loadLibs.length; i++){
                                if( typeof mvCssPaths[ loadLibs[i] ] != 'undefined' ){
-                                       loadExternalCss(  mvCssPaths[ loadLibs[i] ]); 
+                                       loadExternalCss(  mvCssPaths[ loadLibs[i] ]);
                                }
                        }
-                                                                                                                
-                        //check if we should use the script loader to combine all the requests into one:                        
+
+                        //check if we should use the script loader to combine all the requests into one:
                         if( typeof mwSlScript != 'undefined' ){
                                var class_set = '';
-                                 var last_class = '';  
-                                 var coma = ''; 
+                                 var last_class = '';
+                                 var coma = '';
                                  for(var i=0; i< loadLibs.length; i++){
                                          var curLib = loadLibs[i];
-                                         //only add if not included yet: 
+                                         //only add if not included yet:
                                          if( ! this.checkObjPath( curLib ) ){
-                                                 class_set+=coma + curLib ;                              
+                                                 class_set+=coma + curLib ;
                                                  last_class=curLib;
                                                  coma=',';
                                          }
-                                 }      
-                                 var puri = parseUri( getMvEmbedURL() );       
+                                 }
+                                 var puri = parseUri( getMvEmbedURL() );
                                  if( (getMvEmbedURL().indexOf('://')!=-1) && puri.host != parseUri( document.URL).host){
                                        mwSlScript =  puri.protocol + '://' + puri.authority + mwSlScript;
                                  }
-                                 
-                                 var dbug_attr = (puri.queryKey['debug'])?'&debug=true':'';                                                      
+
+                                 var dbug_attr = (puri.queryKey['debug'])?'&debug=true':'';
                                  this.libs[ last_class ] = mwSlScript + '?class=' + class_set +
                                                                          '&urid=' + getMvUniqueReqId() + dbug_attr;
-                                                                                         
-                        }else{                                                                                                            
+
+                        }else{
                                //do many requests:
                                for(var i=0; i< loadLibs.length; i++){
                                     var curLib = loadLibs[i];
                                     if(curLib){
                                             var libLoc = mvGetClassPath(curLib);
-                                                // do a direct load of the file (pass along unique request id from request or mv_embed Version ) 
+                                                // do a direct load of the file (pass along unique request id from request or mv_embed Version )
                                                 var qmark = (libLoc.indexOf('?')!==true)?'?':'&';
                                                 this.libs[curLib] =  mv_embed_path + libLoc + qmark + 'urid='+ getMvUniqueReqId();
-                                    } 
-                                }                                       
+                                    }
+                                }
                        }
                }
-               if( callback ){ 
+               if( callback ){
                        this.callbacks.push(callback);
-               }               
+               }
                if( this.checkLoading() ){
                         if( this.load_time++ > 1000){ //time out after ~80seconds
                                 js_error( gM('error_load_lib') +  this.missing_path );
@@ -423,31 +422,31 @@ var mvJsLoader = {
                         }
                }else{
                         //js_log('checkLoading passed run callbacks');
-                        //only do callback if we are in the same instance (weird concurency issue)                       
+                        //only do callback if we are in the same instance (weird concurency issue)
                         var cb_count=0;
                         for(var i=0; i < this.callbacks.length; i++)
-                                cb_count++;                             
+                                cb_count++;
                         //js_log('REST LIBS: loading is: '+ loading + ' run callbacks: '+cb_count +' p:'+ this.ptime +' c:'+ this.ctime);
                         //reset the libs
-                        this.libs={};                                                                                     
-                        //js_log('done loading do call: ' + this.callbacks[0] );                
+                        this.libs={};
+                        //js_log('done loading do call: ' + this.callbacks[0] );
                         while( this.callbacks.length !=0 ){
                                 if( this.ptime== ( this.ctime-1) ){ //enforce thread consistency
                                         this.callbacks.pop()();
                                         //func = this.callbacks.pop();
                                         //js_log(' run: '+this.ctime+ ' p: ' + this.ptime + ' ' +loading+ ' :'+ func);
-                                       //func();               
+                                       //func();
                                 }else{
-                                        //re-issue doLoad ( ptime will be set to ctime so we should catch up) 
+                                        //re-issue doLoad ( ptime will be set to ctime so we should catch up)
                                         setTimeout( 'mvJsLoader.doLoad()', 25 );
                                         break;
                                 }
-                        }                       
+                        }
                 }
-                this.ptime=this.ctime;         
-        },      
+                this.ptime=this.ctime;
+        },
         doLoadFullPaths:function(loadObj, callback){
-               
+
         },
         doLoadDepMode:function(loadChain, callback){
                //firefox executes js ~in-order of it being included~ so just directly issue request:
@@ -467,36 +466,36 @@ var mvJsLoader = {
                                }else{
                                        callback();
                                }
-                       });      
+                       });
                }                },
-        checkLoading:function(){                 
+        checkLoading:function(){
                  var loading=0;
                 var i=null;
-                for(var i in this.libs){ //for in loop oky on object                                                             
-                        if( !this.checkObjPath( i ) ){                          
-                                if(!this.libreq[i]){ 
+                for(var i in this.libs){ //for in loop oky on object
+                        if( !this.checkObjPath( i ) ){
+                                if(!this.libreq[i]){
                                        loadExternalJs( this.libs[i] );
                                 }
-                                       
+
                                 this.libreq[i]=1;
                                 //js_log("has not yet loaded: " + i);
                                 loading=1;
                         }
-                }               
+                }
                 return loading;
        },
        checkObjPath:function( libVar ){
                if(!libVar)
                        return false;
                var objPath = libVar.split('.')
-               var cur_path ='';                
+               var cur_path ='';
                for(var p=0; p < objPath.length; p++){
                         cur_path = (cur_path=='')?cur_path+objPath[p]:cur_path+'.'+objPath[p];
-                        eval( 'var ptest = typeof ( '+ cur_path + ' ); ');                              
-                        if( ptest == 'undefined'){                                                      
+                        eval( 'var ptest = typeof ( '+ cur_path + ' ); ');
+                        if( ptest == 'undefined'){
                                  this.missing_path = cur_path;
                                 return false;
-                        }                       
+                        }
                }
                this.cur_path = cur_path;
                return true;
@@ -505,74 +504,74 @@ var mvJsLoader = {
         * checks for jQuery and adds the $j noConflict var
         */
        jQueryCheck:function(callback){
-               //skip stuff if $j is already loaded:   
+               //skip stuff if $j is already loaded:
                if(_global['$j'] && callback)
-                       callback();             
+                       callback();
                var _this = this;
                //load jquery
                _this.doLoad([
-                        'window.jQuery'                         
+                        'window.jQuery'
                ],function(){
                        _global['$j'] = jQuery.noConflict();
-                       //set up ajax to not send dynamic urls for loading scripts (we control that with the scriptLoader) 
-                       $j.ajaxSetup({            
+                       //set up ajax to not send dynamic urls for loading scripts (we control that with the scriptLoader)
+                       $j.ajaxSetup({
                                  cache: true
                        });
                        js_log('jquery loaded');
-                       //setup mvEmbed jquery bindigns:  
+                       //setup mvEmbed jquery bindigns:
                        mv_jqueryBindings();
-                       //run the callback                      
+                       //run the callback
                        if(callback){
                                callback();
                        }
-               });     
+               });
        },
        embedVideoCheck:function( callback ){
                var _this = this;
                js_log('embedVideoCheck:');
-               //set videonojs to loading              
-               //issue a style sheet request get both mv_embed and jquery styles: 
+               //set videonojs to loading
+               //issue a style sheet request get both mv_embed and jquery styles:
                loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
                loadExternalCss( mv_embed_path  + 'skins/'+mwConfig['skin_name']+'/styles.css');
-                                
+
                //make sure we have jQuery
                _this.jQueryCheck(function(){
                        $j('.videonojs').html( gM('loading_txt') );
                        var depReq = [
                                [
-                                       '$j.ui', 
-                                       'embedVideo',                                   
-                                       '$j.cookie'                                                                                                                                                             
-                               ], 
+                                       '$j.ui',
+                                       'embedVideo',
+                                       '$j.cookie'
+                               ],
                                [
-                                       '$j.ui.slider'                                  
+                                       '$j.ui.slider'
                                ]
-                       ];                              
+                       ];
                        //add png fix if needed:
-                       if($j.browser.msie || $j.browser.version < 7)                                                           
+                       if($j.browser.msie || $j.browser.version < 7)
                                depReq[0].push( '$j.fn.pngFix' );
-                                                                               
-                       _this.doLoadDepMode(depReq,function(){                                                                                           
-                               embedTypes.init();                                                                              
-                               callback();     
+
+                       _this.doLoadDepMode(depReq,function(){
+                               embedTypes.init();
+                               callback();
                                $j('.videonojs').remove();
                        });
                });
-       },      
+       },
        addLoadEvent:function(fn){
                 this.onReadyEvents.push(fn);
-       },      
-       //checks the jQuery flag (this way when remote embeding we don't load jQuery 
+       },
+       //checks the jQuery flag (this way when remote embeding we don't load jQuery
        // unless js2AddOnloadHook was used or there is video on the page
-       runQuededFunctions:function(){                  
-               var _this = this; 
-               this.doneReadyEvents=true;                      
+       runQuededFunctions:function(){
+               var _this = this;
+               this.doneReadyEvents=true;
                if(this.jQueryCheckFlag){
-                       this.jQueryCheck(function(){                            
+                       this.jQueryCheck(function(){
                                _this.runReadyEvents();
                        });
-               }else{   
-                       this.runReadyEvents();  
+               }else{
+                       this.runReadyEvents();
                }
        },
        runReadyEvents:function(){
@@ -581,7 +580,7 @@ var mvJsLoader = {
                        this.onReadyEvents.shift()();
                }
        }
-       
+
 }
 //load an external JS (similar to jquery .require plugin)
 //but checks for object availability rather than load state
@@ -594,115 +593,115 @@ var mvJsLoader = {
  * and >= 1.1.4 not working: http://pastie.caboo.se/92595
  * $j(document).ready( function(){ */
 function mwdomReady(force){
-       js_log('f:mwdomReady:');        
+       js_log('f:mwdomReady:');
        if( !force && mv_init_done  ){
                js_log("mv_init_done already done do nothing...");
                return false;
        }
-       mv_init_done=true;                      
-       //handle the execution of Queded function with jQuery "ready"   
-       
+       mv_init_done=true;
+       //handle the execution of Queded function with jQuery "ready"
+
        //check if this page does have video or playlist
-       var e = [ 
-               document.getElementsByTagName("video"), 
+       var e = [
+               document.getElementsByTagName("video"),
                document.getElementsByTagName("audio"),
                document.getElementsByTagName("playlist")
-       ];      
+       ];
        if(e[0].length!=0 || e[1].length!=0 || e[2].length!=0){
-               js_log('we have items to rewrite');                                                             
-                       
-               //load libs and proccess:                                        
+               js_log('we have items to rewrite');
+
+               //load libs and proccess:
                mvJsLoader.embedVideoCheck(function(){
                        //run any queded global events:
-                       mv_video_embed( function(){             
+                       mv_video_embed( function(){
                                mvJsLoader.runQuededFunctions();
-                       });                                     
-               });             
+                       });
+               });
        }else{
-               //if we already have jQuery make sure its loaded into its proper context $j             
-               //run any queded global events:                 
-               mvJsLoader.runQuededFunctions();                                
+               //if we already have jQuery make sure its loaded into its proper context $j
+               //run any queded global events:
+               mvJsLoader.runQuededFunctions();
        }
 }
-//js2AddOnloadHook: ensure jQuery and the DOM are ready:  
-function js2AddOnloadHook( func ) {                             
-       //make sure the skin/style sheets are avaliable always: 
+//js2AddOnloadHook: ensure jQuery and the DOM are ready:
+function js2AddOnloadHook( func ) {
+       //make sure the skin/style sheets are avaliable always:
        loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
        loadExternalCss( mv_embed_path  + 'skins/'+mwConfig['skin_name']+'/styles.css');
-                                
-       //if we have already run the dom ready just run the function directly: 
+
+       //if we have already run the dom ready just run the function directly:
        if( mvJsLoader.doneReadyEvents ){
-               //make sure jQuery is there: 
+               //make sure jQuery is there:
                mvJsLoader.jQueryCheck(function(){
                        func();
-               });     
+               });
        }else{
                //if using js2AddOnloadHook we need to get jQuery into place (if its not already included)
                mvJsLoader.jQueryCheckFlag = true;
                mvJsLoader.addLoadEvent( func );
-       };              
+       };
 }
 //depreciated mwAddOnloadHook in favor of js2 naming (for clear seperation of js2 code from old mw code
 var mwAddOnloadHook = js2AddOnloadHook;
 /*
- * this function allows for targeted rewriting 
+ * this function allows for targeted rewriting
  */
 function rewrite_by_id( vid_id, ready_callback ){
-       js_log('f:rewrite_by_id: ' + vid_id);   
-       //force a recheck of the dom for playlist or video element:      
+       js_log('f:rewrite_by_id: ' + vid_id);
+       //force a recheck of the dom for playlist or video element:
        mvJsLoader.embedVideoCheck(function(){
-                mv_video_embed(ready_callback, vid_id ); 
+                mv_video_embed(ready_callback, vid_id );
        });
 }
 //depricated in favor of updates to oggHanlder
-function rewrite_for_oggHanlder( vidIdList ){          
-       for(var i = 0; i < vidIdList.length ; i++){             
+function rewrite_for_oggHanlder( vidIdList ){
+       for(var i = 0; i < vidIdList.length ; i++){
                var vidId = vidIdList[i];
-               js_log('looking at vid: ' + i +' ' + vidId);            
+               js_log('looking at vid: ' + i +' ' + vidId);
                //grab the thumbnail and src video
                var pimg = $j('#'+vidId + ' img');
                var poster_attr = 'poster = "' + pimg.attr('src') + '" ';
                var pwidth = pimg.attr('width');
-               var pheight = pimg.attr('height');                              
-               
+               var pheight = pimg.attr('height');
+
                var type_attr = '';
                //check for audio
-               if( pwidth=='22' && pheight=='22'){             
+               if( pwidth=='22' && pheight=='22'){
                        pwidth='400';
                        pheight='300';
                        type_attr = 'type="audio/ogg"';
                        poster_attr = '';
                }
-               
-               //parsed values:                 
+
+               //parsed values:
                var src = '';
-               var duration = ''; 
-               
+               var duration = '';
+
                var re = new RegExp( /videoUrl(&quot;:?\s*)*([^&]*)/ );
                src  = re.exec( $j('#'+vidId).html() )[2];
-               
+
                var re = new RegExp( /length(&quot;:?\s*)*([^&]*)/ );
                duration = re.exec( $j('#'+vidId).html() )[2];
-               
+
                var re = new RegExp( /offset(&quot;:?\s*)*([^&]*)/ );
-               offset = re.exec( $j('#'+vidId).html() )[2];            
+               offset = re.exec( $j('#'+vidId).html() )[2];
                var offset_attr = (offset)? 'startOffset="'+ offset + '"': '';
-               
+
                if( src ){
-                       //replace the top div with mv_embed based player: 
-                       var vid_html = '<video id="vid_' + i +'" '+ 
+                       //replace the top div with mv_embed based player:
+                       var vid_html = '<video id="vid_' + i +'" '+
                                         'src="' + src + '" ' +
-                                        poster_attr + ' ' + 
-                                        type_attr + ' ' + 
-                                        offset_attr + ' ' + 
-                                        'duration="' + duration + '" ' + 
-                                        'style="width:' + pwidth + 'px;height:' + 
+                                        poster_attr + ' ' +
+                                        type_attr + ' ' +
+                                        offset_attr + ' ' +
+                                        'duration="' + duration + '" ' +
+                                        'style="width:' + pwidth + 'px;height:' +
                                                 pheight + 'px;"></video>';
-                       //js_log("video html: " + vid_html);                    
+                       //js_log("video html: " + vid_html);
                         $j('#'+vidId).html( vid_html );
-               }               
-               
-               //rewrite that video id: 
+               }
+
+               //rewrite that video id:
                rewrite_by_id('vid_' + i);
        }
 }
@@ -714,7 +713,7 @@ function rewrite_for_oggHanlder( vidIdList ){
 // for Mozilla browsers
 if (document.addEventListener ) {
        document.addEventListener("DOMContentLoaded", function(){mwdomReady()}, false);
-}else{ 
+}else{
        //backup "onload" method in case on DOMContentLoaded does not exist
        window.onload = function(){ mwdomReady() };
 }
@@ -724,93 +723,93 @@ if (document.addEventListener ) {
 function mv_write_modal(content, speed){
        $j('#modalbox,#mv_overlay').remove();
        $j('body').append('<div id="modalbox" style="background:#DDD;border:3px solid #666666;font-size:115%;'+
-                               'top:30px;left:20px;right:20px;bottom:30px;position:fixed;z-index:100;">'+                      
-                               content +                       
-                       '</div>'+               
+                               'top:30px;left:20px;right:20px;bottom:30px;position:fixed;z-index:100;">'+
+                               content +
+                       '</div>'+
                        '<div id="mv_overlay" style="background:#000;cursor:wait;height:100%;left:0;position:fixed;'+
                                'top:0;width:100%;z-index:5;filter:alpha(opacity=60);-moz-opacity: 0.6;'+
                                'opacity: 0.6;"/>');
-       $j('#modalbox,#mv_overlay').show( speed );      
+       $j('#modalbox,#mv_overlay').show( speed );
 }
 function mv_remove_modal(speed){
        $j('#modalbox,#mv_overlay').remove( speed);
 }
 
 /*
- * stores all the mwEmbed jQuery specific bindings 
+ * stores all the mwEmbed jQuery specific bindings
  * (setup after jQuery is avaliable)
  * lets you call rewrites in a jquery "way"
- *  
+ *
  * @@ eventually we should refactor mwCode over to jQuery style plugins
- *       and mv_embed.js will just hanndle dependency mapping and loading. 
- *       
- */  
+ *       and mv_embed.js will just hanndle dependency mapping and loading.
+ *
+ */
 function mv_jqueryBindings(){
-       js_log('mv_jqueryBindings');    
-       (function($) {                          
-               $.fn.addMediaWiz = function( iObj, callback ){                  
-                       //first set the cursor for the button to "loading" 
+       js_log('mv_jqueryBindings');
+       (function($) {
+               $.fn.addMediaWiz = function( iObj, callback ){
+                       //first set the cursor for the button to "loading"
                        $j(this.selector).css('cursor','wait').attr('title', gM('loading_title'));
-                                                                       
+
                        iObj['target_invocation'] = this.selector;
-                       
-                       //load the mv_embed_base skin:                                                                                   
-                       loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );                  
-                       loadExternalCss( mv_embed_path  + 'skins/'+mwConfig['skin_name']+'/styles.css' );                                                                                                                                                                                               
-                       //load all the req libs: 
-                       mvJsLoader.jQueryCheck(function(){                              
-                               //load with staged dependeinces (for ie and safari that don't execute in order) 
+
+                       //load the mv_embed_base skin:
+                       loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css' );
+                       loadExternalCss( mv_embed_path  + 'skins/'+mwConfig['skin_name']+'/styles.css' );
+                       //load all the req libs:
+                       mvJsLoader.jQueryCheck(function(){
+                               //load with staged dependeinces (for ie and safari that don't execute in order)
                                mvJsLoader.doLoadDepMode([
                                        [       'remoteSearchDriver',
                                                '$j.cookie',
                                                '$j.ui'
-                                       ],[             
+                                       ],[
                                                '$j.ui.resizable',
                                                '$j.ui.draggable',
                                                '$j.ui.dialog',
                                                '$j.ui.tabs',
                                                '$j.ui.sortable'
                                        ]
-                               ], function(){                                  
+                               ], function(){
                                        iObj['instance_name']= 'rsdMVRS';
-                                       _global['rsdMVRS'] = new remoteSearchDriver( iObj );       
+                                       _global['rsdMVRS'] = new remoteSearchDriver( iObj );
                                        if( callback ){
                                           callback( _global['rsdMVRS'] );
                                        }
-                               });                     
+                               });
                        });
                }
                $.fn.sequencer = function( iObj, callback){
                        //debugger;
                        iObj['target_sequence_container'] = this.selector;
-               //issue a request to get the css file (if not already included):        
+               //issue a request to get the css file (if not already included):
                loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css');
-               loadExternalCss( mv_embed_path+'skins/'+mwConfig['skin_name']+'/mv_sequence.css');      
-               //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page)       
-               mvJsLoader.embedVideoCheck(function(){                                          
+               loadExternalCss( mv_embed_path+'skins/'+mwConfig['skin_name']+'/mv_sequence.css');
+               //make sure we have the required mv_embed libs (they are not loaded when no video element is on the page)
+               mvJsLoader.embedVideoCheck(function(){
                        //load playlist object and then jquery ui stuff:
                        mvJsLoader.doLoadDepMode([
                                [
                                        'mvPlayList',
-                                       '$j.ui',  
+                                       '$j.ui',
                                        '$j.contextMenu',
                                        '$j.secureEvalJSON',
-                                       'mvSequencer'           
+                                       'mvSequencer'
                                ],
                                [
                                        '$j.ui.accordion',
                                        '$j.ui.dialog',
                                        '$j.ui.droppable',
-                                       '$j.ui.draggable',    
-                                       '$j.ui.progressbar',                                    
+                                       '$j.ui.draggable',
+                                       '$j.ui.progressbar',
                                        '$j.ui.sortable',
                                        '$j.ui.resizable',
-                                       '$j.ui.slider',                                 
+                                       '$j.ui.slider',
                                        '$j.ui.tabs'
                                ]
-                       ], function(){                                                  
-                               js_log('calling new mvSequencer');                                              
-                               //init the sequence object (it will take over from there) no more than one mvSeq obj for now: 
+                       ], function(){
+                               js_log('calling new mvSequencer');
+                               //init the sequence object (it will take over from there) no more than one mvSeq obj for now:
                                if(!_global['mvSeq']){
                                        _global['mvSeq'] = new mvSequencer(iObj);
                                }else{
@@ -822,22 +821,22 @@ function mv_jqueryBindings(){
                /*
                 * the firefogg jquery function:
                 * @@note this firefogg envocation could be made to work more like real jquery plugins
-                */                      
+                */
                $.fn.firefogg = function( iObj, callback ) {
                        if(!iObj)
                                iObj={};
                        //add base theme css:
                        loadExternalCss( mv_jquery_skin_path + 'jquery-ui-1.7.1.custom.css');
                        loadExternalCss( mv_embed_path  + 'skins/'+mwConfig['skin_name']+'/styles.css' );
-                                               
-                       //check if we already have firefogg loaded (the call just updates properties for that element) 
-                       var sElm = $j(this.selector).get(0);                                                                    
-                       if(sElm['firefogg']){                           
+
+                       //check if we already have firefogg loaded (the call just updates properties for that element)
+                       var sElm = $j(this.selector).get(0);
+                       if(sElm['firefogg']){
                                if(sElm['firefogg']=='loading'){
                                        js_log("Error: called firefogg operations on Firefogg selector that is not done loading");
                                        return false;
                                }
-                               //update properties: 
+                               //update properties:
                                for(var i in iObj){
                                        js_log("firefogg::updated: "+ i + ' to '+ iObj[i]);
                                        sElm['firefogg'][i] = iObj[i];
@@ -847,69 +846,69 @@ function mv_jqueryBindings(){
                                //avoid concurency
                                sElm['firefogg'] = 'loading';
                        }
-                       //add the selector: 
+                       //add the selector:
                        iObj['selector'] = this.selector;
-                                       
+
                        var loadSet = [
-                               [                               
+                               [
                                        'mvBaseUploadInterface',
                                        'mvFirefogg',
-                                       '$j.ui'                                                                         
+                                       '$j.ui'
                                ],
                                [
                                        '$j.ui.progressbar',
                                        '$j.ui.dialog'
                                ]
-                       ];      
+                       ];
                        if( iObj.encoder_interface ){
                                loadSet.push([
                                        'mvAdvFirefogg',
-                                       '$j.cookie',                      
+                                       '$j.cookie',
                                        '$j.ui.accordion',
-                                       '$j.ui.slider',    
+                                       '$j.ui.slider',
                                        '$j.ui.datepicker'
                                ]);
-                       }               
-                       //make sure we have everything loaded that we need: 
-                       mvJsLoader.doLoadDepMode( loadSet, function(){                                                                          
+                       }
+                       //make sure we have everything loaded that we need:
+                       mvJsLoader.doLoadDepMode( loadSet, function(){
                                        js_log('firefogg libs loaded. target select:' + iObj.selector);
-                                       //select interface provicer based on if we want to include the encoder interface or not: 
+                                       //select interface provicer based on if we want to include the encoder interface or not:
                                        if(iObj.encoder_interface){
                                                var myFogg = new mvAdvFirefogg( iObj );
                                        }else{
                                                var myFogg = new mvFirefogg( iObj );
-                                       }                                                          
+                                       }
                                        if(myFogg){
                                                myFogg.doRewrite( callback );
-                                               var selectorElement = $j( iObj.selector ).get(0);       
+                                               var selectorElement = $j( iObj.selector ).get(0);
                                                selectorElement['firefogg']=myFogg;
                                        }
-                       });             
+                       });
                }
                //takes a input player as the selector and exposes basic rendering controls
-               $.fn.firefoggRender = function( iObj, callback ){                       
-                       //check if we already have render loaded then just pass on updates/actions 
+               $.fn.firefoggRender = function( iObj, callback ){
+                       //check if we already have render loaded then just pass on updates/actions
                        var sElm = $j(this.selector).get(0);
                        if(sElm['fogg_render']){
                                if(sElm['fogg_render']=='loading'){
                                        js_log("Error: called firefoggRender while loading");
                                        return false;
                                }
-                               //call or update the property: 
+                               //call or update the property:
                        }
                        sElm['fogg_render']='loading';
-                       //add the selector: 
-                       iObj['player_target'] = this.selector;                  
+                       //add the selector:
+                       iObj['player_target'] = this.selector;
                        mvJsLoader.doLoad([
                                'mvFirefogg',
                                'mvFirefoggRender'
-                       ],function(){           
+                       ],function(){
                                sElm['fogg_render']= new mvFirefoggRender( iObj );
                                if( callback && typeof callback == 'function' )
                                        callback( sElm['fogg_render'] );
                        });
                }
-               
+
                $.fn.baseUploadInterface = function(iObj){
                        mvJsLoader.doLoadDepMode([
                                [
@@ -920,25 +919,25 @@ function mv_jqueryBindings(){
                                  '$j.ui.progressbar',
                                  '$j.ui.dialog'
                                ]
-                       ],function(){                           
+                       ],function(){
                                myUp = new mvBaseUploadInterface( iObj );
                                myUp.setupForm();
                        });
-               }                               
-                               
+               }
+
                //shortcut to a themed button:
                $.btnHtml = function(msg, className, iconId, opt){
                   if(!opt)
                      opt = {};
                   var href = (opt.href)?opt.href:'#';
-                  var target_attr = (opt.target)?' target="' + opt.target + '" ':''; 
-                  var style_attr = (opt.style)?' style="'+opt.style +'" ':'';    
+                  var target_attr = (opt.target)?' target="' + opt.target + '" ':'';
+                  var style_attr = (opt.style)?' style="'+opt.style +'" ':'';
                   return '<a href="' + href + '" ' + target_attr + style_attr +' class="ui-state-default ui-corner-all ui-icon_link ' +
-                                  className + '"><span class="ui-icon ui-icon-' + iconId + '" />' + 
-                                  msg + '</a>';                                                  
-               }                  
-               //shortcut to bind hover state:         
-               $.fn.btnBind = function(){                      
+                                  className + '"><span class="ui-icon ui-icon-' + iconId + '" />' +
+                                  msg + '</a>';
+               }
+               //shortcut to bind hover state:
+               $.fn.btnBind = function(){
                        $j(this).hover(
                                function(){
                                        $j(this).addClass('ui-state-hover');
@@ -949,50 +948,50 @@ function mv_jqueryBindings(){
                        )
                        return this;
                }
-               
+
        })(jQuery);
-}  
+}
 /*
 * utility functions:
 */
-//simple url re-writer for rewriting urls (could probably be refactored into an inline regular expresion) 
-function getURLParamReplace( url, opt ){       
-       var pSrc = parseUri( url );     
+//simple url re-writer for rewriting urls (could probably be refactored into an inline regular expresion)
+function getURLParamReplace( url, opt ){
+       var pSrc = parseUri( url );
        if(pSrc.protocol != '' ){
-               var new_url = pSrc.protocol +'://'+ pSrc.authority + pSrc.path +'?';                               
+               var new_url = pSrc.protocol +'://'+ pSrc.authority + pSrc.path +'?';
        }else{
-               var new_url = pSrc.path +'?';     
-       }       
+               var new_url = pSrc.path +'?';
+       }
        var amp = '';
        for(var key in pSrc.queryKey){
                var val = pSrc.queryKey[ key ];
-               //do override if requested 
+               //do override if requested
                if( opt[ key ] )
                        val = opt[ key ];
-               new_url+= amp + key + '=' + val;                                        
-               amp = '&';              
-       };      
-       //add any vars that did were not originally there: 
+               new_url+= amp + key + '=' + val;
+               amp = '&';
+       };
+       //add any vars that did were not originally there:
        for(var i in opt){
                if(!pSrc.queryKey[i]){
                  new_url+=amp + i + '=' + opt[i];
-                 amp = '&'; 
+                 amp = '&';
                }
-       }                
+       }
        return new_url;
 }
 /**
  * seconds2npt given a float seconds returns npt format response:
  * @param float seconds
- * @param boolean if we should show ms or not. 
+ * @param boolean if we should show ms or not.
  */
 function seconds2npt(sec, show_ms){
        if( isNaN( sec ) ){
                //js_log("warning: trying to get npt time on NaN:" + sec);
                return '0:0:0';
-       }               
+       }
        var hours = Math.floor(sec/ 3600);
-       var minutes = Math.floor((sec/60) % 60);        
+       var minutes = Math.floor((sec/60) % 60);
        var seconds = sec % 60;
        //round the second amount requested significant digits
        if(show_ms){
@@ -1003,24 +1002,24 @@ function seconds2npt(sec, show_ms){
        if(seconds <10 )
                seconds = '0'+  seconds;
        if(minutes < 10 )
-               minutes = '0' + minutes;        
-       
+               minutes = '0' + minutes;
+
        return hours+":"+minutes+":"+seconds;
 }
-/* 
- * takes hh:mm:ss,ms or  hh:mm:ss.ms input returns number of seconds 
+/*
+ * takes hh:mm:ss,ms or  hh:mm:ss.ms input returns number of seconds
  */
 function npt2seconds( npt_str ){
-       if(!npt_str){           
+       if(!npt_str){
                //js_log('npt2seconds:not valid ntp:'+ntp);
                return false;
        }
        //strip npt: time definition if present
-       npt_str = npt_str.replace('npt:', ''); 
-       
+       npt_str = npt_str.replace('npt:', '');
+
        times = npt_str.split(':');
-       if(times.length!=3){            
-               js_log('error: npt2seconds on ' + npt_str);                     
+       if(times.length!=3){
+               js_log('error: npt2seconds on ' + npt_str);
                return false;
        }
        //sometimes the comma is used inplace of pereid for ms
@@ -1030,99 +1029,99 @@ function npt2seconds( npt_str ){
 }
 /*
  * simple helper to grab a edit token
- * 
+ *
  * @param title the wiki page title you want to edit )
  * @param api_url 'optional' the target api url
- * @param callback the callback function to pass the token or "false" to  
+ * @param callback the callback function to pass the token or "false" to
  */
-function get_mw_token( title, api_url, callback){      
+function get_mw_token( title, api_url, callback){
        js_log(':get_mw_token:');
        if(!title && wgUserName){
-               title = 'User:' + wgUserName; 
+               title = 'User:' + wgUserName;
        }
        var reqObj = {
                        'action':'query',
                        'prop':'info',
                        'intoken':'edit',
                        'titles':title
-               };                      
+               };
                do_api_req( {
                        'data': reqObj,
                        'url' : api_url
-                       },function(data){                                                                                       
-                               for(var i in data.query.pages){ 
+                       },function(data){
+                               for(var i in data.query.pages){
                                        if(data.query.pages[i]['edittoken']){
                                                if(typeof callback == 'function')
                                                        callback ( data.query.pages[i]['edittoken'] );
-                                       }                                                               
+                                       }
                                }
                                //no token found:
                                return false;
                        }
                );
 }
-//does a remote or local api request based on request url 
+//does a remote or local api request based on request url
 //@param options: url, data, cbParam, callback
-function do_api_req( options, callback ){              
-       if(typeof options.data != 'object'){            
+function do_api_req( options, callback ){
+       if(typeof options.data != 'object'){
                return js_error('Error: request paramaters must be an object');;
        }
        //gennerate the url if its missing:
        if( typeof options.url == 'undefined' ||  options.url === false){
-               if(!wgServer || ! wgScriptPath){                        
+               if(!wgServer || ! wgScriptPath){
                        return js_error('Error: no api url for api request');;
-               }                               
-               //update to api.php (if index.php was in the wgScript path): 
-                options.url =  mwGetLocalApiUrl();             
-       }                       
+               }
+               //update to api.php (if index.php was in the wgScript path):
+                options.url =  mwGetLocalApiUrl();
+       }
        if( typeof options.data == 'undefined' )
-               options.data = {};      
-       
-       //force format to json (if not already set)               
+               options.data = {};
+
+       //force format to json (if not already set)
        options.data['format'] = 'json';
-       
+
        //if action not set assume query
        if(!options.data['action'])
                options.data['action']='query';
-       
-       js_log('do api req: ' + options.url +'?' +  jQuery.param(options.data) );                       
-       //build request string:                  
+
+       js_log('do api req: ' + options.url +'?' +  jQuery.param(options.data) );
+       //build request string:
        if( parseUri( document.URL ).host == parseUri( options.url ).host ){
-               //local request do api request directly         
+               //local request do api request directly
                $j.ajax({
                        type: "POST",
                        url: options.url,
                        data: options.data,
-                       dataType:'json', //api requests _should_ always return JSON data: 
+                       dataType:'json', //api requests _should_ always return JSON data:
                        async: false,
-                       success:function(data){                                         
+                       success:function(data){
                                callback(  data );
                        },
                        error:function(e){
-                               js_error( ' error' + e +' in getting: ' + options.url); 
+                               js_error( ' error' + e +' in getting: ' + options.url);
                        }
                });
-       }else{                  
-               //set the callback param if not already set: 
+       }else{
+               //set the callback param if not already set:
                if( typeof options.jsonCB == 'undefined')
                        options.jsonCB = 'callback';
-                                               
-               var req_url = options.url;              
-               var paramAnd = (req_url.indexOf('?')==-1)?'?':'&';              
-               //put all the values into the GET req:   
+
+               var req_url = options.url;
+               var paramAnd = (req_url.indexOf('?')==-1)?'?':'&';
+               //put all the values into the GET req:
                for(var i in options.data){
-                       req_url += paramAnd + encodeURIComponent( i ) + '=' + encodeURIComponent( options.data[i] );            
+                       req_url += paramAnd + encodeURIComponent( i ) + '=' + encodeURIComponent( options.data[i] );
                        paramAnd ='&';
                }
                var fname = 'mycpfn_' + ( global_cb_count++ );
-               _global[ fname ]  =  callback;                          
-               req_url += '&' + options.jsonCB + '=' + fname;                                                          
-               loadExternalJs( req_url );                              
-       }       
+               _global[ fname ]  =  callback;
+               req_url += '&' + options.jsonCB + '=' + fname;
+               loadExternalJs( req_url );
+       }
 }
 function mwGetLocalApiUrl(url){
        if (wgServer && wgScriptPath){
-               return wgServer + wgScriptPath + '/api.php';            
+               return wgServer + wgScriptPath + '/api.php';
        }
        return false;
 }
@@ -1134,32 +1133,32 @@ function grabWikiFormError ( result_page ){
                        se = result_page.indexOf('</span>', sp);
                        res.error_txt = result_page.substr(sp, (sp-se)) + '</span>';
                }else{
-                       //look for warning: 
+                       //look for warning:
                        sp = result_page.indexOf('<ul class="warning">')
                        if(sp != -1){
                                se = result_page.indexOf('</ul>', sp);
                                res.error_txt = result_page.substr(sp, (se-sp)) + '</ul>';
-                               //try and add the ignore form item: 
+                               //try and add the ignore form item:
                                sfp = result_page.indexOf('<form method="post"');
                                if(sfp!=-1){
                                        sfe = result_page.indexOf('</form>', sfp);
                                        res.form_txt = result_page.substr(sfp, ( sfe - sfp )) + '</form>';
                                }
                        }else{
-                               //one more error type check: 
+                               //one more error type check:
                                sp = result_page.indexOf('class="mw-warning-with-logexcerpt">')
                                if(sp!=-1){
                                        se = result_page.indexOf('</div>', sp);
                                        res.error_txt = result_page.substr(sp, ( se - sp )) + '</div>';
                                }
                        }
-               }       
-               return res;             
+               }
+               return res;
 }
-//do a "normal" request 
-function do_request(req_url, callback){                
-       js_log('do_request::req_url:' + req_url + ' != ' +  parseUri( req_url).host);    
-       //if we are doing a request to the same domain or relative link do a normal GET: 
+//do a "normal" request
+function do_request(req_url, callback){
+       js_log('do_request::req_url:' + req_url + ' != ' +  parseUri( req_url).host);
+       //if we are doing a request to the same domain or relative link do a normal GET:
        if( parseUri(document.URL).host == parseUri(req_url).host ||
                req_url.indexOf('://') == -1 ){ //relative url
                //do a direct request:
@@ -1167,17 +1166,17 @@ function do_request(req_url, callback){
                        type: "GET",
                        url:req_url,
                           async: false,
-                       success:function(data){         
+                       success:function(data){
                                callback( data );
                        }
                });
-       }else{                                          
+       }else{
                //get data via DOM injection with callback
                global_req_cb.push(callback);
                //prepend json_ to feed_format if not already requesting json format
                if( req_url.indexOf("feed_format=")!=-1 &&  req_url.indexOf("feed_format=json")==-1)
-                       req_url = req_url.replace(/feed_format=/, 'feed_format=json_');                                                                                                 
-               loadExternalJs( req_url + '&cb=mv_jsdata_cb&cb_inx=' + (global_req_cb.length-1));                       
+                       req_url = req_url.replace(/feed_format=/, 'feed_format=json_');
+               loadExternalJs( req_url + '&cb=mv_jsdata_cb&cb_inx=' + (global_req_cb.length-1));
        }
 }
 
@@ -1205,12 +1204,12 @@ function mv_jsdata_cb(response){
                                        var xmldata=new ActiveXObject("Microsoft.XMLDOM");
                                        xmldata.async="false";
                                        xmldata.loadXML(response['pay_load']);
-                               }else{ //for others (firefox, safari etc)       
+                               }else{ //for others (firefox, safari etc)
                                        try{
-                                               var xmldata = (new DOMParser()).parseFromString(response['pay_load'], "text/xml");              
+                                               var xmldata = (new DOMParser()).parseFromString(response['pay_load'], "text/xml");
                                        }catch(e) {
                                                          js_log('XML parse ERROR: ' + e.message);
-                                         }                                       
+                                         }
                                }
                                //@@todo hanndle xml parser errors
                                if(xmldata)response['pay_load']=xmldata;
@@ -1226,7 +1225,7 @@ function mv_jsdata_cb(response){
 //load external js via dom injection
 function loadExternalJs( url, callback ){
          js_log('load js: '+ url);
-       //if(window['$j']) //use jquery call:   
+       //if(window['$j']) //use jquery call:
           /*$j.ajax({
                        type: "GET",
                        url: url,
@@ -1241,7 +1240,7 @@ function loadExternalJs( url, callback ){
                        e.onload = callback;
                */
                //e.setAttribute('defer', true);
-               document.getElementsByTagName("head")[0].appendChild(e);                
+               document.getElementsByTagName("head")[0].appendChild(e);
    // }
 }
 function styleSheetPresent(url){
@@ -1255,19 +1254,19 @@ function styleSheetPresent(url){
        return false;
 }
 function loadExternalCss(url){
-       //if could have script loader group thes css request 
+       //if could have script loader group thes css request
        //but debatable it may hurt more than it helps with caching and all
        if(typeof url =='object'){
-               for(var i in url){                      
+               for(var i in url){
                        loadExternalCss ( url[i] );
                }
                return ;
        }
-       
+
        if( url.indexOf('?') == -1 ){
                url+='?'+getMvUniqueReqId();
        }
-       if(!styleSheetPresent(url) ){           
+       if(!styleSheetPresent(url) ){
           js_log('load css: ' + url);
           var e = document.createElement("link");
           e.href = url;
@@ -1276,37 +1275,37 @@ function loadExternalCss(url){
           document.getElementsByTagName("head")[0].appendChild(e);
        }
 }
-function getMvEmbedURL(){      
-       if( _global['mv_embed_url'] ) 
-               return _global['mv_embed_url'];                         
-       var js_elements = document.getElementsByTagName("script");                      
-       for(var i=0; i < js_elements.length; i++){                                      
+function getMvEmbedURL(){
+       if( _global['mv_embed_url'] )
+               return _global['mv_embed_url'];
+       var js_elements = document.getElementsByTagName("script");
+       for(var i=0; i < js_elements.length; i++){
                //check for normal mv_embed.js and or script loader
-               var src = js_elements[i].getAttribute("src");           
-               if( src ){                      
-                       if( src.indexOf('mv_embed.js') !=-1 || (  
+               var src = js_elements[i].getAttribute("src");
+               if( src ){
+                       if( src.indexOf('mv_embed.js') !=-1 || (
                                ( src.indexOf('mwScriptLoader.php') != -1 || src.indexOf('jsScriptLoader.php') != -1 )
-                                       && src.indexOf('mv_embed') != -1) ){ //(check for class=mv_embed script_loader call)                                                                                            
+                                       && src.indexOf('mv_embed') != -1) ){ //(check for class=mv_embed script_loader call)
                                _global['mv_embed_url'] = src;
-                               return  src;            
+                               return  src;
                        }
                }
        }
        js_error('Error: getMvEmbedURL failed to get Embed Path');
        return false;
 }
-//gets a unique request id to ensure fresh javascript 
+//gets a unique request id to ensure fresh javascript
 function getMvUniqueReqId(){
-       if( _global['urid'] ) 
-               return _global['urid'];         
-       var mv_embed_url = getMvEmbedURL();             
-       //if we have a uri retun that: 
+       if( _global['urid'] )
+               return _global['urid'];
+       var mv_embed_url = getMvEmbedURL();
+       //if we have a uri retun that:
        var urid = parseUri( mv_embed_url).queryKey['urid']
        if( urid ){
                _global['urid'] = urid;
                return urid;
        }
-       //if in debug mode get a fresh unique request key: 
+       //if in debug mode get a fresh unique request key:
        if(  parseUri( mv_embed_url ).queryKey['debug'] == 'true'){
                var d = new Date();
                var urid = d.getTime();
@@ -1319,10 +1318,10 @@ function getMvUniqueReqId(){
 /*
  * sets the global mv_embed path based on the scripts location
  */
-function getMvEmbedPath(){             
+function getMvEmbedPath(){
        if( _global['mv_embed_path'])
                return _global['mv_embed_path'];
-       var mv_embed_url = getMvEmbedURL();                             
+       var mv_embed_url = getMvEmbedURL();
        if( mv_embed_url.indexOf('mv_embed.js') !== -1 ){
                mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mv_embed.js'));
        }else if(mv_embed_url.indexOf('mwScriptLoader.php')!==-1){
@@ -1330,9 +1329,9 @@ function getMvEmbedPath(){
                mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('mwScriptLoader.php'))  + mediaWiki_mvEmbed_path ;
        }else{
                mv_embed_path = mv_embed_url.substr(0, mv_embed_url.indexOf('jsScriptLoader.php'));
-       }               
+       }
        //absolute the url (if relative) (if we don't have mv_embed path)
-       if( mv_embed_path.indexOf('://') == -1){        
+       if( mv_embed_path.indexOf('://') == -1){
                var pURL = parseUri( document.URL );
                if(mv_embed_path.charAt(0)=='/'){
                        mv_embed_path = pURL.protocol + '://' + pURL.authority + mv_embed_path;
@@ -1341,8 +1340,8 @@ function getMvEmbedPath(){
                        if(mv_embed_path==''){
                                mv_embed_path = pURL.protocol + '://' + pURL.authority + pURL.directory + mv_embed_path;
                        }
-               }               
-       }       
+               }
+       }
        _global['mv_embed_path'] = mv_embed_path;
        return mv_embed_path;
 }
@@ -1371,20 +1370,20 @@ if (typeof DOMParser == "undefined") {
 */
 function js_log(string){
   if( window.console ){
-          window.console.log(string);          
+          window.console.log(string);
   }else{
         /*
          * IE and non-firebug debug:
          */
         /*var log_elm = document.getElementById('mv_js_log');
         if(!log_elm){
-                document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML + 
+                document.getElementsByTagName("body")[0].innerHTML = document.getElementsByTagName("body")[0].innerHTML +
                                         '<div style="position:absolute;z-index:500;top:0px;left:0px;right:0px;height:10px;">'+
                                                 '<textarea id="mv_js_log" cols="120" rows="5"></textarea>'+
                                         '</div>';
-                                 
+
                 var log_elm = document.getElementById('mv_js_log');
-        }       
+        }
         if(log_elm){
                 log_elm.value+=string+"\n";
         }*/
@@ -1393,7 +1392,7 @@ function js_log(string){
 }
 
 function checkDefaultMwConfig(){
-       for(var i in defaultMwConfig){            
+       for(var i in defaultMwConfig){
             if(typeof(mwConfig[i])=='undefined'){
                  mwConfig[i] =defaultMwConfig[i];
             }
index 07a6faf..e96b2c5 100644 (file)
@@ -23,8 +23,7 @@ $messages['en'] = array(
        'upload-in-progress' => 'Upload in progress (do not close this window)',
        'upload-transcoded-status' => 'Transcoded',
        'uploaded-status' => 'Uploaded',
-       'wgfogg_wrong_version' => 'You have Firefogg installed but it is outdated.
-<a href="http://firefogg.org">Please upgrade</a> ',
+       'wgfogg_wrong_version' => 'You have Firefogg installed but it is outdated. <a href="http://firefogg.org">Please upgrade</a>.',
        'upload-stats-fileprogres' => '$1 of $2',
        'mv_upload_completed' => 'Your upload is complete',
        'mv_upload_done' => '<a href="$1">Your upload <i>should be</i> accessible</a>.',
@@ -36,8 +35,7 @@ $messages['en'] = array(
        'unknown-error' => 'Unknown error:',
        'return-to-form' => 'Return to form',
        'file-exists-duplicate' => 'This file is a duplicate of the following file:',
-       'fileexists' => 'A file with this name exists already.
-Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
+       'fileexists' => 'A file with this name exists already. Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
        'fileexists-thumb' => '<center><b>Existing file</b></center>',
        'ignorewarning' => 'Ignore warning and save file anyway',
        'file-thumbnail-no' => 'The filename begins with <b><tt>$1</tt></b>',
@@ -67,8 +65,7 @@ Please check <b><tt>$1</tt></b> if you are not sure if you want to change it.',
        /*
         * js file: /libAddMedia/searchLibs/baseRemoteSearch.js
         */
-       'imported_from' => '$1 imported from [$2 $3].
-See the original [$4 resource page] for more information.',
+       'imported_from' => '$1 imported from [$2 $3]. See the original [$4 resource page] for more information.',
 
        /*
         * js file: /libAddMedia/mvFirefogg.js
@@ -80,10 +77,8 @@ See the original [$4 resource page] for more information.',
        'fogg-check_for_fogg' => 'Checking for Firefogg <blink>...</blink>',
        'fogg-installed' => 'Firefogg is installed',
        'fogg-for_improved_uplods' => 'For improved uploads:',
-       'fogg-please_install' => '<a href="$1">Install Firefogg</a>.
-More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg</a>',
-       'fogg-use_latest_fox' => 'Please first install <a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg">Firefox 3.5</a> (or later).
-<i>Then revisit this page to install the <b>Firefogg</b> extention</i>.',
+       'fogg-please_install' => '<a href="$1">Install Firefogg</a>. More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg</a>',
+       'fogg-use_latest_fox' => 'Please first install <a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=firefogg">Firefox 3.5</a> (or later). <i>Then revisit this page to install the <b>Firefogg</b> extension.</i>',
        'fogg-passthrough_mode' => 'Your selected file is already Ogg or not a video file',
        'fogg-transcoding' => 'Encoding video to Ogg',
        'fogg-encoding-done' => 'Encoding complete',
@@ -108,9 +103,9 @@ More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg
        'mv_media_search' => 'Media search',
        'rsd_box_layout' => 'Box layout',
        'rsd_list_layout' => 'List layout',
-       'rsd_results_desc' => 'Results ',
-       'rsd_results_next' => 'next ',
-       'rsd_results_prev' => 'previous ',
+       'rsd_results_desc' => 'Results',
+       'rsd_results_next' => 'next',
+       'rsd_results_prev' => 'previous',
        'rsd_no_results' => 'No search results for <b>$1</b>',
        'upload_tab' => 'Upload',
        'rsd_layout' => 'Layout:',
@@ -125,12 +120,9 @@ More <a href="http://commons.wikimedia.org/wiki/Commons:Firefogg">about Firefogg
        'cc_sa_title' => 'Share Alike',
        'cc_pd_title' => 'Public Domain',
        'unknown_license' => 'Unknown license',
-       'no_import_by_url' => 'This user or wiki <b>can not</b> import assets from remote URLs.</p>
-<p>Do you need to login?</p>
-<p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href="http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads">more information</a>).</p>',
+       'no_import_by_url' => 'This user or wiki <b>can not</b> import assets from remote URLs.</p><p>Do you need to login?</p><p>If permissions are set, you may have to enable $wgAllowCopyUploads (<a href="http://www.mediawiki.org/wiki/Manual:$wgAllowCopyUploads">more information</a>).</p>',
        'results_from' => 'Results from <a href="$1" target="_new" >$2</a>',
-       'missing_desc_see_soruce' => 'This asset is missing a description.
-Please see the [$1 orginal source] and help describe it',
+       'missing_desc_see_soruce' => 'This asset is missing a description. Please see the [$1 orginal source] and help describe it.',
        'rsd_config_error' => 'Add media wizard configuration error: $1',
 
        /*
@@ -149,8 +141,7 @@ Please see the [$1 orginal source] and help describe it',
        'saving_wait' => 'Save in progress (please wait)',
        'save_done' => 'Save complete',
        'edit_cancel' => 'Cancel sequence edit',
-       'edit_cancel_confirm' => 'Are you sure you want to cancel your edit?
-Changes will be lost.',
+       'edit_cancel_confirm' => 'Are you sure you want to cancel your edit? Changes will be lost.',
        'zoom_in' => 'Zoom in',
        'zoom_out' => 'Zoom out',
        'cut_clip' => 'Cut clips',
@@ -161,13 +152,9 @@ Changes will be lost.',
        'rmclip' => 'Remove clip',
        'clip_in' => 'clip in',
        'clip_out' => 'clip out',
-       'mv_welcome_to_sequencer' => '<h3>Welcome to the sequencer demo</h3>
-Very <b>limited</b> functionality right now.
-Not much documentation yet either',
-       'no_selected_resource' => '<h3>No resource selected</h3>
-Select a clip to enable editing',
-       'error_edit_multiple' => '<h3>Multiple resources selected</h3>
-Select a single clip to edit it',
+       'mv_welcome_to_sequencer' => '<h3>Welcome to the sequencer demo</h3> Very <b>limited</b> functionality right now. Not much documentation yet either.',
+       'no_selected_resource' => '<h3>No resource selected</h3> Select a clip to enable editing.',
+       'error_edit_multiple' => '<h3>Multiple resources selected</h3> Select a single clip to edit it.',
        'mv_editor_options' => 'Editor options',
        'mv_editor_mode' => 'Editor mode',
        'mv_simple_editor_desc' => 'simple editor (iMovie style)',
@@ -183,18 +170,17 @@ Select a single clip to edit it',
        'transition_out' => 'Transition out',
        'effects' => 'Effects stack',
        'remove_transition' => 'Remove transition',
-       'edit_transin' => 'Edit Transition into clip',
-       'edit_transout' => 'Edit Transition out of clip',
+       'edit_transin' => 'Edit transition into clip',
+       'edit_transout' => 'Edit transition out of clip',
 
        /*
         * js file: /libEmbedVideo/embedVideo.js
         */
-       'loading_plugin' => 'loading plugin<blink>...</blink>',
+       'loading_plugin' => 'loading plugin <blink>...</blink>',
        'select_playback' => 'Set playback preference',
        'link_back' => 'Link back',
        'error_load_lib' => 'Error: mv_embed was unable to load required JavaScript libraries.
-Insert script via DOM has failed.
-Please try reloading this page.',
+Insert script via DOM has failed. Please try reloading this page.',
        'error_swap_vid' => 'Error: mv_embed was unable to swap the video tag for the mv_embed interface',
        'add_to_end_of_sequence' => 'Add to end of sequence',
        'missing_video_stream' => 'The video file for this stream is missing',
@@ -232,10 +218,8 @@ Please try reloading this page.',
        'mv_ogg-player-flowplayer' => 'Flowplayer',
        'mv_ogg-player-selected' => ' (selected)',
        'mv_ogg-player-omtkplayer' => 'OMTK Flash Vorbis',
-       'mv_generic_missing_plugin' => 'You browser does not appear to support the following playback type: <b>$1</b><br />
-Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playback Methods</a> page to download a player.<br />',
-       'mv_for_best_experience' => 'For a better video playback experience we recommend:<br />
-<b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed">Firefox 3.5</a></b>',
+       'mv_generic_missing_plugin' => 'You browser does not appear to support the following playback type: <b>$1</b><br />Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playback Methods</a> page to download a player.<br />',
+       'mv_for_best_experience' => 'For a better video playback experience we recommend:<br /><b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mwEmbed">Firefox 3.5</a>.</b>',
        'mv_do_not_warn_again' => 'Dissmiss for now.',
        'players' => 'Players',
 
@@ -274,3 +258,4 @@ Visit the <a href="http://commons.wikimedia.org/wiki/Commons:Media_help">Playbac
        'size-kilobytes' => '$1 K',
        'size-bytes' => '$1 B',
 );
\ No newline at end of file