From: Michael Dale Date: Mon, 3 Aug 2009 08:02:07 +0000 (+0000) Subject: * missing api_url removes tab from add-media-wizard X-Git-Tag: 1.31.0-rc.0~40549 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=f68c32d002fe08f545df9a5fc4716c4b22a353e1;p=lhc%2Fweb%2Fwiklou.git * missing api_url removes tab from add-media-wizard * support crop output to html * language updates * multiple use of add-media css clean up --- diff --git a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js index 45ef3daf5c..5ba1e56a03 100644 --- a/js2/mwEmbed/libAddMedia/remoteSearchDriver.js +++ b/js2/mwEmbed/libAddMedia/remoteSearchDriver.js @@ -129,7 +129,7 @@ remoteSearchDriver.prototype = { 'checked': 1, 'title' : 'This Wiki', 'desc' : '(should be updated with the proper text) maybe import from some config value', - 'api_url': wgServer + wgScriptPath + '/api.php', + 'api_url': ( wgServer && wgScriptPath )? wgServer + wgScriptPath+ '/api.php': null, 'lib' : 'mediaWiki', 'local' : true, 'tab_img': false @@ -321,14 +321,26 @@ remoteSearchDriver.prototype = { _this.getTexboxSelection(); //set up the content provider config: - if(this.cpconfig){ + 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]; } } + } + + //make sure the selected cp has an api to query against: + if(! this.content_providers[ this.disp_item ].api_url ){ + for(var inx in this.content_providers){ + if( this.content_providers[ inx ].api_url ){ + this.disp_item = inx; + break; + } + } } + + //set up the default model config: this.dmodalCss = { 'width':'auto', @@ -362,10 +374,10 @@ remoteSearchDriver.prototype = { $j(this.target_invocation).unbind().click(function(){ js_log("re-open"); //update the base text: - if(_this.target_textbox) + if( _this.target_textbox ) _this.getTexboxSelection(); - - $j(_this.target_container).dialog('open').parent('.ui-dialog').css( _this.dmodalCss ); + //$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 @@ -414,10 +426,10 @@ remoteSearchDriver.prototype = { var _this = this; //add the parent target_container if not provided or missing if(!_this.target_container || $j(_this.target_container).length==0){ - $j('body').append('
'); + $j('body').append('
'); _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')); + //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(); $j(_this.target_container).dialog({ @@ -431,6 +443,7 @@ remoteSearchDriver.prototype = { }, close: function() { js_log('closed modal'); + $j(this).parents('.ui-dialog').fadeOut('slow'); } }).css({'height':'100%'}).parent('.ui-dialog').css( _this.dmodalCss ) //@@bind on resize to disable css dialog to update dmodelCss @@ -452,7 +465,8 @@ remoteSearchDriver.prototype = { }); //re add cancel button _this.cancelClipEditCB(); - js_log('done setup of target_container: ' + $j(_this.target_container +'~ .ui-dialog-buttonpane').length); + js_log('done setup of target_container: ' + + $j(_this.target_container +'~ .ui-dialog-buttonpane').length); /*var resizeTimer = false; @@ -564,7 +578,7 @@ remoteSearchDriver.prototype = { js_log("f:runSearch::" + this.disp_item); //draw_direct_flag var draw_direct_flag = true; - if(!this.content_providers[this.disp_item]) { + if( !this.content_providers[this.disp_item] ){ js_log("can't run search for:" + this.disp_item); return false; } @@ -755,7 +769,7 @@ remoteSearchDriver.prototype = { var tabc = ''; for(var cp_id in this.content_providers){ var cp = this.content_providers[cp_id]; - if( cp.enabled && cp.checked){ + if( cp.enabled && cp.checked && cp.api_url){ //add selected default if set if( this.disp_item == cp_id) selected_tab=inx; @@ -1545,7 +1559,8 @@ remoteSearchDriver.prototype = { js_log("close all"); $j('#rsd_resource_preview').remove(); $j('#rsd_resource_edit').remove(); - $j(_this.target_container).dialog('close'); + //$j(_this.target_container).dialog('close'); + $j(_this.target_container).hide(); }, setResultBarControl:function( ){ var _this = this; diff --git a/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js b/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js index 1f08af31ab..5a26fe5cf7 100644 --- a/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js +++ b/js2/mwEmbed/libAddMedia/searchLibs/mediaWikiSearch.js @@ -215,7 +215,16 @@ mediaWikiSearch.prototype = { var cat = rObj; //return the html type: if(rObj.mime.indexOf('image')!=-1){ - return ''; + //if crop is null do base output: + var imgHtml = ''; + if( rObj.crop == null) + return imgHtml + //else do crop output: + return '
' + + '
' + + '
'+ + imgHtml + + '
'; } var ahtml=''; if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg'){ @@ -230,7 +239,7 @@ mediaWikiSearch.prototype = { if(rObj.mime.indexOf('audio/ogg')!=-1){ return ''; } - } + } js_log('ERROR:unsupored mime type: ' + rObj.mime); }, getInlineDescWiki:function( rObj ){ diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index 32c08f38ec..3fdb0e0cc8 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -47,8 +47,8 @@ loadGM({ "mv_ogg-player-omtkplayer" : "OMTK Flash Vorbis", "mv_generic_missing_plugin" : "You browser does not appear to support playback type: $1
visit the Playback Methods page to download a player
", - "mv_for_best_experience": "For a better video playback experience we recommend Firefox 3.5", - "mv_do_not_warn_again": "Do not warn me again." + "mv_for_best_experience": "For a better video playback experience we recommend:
Firefox 3.5", + "mv_do_not_warn_again": "Dissmiss for now." }); @@ -107,6 +107,8 @@ var mv_default_source_attr= new Array( 'default', 'lang' ); +//set the dismissNativeWarn flag: +_global['dismissNativeWarn'] = false; /* * Converts all occurrences of
'); $j('#ffwarn_'+embedObj.id).click(function(){ - if( $j(this).checked ){ - $j.cookie('dismissNativeWarn', true); + if( $j(this).is(':checked') ){ + //set up a cookie for 7 days: + $j.cookie('dismissNativeWarn', true, { expires: 5 }); + //set the current instance + _global['dismissNativeWarn'] = true; + $j('#gnp_' + embedObj.id).fadeOut('slow'); }else{ + _global['adismissNativeWarn'] = false; $j.cookie('dismissNativeWarn', false); } }); - } - if( $j.cookie('dismissNativeWarn')!== true){ + } + if( ($j.cookie('dismissNativeWarn') !== true) && + _global['dismissNativeWarn'] === false ){ $j('#gnp_' + embedObj.id).fadeIn('slow'); } }, diff --git a/js2/mwEmbed/mv_embed.js b/js2/mwEmbed/mv_embed.js index dc96783349..e86cf8a642 100644 --- a/js2/mwEmbed/mv_embed.js +++ b/js2/mwEmbed/mv_embed.js @@ -58,7 +58,7 @@ var parseUri=function(d){var o=parseUri.options,value=o.parser[o.strictMode?"str if( !mv_embed_path ){ var mv_embed_path = getMvEmbedPath(); } -jQueryUiVN = 'jquery.ui-1.7.1'; +var jQueryUiVN = 'jquery.ui-1.7.1'; //setup the skin path: diff --git a/js2/mwEmbed/php/languages/mwEmbed.i18n.php b/js2/mwEmbed/php/languages/mwEmbed.i18n.php index e140a00cfd..8d60fdfaab 100644 --- a/js2/mwEmbed/php/languages/mwEmbed.i18n.php +++ b/js2/mwEmbed/php/languages/mwEmbed.i18n.php @@ -223,7 +223,7 @@ $messages['en'] = array( '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: $1
visit the Playback Methods page to download a player
', - 'mv_for_best_experience' => 'For a better video playback experience we recommend Firefox 3.5', - 'mv_do_not_warn_again' => 'Do not warn me again.', + 'mv_for_best_experience' => 'For a better video playback experience we recommend:
Firefox 3.5', + 'mv_do_not_warn_again' => 'Dissmiss for now.', ); # \ No newline at end of file