[tor-commits] [flashproxy/master] Put all the badge colors in CSS and control them through class names.
dcf at torproject.org
dcf at torproject.org
Tue Jul 10 00:28:34 UTC 2012
commit 60ab5e99e639fcd28b8869e8347be93c315d0407
Author: David Fifield <david at bamsoftware.com>
Date: Mon Jul 9 15:59:56 2012 -0700
Put all the badge colors in CSS and control them through class names.
---
embed.html | 11 +++++++++++
flashproxy.js | 12 +++++-------
2 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/embed.html b/embed.html
index 2acc381..184869f 100644
--- a/embed.html
+++ b/embed.html
@@ -22,8 +22,19 @@ body {
border: 0;
border-collapse: collapse;
line-height: 0;
+}
+#flashproxy-badge.idle {
background-color: #227;
}
+#flashproxy-badge.active {
+ background-color: #28f;
+}
+#flashproxy-badge.disabled {
+ background-color: #777;
+}
+#flashproxy-badge.dead {
+ background-color: #111;
+}
#flashproxy-badge td {
margin: 0;
padding: 0;
diff --git a/flashproxy.js b/flashproxy.js
index eea3541..422be89 100644
--- a/flashproxy.js
+++ b/flashproxy.js
@@ -694,28 +694,26 @@ function Badge() {
a.appendChild(img);
this.elem = table;
+ this.elem.className = "idle";
this.proxy_begin = function() {
- if (this.num_proxy_pairs <= 0) {
- this.idle_color = this.elem.getAttribute("background-color");
- }
this.num_proxy_pairs++;
- this.set_color("#28f");
+ this.elem.className = "active";
};
this.proxy_end = function() {
this.num_proxy_pairs--;
if (this.num_proxy_pairs <= 0) {
- this.set_color(this.idle_color);
+ this.elem.className = "idle";
}
}
this.disable = function() {
- this.set_color("#777");
+ this.elem.className = "disabled";
}
this.die = function() {
- this.set_color("#111");
+ this.elem.className = "dead";
}
this.set_color = function(color) {
More information about the tor-commits
mailing list