set local wiki to default in add media
authorMichael Dale <dale@users.mediawiki.org>
Sat, 25 Jul 2009 20:05:56 +0000 (20:05 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Sat, 25 Jul 2009 20:05:56 +0000 (20:05 +0000)
js2/mwEmbed/README
js2/mwEmbed/libAddMedia/mvFirefogg.js
js2/mwEmbed/libAddMedia/remoteSearchDriver.js
js2/mwEmbed/libEmbedVideo/embedVideo.js
js2/mwEmbed/mv_embed.js

index 8639659..e51ea57 100644 (file)
@@ -2,7 +2,8 @@
 *
 * mwEmbed version 1.2
 * for details see: http://www.mediawiki.org/wiki/MwEmbed
-* and this README
+* For an overview of all mwEmbed files see: 
+* http://www.mediawiki.org/wiki/MwEmbed
 *
 * All Metavid Wiki code is Released under the GPL2
 * for more info visit http:/metavid.ucsc.edu/code
index b8b10c3..6e690be 100644 (file)
@@ -10,7 +10,7 @@ loadGM({
        "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>. <i>then revisit this page to install the <b>firefogg</b> extention</i>",   
+       "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"
@@ -196,7 +196,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                        _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(){                   
+                   $j(this.target_input_file_name).unbind().attr('readonly', 'readonly').click(function(){                     
                        _this.selectFogg();
                    })          
                        
@@ -212,7 +212,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                }
                                return ;
                        }
-                       //if they have the right version of mozilla provide install link: 
+                       //they have the right version of mozilla provide install link: 
                        var os_link = false;
                        if(navigator.oscpu){
                                if(navigator.oscpu.search('Linux') >= 0)
@@ -224,7 +224,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                        }                                                                                       
                        //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',os_link )).css('padding', '10px').show();                      
+                       $j(_this.target_please_install).html( upMsg + gM('fogg-please_install',os_link )).css('padding', '10px').show();                        
                }
                //setup the target save local file bindins: 
                $j( _this.target_btn_save_local_file ).unbind().click(function(){
@@ -243,7 +243,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        //assume input target
        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();            
@@ -279,7 +279,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                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: 
@@ -292,9 +292,6 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                this.doControlBindings();
        },
        getEditForm:function(){
-               if( this.target_edit_from ){
-                       return this.pe_getEditForm();
-               }
                js_log('get form: action=' + $j(this.selector).parents().find("form").attr('action'));
                return $j(this.selector).parents().find("form").get(0);
        },   
@@ -407,7 +404,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        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: 
-               if(! this.fogg_enabled )
+               if(! this.fogg_enabled || !this.firefogg_form_action )
                        return this.pe_getProgressTitle();                                 
                if( !this.form_rewrite )
                  return gM('fogg-transcoding');
@@ -416,12 +413,12 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        },      
        doUploadSwitch:function(){                              
                var _this = this;
-               js_log( "firefogg: doUploadSwitch:: " + this.fogg_enabled );
+               js_log("firefogg: doUploadSwitch:: " + this.fogg_enabled);
                //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
@@ -431,7 +428,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                }               
        },
        //doChunkUpload does both uploading and encoding at the same time and uploads one meg chunks as they are ready
