Browse Source

HUE-1930 [core] Alert users with older browsers to upgrade instead of showing a blank page

Removed weird characters from unsupported.mako
Added Firefox < 7 detection
Enrico Berti 11 years ago
parent
commit
444d498

+ 10 - 0
desktop/core/src/desktop/templates/common_header.mako

@@ -125,6 +125,16 @@ from django.utils.translation import ugettext as _
   </script>
   <![endif]-->
 
+  <script type="text/javascript">
+    // check if it's a Firefox < 7
+    var _UA = navigator.userAgent.toLowerCase();
+    for (var i = 1; i < 7; i++) {
+      if (_UA.indexOf("firefox/" + i + ".") > -1) {
+        location.href = "${ url('desktop.views.unsupported') }";
+      }
+    }
+  </script>
+
   <script src="/static/js/hue.utils.js"></script>
   <script src="/static/ext/js/jquery/jquery-2.0.2.min.js"></script>
   <script src="/static/js/jquery.migration.js"></script>

+ 3 - 3
desktop/core/src/desktop/templates/unsupported.mako

@@ -90,9 +90,9 @@
 
 <h3>${_('It looks like you are running an older browser. What about upgrading to the latest')}</h3>
 
-<a href="http://www.google.com/chrome/">Google Chrome</a> |
-<a href="http://www.mozilla.org/firefox/">Mozilla Firefox</a> |
-<a href="http://windows.microsoft.com/en-us/internet-explorer/browser-ie">Microsoft Internet Explorer</a>
+<a href="http://www.google.com/chrome/">Google Chrome</a> |
+<a href="http://www.mozilla.org/firefox/">Mozilla Firefox</a> |
+<a href="http://windows.microsoft.com/en-us/internet-explorer/browser-ie">Microsoft Internet Explorer</a>
 
 </body>
 </html>