Skip to content

Commit

Permalink
added browser check and show message if non-supported-browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Klaus committed Apr 27, 2017
1 parent fdba22c commit 8bea136
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ asterics.const.MSG_ERROR = 'error';
asterics.const.OS_IS_WIN10 = (window.navigator.userAgent.indexOf("Windows NT 10.0") != -1);
asterics.const.OS_IS_WIN7 = (window.navigator.userAgent.indexOf("Windows NT 6.1") != -1);
asterics.const.OS_IS_OTHER = !(asterics.const.OS_IS_WIN7 || asterics.const.OS_IS_WIN10);

//browser detection see http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
// Internet Explorer 6-11
asterics.const.BROWSER_IS_IE = /*@cc_on!@*/false || !!document.documentMode;
// Edge 20+
asterics.const.BROWSER_IS_EDGE = !asterics.const.BROWSER_IS_IE && !!window.StyleMedia;
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
<div ui-view="">
<asterics-message message-code="i18n_disclaimer" message-level="error"/>
<h2 translate="i18n_available_apps"/>
<span translate="i18n_click_on_app"/>
<div class="row">
<cell-board choose-items="$ctrl.cellBoardConfig"/>
<div ng-if="$ctrl.isNonSupportedBrowser()">
<asterics-message transclude="true" message-level="error">
<p><b>Ihr aktueller Browser wird von AsTeRICS-Ergo nicht unterstützt!</b></p>
<p>Bitte laden Sie einen der folgenden Browser herunter und starten Sie AsTeRICS-Ergo mit diesem:</p>
<ul>
<li>
<a target="_blank" href="https://www.mozilla.org/de/firefox/new/">Zum Download von Firefox</a>
</li>
<li>
<a target="_blank" href="https://www.google.com/chrome/browser/desktop/">Zum Download von Chrome</a>
</li>
</ul>
</asterics-message>
</div>
<div ng-if="!$ctrl.isNonSupportedBrowser()">
<asterics-message message-code="i18n_disclaimer" message-level="error"/>
<h2 translate="i18n_available_apps"/>
<span translate="i18n_click_on_app"/>
<div class="row">
<cell-board choose-items="$ctrl.cellBoardConfig"/>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ angular.module(asterics.appComponents)
controller: ['utilService', function (utilService) {
var thiz = this;
thiz.cellBoardConfig = [utilService.createCellBoardItemNav('home.envControl', 'home', 'home.envControl')];
thiz.isNonSupportedBrowser = function() {
return asterics.const.BROWSER_IS_IE || asterics.const.BROWSER_IS_EDGE;
}
}],
templateUrl: "angular/global/component/mainMenu.html"
});

0 comments on commit 8bea136

Please sign in to comment.