'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
_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',
$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
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('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:45px;right:0px" title="' + gM('add_media_wizard') + '" ></div>');
+ $j('body').append('<div id="rsd_modal_target" style="position:absolute;top:30px;left:0px;bottom:45px;right:0px;" title="' + gM('add_media_wizard') + '" ></div>');
_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({
},
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
});
//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;
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;
}
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;
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;
var cat = rObj;
//return the html type:
if(rObj.mime.indexOf('image')!=-1){
- return '<img ' + id_attr + ' src="' + rObj.edit_url + '"' + style_attr + ' >';
+ //if crop is null do base output:
+ var imgHtml = '<img ' + id_attr + ' src="' + rObj.edit_url + '"' + style_attr + ' >';
+ if( rObj.crop == null)
+ return imgHtml
+ //else do crop output:
+ return '<div style="width:' + rObj.crop.wpx +'">' +
+ '<div style="width:'+rObj.crop.w +'px;height: ' + rObj.crop.h +'px;overflow:hidden;position:relative">' +
+ '<div style="position:relative;top:-' + rObj.crop.y +'px;left:-' + rObj.crop.x +'px">'+
+ imgHtml +
+ '</div>';
}
var ahtml='';
if(rObj.mime == 'application/ogg' || rObj.mime == 'audio/ogg'){
if(rObj.mime.indexOf('audio/ogg')!=-1){
return '<audio ' + ahtml + '></audio>';
}
- }
+ }
js_log('ERROR:unsupored mime type: ' + rObj.mime);
},
getInlineDescWiki:function( rObj ){
"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 <b><a href=\"http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed\">Firefox 3.5</a></b>",
- "mv_do_not_warn_again": "Do not warn me again."
+ "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."
});
'default',
'lang'
);
+//set the dismissNativeWarn flag:
+_global['dismissNativeWarn'] = false;
/*
* Converts all occurrences of <video> tag into video object
*/
gM('mv_do_not_warn_again') +
'</div>');
$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');
}
},
'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 <b><a href="http://www.mozilla.com/en-US/firefox/upgrade.html?from=mv_embed">Firefox 3.5</a></b>',
- 'mv_do_not_warn_again' => 'Do not warn me again.',
+ '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.',
);
#</JAVASCRIPT EN REPLACE>
\ No newline at end of file