From 18cafbf3614947fc61a88901f9ae1181480bfb0b Mon Sep 17 00:00:00 2001 From: Diego Fernando Bolivar Date: Mon, 6 Jul 2020 12:00:23 -0500 Subject: [PATCH] goog plugin upgrade for fix breaking changes goog plugin upgrade for fix breaking changes in google charts loading using gstatic library like docu in https://developers.google.com/chart/interactive/docs/basic_load_libs#update-library-loader-code Notes: 1. due to gstatic google library, the async plugin it is not necessary anymore. 2. requirejs define only needs two parameters:

define([
	'goog!current,packages:[corechart]',
],
--- src/goog.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/goog.js b/src/goog.js index c9f4056..9c0928d 100644 --- a/src/goog.js +++ b/src/goog.js @@ -4,17 +4,16 @@ * Version: 0.2.0 (2011/12/06) * Released under the MIT license */ -define(['async', 'propertyParser'], function (async, propertyParser) { +define(['propertyParser'], function (propertyParser) { var rParts = /^([^,]+)(?:,([^,]+))?(?:,(.+))?/; function parseName(name){ var match = rParts.exec(name), data = { - moduleName : match[1], - version : match[2] || '1' + version : match[1] || '1' }; - data.settings = propertyParser.parseProperties(match[3]); + data.settings = propertyParser.parseProperties(match[2]); return data; } @@ -28,8 +27,8 @@ define(['async', 'propertyParser'], function (async, propertyParser) { settings.callback = onLoad; - req(['async!'+ (document.location.protocol === 'https:'? 'https' : 'http') +'://www.google.com/jsapi'], function(){ - google.load(data.moduleName, data.version, settings); + req([(document.location.protocol === 'https:'? 'https' : 'http') +'://www.gstatic.com/charts/loader.js'], function(){ + google.charts.load(data.version, settings); }); } }