diff --git a/Phonebook.Frontend/src/index.html b/Phonebook.Frontend/src/index.html index cbfaf1ad5..e8196c6b0 100644 --- a/Phonebook.Frontend/src/index.html +++ b/Phonebook.Frontend/src/index.html @@ -2,6 +2,7 @@ + Phonebook @@ -28,7 +29,6 @@ - @@ -47,5 +47,39 @@ } else { top.location = self.location; } + msieversion(); + + function openURL(e) { + browser = e.getAttribute('value'); + if (browser == 'microsoft-edge') { + //edge can not be opened via shell + window.open((browser = e.getAttribute('value') + ':' + window.location.href)); + } else { + new ActiveXObject('WScript.Shell').run(browser + ' ' + window.location.href); + } + } + + function msieversion() { + var browserList = { + //list of browser-links where app can be openend in: key=browser name, value=shell-command to open browser + 'Microsoft Edge': 'microsoft-edge', + 'Google Chrome': 'chrome', + 'Mozilla Firefox': 'firefox', + Opera: 'opera' + }; + var ua = window.navigator.userAgent; + var msie = ua.indexOf('MSIE '); + + if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { + // stone age browser IE + var html = + '

This application does not support Internet Explorer!

To run the Phonebook, please use one of the following modern browsers:

'; + document.getElementsByTagName('body')[0].innerHTML = html; + } + } diff --git a/Phonebook.Frontend/src/no-ie.js b/Phonebook.Frontend/src/no-ie.js new file mode 100644 index 000000000..ef4ffed6f --- /dev/null +++ b/Phonebook.Frontend/src/no-ie.js @@ -0,0 +1,12 @@ +function msieversion() { + var ua = window.navigator.userAgent; + var msie = ua.indexOf('MSIE '); + + if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) { + // stone age browser IE + console.log('not supported'); + var html = + '

Please notice: This app does not support Internet Explorer!

To run the Phonebook, please use one of the following modern browsers:

'; + document.getElementsByTagName('body')[0].innerHTML = html; + } +} diff --git a/Phonebook.Frontend/src/styles.scss b/Phonebook.Frontend/src/styles.scss index 309abc7a2..60a4b0049 100644 --- a/Phonebook.Frontend/src/styles.scss +++ b/Phonebook.Frontend/src/styles.scss @@ -181,7 +181,17 @@ app-root { margin: auto 1%; } } - +.pb-no-ie { + top: 38%; + left: 38%; + position: absolute; +} +.pb-no-ie li { + cursor: pointer; + &:hover { + color: #9b9e9e; + } +} //Media query classes @include on-med-and-up { .pb-hide-on-med-and-up {