Remove browser checks and use MediaWiki browser policy
We had a browser check to blacklist all browsers older than IE 8 IE <= 7 But that is no longer required since JS support is not there for such browsers as per https://www.mediawiki.org/wiki/Compatibility#Modern We can support all modern browsers listed there and we don't need additional blacklisting now. From 1.27 onwards, there is no JS loaded for IE 8 too. So we can just use MW browser support policy. In this commit, the code to do brower checks removed and simplified the initialization code. Still I am not happy with the interface module, that need further refactoring. Change-Id: I655826c55fb2c7c5c88f16368110142d64a96eec
This commit is contained in:
@@ -183,40 +183,4 @@
|
||||
return unique;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks whether the browser is supported.
|
||||
* Browser support policy: http://www.mediawiki.org/wiki/Browser_support#Grade_A
|
||||
*
|
||||
* @return {boolean}
|
||||
*/
|
||||
function isBrowserSupported() {
|
||||
var blacklist = {
|
||||
msie: [
|
||||
[ '<=', 7 ]
|
||||
]
|
||||
};
|
||||
|
||||
return !$.client.test( blacklist, null, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize ULS front-end if browser is supported.
|
||||
*
|
||||
* @param {Function} callback callback function to be called after initialization.
|
||||
*/
|
||||
mw.uls.init = function ( callback ) {
|
||||
if ( !isBrowserSupported() ) {
|
||||
$( '#pt-uls' ).hide();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( callback ) {
|
||||
callback.call( this );
|
||||
}
|
||||
};
|
||||
|
||||
$( document ).ready( function () {
|
||||
mw.uls.init();
|
||||
} );
|
||||
}( jQuery, mediaWiki ) );
|
||||
|
||||
Reference in New Issue
Block a user