-       doChunkUpload : function(){             
+       doChunkUpload : function(){
                var _this = this;                       
                _this.action_done = false;                      
                
@@ -458,18 +455,17 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                        'comment'       : _this.formData['wpUploadDescription'],
                        'enablechunks': true
                };
-               
                //check for editToken:
-               if( !this.etoken )
+               if(!this.etoken)
                        this.etoken = _this.formData['wpEditToken'];
                        
-               if( this.etoken )
+               if(this.etoken)
                        aReq['token'] = this.etoken;
                
                if( _this.formData['wpWatchthis'] )
                        aReq['watch'] =  _this.formData['wpWatchthis'];
                
-               if( _this.formData['wpIgnoreWarning'] )
+               if(  _this.formData['wpIgnoreWarning'] )
                        aReq['ignorewarnings'] = _this.formData['wpIgnoreWarning'];
                
                js_log('do fogg upload/encode call: '+ _this.api_url + ' :: ' + JSON.stringify( aReq ) );                       
@@ -481,7 +477,6 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
        },
        //doEncode and monitor progress:
        doEncode : function(){  
-               js_log('firefogg:doEncode');
                var _this = this;
                _this.action_done = false;
                _this.dispProgressOverlay();                            
@@ -602,7 +597,7 @@ mvFirefogg.prototype = { //extends mvBaseUploadInterface
                                                   _this.updateProgressWin( gM('successfulupload'),  gM( 'mv_upload_done', _this.fogg.resultUrl),buttons);      
                                           }else{
                                                   //done state with error? ..not really possible given how firefogg works
-                                                  js_log(" upload done, in chunks mode, but no resultUrl::" + response_text);                                             
+                                                  js_log(" upload done, in chunks mode, but no resultUrl!");
                                           }                                                                                                                                                                                                               
                                   }                                                                                                    
                        }else{  
index 2ee256c..0825b21 100644 (file)
@@ -93,7 +93,7 @@ remoteSearchDriver.prototype = {
         * sets the default display item:
         * can be any content_providers key or 'all'
         */
-       disp_item : 'wiki_commons',
+       disp_item : 'this_wiki',
        /** the default content providers list. 
         *
         * (should be note that special tabs like "upload" and "combined" don't go into the content proviers list:
@@ -1131,7 +1131,7 @@ remoteSearchDriver.prototype = {
                        });
                }               
        },
-       checkRepoLocal:function( cp ){
+       checkRepoLocal:function( cp ){                          
                if( cp.local ){
                        return true;
                }else{
@@ -1145,8 +1145,7 @@ remoteSearchDriver.prototype = {
                                }
                        }
                        return false;
-               }
-       
+               }       
        },
        checkImportResource:function( rObj, cir_callback){      
                //@@todo get the localized File/Image namespace name or do a general {NS}:Title
index bf531b1..4939ab7 100644 (file)
@@ -114,15 +114,17 @@ 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. 
        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;
-               //set up the jQuery selector:                            
+               var loadPlaylistLib=false;                                              
                
                var eAction = function(this_elm){
                        js_log( "Do SWAP: " + $j(this_elm).attr("id") + ' tag: '+ this_elm.tagName.toLowerCase() );
@@ -276,7 +278,7 @@ var ctrlBuilder = {
        getControls:function( embedObj ){       
                js_log('f:controlsBuilder:: opt:' + this.options);              
                this.id = (embedObj.pc)?embedObj.pc.pp.id:embedObj.id;
-               this.avaliable_width=embedObj.playerPixelWidth();
+               this.available_width = embedObj.playerPixelWidth();
                //make pointer to the embedObj
                this.embedObj =embedObj;
                var _this = this;               
@@ -297,14 +299,14 @@ var ctrlBuilder = {
                var o='';       
                for( var i in this.components ){
                        if( this.supports[i] ){
-                               if( this.avaliable_width > this.components[i].w ){
+                               if( this.available_width > this.components[i].w ){
                                        //special case with playhead don't add unless we have 60px
-                                       if( i=='play_head' && ctrlBuilder.avaliable_width < 60 )
+                                       if( i == 'play_head' && ctrlBuilder.available_width < 60 )
                                                continue;                                               
                                        o+=this.components[i].o();
-                                       this.avaliable_width -= this.components[i].w;
+                                       this.available_width -= this.components[i].w;
                                }else{
-                                       js_log('not enough space for control component:'+i);
+                                       js_log('not enough space for control component:' + i);
                                }
                        }
                }               
@@ -581,7 +583,7 @@ var ctrlBuilder = {
                'play_head':{
                        'w':0, //special case (takes up remaining space) 
                        'o':function(){
-                               return '<div class="play_head" id="mv_play_head_'+ctrlBuilder.id+'" style="width: ' + (ctrlBuilder.avaliable_width - 30) + 'px;"></div>';
+                               return '<div class="play_head" id="mv_play_head_' + ctrlBuilder.id + '" style="width: ' + ( ctrlBuilder.available_width - 30 ) + 'px;"></div>';
                        }
                }                                                                               
        }       
index 4cec244..b321baf 100644 (file)
@@ -73,7 +73,8 @@ var mv_default_thumb_url = mv_skin_img_path + 'vid_default_thumb.jpg';
 
 //init the global Msg if not already
 if(!gMsg){var gMsg={};}
-//laguage loader:
+
+//laguage msg loader:
 function loadGM( msgSet ){
        for(var i in msgSet){
                gMsg[ i ] = msgSet[i];
@@ -98,7 +99,7 @@ loadGM({
  * @path the path to the file (or set of files) with ending slash
  * @gClasses the set of classes 
  *             if an array $j.className become jquery.className.js
- *             if an asssociative objec then key => value paris are used
+ *             if an asssociative object then key => value paris are used
  */
 if(typeof mvClassPaths == 'undefined')
        mvClassPaths = {};
@@ -112,7 +113,7 @@ function lcPaths( path, gClasses , opt){
                path = '';      
        if(gClasses.length){
                //do array loop: 
-               for(var i=0; i<gClasses.length; i++){
+               for(var i=0; i < gClasses.length; i++){
                        if(typeof gClasses[i] != 'undefined'){
                                //setup normal replacement of j with jquery                     
                                var jsName = ( gClasses[i].substr(0,3) == '$j.' ) ? opt['j_replace'] + gClasses[i].substr(3) : gClasses[i];                                                     
@@ -125,8 +126,7 @@ function lcPaths( path, gClasses , opt){
                        //assume object with key:path:
                        mvClassPaths[i] = path + gClasses[ i ];
                }
-       }
-       var cat = mvClassPaths; 
+       }               
 }
 function mvGetClassPath(k){            
        if( mvClassPaths[k] ){
@@ -757,8 +757,7 @@ function mv_remove_modal(speed){
  */  
 function mv_jqueryBindings(){
        js_log('mv_jqueryBindings');    
-       (function($) {
-               
+       (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'));