Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion Phonebook.Frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>

<body class="mat-typography">
<app-root></app-root>
<noscript>Please enable JavaScript to continue using this application.</noscript>
Expand All @@ -47,5 +46,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 =
'<div class="pb-no-ie"><p><strong>This application does not support Internet Explorer!</strong></p><p>To run the Phonebook, please use one of the following modern browsers:</p><ul>';
for (var key in browserList) {
html += '<li onclick="openURL(this)" value="' + browserList[key] + '"><strong>' + key + '</strong></li>';
}
html += '</ul></div>';
document.getElementsByTagName('body')[0].innerHTML = html;
}
}
</script>
</html>
12 changes: 11 additions & 1 deletion Phonebook.Frontend/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,17 @@ app-root {
margin: auto 1%;
}
}

.pb-no-ie {
top: 38%;
left: 38%;
position: absolute;
Comment on lines +185 to +187
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
top: 38%;
left: 38%;
position: absolute;
margin: auto;
height: 200px;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damit ist es auch genau in der Mitte

}
.pb-no-ie li {
cursor: pointer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das ist eigentlich überfüssig, <a> sind immer mit pointer belegt :)

&:hover {
color: #9b9e9e;
}
}
//Media query classes
@include on-med-and-up {
.pb-hide-on-med-and-up {
Expand Down