Sign in to follow this  
Aleksey

Bug In Fusioncharts.hc.js

Recommended Posts

You have error in the following code

 

..................................
       	var p = {
           	position: "absolute",
           	top: "-9999em",
           	whiteSpace: "nowrap"
       	},
           	g = 0,
           	S = /\b_SmartLabel\b/,
           	ua = /\b_SmartLabelBR\b/,
           	o = /(\<[^\<\>]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,
           	C = RegExp("<span[^>]+?_SmartLabel[^>]+?>(.*?)</span>", "ig"),
           	P = /<[^>][^<]*[^>]+>/i,
           	D = 0,
           	q = 0,
           	y = 0,
           	t = 0,
           	I = 0,
           	na, F, B;
       	document.getElementsByClassName ? (na = "getElementsByClassName", F = "_SmartLabel", B = !0) : (na = "getElementsByTagName", F = "span", B = !1);
       	s.prototype = {
           	dispose: function () {
               	var a = this.container,
                   	c;
               	if (this.init) {
                   	if (a && (c = a.parentNode)) c.removeChild(a),
                   	delete this.container;
                   	delete this.id;
                   	delete this.style;
                   	delete this.parentContainer;
                   	delete this.showNoEllipses
               	}
           	},
           	useEllipsesOnOverflow: function (a) {
               	if (this.init) this.showNoEllipses = !a
           	},
           	getSmartText: function (c, s, z, p) {
               	if (!this.init) return !1;
               	n(c) === void 0 && (c = "");
               	if (!this.container) this.container = a(this.parentContainer),
               	this.setStyle();
               	var X = {
                   	text: c,
                   	maxWidth: s,
                   	maxHeight: z,
                   	width: null,
                   	height: null,
                   	oriTextWidth: null,
                   	oriTextHeight: null,
                   	oriText: c,
                   	isTruncated: !1
               	},
                   	y = !1,
                   	I, fa, K, U, Q = -1,
                   	Cb = -1,
                   	W = -1,
                   	L = this.container,
                   	T = [],
                   	ba = this.showNoEllipses ? "" : "...",
               	e = function (e) {
                   	for (var e = e.replace(/^\s\s*/, ""), a = /\s/, m = e.length; a.test(e.charAt(m -= 1));
                   	return e.slice(0, m + 1)
               	};
               	if (L) {
                   	L.innerHTML = c;
                   	X.oriTextWidth = K = L.offsetWidth;
                   	X.oriTextHeight = y = L.offsetHeight;
                   	if (y <= z && K <= s) return X.width = X.oriTextWidth = K,
                   	X.height = X.oriTextHeight = y,
                   	X;
                   	if (D > z) return X.text = "",
                   	X.width = X.oriTextWidth = 0,
                   	X.height = X.oriTextHeight = 0,
                   	X;
                   	c = e(c).replace(/(\s+)/g, " ");
                   	y = P.test(c);
                   	i = 0;
                   	K = this.showNoEllipses ? s : s - g;
...................

 

You are using i = 0 without var. So i become a global variable. I have errors in my projects because of this.

You just need to use the following code to fix it:

 

...........................
           	D = 0,
           	q = 0,
           	y = 0,
           	t = 0,
           	I = 0,
           	i = 0,
           	na, F, B;
..................

 

Regards,

Aleksey.

Share this post


Link to post
Share on other sites

Hi,

 

You have error in the following code

 

..................................
       	var p = {
           	position: "absolute",
           	top: "-9999em",
           	whiteSpace: "nowrap"
       	},
           	g = 0,
           	S = /\b_SmartLabel\b/,
           	ua = /\b_SmartLabelBR\b/,
           	o = /(\<[^\<\>]+?\>)|(&(?:[a-z]+|#[0-9]+);|.)/ig,
           	C = RegExp("<span[^>]+?_SmartLabel[^>]+?>(.*?)</span>", "ig"),
           	P = /<[^>][^<]*[^>]+>/i,
           	D = 0,
           	q = 0,
           	y = 0,
           	t = 0,
           	I = 0,
           	na, F, B;
       	document.getElementsByClassName ? (na = "getElementsByClassName", F = "_SmartLabel", B = !0) : (na = "getElementsByTagName", F = "span", B = !1);
       	s.prototype = {
           	dispose: function () {
               	var a = this.container,
                   	c;
               	if (this.init) {
                   	if (a && (c = a.parentNode)) c.removeChild(a),
                   	delete this.container;
                   	delete this.id;
                   	delete this.style;
                   	delete this.parentContainer;
                   	delete this.showNoEllipses
               	}
           	},
           	useEllipsesOnOverflow: function (a) {
               	if (this.init) this.showNoEllipses = !a
           	},
           	getSmartText: function (c, s, z, p) {
               	if (!this.init) return !1;
               	n(c) === void 0 && (c = "");
               	if (!this.container) this.container = a(this.parentContainer),
               	this.setStyle();
               	var X = {
                   	text: c,
                   	maxWidth: s,
                   	maxHeight: z,
                   	width: null,
                   	height: null,
                   	oriTextWidth: null,
                   	oriTextHeight: null,
                   	oriText: c,
                   	isTruncated: !1
               	},
                   	y = !1,
                   	I, fa, K, U, Q = -1,
                   	Cb = -1,
                   	W = -1,
                   	L = this.container,
                   	T = [],
                   	ba = this.showNoEllipses ? "" : "...",
               	e = function (e) {
                   	for (var e = e.replace(/^\s\s*/, ""), a = /\s/, m = e.length; a.test(e.charAt(m -= 1));
                   	return e.slice(0, m + 1)
               	};
               	if (L) {
                   	L.innerHTML = c;
                   	X.oriTextWidth = K = L.offsetWidth;
                   	X.oriTextHeight = y = L.offsetHeight;
                   	if (y <= z && K <= s) return X.width = X.oriTextWidth = K,
                   	X.height = X.oriTextHeight = y,
                   	X;
                   	if (D > z) return X.text = "",
                   	X.width = X.oriTextWidth = 0,
                   	X.height = X.oriTextHeight = 0,
                   	X;
                   	c = e(c).replace(/(\s+)/g, " ");
                   	y = P.test(c);
                   	i = 0;
                   	K = this.showNoEllipses ? s : s - g;
...................

 

You are using i = 0 without var. So i become a global variable. I have errors in my projects because of this.

You just need to use the following code to fix it:

 

...........................
           	D = 0,
           	q = 0,
           	y = 0,
           	t = 0,
           	I = 0,
           	i = 0,
           	na, F, B;
..................

 

Regards,

Aleksey.

 

Thanks for the suggestion.

 

We have made a note of the same and shall update our Development team on this.

 

Thank you for your continued patience and support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this