Merge "Disable IE < 9"

This commit is contained in:
jenkins-bot 2014-04-04 00:58:17 +00:00 committed by Gerrit Code Review
commit 6858c41fa6
4 changed files with 21 additions and 4 deletions

View file

@ -689,6 +689,10 @@ call_user_func( function() {
'mmv.head.js',
),
'dependencies' => array(
'mmv.base',
),
'position' => 'top',
), $moduleInfo( 'mmv' ) );

View file

@ -15,8 +15,13 @@
* along with MultimediaViewer. If not, see <http://www.gnu.org/licenses/>.
*/
// This will just set up the MultimediaViewer namespace.
// Included on every page which has images so keep it lightweight.
( function ( mw ) {
mw.mmv = {};
}( mediaWiki ) );
( function ( mw, $ ) {
mw.mmv = {
// We have to disable support for IE < 9 until this is fixed: https://bugzilla.wikimedia.org/show_bug.cgi?id=63303
// This can't be done with feature detection, as the error IE triggers in that situation can't be caught
isBrowserSupported : function () {
return ! ( $.browser.msie && parseFloat( $.browser.version ) < 9 );
}
};
}( mediaWiki, jQuery ) );

View file

@ -18,6 +18,10 @@
// This file is used to do the global initialization that we want on the real pages,
// but do not want in the tests.
( function ( mw, $ ) {
if ( ! mw.mmv.isBrowserSupported() ) {
return;
}
var bootstrap = new mw.mmv.MultimediaViewerBootstrap();
$( document ).ready( function () {

View file

@ -18,6 +18,10 @@
( function ( mw, $ ) {
var $document = $( document );
if ( ! mw.mmv.isBrowserSupported() ) {
return;
}
// If the user disabled MediaViewer in his preferences, we do not set up click handling.
// This is loaded before user JS so we cannot check wgMediaViewer.
if ( mw.config.get( 'wgMediaViewerOnClick' ) !== true ) {