aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js
diff options
context:
space:
mode:
authorHilmar R <u02@u29lx193>2021-02-28 21:06:16 +0100
committerHilmar R <u02@u29lx193>2021-03-01 18:48:11 +0100
commitc26dede97f626b52b7bf8962ed55d1dbda86abe8 (patch)
tree3c8c9bc97aa09f7ce9afe9bf467cf87bbf2c7d0b /vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js
parentea3390d626f85b7293a750958bfd1b5460958365 (diff)
downloadvolse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip
get dev
Diffstat (limited to 'vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js')
-rw-r--r--vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js b/vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js
new file mode 100644
index 000000000..d11ec1c5a
--- /dev/null
+++ b/vendor/twbs/bootstrap/site/assets/js/ie-emulation-modes-warning.js
@@ -0,0 +1,52 @@
+// 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 ([\d.]+)/.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!')
+ }
+})()