summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2011-02-23 10:57:11 +0100
committerjasplin <qt-info@nokia.com>2011-02-23 10:57:11 +0100
commit39dd1cbd0444bd363d4b5d5a1314d908670c9167 (patch)
tree37660e89d839f6be262317c9cb4456afec12d02a
parentfc492807911bbb61ca105f28a4b50a1e8de322b9 (diff)
Replaced certain checkboxes with radio buttons.
-rw-r--r--web/getstats/main.js27
-rw-r--r--web/getstats/rankings.js8
-rw-r--r--web/getstats/stats2.js17
-rw-r--r--web/getstats/tsbmbody.js10
-rw-r--r--web/getstats/tsstats.js8
5 files changed, 22 insertions, 48 deletions
diff --git a/web/getstats/main.js b/web/getstats/main.js
index 17f435b..e10c4d0 100644
--- a/web/getstats/main.js
+++ b/web/getstats/main.js
@@ -363,11 +363,13 @@ function fetchContexts() {
context = contexts[i];
html += "<tr id=\"context_row:" + i + "\">";
html += "<td><input id=\"context1_cb:" + i + "\" " +
- "name=\"context1\" type=\"checkbox\" " +
- "onclick=\"clickContextCheckbox(this, 0)\"></td>";
+ "name=\"context1\" type=\"radio\" " +
+ "onclick=\"clickContextRadioButton(this, 0)\">" +
+ "</td>";
html += "<td><input id=\"context2_cb:" + i + "\" " +
- "name=\"context2\" type=\"checkbox\" " +
- "onclick=\"clickContextCheckbox(this, 1)\"></td>";
+ "name=\"context2\" type=\"radio\" " +
+ "onclick=\"clickContextRadioButton(this, 1)\">" +
+ "</td>";
html += "<td name=\"host\">" + context.host +
"</td>";
@@ -471,21 +473,8 @@ function highlightContextsTable() {
$("#extra_context2_row").attr("class", "context2");
}
-// Handles clicking a context checkbox. Exactly one Context 1 and
-// zero or one Context 2 must be selected at any time.
-function clickContextCheckbox(cb, col) {
- // Enforce selection invariant:
- if (cb.checked) {
- // Deselect all other checkboxes in this column
- // (note: nth-child assumes 1-based indexes):
- $("#contextsTable td:nth-child(" + (col + 1) + ") input")
- .attr("checked", false);
- cb.checked = true;
- } else if ((col == 0)) {
- // Prevent deselection by reselecting:
- cb.checked = true;
- }
-
+// Handles clicking a context radio button.
+function clickContextRadioButton(cb, col) {
// Check if the same host/platform/branch combination is selected for
// both contexts. If so, add an extra row below the selected row to enable
// selection of a different snapshot for the Context 2
diff --git a/web/getstats/rankings.js b/web/getstats/rankings.js
index ad33b1b..e871c0b 100644
--- a/web/getstats/rankings.js
+++ b/web/getstats/rankings.js
@@ -135,16 +135,14 @@ function populateRankingTable(
html += "<tr>"
- html += "<td><input id=\"bm_cb:" + i +
- "\" name=\"currSelector\" type=\"checkbox\" " +
- "onclick=\"" +
- "clickBenchmarkCheckbox(this, '" + tableSel + "', '" +
+ html += "<td><input type=\"radio\" onclick=\"" +
+ "clickBMRadioButton(this, '" + tableSel + "', '" +
database + "', '" + host + "', '" +
platform + "', '" + branch + "', '" +
sha11 + "', '" + sha12 + "', '" +
benchmark + "', '" + metric + "', " +
difftol + ", " + durtolmin + ", " + durtolmax +
- ")\"</td>";
+ ")\"></td>";
if (pos >= 0) {
html += "<td style=\"text-align:right\">" + pos + "</td>";
diff --git a/web/getstats/stats2.js b/web/getstats/stats2.js
index ecb64de..651dd29 100644
--- a/web/getstats/stats2.js
+++ b/web/getstats/stats2.js
@@ -123,15 +123,10 @@ function plot_selectResult(index) {
plot.triggerRedrawOverlay();
}
-// Handles clicking a benchmark checkbox. At most one benchmark may
-// be selected at any time.
-function table_clickBenchmarkCheckbox(cb) {
+// Handles clicking a benchmark radio button.
+function table_clickBMRadioButton(cb) {
if (cb.checked) {
- // Deselect all other benchmarks:
- $("#pbmTable input").attr("checked", false);
- cb.checked = true;
- index = cb.id.match(/bm_cb:(\d+)/)[1];
-
+ var index = cb.id.match(/bm_cb:(\d+)/)[1];
plot_selectResult(index); // synchronize plot
} else {
plot_clearSelection(); // synchronize plot
@@ -919,9 +914,9 @@ function fetchStats(testCaseFilter) {
lowerIsBetter[metric] = lib;
firstColHtml = "<input id=\"bm_cb:" + index +
- "\" type=\"checkbox\" " +
- "onclick=\"" +
- "table_clickBenchmarkCheckbox(this)\">";
+ "\" name=\"currSelector\" " +
+ "type=\"radio\" onclick=\"" +
+ "table_clickBMRadioButton(this)\">";
} else {
firstColHtml =
"<span style=\"color:red\">n/a</span>";
diff --git a/web/getstats/tsbmbody.js b/web/getstats/tsbmbody.js
index 541fcd1..0b299e4 100644
--- a/web/getstats/tsbmbody.js
+++ b/web/getstats/tsbmbody.js
@@ -1279,18 +1279,12 @@ function setSnapshots(sshots) {
sshots[0], sshots[sshots.length - 1], sshots.length);
}
-// Handles clicking a benchmark checkbox. At most one benchmark may
-// be selected at any time.
-function clickBenchmarkCheckbox(
+// Handles clicking a benchmark radio button.
+function clickBMRadioButton(
cb, tableSel, database, host, platform, branch, sha11, sha12, benchmark,
metric, difftol, durtolmin, durtolmax) {
if (cb.checked) {
- // Deselect all other benchmarks:
- $(tableSel + " input").attr("checked", false);
- cb.checked = true;
- index = cb.id.match(/bm_cb:(\d+)/)[1];
-
// Fetch and plot time series:
fetchTimeSeries(
database, host, platform, branch, sha11, sha12, benchmark, metric,
diff --git a/web/getstats/tsstats.js b/web/getstats/tsstats.js
index 1ee26f4..93e58ab 100644
--- a/web/getstats/tsstats.js
+++ b/web/getstats/tsstats.js
@@ -165,17 +165,15 @@ function populatePbmTable(tableSel, data) {
rbdy += "<td></td>"; // LCDS2
}
- rbdy = "<td><input id=\"bm_cb:" + i +
- "\" type=\"checkbox\" " +
- "onclick=\"" +
- "clickBenchmarkCheckbox(this, '" + tableSel + "', '" +
+ rbdy = "<td><input name=\"currSelector\" type=\"radio\" onclick=\"" +
+ "clickBMRadioButton(this, '" + tableSel + "', '" +
data.database + "', '" + data.host + "', '" +
data.platform + "', '" + data.branch + "', '" +
data.sha11 + "', '" + data.sha12 + "', '" +
stats.bm + "', '" + stats.mt + "', " +
data.difftol + ", " + data.durtolmin + ", " +
data.durtolmax +
- ")\"</td>" +
+ ")\"></td>" +
rbdy;
rbdy += "<td class=\"metric\">" + stats.mt + "</td>";