[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [flashproxy/master] Hide buttons when cookies or javascript is disabled.
commit c61ecc05b12b68d9895f8caf3f040a05aee0d09e
Author: Alexandre Allaire <alexandre.allaire@xxxxxxxxxxxxxx>
Date: Wed Mar 20 12:59:25 2013 -0400
Hide buttons when cookies or javascript is disabled.
---
proxy/options.html | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/proxy/options.html b/proxy/options.html
index 6ab39e1..5cbb10e 100644
--- a/proxy/options.html
+++ b/proxy/options.html
@@ -39,7 +39,7 @@ button {
margin: 0;
color: white;
}
-#badge-state p { display: none; }
+#badge-state { display: none; }
</style>
</head>
<body>
@@ -63,11 +63,13 @@ While JavaScript is disabled, your computer will not be a proxy. Enable
JavaScript to change your options.
</p>
</noscript>
-<button onclick="set_allowed()">Yes</button>
-<button onclick="set_disallowed()">No</button>
+<div id="buttons" style="display: none;">
+ <button onclick="set_allowed()">Yes</button>
+ <button onclick="set_disallowed()">No</button>
+</div>
<div id="badge-state">
-<p id="inactive">Proxy disabled</p>
-<p id="active">Proxy enabled</p>
+ <p id="inactive">Proxy disabled</p>
+ <p id="active">Proxy enabled</p>
</div>
<div id="cookies_disabled" style="display: none;">
<p>
@@ -150,7 +152,13 @@ function refresh() {
}
window.onload = function() {
- refresh();
+ if (navigator.cookieEnabled) {
+ document.getElementById("buttons").style.display = "block";
+ document.getElementById("badge-state").style.display = "block";
+ refresh();
+ } else {
+ document.getElementById("cookies_disabled").style.display = "block";
+ }
}
</script>
</body>
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits