dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix order of @var parameter in PHP"
[lhc/web/wiklou.git]
/
resources
/
src
/
startup
/
startup.js
diff --git
a/resources/src/startup/startup.js
b/resources/src/startup/startup.js
index
5483ad2
..
240757c
100644
(file)
--- a/
resources/src/startup/startup.js
+++ b/
resources/src/startup/startup.js
@@
-44,11
+44,11
@@
*
* Other browsers that pass the check are considered Grade X.
*
*
* Other browsers that pass the check are considered Grade X.
*
- * @param {string} [str] User agent, defaults to navigator.userAgent
+ * @private
+ * @param {string} ua User agent string
* @return {boolean} User agent is compatible with MediaWiki JS
*/
* @return {boolean} User agent is compatible with MediaWiki JS
*/
-function isCompatible( str ) {
- var ua = str || navigator.userAgent;
+function isCompatible( ua ) {
return !!(
// https://caniuse.com/#feat=es5
// https://caniuse.com/#feat=use-strict
return !!(
// https://caniuse.com/#feat=es5
// https://caniuse.com/#feat=use-strict
@@
-76,7
+76,7
@@
function isCompatible( str ) {
);
}
);
}
-if ( !isCompatible() ) {
+if ( !isCompatible(
navigator.userAgent
) ) {
// Handle Grade C
// Undo speculative Grade A <html> class. See ResourceLoaderClientHtml::getDocumentAttributes().
document.documentElement.className = document.documentElement.className
// Handle Grade C
// Undo speculative Grade A <html> class. See ResourceLoaderClientHtml::getDocumentAttributes().
document.documentElement.className = document.documentElement.className
@@
-118,9
+118,10
@@
if ( !isCompatible() ) {
mw.config.set( $VARS.configuration );
// Process callbacks for Grade A
mw.config.set( $VARS.configuration );
// Process callbacks for Grade A
- // Must be after registrations and mw.config.set, which mw.loader depends on.
var queue = window.RLQ;
var queue = window.RLQ;
- // Redefine push(), but keep type as array for storing callbacks that require modules.
+ // Replace RLQ placeholder from ResourceLoaderClientHtml with an implementation
+ // that executes simple callbacks, but continues to store callbacks that require
+ // modules.
window.RLQ = [];
/* global RLQ */
RLQ.push = function ( fn ) {
window.RLQ = [];
/* global RLQ */
RLQ.push = function ( fn ) {
@@
-132,7
+133,7
@@
if ( !isCompatible() ) {
}
};
while ( queue && queue[ 0 ] ) {
}
};
while ( queue && queue[ 0 ] ) {
- // Re-use our
push()
+ // Re-use our
new push() method
RLQ.push( queue.shift() );
}
RLQ.push( queue.shift() );
}