From: Michael Dale Date: Sat, 25 Jul 2009 20:05:56 +0000 (+0000) Subject: set local wiki to default in add media X-Git-Tag: 1.31.0-rc.0~40719 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=08247d8b928436cfeaef283aabfb0a2346494729;p=lhc%2Fweb%2Fwiklou.git set local wiki to default in add media --- diff --git a/js2/mwEmbed/README b/js2/mwEmbed/README index 8639659e3d..e51ea577a1 100644 --- a/js2/mwEmbed/README +++ b/js2/mwEmbed/README @@ -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 diff --git a/js2/mwEmbed/libAddMedia/mvFirefogg.js b/js2/mwEmbed/libAddMedia/mvFirefogg.js index b8b10c373e..6e690be1de 100644 --- a/js2/mwEmbed/libAddMedia/mvFirefogg.js +++ b/js2/mwEmbed/libAddMedia/mvFirefogg.js @@ -10,7 +10,7 @@ loadGM({ "fogg-installed" : "Firefogg is Installed", "fogg-for_improved_uplods" : "For Improved uploads: ", "fogg-please_install" : "Install Firefogg. More about firefogg", - "fogg-use_latest_fox" : "Please first install Firefox 3.5. then revisit this page to install the firefogg extention", + "fogg-use_latest_fox" : "Please first install Firefox 3.5 (or later). then revisit this page to install the firefogg extention", "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+= '/>'; 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{ diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 2ee256c621..0825b21dbf 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -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 diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index bf531b1f4e..4939ab750f 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -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 '
'; + return '
'; } } } diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index 4cec2440e9..b321baf9d8 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -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