Template:Team:KIT-Kyoto/browser

From 2014.igem.org

(Difference between revisions)
Line 1: Line 1:
<html>
<html>
<script type="text/javascript" charset="utf-8">
<script type="text/javascript" charset="utf-8">
-
     jQuery(function($){
+
     function kit_ua() {
-
     var _ua = (function(){
+
     var ua = navigator.userAgent.toLowerCase();
-
    return {
+
    if (ua.indexOf('chrome') != -1 || ua.indexOf('safari') != -1 || ua.indexOf('opera') != -1 ua.indexOf('msie') !=-1 || ua.indexOf('trident') !=-1 ) {
-
    ltIE6:typeof window.addEventListener == "undefined" && typeof document.documentElement.style.maxHeight == "undefined",
+
     return true;
-
ltIE7:typeof window.addEventListener == "undefined" && typeof document.querySelectorAll == "undefined",
+
     }
-
ltIE8:typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined",
+
    }
-
ltIE9:document.uniqueID && typeof window.matchMedia == "undefined",
+
    if(kit_ua()) {
-
gtIE10:document.uniqueID && window.matchMedia,
+
    $('#kit_browser').text('Your brouser is <strong>not</strong> FireFox. We recommend FireFox.');
-
Trident:document.uniqueID,
+
-
Gecko:'MozAppearance' in document.documentElement.style,
+
-
Presto:window.opera,
+
-
Blink:window.chrome,
+
-
Webkit:typeof window.chrome == "undefined" && 'WebkitAppearance' in document.documentElement.style,
+
-
Touch:typeof document.ontouchstart != "undefined",Mobile:typeof window.orientation != "undefined",
+
-
ltAd4_4:typeof window.orientation != "undefined" && typeof(EventSource) == "undefined",
+
-
Pointer:window.navigator.pointerEnabled,MSPoniter:window.navigator.msPointerEnabled
+
-
}
+
-
})();
+
-
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){
+
-
     document.getElementById('kit_browser').innerHTML = 'We recommend FireFox';
+
-
     }else if(_ua.Gecko && !_ua.Mobile){
+
-
$("#kit_browser").text('Your browser is FireFox');
+
     }
     }
-
    });
 
</script>
</script>

Revision as of 06:14, 11 September 2014