Template:Team:KIT-Kyoto/browser

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
<script type="text/javascript">
<script type="text/javascript">
-
var ua = window.navigator.userAgent.toLowerCase();
+
    jQuery(function($){
-
var IE = ua.match(/msie/i),
+
    var kit_ua = (function(){
-
     IE6 = ua.match(/msie [6.]/i),
+
     return {
-
     IE7 = ua.match(/msie [7.]/i),
+
    ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined",
-
     IE8 = ua.match(/msie [8.]/i),
+
     ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
-
     IE9 = ua.match(/msie [9.]/i),
+
     ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
-
     IE10 = ua.match(/msie [10.]/i),
+
     ltIE9:document.uniqueID && typeof window.matchMedia == "undefined",
-
     IE11 = ua.match(/trident/i),
+
     gtIE10:document.uniqueID && window.matchMedia,
-
     Chrome = ua.match(/chrome/i),
+
     Trident:document.uniqueID,
-
     Safari = ua.match(/safari/i),
+
     Gecko:'MozAppearance' in document.documentElement.style,
-
     fireFox = ua.match(/firefox/i),
+
     Presto:window.opera,
-
     Opera = ua.match(/opera/i);
+
     Blink:window.chrome,
-
if (IE) {
+
     Webkit:typeof window.chrome == "undefined" && 'WebkitAppearance' in document.documentElement.style,
-
    $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
     Touch:typeof document.ontouchstart != "undefined",
-
     if (IE6) {
+
     Mobile:typeof window.orientation != "undefined",
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
     ltAd4_4:typeof window.orientation != "undefined" && typeof(EventSource) == "undefined",
-
     } else if (IE7) {
+
     Pointer:window.navigator.pointerEnabled,
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
     MSPoniter:window.navigator.msPointerEnabled
-
     } else if (IE8) {
+
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
-
    } else if (IE9) {
+
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
-
     } else if (IE10) {
+
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
-
     } else if (IE11) {
+
-
        $(".kit_browser").text('Your browser is InternetExplorer.We recommend FireFox.');
+
     }
     }
-
}else if(Chrome){
+
    })();
-
     $(".kit_browser").text('Your browser is GoogleChrome.We recommend FireFox.');
+
     if(kit_ua.ltIE6 || _ua.ltIE7 || _ua.ltIE8 || (_ua.Trident && !_ua.ltIE8) || (_ua.Trident && !_ua.ltIE9 ) || _ua.gtIE10 || (_ua.Blink && !_ua.Mobile) || (_ua.Blink && _ua.Mobile) || _ua.ltAd4_4 || (_ua.Webkit && !_ua.Mobile) || (_ua.Webkit && _ua.Mobile) || _ua.ltAd4_4 || (_ua.Gecko && !_ua.Mobile) || (_ua.Gecko && _ua.Mobile) || (_ua.Presto){
-
}else if(Safari){
+
     document.getElementByClass('kit_browser').innerHTML = 'We recommend FireFox';
-
    $(".kit_browser").text('Your browser is Safari.We recommend FireFox.');
+
    }else if(_ua.Gecko && !_ua.Mobile){
-
}else if(fireFox){
+
document.getElementByClass('kit_browser').innerHTML = 'Your browser is FireFox';
-
     $(".kit_browser").text('Your browser is FireFox.');
+
    }
-
}else if(Opera){
+
    });
-
    $(".kit_browser").text('Your browser is Opera.We recommend FireFox.');
+
-
}
+
</script>
</script>

Revision as of 05:36, 11 September 2014