X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki%2Fmediawiki.js;h=65488960935b549b40e5d5d3959628a8c1a735ea;hb=67e70a2650ef1e90651c1478bf82270a9162ba66;hp=ec3c0c3a2534930dc56ed61ad2ae76b35c823a9a;hpb=f5cda3a9e00bec26227f4d40de6b3d737ef3c534;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index ec3c0c3a25..6548896093 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -595,7 +595,6 @@ /** * Write a message the console's warning channel. - * Also logs a stacktrace for easier debugging. * Actions not supported by the browser console are silently ignored. * * @param {string...} msg Messages to output to console @@ -604,9 +603,6 @@ var console = window.console; if ( console && console.warn && console.warn.apply ) { console.warn.apply( console, arguments ); - if ( console.trace ) { - console.trace(); - } } }; @@ -823,6 +819,14 @@ function addEmbeddedCSS( cssText, callback ) { var $style, styleEl; + function fireCallbacks() { + var oldCallbacks = cssCallbacks; + // Reset cssCallbacks variable so it's not polluted by any calls to + // addEmbeddedCSS() from one of the callbacks (T105973) + cssCallbacks = $.Callbacks(); + oldCallbacks.fire().empty(); + } + if ( callback ) { cssCallbacks.add( callback ); } @@ -888,14 +892,14 @@ } else { styleEl.appendChild( document.createTextNode( cssText ) ); } - cssCallbacks.fire().empty(); + fireCallbacks(); return; } } $( newStyleTag( cssText, getMarker() ) ).data( 'ResourceLoaderDynamicStyleTag', true ); - cssCallbacks.fire().empty(); + fireCallbacks(); } /** @@ -1107,39 +1111,24 @@ } /** - * Adds a script tag to the DOM, either using document.write or low-level DOM manipulation, - * depending on whether document-ready has occurred yet and whether we are in async mode. + * Load and execute a script with callback. * * @private * @param {string} src URL to script, will be used as the src attribute in the script tag * @param {Function} [callback] Callback which will be run when the script is done - * @param {boolean} [async=false] Whether to load modules asynchronously. - * Ignored (and defaulted to `true`) if the document-ready event has already occurred. */ - function addScript( src, callback, async ) { - // Using isReady directly instead of storing it locally from a $().ready callback (bug 31895) - if ( $.isReady || async ) { - $.ajax( { - url: src, - dataType: 'script', - // Force jQuery behaviour to be for crossDomain. Otherwise jQuery would use - // XHR for a same domain request instead of