From 6e5c667ab9a2de97251e036168ec4dc3a1490cb0 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 12 Jun 2011 17:20:35 +0100 Subject: fix some js errors --- jarmon/jarmon.js | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index 1dda6a8..c318aee 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -63,10 +63,11 @@ jarmon.downloadBinary = function(url) { // differently. if(textStatus == 'parsererror') { if (typeof xhr.responseBody != 'undefined') { - return this.success(xhr.responseBody); + this.success(xhr.responseBody); } + } else { + this._deferredResult.errback(new Error(xhr.status)); } - this._deferredResult.errback(new Error(xhr.status)); } }); return d; @@ -240,10 +241,10 @@ jarmon.RrdQuery.prototype.getData = function(startTimeJs, endTimeJs, dsId, cfNam var val; var timestamp = startRowTime; - for(var i=startRowIndex; i axis.max ) { @@ -446,7 +447,7 @@ jarmon.Chart = function(template, recipe, downloader) { var stepSize, decimalPlaces = 0; for(var i=0; i', {type: 'submit', value: 'download'}), - $('
', {class: 'next'}) + $('', {'type': 'submit', value: 'download'}), + $('
', {'class': 'next'}) ) ).submit( function(e) { @@ -738,7 +739,7 @@ jarmon.RrdChooser.prototype.drawRrdUrlForm = function() { return false; } ).appendTo(this.$tpl); -} +}; jarmon.RrdChooser.prototype.drawDsLabelForm = function() { var self = this; @@ -772,7 +773,7 @@ jarmon.RrdChooser.prototype.drawDsLabelForm = function() { } ), $('', {type: 'submit', value: 'save'}), - $('
', {class: 'next'}) + $('
', {'class': 'next'}) ).submit( function(e) { self.data.dsLabel = this['dsLabel'].value; @@ -931,7 +932,7 @@ jarmon.ChartEditor.prototype._extractRowValues = function($row) { function(i, el) { return el.value; } - ) + ); }; @@ -1044,7 +1045,7 @@ jarmon.TabbedInterface = function($tpl, recipe) { 'value': $originalLink.text(), 'name': 'editTabTitle', 'type': 'text' - }) + }); $originalLink.replaceWith($input); $input.focus(); } @@ -1060,7 +1061,7 @@ jarmon.TabbedInterface = function($tpl, recipe) { $('', { href: ['#', this.value].join('') }).text(this.value) - ) + ); self.setup(); self.$tabBar.data("tabs").click(this.value); } @@ -1307,7 +1308,7 @@ jarmon.ChartCoordinator = function(ui, charts) { tzoffsetEl = this.ui.find('[name="tzoffset"]'); if(tzoffsetEl.is('select')) { var label, val; - for(var i=-12; i<=12; i++) { + for(i=-12; i<=12; i++) { label = 'UTC'; val = i; if(val >= 0) { @@ -1475,7 +1476,7 @@ jarmon.ChartCoordinator.prototype.update = function() { this.rangePreviewOptions.xaxis.tzoffset = tzoffset; var chartsLoading = []; - for(var i=0; i