Blacklist old browsers

Blacklist browsers not supporting boxModel

Change-Id: I19bd7e3dbaec2454d8512e5d6f394c21fb6ce5cd
This commit is contained in:
Santhosh Thottingal
2013-06-01 17:22:42 +05:30
committed by Amir E. Aharoni
parent 2a6cb597f5
commit d1988bb3c7
2 changed files with 20 additions and 1 deletions

View File

@@ -106,6 +106,18 @@
return unique; return unique;
}; };
/**
* Checks whether the browser is supported.
* Browse support policy: http://www.mediawiki.org/wiki/Browser_support#Grade_A
* @return boolean
*/
mw.uls.isBrowserSupported = function () {
// boxModel is not supported in IE versions under 8.
// We are checking for boxModel here because without that features
// our grid system fails and it makes the ULS non-functional.
return $.support.boxModel;
};
/** /**
* i18n initialization * i18n initialization
*/ */
@@ -147,6 +159,10 @@
} }
$( document ).ready( function () { $( document ).ready( function () {
if ( !mw.uls.isBrowserSupported() ) {
return;
}
/* /*
* The 'als' is used in a non-standard way in MediaWiki - * The 'als' is used in a non-standard way in MediaWiki -
* it may be used to represent the Allemanic language, * it may be used to represent the Allemanic language,
@@ -159,6 +175,5 @@
// JavaScript side i18n initialization // JavaScript side i18n initialization
i18nInit(); i18nInit();
} ); } );
}( jQuery, mediaWiki, window, document ) ); }( jQuery, mediaWiki, window, document ) );

View File

@@ -232,6 +232,10 @@
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) ), !mw.config.get( 'wgULSAnonCanChangeLanguage' ) ),
ulsPosition = mw.config.get( 'wgULSPosition' ); ulsPosition = mw.config.get( 'wgULSPosition' );
if ( !mw.uls.isBrowserSupported() ) {
return;
}
if ( ulsPosition === 'interlanguage' ) { if ( ulsPosition === 'interlanguage' ) {
// The interlanguage links section // The interlanguage links section
$pLang = $( '#p-lang' ); $pLang = $( '#p-lang' );