diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2018-11-13 00:24:09 -0500 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2018-11-13 00:24:09 -0500 |
commit | 2b4757367470d8e36bc00901dac567e375796ed4 (patch) | |
tree | 72368624006c21d28228a100ee88590c7bf95e58 /assets/viz/2/goog/useragent/useragent.js | |
parent | 5ed62d23b4bbbf7717de4adfa0eaf2af19365408 (diff) |
update viz 2 to use the newest version, which has some performance improvements and is easier to read the code for. also update the description
Diffstat (limited to 'assets/viz/2/goog/useragent/useragent.js')
-rw-r--r-- | assets/viz/2/goog/useragent/useragent.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/assets/viz/2/goog/useragent/useragent.js b/assets/viz/2/goog/useragent/useragent.js index 1ab49c4..6fc5ff1 100644 --- a/assets/viz/2/goog/useragent/useragent.js +++ b/assets/viz/2/goog/useragent/useragent.js @@ -27,6 +27,7 @@ goog.require('goog.labs.userAgent.browser'); goog.require('goog.labs.userAgent.engine'); goog.require('goog.labs.userAgent.platform'); goog.require('goog.labs.userAgent.util'); +goog.require('goog.reflect'); goog.require('goog.string'); @@ -98,7 +99,7 @@ goog.userAgent.getUserAgentString = function() { /** * TODO(nnaze): Change type to "Navigator" and update compilation targets. - * @return {Object} The native navigator object. + * @return {?Object} The native navigator object. */ goog.userAgent.getNavigator = function() { // Need a local navigator reference instead of using the global one, @@ -385,6 +386,15 @@ goog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ? /** + * Whether the user agent is running on iOS. + * @type {boolean} + */ +goog.userAgent.IOS = goog.userAgent.PLATFORM_KNOWN_ ? + (goog.userAgent.ASSUME_IPHONE || goog.userAgent.ASSUME_IPAD || + goog.userAgent.ASSUME_IPOD) : + goog.labs.userAgent.platform.isIos(); + +/** * @return {string} The string that describes the version number of the user * agent. * @private @@ -508,9 +518,11 @@ goog.userAgent.isVersionOrHigherCache_ = {}; */ goog.userAgent.isVersionOrHigher = function(version) { return goog.userAgent.ASSUME_ANY_VERSION || - goog.userAgent.isVersionOrHigherCache_[version] || - (goog.userAgent.isVersionOrHigherCache_[version] = - goog.string.compareVersions(goog.userAgent.VERSION, version) >= 0); + goog.reflect.cache( + goog.userAgent.isVersionOrHigherCache_, version, function() { + return goog.string.compareVersions( + goog.userAgent.VERSION, version) >= 0; + }); }; |