r61496 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61495‎ | r61496 | r61497 >
Date:18:50, 25 January 2010
Author:dale
Status:deferred
Tags:
Comment:
* fixed gadget check
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/remotes/mediaWiki.js
@@ -4,7 +4,7 @@
55 */
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
8 -var mwRemoteVersion = 'r81';
 8+var mwRemoteVersion = 'r82';
99 var mwUseScriptLoader = true;
1010
1111 //Log the mwRemote version ( will determin what version of js we get )
@@ -383,10 +383,16 @@
384384 function mwCheckForGadget(){
385385 mw.log('mwCheckForGadget');
386386 scripts = document.getElementsByTagName( 'script' );
 387+ // Check for document paramater withJS and ignore found gadget
 388+ var withJS = getParamValue("withJS");
 389+
387390 for( var i = 0 ; i < scripts.length ; i ++){
388 - if ( scripts[i].src &&
389 - scripts[i].src.indexOf( 'MediaWiki:Gadget-mwEmbed.js' ) !== -1){
390 - mw.log('gadget already installed');
 391+ if (
 392+ scripts[i].src
 393+ && scripts[i].src.indexOf( 'MediaWiki:Gadget-mwEmbed.js' ) !== -1
 394+ && !withJS
 395+ ){
 396+ mw.log('gadget already installed: ' + scripts[i].src);
391397 //gadget found / enabled
392398 return true;
393399 }
@@ -428,7 +434,7 @@
429435 $j('#firstHeading').before(
430436 $j('<div />')
431437 .css({
432 - 'margin': '5px'
 438+ 'margin': '10px'
433439 }).html(
434440 $gadgetBtn
435441 )

Status & tagging log