Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/nonpublic/NP_UserAgent_IE.java

Diff revisions: vs.
  @@ -1,35 +1,35 @@
1 - // This Source Code is in the Public Domain per: http://unlicense.org
2 - package org.litesoft.GWT.client.nonpublic;
3 -
4 - import org.litesoft.core.*;
5 -
6 - public class NP_UserAgent_IE extends org.litesoft.GWT.client.UserAgent {
7 - private boolean mLegacyIE;
8 -
9 - public NP_UserAgent_IE() {
10 - super( BrowserFamily.IE, "IE", determineVersion() );
11 - mLegacyIE = (getVersion() < 9);
12 - }
13 -
14 - @Override
15 - public boolean isLegacyIE() {
16 - return mLegacyIE;
17 - }
18 -
19 - // ; MSIE 6.0;
20 - // 01234567890
21 - private static int determineVersion() {
22 - String zUserAgent = getBrowserUserAgent();
23 - int atStart = zUserAgent.indexOf( "; MSIE " ) + 7;
24 - int atEnd = zUserAgent.indexOf( ".0;", atStart );
25 - if ( (atStart > 6) && (atEnd != -1) && (atEnd <= (atStart + 2)) ) {
26 - try {
27 - return Integer.parseInt( zUserAgent.substring( atStart, atEnd ) );
28 - }
29 - catch ( NumberFormatException e ) {
30 - // Really? Then Assume the default
31 - }
32 - }
33 - return 8;
34 - }
35 - }
1 + // This Source Code is in the Public Domain per: http://unlicense.org
2 + package org.litesoft.GWT.client.nonpublic;
3 +
4 + import org.litesoft.core.*;
5 +
6 + public class NP_UserAgent_IE extends org.litesoft.GWT.client.UserAgent {
7 + private boolean mLegacyIE;
8 +
9 + public NP_UserAgent_IE() {
10 + super( BrowserFamily.IE, "IE", determineVersion() );
11 + mLegacyIE = (getVersion() < 9);
12 + }
13 +
14 + @Override
15 + public boolean isLegacyIE() {
16 + return mLegacyIE;
17 + }
18 +
19 + // ; MSIE 6.0;
20 + // 01234567890
21 + private static int determineVersion() {
22 + String zUserAgent = getBrowserUserAgent();
23 + int atStart = zUserAgent.indexOf( "; MSIE " ) + 7;
24 + int atEnd = zUserAgent.indexOf( ".0;", atStart );
25 + if ( (atStart > 6) && (atEnd != -1) && (atEnd <= (atStart + 2)) ) {
26 + try {
27 + return Integer.parseInt( zUserAgent.substring( atStart, atEnd ) );
28 + }
29 + catch ( NumberFormatException e ) {
30 + // Really? Then Assume the default
31 + }
32 + }
33 + return 8;
34 + }
35 + }