com.smartclient.debug.public.sc.client.browser.Browser.js Maven / Gradle / Ivy
Show all versions of smartgwt Show documentation
/*
* Isomorphic SmartClient
* Version SC_SNAPSHOT-2011-08-08 (2011-08-08)
* Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
* "SmartClient" is a trademark of Isomorphic Software, Inc.
*
* [email protected]
*
* http://smartclient.com/license
*/
// =================================================================================================
// IMPORTANT :If you update this file, also update FileLoader.js that has a subset of these checks
// =================================================================================================
//> @object Browser
// Object containing flags indicating basic attributes of the browser.
// @treeLocation Client Reference/Foundation
// @visibility external
//<
isc.addGlobal("Browser", {
isSupported:false
});
//> @classAttr Browser.isOpera (boolean : ? : R)
// Are we in Opera ?
//<
isc.Browser.isOpera = (navigator.appName == "Opera" ||
navigator.userAgent.indexOf("Opera") != -1);
//> @classAttr Browser.isNS (boolean : ? : R)
// Are we in Netscape (including Navigator 4+, NS6 & 7, and Mozilla)
// Note: Safari also reports itself as Netscape, so isNS is true for Safari.
//<
isc.Browser.isNS = (navigator.appName == "Netscape" && !isc.Browser.isOpera);
//> @classAttr Browser.isIE (boolean : ? : R)
// Are we in Internet Explorer?
//<
isc.Browser.isIE = (navigator.appName == "Microsoft Internet Explorer"
&& !isc.Browser.isOpera);
//> @classAttr Browser.isMSN (boolean : ? : R)
// Are we in the MSN browser (based on MSIE, so isIE will be true in this case)
//<
isc.Browser.isMSN = (isc.Browser.isIE && navigator.userAgent.indexOf("MSN") != -1);
//> @classAttr Browser.minorVersion (number : ? : R)
// Browser version, with minor revision included (4.7, 5.5, etc).
//<
isc.Browser.minorVersion = parseFloat(isc.Browser.isIE ?
navigator.appVersion.substring(navigator.appVersion.indexOf("MSIE")+5)
: navigator.appVersion
);
//> @classAttr Browser.version (number : ? : R)
// Browser major version number (integer: 4, 5, etc).
//<
isc.Browser.version = parseInt(isc.Browser.minorVersion);
// actually means IE6 or earlier, which requires radically different optimization techniques
isc.Browser.isIE6 = isc.Browser.isIE && isc.Browser.version <= 6;
//> @classAttr Browser.isMoz (boolean : ? : R)
// Are we in any Mozilla-derived browser, that is, a browser based on Netscape's Gecko
// engine? (includes Mozilla and Netscape 6+)
//<
isc.Browser.isMoz = (navigator.userAgent.indexOf("Gecko") != -1) &&
// NOTE: Safari sends "(like Gecko)", but behaves differently from Moz in many ways
(navigator.userAgent.indexOf("Safari") == -1) &&
(navigator.userAgent.indexOf("AppleWebKit") == -1);
//> @classAttr Browser.isCamino (boolean : false : R)
// Are we in Mozilla Camino?
//<
isc.Browser.isCamino = (isc.Browser.isMoz && navigator.userAgent.indexOf("Camino/") != -1);
//> @classAttr Browser.caminoVersion (string : ? : R)
// For Camino-based browsers, the Camino version number.
//<
if (isc.Browser.isCamino) {
// Camino Version is the last thing in the userAgent
isc.Browser.caminoVersion =
navigator.userAgent.substring(navigator.userAgent.indexOf("Camino/") +7);
}
//> @classAttr Browser.isFirefox (boolean : false : R)
// Are we in Mozilla Firefox?
//<
isc.Browser.isFirefox = (isc.Browser.isMoz && navigator.userAgent.indexOf("Firefox/") != -1);
if (isc.Browser.isFirefox) {
//> @classAttr Browser.firefoxVersion (string : ? : R)
// For Firefox-based browsers, the Firefox version number.
// - 0.10.1 is Firefox PR 1
// After this the version numbers reported match those in the about dialog
// - 1.0 is Firefox 1.0
// - 1.0.2 is Firefox 1.0.2
// - 1.5.0.3 is Firefox 1.5.0.3
//<
isc.Browser.firefoxVersion =
navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox/")+ 8);
}
//> @classAttr Browser.geckoVersion (integer : ? : R)
// For Gecko-based browsers, the Gecko version number.
// Looks like a datestamp:
// - 20011019 is Netscape 6.2
// - 20020530 is Mozilla 1.0
// - 20020823 is Netscape 7.0
// - 20020826 is Mozilla 1.1
// - 20021126 is Mozilla 1.2
// - 20030312 is Mozilla 1.3
// - 20030624 is Mozilla 1.4
// - 20031007 is Mozilla 1.5
// - 20031120 is Mozilla 1.5.1 (Mac only release)
// - 20040113 is Mozilla 1.6
// - 20040616 is Mozilla 1.7
// - 20040910 is Mozilla 1.73
// - 20041001 is Mozilla Firefox PR1 (-- also see firefox version)
// - 20041107 is Mozilla Firefox 1.0
// - 20050915 is Mozilla Firefox 1.0.7
// - 20051107 is Mozilla Firefox 1.5 RC2
// - 20051111 is Mozilla Firefox 1.5 final
// - 20060426 is Mozilla Firefox 1.5.0.3
// - 20061010 is Mozilla Firefox 2.0
// - 20070321 is Netscape 8.1.3 - LIES - really based on Firefox 1.0 codebase
// - 20071109 is Firefox 3.0 beta 1
// - 20080529 is Firefox 3.0
// - 20100101 is Firefox 4.0.1
//<
if (isc.Browser.isMoz) {
isc.Browser._geckoVIndex = navigator.userAgent.indexOf("Gecko/") + 6;
// The 'parseInt' actually means we could just grab everything from the
// end of "Gecko/" on, as we know that even if the gecko version is followed
// by something, there will be a space before the next part of the UA string
// However, we know the length, so just use it
isc.Browser.geckoVersion = parseInt(
navigator.userAgent.substring(
isc.Browser._geckoVIndex, isc.Browser._geckoVIndex+8
)
);
if (isc.Browser.isFirefox) {
// clamp 1.0.x series to last known pre 1.5 version (1.0.7)
if (isc.Browser.firefoxVersion.match(/^1\.0/)) isc.Browser.geckoVersion = 20050915;
// clamp 2.0.x series to one day before near-final FF3 beta
else if (isc.Browser.firefoxVersion.match(/^2\.0/)) isc.Browser.geckoVersion = 20071108;
}
}
// Doctypes
// Are we in strict standards mode. This applies to IE6+ and all Moz 1.0+.
//
// In strict mode, browsers attempt to behave in a more standards-compliant manner. Of course,
// standards interpretation varies pretty drastically between browser makers, so this is in effect
// just another fairly arbitrary set of behaviors which continues to vary across browser makers,
// and now also across modes within the same browser.
//
// We have essentially 3 cases to consider:
// - BackCompat / Quirks mode. This is the rendering used if docType is not specified, or if
// specified as 'Transitional' or 'Frameset' / with no URI
// (EG: )
// This is the default mode.
// - Strict. Completely standards complient.
// Triggered by
//
// - "Almost Strict" (AKA Transitional).
// In IE this matches Strict mode completely.
// In Moz it matches strict mode except for rendering of images within tables - see
// http://developer.mozilla.org/en/docs/Images%2C_Tables%2C_and_Mysterious_Gaps
// Triggered "transitional" doctype with URI
// Reports document.compatMode as "CSS1Compat"
// - http://developer.mozilla.org/en/docs/Gecko%27s_%22Almost_Standards%22_Mode
// - http://www.htmlhelp.com/reference/html40/html/doctype.html
// - http://developer.mozilla.org/en/docs/Mozilla%27s_DOCTYPE_sniffing
//> @classAttr Browser.isStrict (boolean : ? : R)
// Are we in strict standards mode.
//<
// HACK: Netscape6 does not report document.compatMode, so we can't tell that a DOCTYPE has been
// specified, but Netscape6 IS affected by a DOCTYPE. So, in Netscape6, assume we're always in
// strict mode. At the moment (3/30/03) all strict mode workarounds have identical behavior in
// normal mode.
isc.Browser.isStrict = document.compatMode == "CSS1Compat";
if (isc.Browser.isStrict && isc.Browser.isMoz) {
isc.Browser._docTypePublicID = document.doctype.publicId;
isc.Browser._docTypeSystemID = document.doctype.systemId;
// See http://developer.mozilla.org/en/docs/Mozilla%27s_DOCTYPE_sniffing
isc.Browser.isTransitional = isc.Browser._docTypePublicID.indexOf("Transitional") != -1 ||
isc.Browser._docTypePublicID.indexOf("Frameset") != -1;
}
isc.Browser.isIE7 = isc.Browser.isIE && isc.Browser.version == 7;
//> @classAttr Browser.isIE8 (boolean : ? : R)
// Returns true if we're running IE8 and we're in IE8 mode
// IE8 has a 'back-compat' type mode whereby it can run using IE7 rendering logic.
// This is explicitly controlled via the meta tags:
//
// <meta http-equiv="X-UA-Compatible" content="IE=8" />
// or
// <meta http-equiv="X-UA-Compatible" content="IE=7" />
//
// In beta versions IE8 reported itself version 7 and ran in IE7 mode unless the explicit IE8
// tag was present
// In final versions (observed on 8.0.6001.18702) it reports a browser version of 8 and runs
// in IE8 mode by default - but can be switched into IE7 mode via the explicit IE=7 tag.
//
// We therefore want to check the document.documentMode tag rather than just the standard
// browser version when checking for IE8
//<
isc.Browser.isIE8 = isc.Browser.isIE && isc.Browser.version>=8 && document.documentMode == 8
//<
//> @classAttr Browser.isIE8Strict (boolean : ? : R)
// Are we in IE8 [or greater] strict mode.
//
// In IE8 when the meta tag is present to trigger IE7 / IE8 mode the document is in
//
// <meta http-equiv="X-UA-Compatible" content="IE=8" />
// <meta http-equiv="X-UA-Compatible" content="IE=7" />
//
// If this tag is present, the document is in strict mode even if no DOCTYPE was present.
// The presence of this tag can be detected as document.documentMode being 8 rather than 7.
// document.compatMode still reports "CSS1Compat" as with earlier IE.
//<
// IE9 running in IE9 mode will report as IE8Strict:true. This makes sense since rendering quirks
// introduced in IE8 Strict, such as requiring explicit "overflow:hidden" in addition
// to table-layout-fixed in order to clip cells horizontally in tables apply in both places.
// For cases where we really need to distinguish we can check isc.Browser.version or isc.Browser.isIE9
isc.Browser.isIE8Strict = isc.Browser.isIE && isc.Browser.isStrict &&
document.documentMode >= 8;
//> @classAttr Browser.isIE9 (boolean : ? : R)
// Returns true if we're running IE9, running as IE9
//<
isc.Browser.isIE9 = isc.Browser.isIE && isc.Browser.version>=9 && document.documentMode >= 9;
//> @classAttr Browser.isAIR (boolean : ? : R)
// Is this application running in the Adobe AIR environment?
//<
isc.Browser.isAIR = (navigator.userAgent.indexOf("AdobeAIR") != -1);
//> @classAttr Browser.AIRVersion (string : ? : R)
// If this application running in the Adobe AIR environment, what version of AIR is
// running. Will be a string, like "1.0".
//<
isc.Browser.AIRVersion = (isc.Browser.isAIR ? navigator.userAgent.substring(navigator.userAgent.indexOf("AdobeAir/") + 9) : null);
//> @classAttr Browser.isWebKit (boolean : ? : R)
// Are we in a WebKit-based browser (Safari, Chrome, mobile Safari and Android, others).
//<
isc.Browser.isWebKit = navigator.userAgent.indexOf("WebKit") != -1;
//> @classAttr Browser.isSafari (boolean : ? : R)
// Are we in Apple's "Safari" browser? Note that this property will also be set for other
// WebKit based browsers (such as Google Chrome).
//<
// As far as we know all "true" Safari implementations idenify themselves in the userAgent with
// the string "Safari".
// However the GWT hosted mode browser on OSX is also based on apple webkit and should be treated
// like Safari but is not a Safari browser and doesn't identify itself as such in the useragent
// Reported UserAgent:
// Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko)
isc.Browser.isSafari = isc.Browser.isAIR || navigator.userAgent.indexOf("Safari") != -1 ||
navigator.userAgent.indexOf("AppleWebKit") != -1;
//> @classAttr Browser.isChrome (boolean : ? : R)
// Are we in the Google Chrome browser?
//<
// Behaves like Safari in most ways
isc.Browser.isChrome = isc.Browser.isSafari && (navigator.userAgent.indexOf("Chrome/") != -1);
//> @classAttr Browser.safariVersion (number : ? : R)
// in Safari, what is is the reported version number
if (isc.Browser.isSafari) {
if (isc.Browser.isAIR) {
isc.Browser.safariVersion = 530;
} else {
if (navigator.userAgent.indexOf("Safari/") != -1) {
isc.Browser.rawSafariVersion = navigator.userAgent.substring(
navigator.userAgent.indexOf("Safari/") + 7
);
} else if (navigator.userAgent.indexOf("AppleWebKit/") != -1) {
isc.Browser.rawSafariVersion = navigator.userAgent.substring(
navigator.userAgent.indexOf("AppleWebKit/") + 12
);
} else {
isc.Browser.rawSafariVersion = "530"
}
isc.Browser.safariVersion = (function () {
var rawVersion = isc.Browser.rawSafariVersion,
currentDot = rawVersion.indexOf(".");
if (currentDot == -1) return parseInt(rawVersion);
var version = rawVersion.substring(0,currentDot+1),
nextDot;
while (currentDot != -1) {
// Check AFTER the dot
currentDot += 1;
nextDot = rawVersion.indexOf(".", currentDot);
version += rawVersion.substring(currentDot,
(nextDot == -1 ? rawVersion.length: nextDot));
currentDot = nextDot;
}
return parseFloat(version);
})();
}
}
//> @classAttr Browser.isWin (boolean : ? : R)
// Is this a Windows computer ?
//<
isc.Browser.isWin = navigator.platform.toLowerCase().indexOf("win") > -1;
// NT 5.0 is Win2k, NT5.0.1 is Win2k SP1
isc.Browser.isWin2k = navigator.userAgent.match(/NT 5.01?/) != null;
//> @classAttr Browser.isMac (boolean : ? : R)
// Is this a Macintosh computer ?
//<
isc.Browser.isMac = navigator.platform.toLowerCase().indexOf("mac") > -1;
isc.Browser.isUnix = (!isc.Browser.isMac &&! isc.Browser.isWin);
//> @groupDef mobileDevelopment
// SmartClient supports building web applications that can be accessed by mobile devices that
// support modern web browsers, specifically:
//
// - Safari on iOS devices (iPad, iPhone, iPod Touch)
//
- Android's default (WebKit-based) browser
//
- Blackberry devices that use a WebKit-based browser (future)
//
- Palm OS devices that use a WebKit-based browser (future)
//
- Windows Phone 7 (future: once IE mobile is based on IE9)
//
// Via "packaging" technologies such as Titanium and Phonegap, a SmartClient web application
// can be +link{packaged as an installable native application,nativeMobileApps} that can be
// delivered via the "App Store" for the target mobile platform. Applications packaged in this
// way have access to phone-specific data and services such as contacts stored on the phone, or
// the ability to invoke the device's camera.
//
//
Finger / touch events
//
// Mobile and touch devices support "touch events" that correspond to finger actions on the
// screen. By default, SmartClient simply sends touch events to UI components as normal mouse
// events. Specifically:
//
// - a finger tap gesture will trigger mouseDown, mouseUp and click events
//
- a touch-and-slide interaction will trigger drag and drop, firing the normal SmartClient
// sequence of dragStart, dragMove, and dragStop
//
- a touch-and-hold interaction will trigger a contextMenu event, and will trigger a hover
// if no contextMenu is shown
//
// This means that most applications that are written initially to target desktop computers
// need little or no modification in order be able to run on tablet-sized devices (eg the
// iPad). For handset-sized devices (phones, iPod touch), conditional logic may need to be
// added to make different use of the screen real estate.
//
//
Mobile look and feel
//
// The "Mobile" skin should be used whenever mobile devices are detected. This skin roughly
// mimics the appearance of the iOS default widgets wherever there is an iOS widget that
// corresponds closely to a given SmartClient widget. It also makes extensive use of CSS3 to
// minimize the use of images while still providing an attractive look and feel.
//
// In addition, this skin also changes the behavior of some SmartClient widgets to match the
// UI idioms common on mobile devices. For example, the TabSet component switches to
// bottom-oriented tabs, which are flush together (no gaps). If there are more than a certain
// number of tabs, a special "More" tab appears which lists other remaining tabs. Among other
// examples, this is the behavior of the "iPad" application on iOS devices, and is an efficient
// use of minimal screen real estate which feels natural when used on a mobile device.
//
// In order to detect whether to use the Mobile skin, because of the rapid proliferation of
// mobile devices, we recommend using server-side detection based on the User-Agent HTTP
// header, and using conditional logic (such as logic in a .jsp) to load the "Mobile" skin
// specifically for these devices.
//
//
Adapting to Screen Size and Orientation Change
//
// Safari on the Apple iPod/iPhone supports explicitly configuring the viewport as detailed here:
// +externalLink{http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html}.
// Including these meta tags in your bootstrap HTML file will allow you to set
// a default "zoom level" - how many pixels show up on the screen in landscape or portrait
// mode as well as disabling the user's standard zoom interactions. We also have
// +link{Page.updateViewport(),an API} to configure the viewport programmatically at runtime.
//
// Note that the +link{Page.getOrientation()} API may be used to determine the current
// orientation of the application, and +link{pageEvent,the page orientationChange event} will fire
// whenever the user rotates the screen allowing applications to directly respond to the user
// pivoting their device.
//
// @title Mobile Application Development
// @treeLocation Concepts
// @visibility external
//<
//> @groupDef nativeMobileApps
// "Packaging" technologies such as Titanium and Phonegap can be used to take a SmartClient web
// application and package it as an installable native application that can be delivered via
// the "App Store" for the target mobile platform. Applications packaged in this way have
// access to native phone functionality that web applications in the phone's browser cannot
// access.
//
// Both Titanium and Phonegap are open source mobile development frameworks which provide access to the
// underlying native device API's such as the accelerometer, geolocation, and UI. Both frameworks enable
// application development using only Javascript, CSS and HTML. Additionally they provide development environments
// that work across a wide variety of devices.
//
// Phonegap has good support for native device API's as noted +externalLink{http://www.phonegap.com/features,here}.
// Titanium also has similar +externalLink{http://www.appcelerator.com/products/native-iphone-android-development/,support}.
// There are differences between the two environments and how they expose their API's, though both provide
// XCode compatible projects that can be compiled and run from the XCode IDE.
// See the subsections for additional details and references.
// @title Creating Native Mobile Apps (Titanium, Phonegap)
// @treeLocation Concepts/Mobile Application Development
// @visibility external
//<
//> @groupDef titaniumIntegration
// Titanium provides an extensive Javascript API to access a native device's UI, phone, camera, geolocation, etc.
// Documentation, getting started, programming guides are +externalLink{http://developer.appcelerator.com/documentation,here}.
// Titanium provides a consistent API across devices including the ability to mix webviews with native controls.
//
// The Titanium sample application provides an example of accessing a device's Contacts db using SmartClient.
// The application presents 2 tabs 'Customers' and 'Contacts' and allows the user to import Customer contacts into
// his/her contacts db resident on the device. Selecting a Customer's Contact address will show a map of the contact.
// Selecting a Customer's phone number will call the customer or prompt to import the contact into the user's
// contacts. The latter option is default behavior on the iPad. Calling the customer contact is default behavior for
// devices such as the iPhone or Android.
//
// The Titanium Contact object holds the following properties:
//
// - URL
// - address
// - birthday
// - created
// - date
// - department
// - email
// - firstName
// - firstPhonetic
// - fullName
// - image
// - instantMessage
// - jobTitle
// - kind
// - lastName
// - lastPhonetic
// - middleName
// - middlePhonetic
// - modified
// - nickname
// - note
// - organization
// - phone
// - prefix
// - relatedNames
// - suffix
//
//
// The following Titanium API's are used:
//
// - Titanium.App.addEventListener
// - Titanium.App.fireEvent
// - Titanium.Contacts.getAllPeople
// - Titanium.Geolocation.forwardGeocoder
// - Titanium.Map.STANDARD_TYPE,
// - Titanium.Map.createView
// - Titanium.UI.createTab
// - Titanium.UI.createTabGroup
// - Titanium.UI.createWebView
// - Titanium.UI.createWindow
// - Titanium.UI.setBackgroundColor
//
//
// The following SmartClient Components are used
//
// - isc.DataSource
// - isc.ListGrid
//
//
// The following SmartClient Resources are bundled in the Titanium application
//
// - ISC_Containers.js
// - ISC_Core.js
// - ISC_DataBinding.js
// - ISC_Foundation.js
// - ISC_Grids.js
// - load_skin.js
// - skins/Mobile/images/black.gif
// - skins/Mobile/images/blank.gif
// - skins/Mobile/images/checked.png
// - skins/Mobile/images/formula_menuItem.png
// - skins/Mobile/images/grid.gif
// - skins/Mobile/images/group_closed.gif
// - skins/Mobile/images/group_opened.gif
// - skins/Mobile/images/headerMenuButton_icon.gif
// - skins/Mobile/images/loading.gif
// - skins/Mobile/images/loadingSmall.gif
// - skins/Mobile/images/opacity.png
// - skins/Mobile/images/pinstripes.png
// - skins/Mobile/images/row_collapsed.gif
// - skins/Mobile/images/row_expanded.gif
// - skins/Mobile/images/sort_ascending.gif
// - skins/Mobile/images/sort_descending.gif
// - skins/Mobile/skin_styles.css
//
//
// @title Integration with Titanium
// @treeLocation Concepts/Mobile Application Development
// @visibility external
//<
//> @groupDef phonegapIntegration
//
// Phonegap documentation, getting started, programming guides are +externalLink{http://www.phonegap.com/,here}.
// The Phonegap sample application provides an example of accessing a device's Contacts db using SmartClient.
// Phonegap exposes a Contacts API which allows one to find, create and remove contacts from the devices db.
// Unlike Titanium, which provides many native UI components, Phonegap relies on 3rd party frameworks for
// these UI components. Additionally, Phonegap provides no transitions or other animation effects normally
// accessible in native applications.
//
// The Phonegap Contact object holds the following properties:
//
// - id
// - displayName
// - name
// - nickname
// - phoneNumbers
// - emails
// - addresses
// - ims
// - organizations
// - revision
// - birthday
// - gender
// - note
// - photos
// - categories
// - urls
// - timezone
//
//
// @title Integration with Phonegap
// @treeLocation Concepts/Mobile Application Development
// @visibility external
//<
isc.Browser.isAndroid = navigator.userAgent.indexOf("Android") > -1;
isc.Browser.isMobileWebkit = (isc.Browser.isSafari && navigator.userAgent.indexOf(" Mobile/") > -1
|| isc.Browser.isAndroid);
// intended for general mobile changes (performance, etc)
isc.Browser.isMobile = (isc.Browser.isMobileWebkit);
// browser has a touch interface (iPhone, iPad, Android device, etc)
isc.Browser.isTouch = (isc.Browser.isMobileWebkit);
// iPhone OS including iPad. These devices also include "iPhone" or "iPad" in UA String but
// we're assuming "AppleWebKit" will capture any future devices.
isc.Browser.isIPhone = (isc.Browser.isMobileWebkit &&
navigator.userAgent.indexOf("AppleWebKit"));
// specifically a handset-sized device, with an assumed screen width of 3-4 inches, implying
// the application will be working with only 300-400 pixels at typical DPI
isc.Browser.isHandset = (isc.Browser.isMobileWebkit && navigator.userAgent.indexOf("iPad") == -1);
// iPad. Checks for "iPhone" OS + "iPad" in UA String.
isc.Browser.isIPad = (isc.Browser.isIPhone &&
navigator.userAgent.indexOf("iPad"));
// tablet. assumes isIPad for now
isc.Browser.isTablet = (isc.Browser.isIPad);
//> @classAttr Browser.isBorderBox (boolean : ? : R)
// Do divs render out with "border-box" sizing by default.
//<
// See comments in Canvas.adjustHandleSize() for a discussion of border-box vs content-box sizing
isc.Browser.isBorderBox = (isc.Browser.isIE && !isc.Browser.isStrict);
//> @classAttr Browser.lineFeed (string : ? : RA)
// Linefeed for this platform
//<
isc.Browser.lineFeed = (isc.Browser.isWin ? "\r\n" : "\r");
//> @classAttr Browser._supportsMethodTimeout (string : ? : RA)
// setTimeout() requires text string parameter in MacIE or IE 4
//<
isc.Browser._supportsMethodTimeout = false;//!(isc.Browser.isIE && (isc.Browser.isMac || isc.Browser.version == 4));
//> @classAttr Browser.isDOM (string : ? : RA)
// Whether this is a DOM-compliant browser. Indicates general compliance with DOM standards,
// not perfect compliance.
//<
isc.Browser.isDOM = (isc.Browser.isMoz || isc.Browser.isOpera ||
isc.Browser.isSafari || (isc.Browser.isIE && isc.Browser.version >= 5));
//> @classAttr Browser.isSupported (boolean : varies by browser : R)
// Whether SmartClient supports the current browser.
//
// Note that this flag will only be available on browsers that at least support basic
// JavaScript.
//
// @visibility external
//<
isc.Browser.isSupported = (
// we support all versions of IE 5.5 and greater on Windows only
(isc.Browser.isIE && isc.Browser.minorVersion >= 5.5 && isc.Browser.isWin) ||
// Mozilla and Netscape 6, all platforms
isc.Browser.isMoz ||
isc.Browser.isOpera ||
// Safari (only available on Mac)
isc.Browser.isSafari ||
isc.Browser.isAIR
);
//> @classAttr Browser.allowsXSXHR (boolean : ? : RA)
// Traditionally, web browsers reject attempts to make an XmlHttpRequest of a server other than the origin
// server. However, some more recent browsers allow cross-site XmlHttpRequests to be made, relying on the
// server to accept or reject them depending on what the origin server is.
//<
isc.Browser.allowsXSXHR = (
(isc.Browser.isFirefox && isc.Browser.firefoxVersion >= "3.5") ||
// Chrome auto-updates to latest stable version every time you start it, and there is no option to prevent
// this from happening, so there's no point in querying version
(isc.Browser.isChrome) ||
(isc.Browser.isSafari && isc.Browser.safariVersion >= 531)
);
//> @classAttr Browser.isSGWT (boolean : ? : RA)
// Are we running in SGWT.
// This is set up by SmartGWT wrapper code in JsObject.init().
// Obviously only applies to internal SmartClient code since developer code for an SGWT app
// would be written in Java and there'd be no need to check this var!
// @visibility internal
//<