r54581 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54580‎ | r54581 | r54582 >
Date:12:38, 7 August 2009
Author:shinjiman
Status:ok
Tags:
Comment:
added documentMode detection for IE8 if the user has been chosen for the IE7 compat mode or the site is in the compatibility list (forcing IE7 compat mode).
Modified paths:
  • /trunk/extensions/UsabilityInitiative/OptIn/OptIn.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/OptIn/OptIn.js
@@ -29,7 +29,19 @@
3030 var browserIndex = 'other';
3131 switch ( $j.browser.name ) {
3232 case 'msie':
33 - browserIndex = 'ie'+ parseInt( $j.browser.versionNumber );
 33+ if ( parseInt( $j.browser.versionNumber ) == 7 ) {
 34+ // IE7 or IE8 compat mode
 35+ if( document.documentMode ) {
 36+ // IE8 supports Document mode
 37+ browserIndex = 'ie8';
 38+ } else {
 39+ // while IE7 does not support it
 40+ browserIndex = 'ie7';
 41+ }
 42+ } else {
 43+ // other versions
 44+ browserIndex = 'ie'+ parseInt( $j.browser.versionNumber );
 45+ }
3446 break;
3547 case 'firefox':
3648 browserIndex = 'ff' + parseInt( $j.browser.versionNumber );

Status & tagging log