| 26 | | }-*/; |
| 27 | | |
| 28 | | /** |
| 29 | | * Detects if current browser is IE. |
| 30 | | * |
| 31 | | * @return true if IE |
| 32 | | */ |
| 33 | | public static native boolean isIE() |
| 34 | | /*-{ |
| 35 | | var browser=$wnd.navigator.appName; |
| 36 | | if (browser=="Microsoft Internet Explorer") { |
| 37 | | return true; |
| 38 | | } |
| 39 | | return false; |
| 40 | | }-*/; |
| 41 | | |
| 42 | | /** |
| 43 | | * Detects if current browser is IE6. |
| 44 | | * |
| 45 | | * @return true if IE6 |
| 46 | | */ |
| 47 | | public static native boolean isIE6() |
| 48 | | /*-{ |
| 49 | | var browser=$wnd.navigator.appName; |
| 50 | | if (browser=="Microsoft Internet Explorer") { |
| 51 | | var ua = navigator.userAgent; |
| 52 | | var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); |
| 53 | | if (re.exec(ua) != null) |
| 54 | | rv = parseFloat(RegExp.$1); |
| 55 | | if(rv == 6) return true; |
| 56 | | } |
| 57 | | return false; |
| 113 | | public static native boolean isFF2() |
| 114 | | /*-{ |
| 115 | | var browser=$wnd.navigator.appName; |
| 116 | | if (browser=="Netscape") { |
| 117 | | var ua = navigator.userAgent; |
| 118 | | var re = new RegExp("Firefox/([0-9]+)"); |
| 119 | | if (re.exec(ua) != null) |
| 120 | | var rv = parseInt(RegExp.$1); |
| 121 | | if(rv && rv == 2) |
| 122 | | return true; |
| | 88 | /** |
| | 89 | * Detects if current browser is IE6. |
| | 90 | * |
| | 91 | * @deprecated use BrowserInfo class instead |
| | 92 | * |
| | 93 | * @return true if IE6 |
| | 94 | */ |
| | 95 | public static boolean isIE6() { |
| | 96 | return BrowserInfo.get().isIE6(); |