r48941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48940‎ | r48941 | r48942 >
Date:22:49, 27 March 2009
Author:dale
Status:deferred
Tags:
Comment:
fixes for easy gadget copy-config (without an extra js request)
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/add_media_wizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/add_media_wizard.js
@@ -7,8 +7,12 @@
88 var wg_local_wiki_api_url = wgServer + wgScriptPath + '/api.php';
99
1010 //if mv_embed is hosted somewhere other than near by the add_media_wizard you can define it here:
11 -var mv_add_media_wizard_path = 'http://mvbox2.cse.ucsc.edu/w/extensions/MetavidWiki/skins/';
 11+var force_mv_add_media_wizard_path=false;
 12+//var force_mv_add_media_wizard_path = 'http://metavid.org/w/extensions/MetavidWiki/skins/';
1213
 14+var force_mv_embed_path = false;
 15+//var force_mv_embed_path = 'http://metavid.org/w/extensions/MetavidWiki/skins/mv_embed/mvwScriptLoader.php?class=mv_embed';
 16+
1317 var MV_EMBED_VIDEO_HANDLER = true; // if we should use mv_embed for all ogg_hanlder video embeds.
1418
1519 if( MV_EMBED_VIDEO_HANDLER ){
@@ -148,7 +152,11 @@
149153 //inject mv_embed if needed:
150154 if( typeof mvEmbed == 'undefined'){
151155 //get mv_embed path from _this_ file location:
152 - var mv_embed_url = getAddMediaPath( 'mv_embed/mv_embed.js' );
 156+ if( force_mv_embed_path ){
 157+ var mv_embed_url = force_mv_embed_path;
 158+ }else{
 159+ var mv_embed_url = getAddMediaPath( 'mv_embed/mv_embed.js' );
 160+ }
153161 var e = document.createElement("script");
154162 e.setAttribute('src', mv_embed_url);
155163 e.setAttribute('type',"text/javascript");
@@ -169,15 +177,16 @@
170178 function getAddMediaPath( replace_str ){
171179 if(!replace_str)
172180 replace_str = '';
 181+ if( force_mv_add_media_wizard_path )
 182+ return force_mv_add_media_wizard_path + replace_str;
 183+
173184 for(var i=0; i < document.getElementsByTagName('script').length; i++){
174185 var s = document.getElementsByTagName('script')[i];
175186 if( s.src.indexOf('add_media_wizard.js') != -1 ){
176187 //use the external_media_wizard path:
177188 return s.src.replace('add_media_wizard.js', replace_str);
178189 }
179 - }
180 - js_log('return default path: ' + mv_add_media_wizard_path + replace_str);
181 - return mv_add_media_wizard_path + replace_str;
 190+ }
182191 }
183192
184193

Status & tagging log