diff options
author | jasplin <qt-info@nokia.com> | 2010-05-12 13:12:58 +0200 |
---|---|---|
committer | jasplin <qt-info@nokia.com> | 2010-05-12 13:12:58 +0200 |
commit | cdf8aa6a07f2edae8dd43aa809a1b7c584898222 (patch) | |
tree | f4a2c87ed61d8cfd35321f64590b2d78889f059b | |
parent | 040ebec54bf7bfc982de02c6e04644c4dbe33291 (diff) |
Added a warning for 'no explicitly set filter values'.
This covers the case where the user
unintentionally tries to compute the index or ASF stats
without having any filter values explicitly set.
-rw-r--r-- | src/bmweb/indexsection.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bmweb/indexsection.js b/src/bmweb/indexsection.js index 8dfd074..1a1f31d 100644 --- a/src/bmweb/indexsection.js +++ b/src/bmweb/indexsection.js @@ -40,6 +40,25 @@ function createFilterOptionsString(option, values) { return s; } +function confirmComputeLink() { + var testCaseFilter = getCheckedFilterValues("ixTestCaseFilter"); + var metricFilter = getCheckedFilterValues("ixMetricFilter"); + var platformFilter = getCheckedFilterValues("ixPlatformFilter"); + var hostFilter = getCheckedFilterValues("ixHostFilter"); + var branchFilter = getCheckedFilterValues("ixBranchFilter"); + + var filterValuesSet = + (testCaseFilter.length > 0) + || (metricFilter.length > 0) + || (platformFilter.length > 0) + || (hostFilter.length > 0) + || (branchFilter.length > 0); + + return filterValuesSet + ? true + : confirm("No filter values have been explicitly set! Compute " + linkDescr + " anyway?"); +} + function updateComputeIndexLink(defaultBaseTime, defaultMedianWinSize) { // Initialize URL ... @@ -89,6 +108,8 @@ function updateComputeIndexLink(defaultBaseTime, defaultMedianWinSize) link.setAttribute("href", url) link.setAttribute("target", "_blank"); // prevent page from opening in same window + + linkDescr = "index"; } function updateComputeASFStatsLink(defaultMedianWinSize) @@ -126,6 +147,8 @@ function updateComputeASFStatsLink(defaultMedianWinSize) link.setAttribute("href", url); link.setAttribute("target", "_blank"); // prevent page from opening in same window + + linkDescr = "ASF stats"; } function updateComputeStatsLink(defaultBaseTime, defaultMedianWinSize) @@ -156,6 +179,8 @@ function IndexSection() // given combination, the value itself and all the other values of // the combination need to be selected. + var linkDescr = "<no descr>"; + this.name = function() { return "ixSection"; } this.reset = function(handleDone) @@ -605,6 +630,7 @@ function IndexSection() + ", " + defaultMedianWinSize + ")" ); + link.onclick = confirmComputeLink; // ... data quality stats fieldset ... td = topRow.insertCell(topRow.cells.length); @@ -670,6 +696,8 @@ function IndexSection() + defaultMedianWinSize + ")" ); + link.onclick = confirmComputeLink; + fieldset.appendChild(document.createElement("br")); table = fieldset.appendChild(document.createElement("table")); |