| |
|
| java.lang.Object org.apache.turbine.util.BrowserDetector
BrowserDetector | public class BrowserDetector (Code) | | This class parses the user agent string and sets javasciptOK and
cssOK following the rules described below. If you want to check
for specific browsers/versions then use this class to parse the
user agent string and use the accessor methods in this class.
JavaScriptOK means that the browser understands JavaScript on the
same level the Navigator 3 does. Specifically, it can use named
images. This allows easier rollovers. If a browser doesn't do
this (Nav 2 or MSIE 3), then we just assume it can't do any
JavaScript. Referencing images by load order is too hard to
maintain.
CSSOK is kind of sketchy in that Nav 4 and MSIE work differently,
but they do seem to have most of the functionality. MSIE 4 for the
Mac has buggy CSS support, so we let it do JavaScript, but no CSS.
Ported from Leon's PHP code at
http://www.working-dogs.com/freetrade by Frank.
author: Frank Y. Kim author: Leon Atkisnon author: Chris Mospaw author: Benjamin Elijah Griffin version: $Id: BrowserDetector.java 534527 2007-05-02 16:10:59Z tv $ |
BrowserDetector | public BrowserDetector(String userAgentString)(Code) | | Constructor used to initialize this class.
Parameters: userAgentString - A String with the user agent field. |
BrowserDetector | public BrowserDetector(RunData data)(Code) | | Constructor used to initialize this class.
Parameters: data - The Turbine RunData object. |
getBrowserName | public String getBrowserName()(Code) | | The browser name specified in the user agent string.
A String with the browser name. |
getBrowserPlatform | public String getBrowserPlatform()(Code) | | The browser platform specified in the user agent string.
A String with the browser platform. |
getBrowserVersion | public float getBrowserVersion()(Code) | | The browser version specified in the user agent string.
A String with the browser version. |
getUserAgentString | public String getUserAgentString()(Code) | | The user agent string for this class.
A String with the user agent. |
isCssOK | public boolean isCssOK()(Code) | | Whether or not CSS works in this browser.
True if CSS works in this browser. |
isFileUploadOK | public boolean isFileUploadOK()(Code) | | Whether or not file upload works in this browser.
True if file upload works in this browser. |
isJavascriptOK | public boolean isJavascriptOK()(Code) | | Whether or not Javascript works in this browser.
True if Javascript works in this browser. |
|
|
|