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/html/trustedresourceurl.js | 174 ++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 5 deletions(-) (limited to 'assets/viz/2/goog/html/trustedresourceurl.js') diff --git a/assets/viz/2/goog/html/trustedresourceurl.js b/assets/viz/2/goog/html/trustedresourceurl.js index 6e3c0df..c043ef1 100644 --- a/assets/viz/2/goog/html/trustedresourceurl.js +++ b/assets/viz/2/goog/html/trustedresourceurl.js @@ -40,10 +40,11 @@ goog.require('goog.string.TypedString'); * this type. * * Instances of this type must be created via the factory method, - * ({@code goog.html.TrustedResourceUrl.fromConstant}), and not by invoking its - * constructor. The constructor intentionally takes no parameters and the type - * is immutable; hence only a default instance corresponding to the empty - * string can be obtained via constructor invocation. + * ({@code fromConstant}, {@code fromConstants}, {@code format} or {@code + * formatWithParams}), and not by invoking its constructor. The constructor + * intentionally takes no parameters and the type is immutable; hence only a + * default instance corresponding to the empty string can be obtained via + * constructor invocation. * * @see goog.html.TrustedResourceUrl#fromConstant * @constructor @@ -64,7 +65,7 @@ goog.html.TrustedResourceUrl = function() { /** * A type marker used to implement additional run-time type checking. * @see goog.html.TrustedResourceUrl#unwrap - * @const + * @const {!Object} * @private */ this.TRUSTED_RESOURCE_URL_TYPE_MARKER_GOOG_HTML_SECURITY_PRIVATE_ = @@ -178,6 +179,169 @@ goog.html.TrustedResourceUrl.unwrap = function(trustedResourceUrl) { }; +/** + * Creates a TrustedResourceUrl from a format string and arguments. + * + * The arguments for interpolation into the format string map labels to values. + * Values of type `goog.string.Const` are interpolated without modifcation. + * Values of other types are cast to string and encoded with + * encodeURIComponent. + * + * `%{