r79918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79917‎ | r79918 | r79919 >
Date:22:08, 9 January 2011
Author:dale
Status:deferred
Tags:
Comment:
fixed minor layout issue of AMW
removed non-resource loader path for mediaWiki remote
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -906,9 +906,6 @@
907907
908908 this.$resultsContainer = $j('<div />').attr({
909909 id : "rsd_results_container"
910 - }).css({
911 - 'position' : 'relative',
912 - 'bottom' : '30px'
913910 });
914911
915912 $mainContainer.append( this.$filtersContainer );
Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -5,7 +5,6 @@
66 var urlparts = getRemoteEmbedPath();
77 var mwEmbedHostPath = urlparts[0];
88 var mwRemoteVersion = 'r183';
9 -var mwUseScriptLoader = true;
109
1110 // Log the mwRemote version makes it easy to debug cache issues
1211 if( window.console ){
@@ -34,13 +33,8 @@
3534 if( document.URL.indexOf( 'embedplayer=yes' ) !== -1 ){
3635 mwReqParam['embedplayer'] = 'yes';
3736 }
38 -// Check if debug mode and disable script grouping
39 -if( mwReqParam['debug'] ) {
40 - mwUseScriptLoader = false;
41 -}
4237
4338 mwReqParam['debug'] = true;
44 -mwUseScriptLoader = true;
4539
4640 // Setup up some globals to wrap mwEmbed mw.ready and mw.setConfig functions
4741
@@ -135,7 +129,7 @@
136130 }
137131 window.ranMwRewrites = true;
138132
139 - // Add media wizard ( only if not on a sequence page
 133+ // Add media wizard
140134 if ( wgAction == 'edit' || wgAction == 'submit' ) {
141135 if( wgPageName.indexOf( "Sequence:" ) != 0 ){
142136 // Add a timeout to give a chance for wikieditor to build out.
@@ -668,63 +662,51 @@
669663 }
670664 var doLoadMwEmbed = function(){
671665 // Inject mwEmbed
672 - if ( mwUseScriptLoader ) {
673 - var rurl = mwEmbedHostPath + '/ResourceLoader.php?class=';
674 -
675 - var coma = '';
676 -
677 -
678 - // Add jQuery too if we need it:
679 - if ( typeof window.jQuery == 'undefined'
680 - ||
681 - // force load jquery if version 1.3.2 ( issues with '1.3.2' .data handling )
682 - jQuery.fn.jquery == '1.3.2')
683 - {
684 - rurl += 'window.jQuery';
685 - coma = ',';
686 - }
687 - // Add Core mwEmbed lib ( if not already defined )
688 - if( typeof MW_EMBED_VERSION == 'undefined' ){
689 - rurl += coma + 'mwEmbed,mw.style.mwCommon';
690 - coma = ',';
691 - }
692 -
693 - // Add requested classSet to scriptLoader request
694 - for( var i=0; i < classSet.length; i++ ){
695 - var cName = classSet[i];
696 - // always include our version of the library ( too many crazy conflicts with old library versions )
697 - rurl += ',' + cName;
698 - }
699 -
700 - // Add the remaining arguments
701 - rurl += '&' + mwGetReqArgs();
702 - $j.getScript( rurl, callback);
703 - } else {
704 -
705 - // Force load jQuery for debug mode
706 - var jQueryRequested = false;
707 - $j.getScript(mwEmbedHostPath + '/libraries/jquery/jquery-1.4.2.js?' + mwGetReqArgs(), function(){
708 - // load mwEmbed js
709 - $j.getScript( mwEmbedHostPath + '/ResourceLoader.php?class=window.jQuery,mwEmbed&&' + mwGetReqArgs(), function(){
710 - // Load the class set as part of mwReady callback
711 - mw.load( classSet, function(){
712 - callback();
713 - });
714 - });
715 - });
 666+ var rurl = mwEmbedHostPath + '/ResourceLoader.php?class=';
 667+
 668+ var coma = '';
 669+ // Add jQuery too if we need it:
 670+ if ( typeof window.jQuery == 'undefined'
 671+ ||
 672+ // force load jquery if version 1.3.2 ( issues with '1.3.2' .data handling )
 673+ jQuery.fn.jquery == '1.3.2')
 674+ {
 675+ rurl += 'window.jQuery';
 676+ coma = ',';
716677 }
 678+ // Add Core mwEmbed lib ( if not already defined )
 679+ if( typeof MW_EMBED_VERSION == 'undefined' ){
 680+ rurl += coma + 'mwEmbed,mw.style.mwCommon';
 681+ coma = ',';
 682+ }
 683+
 684+ // Add requested classSet to scriptLoader request
 685+ for( var i=0; i < classSet.length; i++ ){
 686+ var cName = classSet[i];
 687+ // always include our version of the library ( too many crazy conflicts with old library versions )
 688+ rurl += ',' + cName;
 689+ }
 690+
 691+ // Add the remaining arguments
 692+ rurl += '&' + mwGetReqArgs();
 693+ $j.getScript( rurl, callback);
717694 };
718695
719696 // Wait for jQuery ui to be loaded ( so that we can override it )
720697 // Usability loads jqueryUI asynchronously. We need a to wait until its defined
721698 // so that we can override it. )
722699 // if not defined after 1 second assume it is not going to be loaded
 700+ var waitjQueryUiCount = 0;
723701 var waitForJqueryUi = function(){
 702+ if( waitjQueryUiCount == 200 ){ // 2 seconds
 703+ doLoadMwEmbed();
 704+ }
724705 if( !window.jQuery.ui ){
725706 setTimeout( waitForJqueryUi, 10);
726707 } else {
727708 doLoadMwEmbed();
728709 }
 710+ waitjQueryUiCount++;
729711 };
730712 waitForJqueryUi();
731713 }

Status & tagging log