Sha256: 9e1180c44c25add2efa986c76b6b3f0bb8ff9e7ef732dfd80274d02c3d2c4278

Contents?: true

Size: 1.96 KB

Versions: 44

Compression:

Stored size: 1.96 KB

Contents

// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
// IT'S ALL JUST JUNK FOR OUR DOCS!
// ++++++++++++++++++++++++++++++++++++++++++

// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
(function () {
  'use strict'

  function emulatedIEMajorVersion() {
    var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
    if (groups === null) {
      return null
    }
    var ieVersionNum = parseInt(groups[1], 10)
    var ieMajorVersion = Math.floor(ieVersionNum)
    return ieMajorVersion
  }

  function actualNonEmulatedIEMajorVersion() {
    // Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
    // IE JavaScript conditional compilation docs: https://msdn.microsoft.com/library/121hztk3%28v=vs.94%29.aspx
    // @cc_on docs: https://msdn.microsoft.com/library/8ka90k2e%28v=vs.94%29.aspx
    var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // eslint-disable-line no-new-func
    if (typeof jscriptVersion === 'undefined') {
      return 11 // IE11+ not in emulation mode
    }
    if (jscriptVersion < 9) {
      return 8 // IE8 (or lower; haven't tested on IE<8)
    }
    return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
  }

  var ua = window.navigator.userAgent
  if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
    return // Opera, which might pretend to be IE
  }
  var emulated = emulatedIEMajorVersion()
  if (emulated === null) {
    return // Not IE
  }
  var nonEmulated = actualNonEmulatedIEMajorVersion()

  if (emulated !== nonEmulated) {
    // eslint-disable-next-line no-alert
    window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
  }
}())

Version data entries

44 entries across 44 versions & 2 rubygems

Version Path
card-mod-bootstrap-0.14.2 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.14.1 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.14.0 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.13.4 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.13.3 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.13.2 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.13.1 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.13.0 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.7 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.12.0 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.6 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.5 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.4 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.3 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.2 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.1 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-mod-bootstrap-0.11.0 vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-1.100.0 mod/bootstrap/vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-1.99.6 mod/bootstrap/vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js
card-1.99.5 mod/bootstrap/vendor/bootstrap/assets/js/src/ie-emulation-modes-warning.js