From b6be82b8edefa452e72ed53391971e53d9dccf83 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Fri, 25 Jul 2014 23:28:21 +0200 Subject: jsrrdgraph: Fixed jshint warnings/errors Many fall in the category missing semicolon, but there are legitimate bugs (like throwing an error with an undefined variable, using isInfinite instead of !isFinite or fabs instead of Math.abs). At some places, I moved the variable declarations to avoid duplicate definition warnings. Redundant breaks have been removed (after return / throw). Global variables were implicitly defined in RrdDataFile (which caught my attention) and Base64, these have been made local. Also fixed some whitespace errors. Yay, the consistency. Not all (style) issues are fixed. --- js/RrdGfxPdf.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'js/RrdGfxPdf.js') diff --git a/js/RrdGfxPdf.js b/js/RrdGfxPdf.js index 9203020..230d441 100644 --- a/js/RrdGfxPdf.js +++ b/js/RrdGfxPdf.js @@ -267,7 +267,7 @@ RrdGfxPdf.prototype.moveTo = function (x,y) RrdGfxPdf.prototype.lineTo = function (x,y) { - this._lineTo(x, y) + this._lineTo(x, y); }; RrdGfxPdf.prototype.text = function (x, y, color, font, tabwidth, angle, h_align, v_align, text) @@ -319,7 +319,7 @@ RrdGfxPdf.prototype.text = function (x, y, color, font, tabwidth, angle, h_align } x = x*this.k; - y = (this.h-y)*this.k + y = (this.h-y)*this.k; var tm = []; tm[0] = Math.cos(angle*Math.PI/180.0); @@ -834,7 +834,7 @@ RrdGfxPdf.prototype._putstream = function(s) this._out('stream'); this._out(s); this._out('endstream'); -}, +}; RrdGfxPdf.prototype._out = function(s) { @@ -964,7 +964,7 @@ RrdGfxPdf.prototype._putcatalog = function() this._out('/OpenAction [3 0 R /FitH null]'); else if(this.ZoomMode=='real') this._out('/OpenAction [3 0 R /XYZ null null 1]'); - else if(!(typeof this.ZoomMode === 'string')) + else if(typeof this.ZoomMode !== 'string') this._out('/OpenAction [3 0 R /XYZ null null '+sprintf('%.2F',this.ZoomMode/100)+']'); if(this.LayoutMode=='single') -- cgit v1.1