Bläddra i källkod

Add IE message compatibility

boutils 10 år sedan
förälder
incheckning
72d416cf12
3 ändrade filer med 35 tillägg och 0 borttagningar
  1. 0 0
      css/main.css
  2. 10 0
      css/main.less
  3. 25 0
      js/app.js

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
css/main.css


+ 10 - 0
css/main.less

@@ -12,6 +12,16 @@ body {
   height: 100%;
   width: 100%;
   overflow: auto;
+
+  .error-navigator {
+    font-size: 41px;
+    color: red;
+    text-align: center;
+    position: relative;
+    top: 50%;
+    background: white;
+    opacity: 0.5;
+  }
 }
 
 a {

+ 25 - 0
js/app.js

@@ -12,6 +12,31 @@ app.directive('skrollr', function() {
 });
 
 
+navigator.sayswho = (function(){
+    var ua= navigator.userAgent, tem,
+    M= ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
+    if(/trident/i.test(M[1])){
+        tem=  /\brv[ :]+(\d+)/g.exec(ua) || [];
+        return 'IE '+(tem[1] || '');
+    }
+    if(M[1]=== 'Chrome'){
+        tem= ua.match(/\b(OPR|Edge)\/(\d+)/);
+        if(tem!== null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
+    }
+    M= M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
+    if((tem= ua.match(/version\/(\d+)/i))!== null) M.splice(1, 1, tem[1]);
+    return M.join(' ');
+})();
+
+if(navigator.sayswho === 'IE 6' || navigator.sayswho === 'IE 7' || navigator.sayswho === 'IE 8') {
+
+  $(document).ready(function() {
+    $('body').html('<div class="error-navigator">Votre navigateur ' + navigator.sayswho + " n'est pas supporté, vous devez avoir au minimum la version 9.</div>");
+  });
+}
+
+
+
 app.controller('mainController', function($scope, $detection, $http, $mdSidenav, $timeout, $sce, $mdToast) {
   $scope.title   = "Manche Numerique";
 

Vissa filer visades inte eftersom för många filer har ändrats