From 04e45ad7e22505b1cd70f22e38e2cbb09e8a28a6 Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Thu, 30 Dec 2010 23:56:16 +0000 Subject: step 2 - choose a label and unit --- jarmon/jarmon.js | 115 +++++++++++++++++++++++++++++++++----------------- jarmon/jarmon.test.js | 4 +- 2 files changed, 79 insertions(+), 40 deletions(-) diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index ae452d3..1c5c3eb 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -693,68 +693,107 @@ jarmon.Chart.fromRecipe = function(recipes, templateFactory, downloader) { jarmon.ChartConfig = function($tpl) { this.$tpl = $tpl; this.rrdUrl = ''; - this.dsNames = []; - this.errors = []; + this.dsName = ''; + this.dsLabel = ''; + this.dsUnit = ''; }; -jarmon.ChartConfig.prototype.draw = function() { +jarmon.ChartConfig.prototype.drawRrdUrlForm = function() { var self = this; this.$tpl.empty(); - $(this.errors).map(function(i, el) { - return $('

', {'class': 'error'}).text(el.toString()); - }).appendTo(this.$tpl); + var $f = $('

'); - var $f = $('') $('
').append( + $('

').text('Enter the URL of an RRD file'), $('

', {class: 'next'}) ) ).appendTo($f); - $(this.dsNames).map(function(i, el) { - return $('