aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js/RrdGfxPdf.js
diff options
context:
space:
mode:
authorPeter Wu2014-07-25 23:28:21 +0200
committerPim van den Berg2014-08-02 12:29:32 +0200
commitb6be82b8edefa452e72ed53391971e53d9dccf83 (patch)
tree01a33ac72f6ef7e6e5c607238bc5e4dd3a8751fe /js/RrdGfxPdf.js
parentsupport php versions without json support and show a warning message (diff)
downloadapt-panopticon_cgp-b6be82b8edefa452e72ed53391971e53d9dccf83.zip
apt-panopticon_cgp-b6be82b8edefa452e72ed53391971e53d9dccf83.tar.gz
apt-panopticon_cgp-b6be82b8edefa452e72ed53391971e53d9dccf83.tar.bz2
apt-panopticon_cgp-b6be82b8edefa452e72ed53391971e53d9dccf83.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--js/RrdGfxPdf.js8
1 files changed, 4 insertions, 4 deletions
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)
267 267
268RrdGfxPdf.prototype.lineTo = function (x,y) 268RrdGfxPdf.prototype.lineTo = function (x,y)
269{ 269{
270 this._lineTo(x, y) 270 this._lineTo(x, y);
271}; 271};
272 272
273RrdGfxPdf.prototype.text = function (x, y, color, font, tabwidth, angle, h_align, v_align, text) 273RrdGfxPdf.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
319 } 319 }
320 320
321 x = x*this.k; 321 x = x*this.k;
322 y = (this.h-y)*this.k 322 y = (this.h-y)*this.k;
323 323
324 var tm = []; 324 var tm = [];
325 tm[0] = Math.cos(angle*Math.PI/180.0); 325 tm[0] = Math.cos(angle*Math.PI/180.0);
@@ -834,7 +834,7 @@ RrdGfxPdf.prototype._putstream = function(s)
834 this._out('stream'); 834 this._out('stream');
835 this._out(s); 835 this._out(s);
836 this._out('endstream'); 836 this._out('endstream');
837}, 837};
838 838
839RrdGfxPdf.prototype._out = function(s) 839RrdGfxPdf.prototype._out = function(s)
840{ 840{
@@ -964,7 +964,7 @@ RrdGfxPdf.prototype._putcatalog = function()
964 this._out('/OpenAction [3 0 R /FitH null]'); 964 this._out('/OpenAction [3 0 R /FitH null]');
965 else if(this.ZoomMode=='real') 965 else if(this.ZoomMode=='real')
966 this._out('/OpenAction [3 0 R /XYZ null null 1]'); 966 this._out('/OpenAction [3 0 R /XYZ null null 1]');
967 else if(!(typeof this.ZoomMode === 'string')) 967 else if(typeof this.ZoomMode !== 'string')
968 this._out('/OpenAction [3 0 R /XYZ null null '+sprintf('%.2F',this.ZoomMode/100)+']'); 968 this._out('/OpenAction [3 0 R /XYZ null null '+sprintf('%.2F',this.ZoomMode/100)+']');
969 969
970 if(this.LayoutMode=='single') 970 if(this.LayoutMode=='single')