From 2b4757367470d8e36bc00901dac567e375796ed4 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 13 Nov 2018 00:24:09 -0500 Subject: 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 --- assets/viz/2/goog/useragent/useragent.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'assets/viz/2/goog/useragent') 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, @@ -384,6 +385,15 @@ goog.userAgent.IPOD = goog.userAgent.PLATFORM_KNOWN_ ? goog.labs.userAgent.platform.isIpod(); +/** + * 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. @@ -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; + }); }; -- cgit v1.2.3