tor-commits
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 214563 discussions
[tor/master] Fix compilation on non-bufferevent systems after 3803 fix: oops.
by nickm@torproject.org 29 Aug '11
by nickm@torproject.org 29 Aug '11
29 Aug '11
commit cdbfc2a0c26fbe4cc3348babf3b92fb1ae931dec
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Mon Aug 29 13:41:59 2011 -0400
Fix compilation on non-bufferevent systems after 3803 fix: oops.
---
src/or/connection.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/or/connection.c b/src/or/connection.c
index 23546f0..7615952 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2223,6 +2223,7 @@ record_num_bytes_transferred_impl(connection_t *conn,
rep_hist_note_exit_bytes(conn->port, num_written, num_read);
}
+#ifdef USE_BUFFEREVENTS
/** DOCDOC */
static void
record_num_bytes_transferred(connection_t *conn,
@@ -2242,6 +2243,7 @@ record_num_bytes_transferred(connection_t *conn,
record_num_bytes_transferred_impl(conn,now,num_read,num_written);
}
+#endif
#ifndef USE_BUFFEREVENTS
/** We just read <b>num_read</b> and wrote <b>num_written</b> bytes
@@ -2261,7 +2263,7 @@ connection_buckets_decrement(connection_t *conn, time_t now,
tor_fragile_assert();
}
- record_num_bytes_transferred_(conn, now, num_read, num_written);
+ record_num_bytes_transferred_impl(conn, now, num_read, num_written);
if (!connection_is_rate_limited(conn))
return; /* local IPs are free */
1
0
29 Aug '11
commit 0de8afd8f545b4104ffb05d307b019cdf5aa505a
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Mon Aug 29 12:55:59 2011 -0400
Split out rephist parts of buckets_decrement
For bufferevents, we had all of connection_buckets_decrement() stubbed
out. But that's not actually right! The rephist_* parts were
essential for, inter alia, recording our own bandwidth. This patch
splits out the rephist parts of connection_buckets_decrement() into their
own function, and makes the bufferevent code call that new function.
Fixes bug 3803, and probably 3824 and 3826 too. Bugfix on 0.2.3.1-alpha.
---
changes/bug3803 | 4 +++
src/or/connection.c | 69 +++++++++++++++++++++++++++++++++++++--------------
2 files changed, 54 insertions(+), 19 deletions(-)
diff --git a/changes/bug3803 b/changes/bug3803
new file mode 100644
index 0000000..2d50f0c
--- /dev/null
+++ b/changes/bug3803
@@ -0,0 +1,4 @@
+ o Major bugfixes (bufferevents):
+ - Correctly record the bytes we've read and written when using
+ bufferevents, so that we can include them in our bandwidth history
+ and advertised bandwidth. Fixes bug 3803; bugfix on 0.2.3.1-alpha.
diff --git a/src/or/connection.c b/src/or/connection.c
index dc804dd..23546f0 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2193,24 +2193,11 @@ global_write_bucket_low(connection_t *conn, size_t attempt, int priority)
return 0;
}
-#ifndef USE_BUFFEREVENTS
-/** We just read <b>num_read</b> and wrote <b>num_written</b> bytes
- * onto <b>conn</b>. Decrement buckets appropriately. */
+/** DOCDOC */
static void
-connection_buckets_decrement(connection_t *conn, time_t now,
- size_t num_read, size_t num_written)
+record_num_bytes_transferred_impl(connection_t *conn,
+ time_t now, size_t num_read, size_t num_written)
{
- if (num_written >= INT_MAX || num_read >= INT_MAX) {
- log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, "
- "connection type=%s, state=%s",
- (unsigned long)num_read, (unsigned long)num_written,
- conn_type_to_string(conn->type),
- conn_state_to_string(conn->type, conn->state));
- if (num_written >= INT_MAX) num_written = 1;
- if (num_read >= INT_MAX) num_read = 1;
- tor_fragile_assert();
- }
-
/* Count bytes of answering direct and tunneled directory requests */
if (conn->type == CONN_TYPE_DIR && conn->purpose == DIR_PURPOSE_SERVER) {
if (num_read > 0)
@@ -2234,6 +2221,50 @@ connection_buckets_decrement(connection_t *conn, time_t now,
}
if (conn->type == CONN_TYPE_EXIT)
rep_hist_note_exit_bytes(conn->port, num_written, num_read);
+}
+
+/** DOCDOC */
+static void
+record_num_bytes_transferred(connection_t *conn,
+ time_t now, size_t num_read, size_t num_written)
+{
+ /* XXX023 check if this is necessary */
+ if (num_written >= INT_MAX || num_read >= INT_MAX) {
+ log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, "
+ "connection type=%s, state=%s",
+ (unsigned long)num_read, (unsigned long)num_written,
+ conn_type_to_string(conn->type),
+ conn_state_to_string(conn->type, conn->state));
+ if (num_written >= INT_MAX) num_written = 1;
+ if (num_read >= INT_MAX) num_read = 1;
+ tor_fragile_assert();
+ }
+
+ record_num_bytes_transferred_impl(conn,now,num_read,num_written);
+}
+
+#ifndef USE_BUFFEREVENTS
+/** We just read <b>num_read</b> and wrote <b>num_written</b> bytes
+ * onto <b>conn</b>. Decrement buckets appropriately. */
+static void
+connection_buckets_decrement(connection_t *conn, time_t now,
+ size_t num_read, size_t num_written)
+{
+ if (num_written >= INT_MAX || num_read >= INT_MAX) {
+ log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, "
+ "connection type=%s, state=%s",
+ (unsigned long)num_read, (unsigned long)num_written,
+ conn_type_to_string(conn->type),
+ conn_state_to_string(conn->type, conn->state));
+ if (num_written >= INT_MAX) num_written = 1;
+ if (num_read >= INT_MAX) num_read = 1;
+ tor_fragile_assert();
+ }
+
+ record_num_bytes_transferred_(conn, now, num_read, num_written);
+
+ if (!connection_is_rate_limited(conn))
+ return; /* local IPs are free */
if (connection_counts_as_relayed_traffic(conn, now)) {
global_relayed_read_bucket -= (int)num_read;
@@ -2443,7 +2474,6 @@ connection_bucket_should_increase(int bucket, or_connection_t *conn)
return 1;
}
#else
-
static void
connection_buckets_decrement(connection_t *conn, time_t now,
size_t num_read, size_t num_written)
@@ -2454,6 +2484,7 @@ connection_buckets_decrement(connection_t *conn, time_t now,
(void) num_written;
/* Libevent does this for us. */
}
+
void
connection_bucket_refill(int seconds_elapsed, time_t now)
{
@@ -2826,7 +2857,7 @@ evbuffer_inbuf_callback(struct evbuffer *buf,
if (info->n_added) {
time_t now = approx_time();
conn->timestamp_lastread = now;
- connection_buckets_decrement(conn, now, info->n_added, 0);
+ record_num_bytes_transferred(conn, now, info->n_added, 0);
connection_consider_empty_read_buckets(conn);
if (conn->type == CONN_TYPE_AP) {
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
@@ -2847,7 +2878,7 @@ evbuffer_outbuf_callback(struct evbuffer *buf,
if (info->n_deleted) {
time_t now = approx_time();
conn->timestamp_lastwritten = now;
- connection_buckets_decrement(conn, now, 0, info->n_deleted);
+ record_num_bytes_transferred(conn, now, 0, info->n_deleted);
connection_consider_empty_write_buckets(conn);
if (conn->type == CONN_TYPE_AP) {
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
1
0
29 Aug '11
commit d450147910a05d72b304cdfe2d449a65e7db41a3
Author: Jacob Appelbaum <jacob(a)appelbaum.net>
Date: Mon Aug 29 18:16:46 2011 +0200
add interfaces and module overrides
---
freedom-maker/mk_dreamplug_rootfs | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/freedom-maker/mk_dreamplug_rootfs b/freedom-maker/mk_dreamplug_rootfs
index a70f032..5f11bc9 100755
--- a/freedom-maker/mk_dreamplug_rootfs
+++ b/freedom-maker/mk_dreamplug_rootfs
@@ -115,6 +115,12 @@ allow-hotplug eth1
iface eth1 inet dhcp
" > $target/etc/network/interfaces
+# Override the above stuff - we know better
+cp ../packages/torouter-prep/configs/interfaces $target/etc/network/interfaces
+
+# Stop the libertas module from loading
+cp ../packages/torouter-prep/configs/modprobe.d-blacklist.conf $target/etc/modprobe.d/blacklist.conf
+
# Setup nameserver (use OpenDNS by default)
echo "nameserver 208.67.222.222
nameserver 208.67.220.220" > $target/etc/resolv.conf
1
0
commit 582053df481e11b7f1648a9983a71ed147f75cf9
Author: Jacob Appelbaum <jacob(a)appelbaum.net>
Date: Mon Aug 29 17:22:14 2011 +0200
print info before takeover
---
packages/torouter_easy_setup.sh | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/packages/torouter_easy_setup.sh b/packages/torouter_easy_setup.sh
index f5bf6c5..d9a85ea 100755
--- a/packages/torouter_easy_setup.sh
+++ b/packages/torouter_easy_setup.sh
@@ -33,5 +33,28 @@ apt-key add /tmp/torouter-repo.key
apt-get update --fix-missing
apt-get install -t torrouter -y torouter-prep
+echo "This is the current state of the system:"
+
+echo "Kernel message log: "
+
+dmesg
+
+echo "Kernel modules: "
+
+lsmod
+
+echo "File systems: "
+mount
+echo
+df -h
+
+echo "Interfaces: "
+
+ifconfig -a
+
+echo "Route info: "
+
+route -n
+
echo "We're going to trash your system now; you have 30 seconds to bail out!"
sleep 30 && /usr/bin/torouter_config.sh
1
0
r24976: {website} new download page layout from jeremy from ticket 3590. (in website/trunk: . css download/en images js)
by Andrew Lewman 28 Aug '11
by Andrew Lewman 28 Aug '11
28 Aug '11
Author: phobos
Date: 2011-08-29 02:37:19 +0000 (Mon, 29 Aug 2011)
New Revision: 24976
Added:
website/trunk/download/en/head.wmi
website/trunk/download/en/lang.wmi
website/trunk/images/button-downloadpage.png
website/trunk/images/icon-linux24.png
website/trunk/images/icon-mac24.png
website/trunk/images/icon-smartphone24.png
website/trunk/images/icon-sourcecode24.png
website/trunk/images/icon-windows24.png
website/trunk/js/
website/trunk/js/dlpage01.js
website/trunk/js/jquery.accordion.min.js
website/trunk/js/jquery.client.min.js
website/trunk/js/jquery.min.js
website/trunk/js/ppwidget.js
Modified:
website/trunk/css/layout-rtl.css
website/trunk/css/layout.css
website/trunk/css/typography.css
website/trunk/download/en/download.wml
website/trunk/images/warning.png
Log:
new download page layout from jeremy from ticket 3590.
Modified: website/trunk/css/layout-rtl.css
===================================================================
--- website/trunk/css/layout-rtl.css 2011-08-29 02:12:07 UTC (rev 24975)
+++ website/trunk/css/layout-rtl.css 2011-08-29 02:37:19 UTC (rev 24976)
@@ -194,16 +194,65 @@
float: left;
}
-.windows,
-.mac,
-.linux,
-.android { padding: 5px 30px 5px 0; }
+/* DL PAGE ------------*/
-.windows { background-position: right center; }
-.mac { background-position: right center; }
-.linux { background-position: right center; }
-.android { background-position: right center; }
+.windows24,
+.mac24,
+.linux24,
+.smartphone24,
+.sourcecode24 {
+ background-position: right center;
+ padding: 0px 33px 0px 0;
+ }
+.warning-top {
+ padding: 10px 60px 10px 10px;
+ background: url("../images/warning.png") no-repeat scroll 628px 23px #FFFEB6;
+ }
+
+.warning-top h2 {
+ padding-left: 15px;
+ padding-right: 0px;
+ }
+
+.warning-top p {
+ padding-left: 0;
+ padding-right: 10px;
+ }
+
+.warning h2 {
+ padding-left: 0;
+ padding-right: 0px;
+ }
+
+.warning p {
+ padding-left: 0;
+ padding-right: 10px;
+ }
+
+.accordionButton {
+ padding-left: 0;
+ padding-right: 10px;
+ }
+
+.package p {
+ padding-left: 0px;
+ padding-right: 10px;
+ }
+
+.downloads {
+ float: left;
+ margin: 0px 20px 0 0;
+ }
+
+.lang {
+ float: left;
+ margin: 0px 0px 0px 7px;
+ padding: 0px 3px 0px 0px;
+ }
+
+/* END DL PAGE ------------*/
+
.title {
background: url(../images/table-title-arrow-rtl.jpg) right top no-repeat;
padding: 10px 10px 0 25px;
@@ -220,18 +269,6 @@
}
.paypal span { padding-left: 20px; }
-.warning {
- background-position: right center;
-}
- .warning h2 {
- background: url("../images/warning2.jpg") no-repeat scroll right top transparent;
- padding-right: 40px;
- }
-
- .warning p {
- padding-right: 20px;
- }
-
.focus .icon {
float: right;
margin-left: 10px;
@@ -294,11 +331,6 @@
padding-right: 0px;
}
-.dbox.dl {
- margin: -50px 20px 20px 0px;
- float: left;
- }
-
#footer .about {
padding-left: 30px;
border-left: 1px solid #ddd;
Modified: website/trunk/css/layout.css
===================================================================
--- website/trunk/css/layout.css 2011-08-29 02:12:07 UTC (rev 24975)
+++ website/trunk/css/layout.css 2011-08-29 02:37:19 UTC (rev 24976)
@@ -453,23 +453,163 @@
width: auto;
}
-/* DL TABLE ------------*/
+/* DL PAGE ------------*/
-td.intro { padding: 0 0 10px; }
+.windows24 {
+ /* Open Icon Library - Webpage Icons Package
+ * Source: http://openiconlibrary.sourceforge.net/downloads.html */
+ background: url("../images/icon-windows24.png") no-repeat scroll left center transparent;
+ }
-.windows,
-.mac,
-.linux,
-.android {
- padding: 5px 0 5px 30px;
- }
+.mac24 {
+ /* Open Icon Library - Webpage Icons Package
+ * Source: http://openiconlibrary.sourceforge.net/downloads.html */
+ background: url("../images/icon-mac24.png") no-repeat scroll left center transparent;
+ }
-.windows { background: url(../images/icon-windows.gif) left center no-repeat; }
-.mac { background: url(../images/icon-mac.gif) left center no-repeat; }
-.linux { background: url(../images/icon-linux.gif) left center no-repeat; }
-.android { background: url(../images/icon-android.gif) left center no-repeat; }
+.linux24 {
+ /* Open Icon Library - Webpage Icons Package
+ * Source: http://openiconlibrary.sourceforge.net/downloads.html */
+ background: url("../images/icon-linux24.png") no-repeat scroll left center transparent;
+ }
+.smartphone24 {
+/* Icon from the Crystal set
+ * author: Everaldo Coelho
+ * source: http://www.everaldo.com/crystal/
+ * license: LGPL v2 */
+ background: url("../images/icon-smartphone24.png") no-repeat scroll left center transparent;
+ }
+.sourcecode24 {
+/* Icon from the Crystal set
+ * author: Everaldo Coelho
+ * source: http://www.everaldo.com/crystal/
+ * license: LGPL v2 */
+ background: url("../images/icon-sourcecode24.png") no-repeat scroll left center transparent;
+ }
+
+.windows24,
+.mac24,
+.linux24,
+.smartphone24,
+.sourcecode24 {
+ display: block;
+ line-height: 34px;
+ padding: 0px 0 0px 33px;
+ }
+
+.accordionButton {
+ background: url("../images/table-head.jpg") repeat-x scroll left top #885CA4;
+ color: #FFFFFF;
+ margin: 0;
+ padding-left: 10px;
+ font-size: 1.1em;
+ font-weight: bold;
+ width: 700px;
+ float: left;
+ _float: none; /* Float works in all browsers but IE6 */
+ border: 1px solid #FFFFFF;
+ border-bottom: none;
+ cursor: pointer;
+ -webkit-border-top-left-radius: 7px;
+ -webkit-border-top-right-radius: 7px;
+ -moz-border-radius-topleft: 7px;
+ -moz-border-radius-topright: 7px;
+ border-top-left-radius: 7px;
+ border-top-right-radius: 7px;
+ }
+
+ .accordionButton:hover {
+ text-shadow: 1px 1px 0px rgba(17, 17, 17, 1);
+ }
+
+.accordionContent {
+ width: 708px;
+ float: left;
+ _float: none; /* Float works in all browsers but IE6 */
+ background: #FFFFFF;
+ display: block;
+ }
+
+.package {
+ float: left;
+ width: 668px;
+ margin: 0px;
+ padding: 25px 20px 20px 20px;
+ border-top: 1px solid #888888;
+ }
+
+ .package h2 {
+ margin-bottom: 3px;
+ }
+
+ .package p {
+ margin-top: 20px;
+ margin-bottom: 5px;
+ padding-left: 10px;
+ }
+
+.downloads {
+ float: right;
+ width: 200px;
+ padding: 0px;
+ margin: 0px 0 0 20px;
+ text-align: center;
+ }
+
+.lang {
+ float: right;
+ display: none;
+ width: 80px;
+ height: 18px;
+ margin: 0px 7px 0px 0px;
+ padding: 0px 0px 0px 3px;
+ background-color: #fefff7;
+ border: 2px solid #CCCFB8;
+ border-top: 0px;
+ -webkit-border-bottom-left-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+ }
+
+.button {
+ text-align: center;
+ display: block;
+ width: 200px;
+ height: 60px;
+ text-decoration: none;
+ background: url(../images/button-downloadpage.png) bottom left no-repeat #FF9800;
+ margin: 0px auto 0px auto;
+ text-shadow: 1px 1px 0px rgba(17, 17, 17, 1);
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ border-radius: 7px;
+ }
+
+.button:hover {
+ background: url(../images/button-downloadpage.png) top left no-repeat #FF9800;
+ }
+
+.button .strong {
+ display: block;
+ padding: 10px 0 0 0px;
+ }
+
+.button .normal {
+ padding: 5px 0 0 0px;
+ display: block;
+ }
+
+.sig {
+ display: block;
+ margin: 3px 0px 20px 0px;
+ }
+
+
/* MISC ------------*/
.title {
@@ -493,23 +633,44 @@
max-width: 365px;
}
.paypal span { padding-right: 20px; }
+
+.warning-top {
+ padding: 10px 10px 10px 60px;
+ margin: 0px 10px 0px 10px;
+ display: block;
+ background: url("../images/warning.png") no-repeat scroll 2px 23px #FFFEB6;
+ border: 1px solid #A6A427;
+ border-bottom: none;
+ -webkit-border-top-left-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ }
+ .warning-top h2 {
+ padding-right: 15px;
+ padding-left: 0px;
+ margin-bottom: 5px;
+ }
+
+ .warning-top p {
+ padding-left: 10px;
+ margin-bottom: 0px;
+ }
+
.warning {
- background: #F4F2C7;
- border: 2px dashed #bfbd8c;
- padding: 25px 25px;
- margin-top: 4px;
- }
+ float: left;
+ _float: none; /* Float works in all browsers but IE6 */
+ padding: 25px 25px;
+ margin-top: 4px;
+ }
- .warning h2 {
- background: url("../images/warning2.jpg") no-repeat scroll left top transparent;
- padding-left: 40px;
- }
-
- .warning p {
- padding-left: 20px;
- }
-
+ .warning p {
+ padding-left: 10px;
+ }
+
.focus {
background: #f4f2c7;
border: 1px solid #ebd4a9;
@@ -788,10 +949,19 @@
}
.dbox.dl {
- margin: -50px 0px 20px 20px;
- float: right;
- }
-
+ float: none;
+ width: 177px;
+ margin: 0px 5px 20px 5px;
+ }
+
+.dbox.dl h2 {
+ padding: 0;
+ }
+
+.dbox.dl input.amount {
+ width: 120px;
+ }
+
.dbox.donate {
float: none;
padding: 30px 30px;
Modified: website/trunk/css/typography.css
===================================================================
--- website/trunk/css/typography.css 2011-08-29 02:12:07 UTC (rev 24975)
+++ website/trunk/css/typography.css 2011-08-29 02:37:19 UTC (rev 24976)
@@ -240,13 +240,50 @@
line-height: 32px;
}
-/* DL TABLE ------------*/
+/* DL PAGE ------------*/
-.column-title {
- font-weight: bold;
- color: #23300e;
-}
+.package h2 {
+ color: #4E6A20;
+ font-size: 22px;
+ line-height: 22px;
+ font-weight: bold;
+ }
+.package p {
+ text-indent: 5px;
+ line-height: 18px;
+ }
+
+.lang {
+ line-height: 18px;
+ color: #23300E;
+ font-size: 10px;
+ }
+
+.button .strong {
+ font-size: 20px;
+ font-weight: bold;
+ color: #FFFFFF;
+ }
+
+.button .normal {
+ font-size: 12px;
+ font-weight: bold;
+ font-style: italic;
+ color: #FFFFFF;
+ }
+
+.siginfo {
+ font-size: 10px;
+ text-decoration: none;
+ font-style: italic;
+ }
+
+.additional {
+ font-size: 12px;
+ line-height: 16px;
+ }
+
/* MISC ------------*/
.continue a:link,
@@ -266,6 +303,16 @@
color: #666;
}
+.warning-top h2 {
+ font-size: 1em;
+ line-height: 18px;
+ }
+
+.warning-top p {
+ font-size: 0.8em;
+ line-height: 14px;
+ }
+
.warning p {
color: #3a3a3a;
margin-bottom: 0;
Modified: website/trunk/download/en/download.wml
===================================================================
--- website/trunk/download/en/download.wml 2011-08-29 02:12:07 UTC (rev 24975)
+++ website/trunk/download/en/download.wml 2011-08-29 02:37:19 UTC (rev 24976)
@@ -3,265 +3,224 @@
# Translation-Priority: 3-low
#include "head.wmi" TITLE="Download Tor" CHARSET="UTF-8" ANNOUNCE_RSS="yes"
+#<!-- ATTENTION TRANSLATOR -->
+#<!-- You MUST copy 'head.wmi' and 'lang.wmi' along with this file! -->
+
+#<!-- TBB DEFAULT LANGUAGE: Change 'en-US' below to your language code (if package exists)-->
+#<!-- IMPORTANT: You MUST also change the default selection in 'lang.wmi' -->
+<define-tag lang>en-US</define-tag>
+
<div id="content" class="clearfix">
-<div id="breadcrumbs"><a href="<page index>">Home » </a><a href="<page download/download>">Download</a></div>
-<div id="maincol-left">
-<h1>Download Tor</h1>
+ <div id="breadcrumbs"><a href="<page index>">Home » </a><a href="<page download/download>">Download</a></div>
+ <div id="maincol-left">
<!-- BEGIN TEASER WARNING -->
-<div class="warning">
-<h2>Want Tor to really work?</h2>
-<p>...then please don't just install it and go on. You need to change some of your habits, and reconfigure your software! Tor by itself is <em>NOT</em> all you need to maintain your anonymity. Read the <a href="#warning">full list of warnings</a>.
-</p>
-</div>
+ <div class="warning-top">
+ <h2>Want Tor to really work?</h2>
+ <p>...then please don't just install it and go on. You need to change some of your habits, and reconfigure your software! Tor by itself is <em>NOT</em> all you need to maintain your anonymity. Read the <a href="#warning">full list of warnings</a>.
+ </p>
+ </div>
<!-- END TEASER WARNING -->
+<!-- START DOWNLOADS -->
<!-- START WINDOWS -->
-<table class="topforty">
-<tr>
-<td class="nopad"><div class="title"><a name="Windows">Microsoft Windows</a></div></td>
-</tr>
-<tr>
-<td>
- <!-- DONATION WIDGET BEGIN -->
-<script type="text/javascript" src="$(DOCROOT)/jquery.min.js"></script>
-<script type="text/javascript">
-function displayVals() {
- var t3 = jQuery("#t3").val();
- var amount = jQuery("#amount").val();
- if(t3 != 0){
- jQuery('#a3').val(amount);
- jQuery('#p3').val(1);
- jQuery('#cmd').val('_xclick-subscriptions');
- jQuery('#item_name').val('Tor Project Membership');
- jQuery('#ppinfo').replaceWith('<h6 id="ppinfo"><small>(Requires a PayPal Account)</small></h6>');
- }else{
- jQuery('#a3').val(0);
- jQuery('#p3').val(0);
- jQuery('#cmd').val('_donations');
- jQuery('#item_name').val('Donation to the Tor Project');
- jQuery('#ppinfo').replaceWith('<h6 id="ppinfo" style="height:0px;"></h6>');
- }
- if( !t3 ) {
- jQuery('#cmd').val('_donations');
- jQuery('#item_name').val('Donation to the Tor Project');
- jQuery('#ppinfo').replaceWith('<h6 id="ppinfo" style="height:0px;"></h6>');
- }
-}
+ <div id="windows" style="border-top: 0px;" class="accordionButton">
+ <span class="windows24">Microsoft Windows</span>
+ </div>
+ <div class="accordionContent">
+ <div class="fauxhead"></div>
+<!-- TOR BROWSER BUNDLE -->
+ <div class="package" style="padding-top: 13px; border-top: 0px;">
+ <form class="downloads">
+ <a class="button win-tbb" href="../dist/torbrowser/tor-browser-<version-torbrowserbundle>_<lang>.exe"><span class="strong">Download</span><span class="normal">Tor Browser Bundle</span></a>
+ <select name="language" id="win-tbb" class="lang">
+#include <lang.wmi>
+ </select>
+ <div class="sig">
+ (<a class="win-tbb-sig" href="../dist/torbrowser/tor-browser-<version-torbrowserbundle>_<lang>.exe.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="additional" href="<page projects/torbrowser-details>#build">Source Code</a>
+ </form>
-jQuery(function(){
- jQuery("#amount").change(displayVals);
- jQuery("#t3").change(displayVals);
- displayVals();
-});
+ <h2>Tor Browser Bundle</h2>
+ <em>Version <version-torbrowserbundle> - Windows 7, Vista, and XP</em>
+ <p>Everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></p>
+ </div>
+<!-- VIDALIA BUNDLE -->
+ <div class="package">
+ <div class="downloads">
+ <a class="button" href="<package-win32-bundle-stable>"><span class="strong">Download</span><span class="normal">Vidalia Bundle</span></a>
+ <div class="sig">
+ (<a href="<package-win32-bundle-stable>.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="additional" href="<package-win32-bundle-alpha>">Download Unstable</a> (<a href="<package-win32-bundle-alpha>.asc">sig</a>)
+ </div>
-</script>
- <form class="dbox dl" action="https://www.paypal.com/cgi-bin/webscr" method="post">
- <h2>Donate to Tor</h2>
- <p>
- <select name="currency_code" class="cur">
- <option value="USD" selected="selected">$</option>
- <option value="EUR">€</option>
- <option value="GBP">£</option>
- <option value="YEN">¥</option>
- </select>
- <input type="text" id="amount" class="amount" name="amount" value="5" size="10">
- </p>
- <p>
- <input type="hidden" id="a3" name="a3" value="0">
- <select id="t3" name="t3">
- <option value="0">One-time Donation</option>
- <option value="M">Monthly Subscription</option>
- </select>
- </p>
+ <h2>Vidalia Bundle</h2>
+ <em>Windows 7, Vista, and XP</em>
+ <p>Contains Tor, <a href="<page projects/vidalia>">Vidalia</a>, Polipo, and Torbutton for installation on your system. You need your own Firefox, and you'll need to configure other applications if you want them to use Tor. <a href="<page docs/tor-doc-windows>">Installation Guide »</a></p>
+ </div>
+<!-- VIDALIA BRIDGE BUNDLE -->
+ <div class="package">
+ <div class="downloads">
+ <a class="button" href="../dist/vidalia-bundles/vidalia-bridge-bundle-<version-win32-bridge-bundle-alpha>.exe"><span class="strong">Download</span><span class="normal">Vidalia Bridge Bundle (Beta)</span></a>
+ <div class="sig">
+ (<a href="../dist/vidalia-bundles/vidalia-bridge-bundle-<version-win32-bridge-bundle-alpha>.exe.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ </div>
- <p>
+ <h2>Vidalia Bridge Bundle</h2>
+ <em>Windows 7, Vista, and XP</em>
+ <p>A Vidalia Bundle which is configured to be a <a href="<page docs/bridges>">bridge</a> by default. This helps censored users reach the Tor network. <a href="<page docs/tor-doc-windows>">Installation Guide »</a></p>
+ </div>
+<!-- EXPERT BUNDLE -->
+ <div class="package">
+ <div class="downloads">
+ <a class="button" href="../dist/win32/tor-<version-win32-stable>-win32.exe"><span class="strong">Download</span><span class="normal">Expert Bundle</span></a>
+ <div class="sig">
+ (<a href="../dist/win32/tor-<version-win32-stable>-win32.exe.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="additional" href="../dist/win32/tor-<version-win32-alpha>-win32.exe">Download Unstable</a> (<a href="../dist/win32/tor-<version-win32-alpha>-win32.exe.asc">sig</a>)
+ </div>
- <input type="hidden" id="p3" name="p3" value="1">
-
- <input type="hidden" name="sra" value="1">
- <input type="hidden" name="src" value="1">
- <input type="hidden" name="no_shipping" value="1">
- <input type="hidden" name="no_note" value="1">
-
- <input type="hidden" id="cmd" name="cmd" value="_donations">
- <input type="hidden" name="business" value="donations(a)torproject.org">
- <input type="hidden" id="item_name" name="item_name" value="Donation to the Tor Project">
- <input type="hidden" name="return" value="https://www.torproject.org/donate/thankyou">
- <input type="hidden" name="cancel_return" value="https://www.torproject.org/download">
- </p>
- <h6 id="ppinfo" style="height:0px;"></h6>
- <p>
- <input class="donate-btn" type="submit" name="donate" value="Donate">
- </p>
- <p><a href="<page donate/donate>">Other donation options...</a></p>
- </form>
-
- <!-- DONATION WIDGET END -->
-
-The Tor Software for Windows comes bundled in four different ways:
-<ul>
-<li>The <strong>Tor Browser Bundle</strong> contains everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></li>
-<li>The <strong>Vidalia Bundle</strong> contains Tor, <a href="<page projects/vidalia>">Vidalia</a>, Polipo, and Torbutton for installation on your system. You need your own Firefox, and you'll need to configure other applications if you want them to use Tor.</li>
-<li>The <strong>Bridge-by-Default Vidalia Bundle</strong> is a
-<strong>Vidalia Bundle</strong> which is configured to be a <a
-href="<page docs/bridges>">bridge</a> in order to help censored users
-reach the Tor network.</li>
-<li>The <strong>Expert Bundle</strong> contains just Tor and nothing else. You'll need to configure Tor and all of your applications manually.</li>
-</ul>
-<p>There are two versions of each package, a stable and alpha release. Stable packages are released when we believe the features and code will not change for many months. Alpha or unstable packages are released so you can help us test new features and bugfixes. Even though they have a higher version number than the stable versions listed above, there is a much higher chance of serious reliability and security bugs in these downloads. Please be prepared to <a href="https://bugs.torproject.org/">report bugs</a>.</p>
-<p>The current stable version of Tor for Windows is <version-win32-stable>. The current alpha/unstable version of Tor for Windows is <version-win32-alpha>.</p>
-</td>
-</tr>
-<tr class="gray">
-<td><span class="windows">
-Tor Browser Bundle (English) version <version-torbrowserbundle>, works with
-Windows 7, Vista, and XP. <a href="../dist/torbrowser/tor-browser-<version-torbrowserbundle>_en-US.exe">Download</a> (<a href="../dist/torbrowser/tor-browser-<version-torbrowserbundle>_en-US.exe.asc">sig</a>)
-</span>
-</td>
-</tr>
-<tr>
-<td><span class="windows">
-Tor Browser Instant Messaging Bundle (English) has been
-<a href="https://blog.torproject.org/blog/tor-im-browser-bundle-discontinued-tempora…">temporarily discontinued</a>.
-</span>
- </td>
-</tr>
- <tr class="gray">
- <td><span class="windows">
-Download <a href="<page projects/torbrowser>">other language versions and the source code</a> of the Tor Browser Bundle.
-</span>
-</td>
-</tr>
- <tr><td><span class="windows">
- Stable Vidalia Bundle works with Windows 7, Vista, XP, <a href="<package-win32-bundle-stable>">Download Stable</a> (<a href="<package-win32-bundle-stable>.asc">sig</a>)
- </span></td>
- </tr>
- <tr class="gray"><td><span class="windows">Unstable Vidalia Bundle works with Windows 7, Vista, XP, <a href="<package-win32-bundle-alpha>">Download Unstable</a> (<a href="<package-win32-bundle-alpha>.asc">sig</a>)</span></td>
- </tr>
- <tr class="gray"><td><span class="windows">Unstable Bridge-by-Default Vidalia Bundle works with Windows 7, Vista, XP, <a href="../dist/vidalia-bundles/vidalia-bridge-bundle-<version-win32-bridge-bundle-alpha>.exe">Download Unstable</a> (<a href="../dist/vidalia-bundles/vidalia-bridge-bundle-<version-win32-bridge-bundle-alpha>.asc">sig</a>)</span></td>
- </tr>
- <tr>
- <td><span class="windows">Stable Expert Bundle works with Windows 98SE, ME, Windows 7, Vista, XP, 2000, 2003 Server, <a href="../dist/win32/tor-<version-win32-stable>-win32.exe">Download Stable</a> (<a href="../dist/win32/tor-<version-win32-stable>-win32.exe.asc">sig</a>)</span></td>
-</tr>
- <tr class="gray">
- <td><span class="windows">Unstable Expert Bundle works with Windows 98SE, ME, Windows 7, Vista, XP, 2000, 2003 Server,
-<a href="../dist/win32/tor-<version-win32-alpha>-win32.exe">Download Unstable</a> (<a href="../dist/win32/tor-<version-win32-alpha>-win32.exe.asc">sig</a>)
- </span></td>
- </tr>
- <tr>
-<td>
-<a href="<page docs/tor-doc-windows>">Documentation for Microsoft Windows clients</a>
-</td>
-</tr>
-</table>
+ <h2>Expert Bundle</h2>
+ <em>Windows 7, Vista, XP, 2000, 2003 Server, ME, and Windows 98SE</em>
+ <p>Contains just Tor and nothing else. You'll need to configure Tor and all of your applications manually.</p>
+ </div>
+ </div>
<!-- END WINDOWS -->
<!-- START OS X -->
-<table class="topforty">
-<tr>
-<td class="nopad"><div class="title"><a name="mac">Apple OS X</a></div></td>
-</tr>
-<tr>
-<td class="intro">The Tor Software for OS X comes bundled in two different ways:
-<ul>
-<li>The <strong>Tor Browser Bundle</strong> contains everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></li>
-<li>The <strong>Vidalia Bundle</strong> contains Tor, <a href="<page projects/vidalia>">Vidalia</a>, Polipo, and Torbutton for installation on your system. You need your own Firefox, and you'll need to configure other applications if you want them to use Tor.</li>
-</ul>
-<p>There are two versions of each package, a stable and alpha release. Stable packages are released when we believe the features and code will not change for many months. Alpha or unstable packages are released so you can help us test new features and bugfixes. Even though they have a higher version number than the stable versions listed above, there is a much higher chance of serious reliability and security bugs in these downloads. Please be prepared to <a href="https://bugs.torproject.org/">report bugs</a>.</p>
-<p>The current stable version of Tor for OS X is <version-osx-x86-stable>. The current alpha/unstable version of Tor for OS X is <version-osx-x86-alpha>.</p>
-</td>
-</tr>
-<tr class="gray">
-<td><span class="mac">Tor Browser Bundle for OS X Intel (beta version),
-<a href="../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-en-US.zip">Download</a>
-(<a href="../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-en-US.zip.asc">sig</a>)
-</span>
-</td>
-</tr>
-<tr>
-<td><span class="mac">Stable Vidalia Bundle for OS X Intel, <a href="<package-osx-x86-bundle-stable>">Download Stable</a> (<a href="<package-osx-x86-bundle-stable>.asc">sig</a>)</span></td>
-</tr>
-<tr class="gray">
-<td><span class="mac">Unstable Vidalia Bundle for OS X Intel, <a href="<package-osx-x86-bundle-alpha>">Download Unstable</a> (<a href="<package-osx-x86-bundle-alpha>.asc">sig</a>)</span></td>
-</tr>
-<tr>
-<td><span class="mac">Stable Vidalia Bundle for OS X PowerPC, <a href="<package-osx-ppc-bundle-stable>">Download Stable</a> (<a href="<package-osx-ppc-bundle-stable>.asc">sig</a>)</span></td>
-</tr>
-<tr class="gray">
-<td><span class="mac">Unstable Vidalia Bundle for OS X PowerPC, <a href="<package-osx-ppc-bundle-alpha>">Download Unstable</a> (<a href="<package-osx-ppc-bundle-alpha>.asc">sig</a>)</span></td>
-</tr>
-<tr>
-<td><a href="<page docs/tor-doc-osx>">Documentation for Apple OS X clients</a>.</td>
-</tr>
-</table>
+ <div id="apple" class="accordionButton">
+ <span class="mac24">Apple OS X</span></div>
+ <div class="accordionContent">
+ <div class="fauxhead"></div>
+<!-- TOR BROWSER BUNDLE -->
+ <div class="package" style="padding-top: 13px; border-top: 0px;">
+ <form class="downloads">
+ <a class="button osx-tbb" href="../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-<lang>.zip"><span class="strong">Download</span><span class="normal">Tor Browser Bundle (Beta)</span></a>
+ <select name="language" id="osx-tbb" class="lang">
+#include <lang.wmi>
+ </select>
+ <div class="sig">
+ (<a class="osx-tbb-sig" href="../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-<lang>.zip.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a href="<page projects/torbrowser-details>#build">Source Code</a>
+ </form>
+
+ <h2>Tor Browser Bundle</h2>
+ <em>Version <version-torbrowserbundleosx> - OS X Intel</em>
+ <p>Everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></p>
+ </div>
+<!-- VIDALIA BUNDLE -->
+ <div class="package">
+ <div class="downloads">
+ <a class="button" href="<package-osx-x86-bundle-stable>"><span class="strong">Download</span><span class="normal">OS X Intel</span></a>
+ <div class="sig">
+ (<a href="<package-osx-x86-bundle-stable>.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="button" href="<package-osx-ppc-bundle-stable>"><span class="strong">Download</span><span class="normal">OS X Power PC</span></a>
+ <div class="sig">
+ (<a href="<package-osx-ppc-bundle-stable>.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ Download Unstable<br /><a class="additional" href="<package-osx-x86-bundle-alpha>">OS X Intel</a> (<a href="<package-osx-x86-bundle-alpha>.asc">sig</a>)<br /><a class="additional" href="<package-osx-ppc-bundle-alpha>">OS X PowerPC</a> (<a href="<package-osx-ppc-bundle-alpha>.asc">sig</a>)
+ </div>
+
+ <h2>Vidalia Bundle</h2>
+ <em>OS X Intel, OS X Power PC</em>
+ <p>Contains Tor, <a href="<page projects/vidalia>">Vidalia</a>, Polipo, and Torbutton for installation on your system. You need your own Firefox, and you'll need to configure other applications if you want them to use Tor. <a href="<page docs/tor-doc-osx>">Installation Guide »</a></p>
+ </div>
+ </div>
<!-- END OS X -->
<!-- START UNIX -->
- <table class="topforty">
-<tr>
-<td class="nopad"><div class="title"><a name="linux">Linux/Unix</a></div></td></tr>
-<tr>
-<td class="intro">The Tor Software comes bundled in two different ways:
-<ul>
-<li>The <strong>Tor Browser Bundle</strong> contains everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></li>
-<li>Read how to use <a href="<page download/download-unix>">our repositories for the Tor software</a>.</li>
-</ul>
-</td>
-</tr>
-<tr class="gray">
-<td><span class="linux">Tor Browser Bundle for GNU/Linux (beta version) on i686,
-<a href="../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-en-US.tar.gz">Download</a>
-(<a href="../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-en-US.tar.gz.asc">sig</a>)</span></td>
-</tr>
-<tr>
-<td><span class="linux">Tor Browser Bundle for GNU/Linux (beta version) on x86_64,
-<a href="../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-en-US.tar.gz">Download</a>
-(<a href="../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-en-US.tar.gz.asc">sig</a>)</span></td>
-</tr>
-<tr class="gray">
-<td><span class="linux">Use <a href="<page download/download-unix>">our repositories</a> for all other Tor-related software.</span></td>
-</tr>
-</table>
-<table class="topforty">
-<tr>
-<td class="nopad"><div class="title"><a name="smartphones">Tor for Smartphones</a></div></td>
-</tr>
-<tr class="gray">
-<td colspan="2">Android-based phones, tablets, computers</td>
-<td><a href="../dist/android/<version-androidbundle-tor>-orbot-<version-androidbundle-orbot>.apk">Android Bundle</a></td>
-<td><a href="<page docs/android>">Android Instructions</a></td>
-</tr>
-<tr>
-<td colspan="2">iPhone, iPod Touch, iPad</td>
-<td colspan="2"><span class="mac"><a href="http://sid77.slackware.it/iphone/">Test packages by Marco</a></span></td>
-</tr>
-<tr class="gray">
-<td>Nokia Maemo/N900</td>
-<td></td>
-<td><span class="nokia"><a href="<page docs/N900>">Experimental instructions</a></span></td>
-<td></td>
-</tr>
-</table>
+ <div id="linux" class="accordionButton">
+ <span class="linux24">Linux, BSD, & Unix</span></div>
+ <div class="accordionContent">
+ <div class="fauxhead"></div>
+ <!-- TOR BROWSER BUNDLE -->
+ <div class="package" style="padding-top: 13px; border-top: 0px;">
+ <form class="downloads">
+ <a class="button lin-tbb32" href="../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-<lang>.tar.gz"><span class="strong">Download</span><span class="normal">i686 / 32-bit (Beta)</span></a>
+ <select name="language" id="lin-tbb32" class="lang">
+#include <lang.wmi>
+ </select>
+ <div class="sig">
+ (<a class="lin-tbb32-sig" href="../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-<lang>.tar.gz.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+
+ <a class="button lin-tbb64" href="../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-<lang>.tar.gz"><span class="strong">Download</span><span class="normal">x86_64 / 64-bit (Beta)</span></a>
+ <select name="language" id="lin-tbb64" class="lang">
+#include <lang.wmi>
+ </select>
+ <div class="sig">
+ (<a class="lin-tbb64-sig" href="../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-<lang>.tar.gz.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="additional" href="<page projects/torbrowser-details>#build">Source Code</a>
+ </form>
+
+ <h2>Tor Browser Bundle</h2>
+ <em>Version <version-torbrowserbundlelinux32> - Linux, BSD, and Unix</em>
+ <p>Everything you need to safely browse the Internet. This package requires no installation. Just extract it and run. <a href="<page projects/torbrowser>">Learn more »</a></p>
+ <p>Use <a href="<page download/download-unix>">our repositories</a> for all other Tor-related software.</p>
+ </div>
+ </div>
<!-- END UNIX -->
+<!-- START SMARTPHONES -->
+ <div id="smartphone" class="accordionButton">
+ <span class="smartphone24">Tor for Smartphones</span></div>
+ <div class="accordionContent">
+ <div class="fauxhead"></div>
+<!-- ANDROID -->
+ <div class="package" style="padding-top: 13px; border-top: 0px;">
+ <div class="downloads">
+ <a class="button" style="margin-bottom: 5px;" href="../dist/android/<version-androidbundle-tor>-orbot-<version-androidbundle-orbot>.apk"><span class="strong">Download</span><span class="normal">Android Bundle</span></a>
+ <a class="additional" href="<page docs/android>">Installation Instructions</a>
+ </div>
+
+ <h2>Android Bundle</h2>
+ <p>For Android-based phones, tablets, and computers.</p>
+ </div>
+<!-- iOS -->
+ <div class="package">
+ <div class="downloads" style="padding-top: 20px;">
+ <a class="additional" style="font-weight: bold;" href="http://sid77.slackware.it/iphone/">Test Packages by Marco</a>
+ </div>
+
+ <h2>Tor for Apple iOS</h2>
+ <p>For iPhone, iPod Touch, and iPad.</p>
+ </div>
+<!-- Nokia -->
+ <div class="package" style="border-bottom: 0px;">
+ <div class="downloads">
+ <a class="additional" style="font-weight: bold;" href="<page docs/N900>">Experimental Instructions</a>
+ </div>
+
+ <h2>Nokia Maemo/N900</h2>
+ </div>
+ </div>
+<!-- END SMARTPHONES -->
<!-- BEGIN SOURCE -->
-<table class="topforty">
-<tr>
-<td class="nopad"><div class="title"><a name="source">Source Code</a></div></td>
-</tr>
-<tr>
-<td colspan="2">The current stable version of Tor is <version-stable>. Its <a
-href="https://gitweb.torproject.org/tor.git/blob/release-0.2.1:/ChangeLog">release
-notes</a> are available.</td>
-<td colspan="2">The current unstable/alpha version of Tor is <version-alpha>. Its
-<a
-href="https://gitweb.torproject.org/tor.git/blob/refs/heads/release-0.2.2:/Change…">Changelog
-</a> is available.</td>
-</tr>
-<tr class="gray">
-<td>Source Tarballs</td>
-<td>./configure && make && src/or/tor</td>
-<td><a href="../dist/tor-<version-stable>.tar.gz">Download Stable</a> (<a href="../dist/tor-<version-stable>.tar.gz.asc">sig</a>)</td>
-<td><a href="../dist/tor-<version-alpha>.tar.gz">Download Unstable</a> (<a href="../dist/tor-<version-alpha>.tar.gz.asc">sig</a>)</td>
-</tr>
-</table>
+ <div class="accordionButton">
+ <span class="sourcecode24">Source Code</span></div>
+ <div class="accordionContent">
+ <div class="fauxhead"></div>
+ <div class="package" style="padding-top: 13px; border-top: 0px; border-bottom: 1px solid #888888;">
+ <div class="downloads">
+ <a class="button" href="../dist/tor-<version-stable>.tar.gz"><span class="strong">Download</span><span class="normal">Source Code</span></a>
+ <div class="sig">
+ (<a href="../dist/tor-<version-stable>.tar.gz.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ <a class="button" href="../dist/tor-<version-alpha>.tar.gz"><span class="strong">Download</span><span class="normal">Source Code (Unstable)</span></a>
+ <div class="sig">
+ (<a href="../dist/tor-<version-alpha>.tar.gz.asc">sig</a>) <a class="siginfo" href="<page docs/verifying-signatures>">What's This?</a>
+ </div>
+ </div>
+
+ <h2>Source Tarball</h2>
+ <p> Configure with: <code style="color: #666666;">./configure && make && src/or/tor</code></p>
+ <p>The current stable version of Tor is 0.2.1.30. Its <a href="https://gitweb.torproject.org/tor.git/blob/release-0.2.1:/ChangeLog">release notes</a> are available.</p>
+ <p>The current unstable/alpha version of Tor is 0.2.2.30-rc. Its <a href="https://gitweb.torproject.org/tor.git/blob/refs/heads/release-0.2.2:/Change…">Changelog</a> is available.</p>
+ </div>
+ </div>
<!-- END SOURCE -->
+<!-- END DOWNLOADS -->
<br>
<!-- BEGIN WARNING -->
<div class="warning">
@@ -351,39 +310,56 @@
<!-- END WARNING -->
</div>
<!-- END MAINCOL -->
+<!-- START SIDECOL -->
<div id="sidecol-right">
+<!-- START DONATION WIDGET -->
+<form class="dbox dl" action="https://www.paypal.com/cgi-bin/webscr" method="post">
+ <h2>Donate to Tor</h2>
+ <p>
+ <select name="currency_code" class="cur">
+ <option value="USD" selected="selected">$</option>
+ <option value="EUR">€</option>
+ <option value="GBP">£</option>
+ <option value="YEN">¥</option>
+ </select>
+ <input type="text" id="amount" class="amount" name="amount" value="5" size="10">
+ </p>
+ <p>
+ <input type="hidden" id="a3" name="a3" value="0">
+ <select id="t3" name="t3">
+ <option value="0">One-time Donation</option>
+ <option value="M">Monthly Subscription</option>
+ </select>
+ </p>
+ <p>
+ <input type="hidden" id="p3" name="p3" value="1">
+ <input type="hidden" name="sra" value="1">
+ <input type="hidden" name="src" value="1">
+ <input type="hidden" name="no_shipping" value="1">
+ <input type="hidden" name="no_note" value="1">
+ <input type="hidden" id="cmd" name="cmd" value="_donations">
+ <input type="hidden" name="business" value="donations(a)torproject.org">
+ <input type="hidden" id="item_name" name="item_name" value="Donation to the Tor Project">
+ <input type="hidden" name="return" value="<page donate/thankyou>">
+ <input type="hidden" name="cancel_return" value="<page download/download>">
+ </p>
+ <h6 id="ppinfo" style="height:0px;"></h6>
+ <p>
+ <input class="donate-btn" type="submit" name="donate" value="Donate">
+ </p>
+ <p><a href="<page donate/donate>">Other donation options...</a></p>
+</form>
+<!-- END DONATION WIDGET -->
+<!-- START INFO -->
<div class="img-shadow">
<div class="sidenav-sub">
-<h2>Jump to:</h2>
-<ul>
-<li class="dropdown"><a href="#Windows">Microsoft Windows</a></li>
-<li class="dropdown"><a href="#mac">Apple OS X</a></li>
-<li class="dropdown"><a href="#linux">Linux/Unix</a></li>
-<li class="dropdown"><a href="#smartphones">Smartphones</a></li>
-<li class="dropdown"><a href="#source">Source Code</a></li>
-</ul>
-</div>
-</div>
-<!-- END SIDENAV -->
-<div class="img-shadow">
-<div class="infoblock">
-<h2>What is the (sig) link?</h2>
-<p>These are GPG signatures to allow you to verify that
-your downloaded file is really from The Tor Project and not
-an imposter.</p>
-<a href="<page docs/verifying-signatures>">Learn more »</a>
-</div>
-</div>
-<!-- END INFOBLOCK -->
-<div class="img-shadow">
-<div class="sidenav-sub">
<h2>Having Trouble?</h2>
<ul>
<li class="dropdown"><a href="<page docs/documentation>">Read the fine manuals</a></li>
</ul>
</div>
</div>
-<!-- END SIDENAV -->
+<!-- END INFO -->
</div>
<!-- END SIDECOL -->
</div>
Added: website/trunk/download/en/head.wmi
===================================================================
--- website/trunk/download/en/head.wmi (rev 0)
+++ website/trunk/download/en/head.wmi 2011-08-29 02:37:19 UTC (rev 24976)
@@ -0,0 +1,197 @@
+#! /usr/bin/wml
+<: use strict; :>
+<: use warnings; :>
+#use "perl-globals.wmi"
+#use "links.wmi"
+#use "versions.wmi"
+#use "navigation.wmi"
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>$(TITLE)</title>
+ <link rel="shortcut icon" type="image/x-icon" href="$(IMGROOT)/favicon.ico">
+ <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)">">
+ <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)">">
+ <ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce"
+type="application/rss+xml">">
+
+ # begin WML to generate css/js paths
+ <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">">
+ <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">">
+
+ #<link href="css/master.css" rel="stylesheet" type="text/css">
+ <!--[if lte IE 8]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie8-and-down.css">
+ <![endif]-->
+ <!--[if lte IE 7]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css">
+ <![endif]-->
+ <!--[if IE 6]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css">
+ <![endif]-->
+
+# <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script>
+ # end WML to generate css/js paths
+
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="author" content="The Tor Project, Inc.">
+ <meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research">
+ <script type="text/javascript" src="../js/jquery.min.js">
+#/* jQuery */
+ </script>
+ <script type="text/javascript" src="../js/jquery.client.min.js">
+/* "jQuery Browser And OS Detection Plugin" by Stoiman
+ Source: http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plug…
+ License: Public Domain (http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plug…) */
+ </script>
+ <script type="text/javascript" src="../js/dlpage01.js">
+#/* Displays detected section */
+ </script>
+ <script async type="text/javascript" src="../js/jquery.accordion.min.js">
+/* Modified version of "Stupid Simple jQuery Accordian Menu" originally developed by Ryan Stemkoski
+ Source: http://www.stemkoski.com/stupid-simple-jquery-accordion-menu/
+ License: Public Domain (http://www.stemkoski.com/stupid-simple-jquery-accordion-menu/#comment-32882) */
+ </script>
+ <script async type="text/javascript">
+#/* switches package links depending on selection */
+ function updateLang() {
+ var caller = $( this );
+ var pkg = caller.attr('id');
+ var lang = caller.val();
+ var wintbb = '../dist/torbrowser/tor-browser-<version-torbrowserbundle>_'+lang+'.exe';
+ var osxtbb = '../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-'+lang+'.zip';
+ var lintbb32 = '../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-'+lang+'.tar.gz';
+ var lintbb64 = '../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-'+lang+'.tar.gz';
+ if(pkg == 'win-tbb'){
+ $('.'+pkg).replaceWith('<a class="button win-tbb" href="'+wintbb+'"><span class="strong">Download</span><span class="normal">Tor Browser Bundle</span></a>');
+ $('.'+pkg+'-sig').replaceWith('<a class="win-tbb-sig" href="'+wintbb+'.asc">sig</a>');
+ }else if(pkg == 'osx-tbb'){
+ $('.'+pkg).replaceWith('<a class="button osx-tbb" href="'+osxtbb+'"><span class="strong">Download</span><span class="normal">Tor Browser Bundle (Beta)</span></a>');
+ $('.'+pkg+'-sig').replaceWith('<a class="osx-tbb-sig" href="'+osxtbb+'.asc">sig</a>');
+ }else if(pkg == 'lin-tbb32'){
+ $('.'+pkg).replaceWith('<a class="button lin-tbb32" href="'+lintbb32+'"><span class="strong">Download</span><span class="normal">i686 / 32-bit (Beta)</span></a>');
+ $('.'+pkg+'-sig').replaceWith('<a class="lin-tbb32-sig" href="'+lintbb32+'.asc">sig</a>');
+ }else if(pkg == 'lin-tbb64'){
+ $('.'+pkg).replaceWith('<a class="button lin-tbb64" href="'+lintbb64+'"><span class="strong">Download</span><span class="normal">x86_64 / 64-bit (Beta)</span></a>');
+ $('.'+pkg+'-sig').replaceWith('<a class="lin-tbb64-sig" href="'+lintbb64+'.asc">sig</a>');
+ }
+ }
+
+ $(function(){
+ $('.lang').ready(updateLang);
+ $('.lang').change(updateLang);
+ /* Only show language selector if javascript is enabled */
+ $('.lang').css('display', 'block');
+ });
+ </script>
+ <script async type="text/javascript" src="../js/ppwidget.js">
+#/* Script For Donation Widget */
+ </script>
+</head>
+<body onload="resetAll()" onunload="">
+<div id="wrap">
+ <div id="header">
+ <h1 id="logo"><a href="<page index>">Tor</a></h1>
+ # navigation menu generation
+ <div id="nav">
+ <ul>
+ <:{
+ # create a hash and maintain order of keys
+ my %navigation;
+ my @keys;
+ while (@navigation) {
+ my $key = shift @navigation;
+ my $val = shift @navigation;
+ push @keys, $key;
+ $navigation{$key} = $val;
+ }
+
+ my $page = $WML_SRC_BASENAME;
+ my $lang = "$(LANG)";
+
+ for my $key (@keys) {
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
+
+ # in directory of active link, set class active
+ my $class;
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
+ $class = 'class="active"';
+ } else {
+ $class = '';
+ }
+
+ $dir = '.' unless defined $dir;
+
+ # translated version
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key};
+ }
+ # english version
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key};
+ }
+ # full url
+ elsif ($key =~/^http/) {
+ printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key};
+ } else {
+ warn "$WML_SRC_FILENAME has a [page $key] (parses to
+docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
+ }
+ }
+ }:>
+ </ul>
+ </div>
+ <!-- END NAV -->
+ # end navigation generation
+ <div id="calltoaction">
+ <ul>
+ <:{
+ my %calltoaction;
+ my @keys;
+ while (@calltoaction) {
+ my $key = shift @calltoaction;
+ my $val = shift @calltoaction;
+ push @keys, $key;
+ $calltoaction{$key} = $val;
+ }
+
+ my $page = $WML_SRC_BASENAME;
+ my $lang = "$(LANG)";
+ for my $key (@keys) {
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
+
+ # in directory, set active
+ my $class;
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
+ #if ($WML_SRC_BASENAME eq $base) {
+ $class = 'class="active"';
+ } else {
+ $class = '';
+ }
+
+ $dir = '.' unless defined $dir;
+ # try to use a translated version
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key};
+ }
+ # default to english version
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key};
+ } else {
+ warn "$WML_SRC_FILENAME has a [page $key] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
+ }
+ }
+ }:>
+ </ul>
+ </div>
+ <!-- END CALLTOACTION -->
+ </div>
+ <!-- END HEADER -->
+
+#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">
+#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>.">
Added: website/trunk/download/en/lang.wmi
===================================================================
--- website/trunk/download/en/lang.wmi (rev 0)
+++ website/trunk/download/en/lang.wmi 2011-08-29 02:37:19 UTC (rev 24976)
@@ -0,0 +1,20 @@
+#! /usr/bin/wml
+<: use strict; :>
+<: use warnings; :>
+
+#<!-- Remove 'selected="selected"' from English option and add it to preferred default language option -->
+#<!-- IMPORTANT: You MUST also change '<define-tag lang>en-US</define-tag>' within download.wml -->
+
+ <option value="en-US" selected="selected">English</option>
+ <option value="ar">العربية</option>
+ <option value="de">Deutsch</option>
+ <option value="es-ES">Español</option>
+ <option value="fa">فارسی</option>
+ <option value="fr">Français</option>
+ <option value="it">Italiano</option>
+ <option value="nl">Nederlands</option>
+ <option value="pl">Polish</option>
+ <option value="pt-PT">Português</option>
+ <option value="ru">Русский</option>
+ <option value="vi">Vietnamese</option>
+ <option value="zh-CN">简体字</option>
Added: website/trunk/images/button-downloadpage.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/button-downloadpage.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: website/trunk/images/icon-linux24.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/icon-linux24.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: website/trunk/images/icon-mac24.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/icon-mac24.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Added: website/trunk/images/icon-smartphone24.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/icon-smartphone24.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ image/png
Added: website/trunk/images/icon-sourcecode24.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/icon-sourcecode24.png
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ image/png
Added: website/trunk/images/icon-windows24.png
===================================================================
(Binary files differ)
Property changes on: website/trunk/images/icon-windows24.png
___________________________________________________________________
Added: svn:mime-type
+ image/png
Modified: website/trunk/images/warning.png
===================================================================
(Binary files differ)
Added: website/trunk/js/dlpage01.js
===================================================================
(Binary files differ)
Property changes on: website/trunk/js/dlpage01.js
___________________________________________________________________
Added: svn:mime-type
+ application/javascript
Added: website/trunk/js/jquery.accordion.min.js
===================================================================
(Binary files differ)
Property changes on: website/trunk/js/jquery.accordion.min.js
___________________________________________________________________
Added: svn:mime-type
+ application/javascript
Added: website/trunk/js/jquery.client.min.js
===================================================================
(Binary files differ)
Property changes on: website/trunk/js/jquery.client.min.js
___________________________________________________________________
Added: svn:mime-type
+ application/javascript
Added: website/trunk/js/jquery.min.js
===================================================================
(Binary files differ)
Property changes on: website/trunk/js/jquery.min.js
___________________________________________________________________
Added: svn:mime-type
+ application/javascript
Added: website/trunk/js/ppwidget.js
===================================================================
(Binary files differ)
Property changes on: website/trunk/js/ppwidget.js
___________________________________________________________________
Added: svn:mime-type
+ application/javascript
1
0
r24975: {} make the farsi translations include sidenav, header, footer, (in website/trunk/include: . fa)
by Andrew Lewman 28 Aug '11
by Andrew Lewman 28 Aug '11
28 Aug '11
Author: phobos
Date: 2011-08-29 02:12:07 +0000 (Mon, 29 Aug 2011)
New Revision: 24975
Added:
website/trunk/include/fa/
website/trunk/include/fa/foot.wmi
website/trunk/include/fa/head.wmi
website/trunk/include/fa/info.wmi
website/trunk/include/fa/navigation.wmi
website/trunk/include/fa/side.wmi
Log:
make the farsi translations include sidenav, header, footer, navigation
so they can use the right to left css and even look correct.
Added: website/trunk/include/fa/foot.wmi
===================================================================
--- website/trunk/include/fa/foot.wmi (rev 0)
+++ website/trunk/include/fa/foot.wmi 2011-08-29 02:12:07 UTC (rev 24975)
@@ -0,0 +1,131 @@
+#!/usr/bin/env wml
+#use "functions.wmi"
+
+ <div id="footer">
+ <div class="onion"><img src="$(IMGROOT)/onion.jpg" alt="Tor"></div>
+ <div class="about">
+ <p>"Tor" and the "Onion Logo" are registered trademarks of
+ <a href="<page docs/trademark-faq>">The Tor Project, Inc.</a>
+ Content on this site is licensed under a <a
+ href="http://creativecommons.org/licenses/by/3.0/us/">Creative
+ Commons Attribution 3.0 United States License</a>, unless
+ otherwise noted.</p>
+<!--
+ # This will grab the date from svn info but formatting is tedious
+ # REQUIRES svn for this to work
+ <:{
+ my $svninfo = `svn info`;
+ if ($svninfo =~ m/Last Changed Date: (\d{4}-\d{2}-\d{2})\s(\d{2}:\d{2}:\d{2})\s(.*)\s\((.*)\)/) {
+ my $modifydate = "$4 $2 $3";
+ # remove commas from date
+ $modifydate =~ s/,//;
+ print 'Last modified: '.$modifydate."\n";
+ }
+ }:>
+ <:{
+ #my $compiledate = `date`;
+ my $compiledate = `date +"%a %b %d %Y %k:%M:%S %z"`;
+ print 'Last compiled: '.$compiledate."\n";
+ }:>
+-->
+ </div>
+ <!-- END ABOUT -->
+ <!-- WE HAVE NO NEWSLETTER SO REMOVE THIS
+ <div class="newsletter">
+ <form action="">
+ <input class="textfield" type="text" name="email" value="Sign up for our newsletter! Enter email." onClick="clearDefault(this);">
+ <input class="signup" type="submit" name="submit" value="Sign Up">
+ </form>
+ </div>
+ END NEWSLETTER -->
+ <div class="col first">
+ <h4>About Tor</h4>
+ <ul>
+ <li><a href="<page about/overview>">What Tor Does</a></li>
+ <li><a href="<page about/torusers>">Users of Tor</a></li>
+ <li><a href="<page about/corepeople>">Core Tor People</a></li>
+ <li><a href="<page about/sponsors>">Sponsors</a></li>
+ <li><a href="<page about/contact>">Contact Us</a></li>
+ </ul>
+ </div>
+ <!-- END COL -->
+ <div class="col">
+ <h4>Get Involved</h4>
+ <ul>
+ <li><a href="<page donate/donate>">Donate</a></li>
+ <li><a href="<page docs/documentation>#MailingLists">Mailing List</a></li>
+ <li><a href="<page getinvolved/mirrors>">Mirrors</a></li>
+ <li><a href="<page docs/hidden-services>">Hidden Services</a></li>
+ <li><a href="<page getinvolved/translation>">Translations</a></li>
+# <li><a href="<page getinvolved/open-positions>">Careers</a></li>
+ </ul>
+ </div>
+ <!-- END COL -->
+ <div class="col">
+ <h4>Documentation</h4>
+ <ul>
+ <li><a href="<page docs/tor-manual>">Manuals</a></li>
+ <li><a href="<page docs/documentation>">Installation Guides</a></li>
+ <li><a href="<wiki>">Tor Wiki</a></li>
+ <li><a href="<page docs/faq>">General Tor FAQ</a></li>
+ </ul>
+ </div>
+ <!-- END COL -->
+
+ <!-- List available languages -->
+ <div class="col wider">
+ <h4>Languages</h4>
+ <: if (has_translations()) { :>
+ <p>
+ This page is also available in the following languages:
+ <: print list_translations() :>.<br />
+ How to set <a href="http://www.debian.org/intro/cn#howtoset">the default document language</a>.
+ </p>
+ <: }; :>
+ </div>
+
+# LANGUAGE SWITCH CGI
+# <div class="col wider">
+# <h4>Languages</h4>
+# # this is a cgi trampoline to bounce us to the right page
+# # alternately, if the client supports javascript we can redirect that way
+# # noscript does not block onclick but clients may have disabled javascript completely
+# #
+# # for this to work we need to know the relative path from the document root
+# # to the current directory that wml is in.
+# <form action="$(DOCROOT)/cgi-bin/languageswitch.cgi">
+# <select name="Language" id="lang">
+# <:{
+# #import "perl-globals.wmi";
+# use Cwd;
+# use Cwd 'abs_path';
+# use File::Spec;
+# my $urlbase = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
+# my $LANGUAGES;
+# my $page = $WML_SRC_FILENAME;
+# opendir(DIR, getcwd()) or die $!;
+# # take a look and see what language support we have
+# while (my $file = readdir(DIR)) {
+# if (-d $file) {
+# if (-e "$file/$page") {
+# my $url = $urlbase.'/'.$WML_SRC_BASENAME.'.html.'.$file;
+# my $url2js = $WML_SRC_BASENAME.'.html.'.$file;
+# print '<option value="'.$url.'" onclick="window.location=\''.$url2js.'\'">'.$LANGUAGES{$file}.'</option>'."\n" unless not defined $LANGUAGES{$file};
+# }
+# }
+# }
+# closedir(DIR);
+# }:>
+# </select>
+# <input class="go" type="submit" name="submit" value="Go">
+# </form>
+# <p>Questions on this? Visit <a href="http://www.debian.org/intro/cn#howtoset">how to set the default document language</a>.</p>
+# </div>
+#
+ </div>
+ <!-- END FOOTER -->
+
+ </div>
+ <!-- END WRAP -->
+</body>
+</html>
Added: website/trunk/include/fa/head.wmi
===================================================================
--- website/trunk/include/fa/head.wmi (rev 0)
+++ website/trunk/include/fa/head.wmi 2011-08-29 02:12:07 UTC (rev 24975)
@@ -0,0 +1,145 @@
+#! /usr/bin/wml
+<: use strict; :>
+<: use warnings; :>
+#use "perl-globals.wmi"
+#use "links.wmi"
+#use "versions.wmi"
+#use "navigation.wmi"
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>$(TITLE)</title>
+ <link rel="shortcut icon" type="image/x-icon" href="$(IMGROOT)/favicon.ico">
+ <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)">">
+ <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)">">
+ <ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce"
+type="application/rss+xml">">
+
+ # begin WML to generate css/js paths
+ <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">">
+ <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">">
+
+ #<link href="css/master.css" rel="stylesheet" type="text/css">
+ <!--[if lte IE 8]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie8-and-down.css">
+ <![endif]-->
+ <!--[if lte IE 7]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css">
+ <![endif]-->
+ <!--[if IE 6]>
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css">
+ <![endif]-->
+# <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script>
+ # end WML to generate css/js paths
+
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta name="author" content="The Tor Project, Inc.">
+ <meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research">
+</head>
+<body>
+<div id="wrap">
+ <div id="header">
+ <h1 id="logo"><a href="<page index>">Tor</a></h1>
+ # navigation menu generation
+ <div id="nav">
+ <ul>
+ <:{
+ # create a hash and maintain order of keys
+ my %navigation;
+ my @keys;
+ while (@navigation) {
+ my $key = shift @navigation;
+ my $val = shift @navigation;
+ push @keys, $key;
+ $navigation{$key} = $val;
+ }
+
+ my $page = $WML_SRC_BASENAME;
+ my $lang = "$(LANG)";
+
+ for my $key (@keys) {
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
+
+ # in directory of active link, set class active
+ my $class;
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
+ $class = 'class="active"';
+ } else {
+ $class = '';
+ }
+
+ $dir = '.' unless defined $dir;
+
+ # translated version
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key};
+ }
+ # english version
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key};
+ }
+ # full url
+ elsif ($key =~/^http/) {
+ printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key};
+ } else {
+ warn "$WML_SRC_FILENAME has a [page $key] (parses to
+docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
+ }
+ }
+ }:>
+ </ul>
+ </div>
+ <!-- END NAV -->
+ # end navigation generation
+ <div id="calltoaction">
+ <ul>
+ <:{
+ my %calltoaction;
+ my @keys;
+ while (@calltoaction) {
+ my $key = shift @calltoaction;
+ my $val = shift @calltoaction;
+ push @keys, $key;
+ $calltoaction{$key} = $val;
+ }
+
+ my $page = $WML_SRC_BASENAME;
+ my $lang = "$(LANG)";
+ for my $key (@keys) {
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;
+
+ # in directory, set active
+ my $class;
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
+ #if ($WML_SRC_BASENAME eq $base) {
+ $class = 'class="active"';
+ } else {
+ $class = '';
+ }
+
+ $dir = '.' unless defined $dir;
+ # try to use a translated version
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key};
+ }
+ # default to english version
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key};
+ } else {
+ warn "$WML_SRC_FILENAME has a [page $key] (parses to docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
+ }
+ }
+ }:>
+ </ul>
+ </div>
+ <!-- END CALLTOACTION -->
+ </div>
+ <!-- END HEADER -->
+
+#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">
+#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>.">
Added: website/trunk/include/fa/info.wmi
===================================================================
--- website/trunk/include/fa/info.wmi (rev 0)
+++ website/trunk/include/fa/info.wmi 2011-08-29 02:12:07 UTC (rev 24975)
@@ -0,0 +1,10 @@
+#!/usr/bin/env wml
+<div class="img-shadow">
+ <div class="infoblock">
+ <h2 class="bulb">Tor Tip</h2>
+ <p>Tor is written for and supported by people like you. <a href="<page
+donate/donate>">Donate today</a>!</p>
+ </div>
+ <!-- END INFOBLOCK -->
+</div>
+<!-- END IMG-SHADOW -->
Added: website/trunk/include/fa/navigation.wmi
===================================================================
--- website/trunk/include/fa/navigation.wmi (rev 0)
+++ website/trunk/include/fa/navigation.wmi 2011-08-29 02:12:07 UTC (rev 24975)
@@ -0,0 +1,24 @@
+#!/usr/bin/wml
+
+## translation metadata
+# Revision: $Revision: 22069 $
+# Translation-Priority: 1-high
+
+<:
+ # path link text
+ my @navigation = (
+ 'index' , 'Home',
+ 'about/overview' , 'About Tor',
+ 'docs/documentation' , 'Documentation',
+ 'projects/projects' , 'Projects',
+ 'press/press' , 'Press',
+ '<blog>' , 'Blog',
+ 'http://printfection.com/torprojectstore' , 'Store',
+ );
+ my @calltoaction = (
+ 'download/download' , 'Download',
+ 'getinvolved/volunteer' , 'Volunteer',
+ 'donate/donate' , 'Donate',
+ );
+
+:>
Added: website/trunk/include/fa/side.wmi
===================================================================
--- website/trunk/include/fa/side.wmi (rev 0)
+++ website/trunk/include/fa/side.wmi 2011-08-29 02:12:07 UTC (rev 24975)
@@ -0,0 +1,91 @@
+#! /usr/bin/wml
+<: use strict; :>
+<: use warnings; :>
+#use "perl-globals.wmi"
+#use "links.wmi"
+#use "versions.wmi"
+#use "sidenav.wmi"
+<div class="img-shadow">
+ <div id="sidenav">
+ <:
+ # recursively search menu structure to see if it contains a given page
+ sub containsSub($$);
+ sub containsSub($$) {
+ my ($elements, $page) = @_;
+ for my $ele (@{$elements}) {
+ if (containsSub($ele->{'subelements'},$page)){
+ return 1;
+ } elsif ($page eq $ele->{'url'}) {
+ return 1;
+ }
+
+ }
+ return 0;
+ }
+
+ # generate navigation menu
+ sub printNavMenu($$$);
+ sub printNavMenu($$$) {
+ my ($navmenu, $page, $lang) = @_;
+ print '<ul>'."\n";
+ for my $navmenu (@{$navmenu}) {
+ # this menu entry is the current (active) page
+ if ($navmenu->{'url'} eq $page) {
+
+ # the current page has nested menu elements
+ if ($navmenu->{'subelements'}) { # menu has dropdown
+ printf '<li class="dropdown active"><a class="active" href="%s">%s</a></li>'."\n",
+ pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
+
+ print '<li>'."\n";
+ printNavMenu($navmenu->{'subelements'},$page,$lang);
+ print '</li>'."\n";
+
+ # the current (active) page does not have sub elements
+ } else {
+ printf '<li class="active"><a class="active" href="%s">%s</a></li>'."\n",
+ pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
+ }
+
+ # a subelement of this menu item is the current (active) page
+ } elsif (containsSub($navmenu->{'subelements'}, $page)) {
+ printf '<li class="dropdown"><a class="active" href="%s">%s</a></li>'."\n",
+ pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
+
+ print '<li>'."\n"; #encapsulate subelements
+ # recurse to generate the expanded menu
+ printNavMenu($navmenu->{'subelements'},$page,$lang);
+ print '</li>'."\n"; #encapsulate subelements
+
+ # the menu entry is not active and does not enclose the active page
+ } else {
+
+ # if there are subelements, set collapsed style
+ if ($navmenu->{'subelements'}) {
+ printf '<li class="dropdown"><a href="%s">%s</a></li>'."\n",
+ pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
+ # regular menu entry
+ } else {
+ printf '<li><a href="%s">%s</a></li>'."\n",
+ pageToURL($navmenu->{'url'}, $lang), $navmenu->{'txt'};
+ }
+ }
+ }
+ print '</ul>'."\n";
+ }
+
+ my $lang = "$(LANG)";
+
+ use Cwd;
+ use Cwd 'abs_path';
+ use File::Spec;
+
+ # get document path from site root
+ my $path = File::Spec->abs2rel(getcwd(),abs_path("$(DOCROOT)"));
+ my $page = $WML_SRC_BASENAME;
+ printNavMenu($sidenav, $path.'/'.$page, $lang);
+ :>
+ </div>
+ <!-- END SIDENAV -->
+</div>
+<!-- END IMG-SHADOW -->
1
0
28 Aug '11
commit 38881173188209db0bb9dd40bacc48aa1883f5e4
Author: Roger Dingledine <arma(a)torproject.org>
Date: Sun Aug 28 21:43:19 2011 -0400
add another heuristic for making release notes
---
doc/HACKING | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/doc/HACKING b/doc/HACKING
index 9747f22..b0689d8 100644
--- a/doc/HACKING
+++ b/doc/HACKING
@@ -426,10 +426,10 @@ interesting and understandable.
first entry or two and the last entry most interesting: they're
the ones that skimmers tend to read.
- 2.4) Clean them up
+ 2.4) Clean them up:
Standard idioms:
- "Fixes bug 9999; Bugfix on 0.3.3.3-alpha."
+ "Fixes bug 9999; bugfix on 0.3.3.3-alpha."
One period after a space.
@@ -446,6 +446,11 @@ interesting and understandable.
Present and imperative tense: not past.
+ Try not to let any given section be longer than about a page. Break up
+ long sections into subsections by some sort of common subtopic. This
+ guideline is especially important when organizing Release Notes for
+ new stable releases.
+
If a given changes stanza showed up in a different release (e.g.
maint-0.2.1), be sure to make the stanzas identical (so people can
distinguish if these are the same change).
1
0
commit d8d13f5fe5be8a29732d73d535df963aca34c8d9
Author: Damian Johnson <atagar(a)torproject.org>
Date: Sun Aug 28 14:57:43 2011 -0700
Tidying up the interpretor panel
---
src/cli/interpretorPanel.py | 72 +++++++++++++++++++++++-------------------
1 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/src/cli/interpretorPanel.py b/src/cli/interpretorPanel.py
index b81fa85..162fd19 100644
--- a/src/cli/interpretorPanel.py
+++ b/src/cli/interpretorPanel.py
@@ -5,28 +5,48 @@ information, tab completion, and other usability features.
import curses
-from util import enum, panel, textInput, torInterpretor, torTools, uiTools
-
-from TorCtl import TorCtl
+from util import panel, textInput, torInterpretor, uiTools
USAGE_INFO = "to use this panel press enter"
+PROMPT_LINE = [(torInterpretor.PROMPT, torInterpretor.Formats.PROMPT), (USAGE_INFO, torInterpretor.Formats.USAGE)]
# limits used for cropping
-COMMAND_BACKLOG = 100
-LINES_BACKLOG = 2000
+BACKLOG_LIMIT = 100
+LINES_LIMIT = 2000
+
+# lazy loaded curses formatting constants
+FORMATS = {}
+
+def getFormat(format):
+ """
+ Provides the curses drawing attributes for a torInterpretor.Formats enum.
+ This returns plain formatting if the entry doesn't exist.
+
+ Arguments:
+ format - format enum to fetch
+ """
+
+ # initializes formats if they haven't yet been loaded
+ if not FORMATS:
+ FORMATS[torInterpretor.Formats.PROMPT] = curses.A_BOLD | uiTools.getColor("green")
+ FORMATS[torInterpretor.Formats.INPUT] = uiTools.getColor("cyan")
+ FORMATS[torInterpretor.Formats.INPUT_INTERPRETOR] = curses.A_BOLD | uiTools.getColor("magenta")
+ FORMATS[torInterpretor.Formats.INPUT_CMD] = curses.A_BOLD | uiTools.getColor("green")
+ FORMATS[torInterpretor.Formats.INPUT_ARG] = curses.A_BOLD | uiTools.getColor("cyan")
+ FORMATS[torInterpretor.Formats.OUTPUT] = uiTools.getColor("blue")
+ FORMATS[torInterpretor.Formats.USAGE] = uiTools.getColor("cyan")
+ FORMATS[torInterpretor.Formats.HELP] = uiTools.getColor("magenta")
+ FORMATS[torInterpretor.Formats.ERROR] = curses.A_BOLD | uiTools.getColor("red")
+
+ return FORMATS.get(format, curses.A_NORMAL)
class InterpretorPanel(panel.Panel):
def __init__(self, stdscr):
panel.Panel.__init__(self, stdscr, "interpretor", 0)
self.isInputMode = False
self.scroll = 0
- self.formats = {} # lazy loaded curses formatting constants
- self.previousCommands = [] # user input, newest to oldest
-
- # contents of the panel (oldest to newest), each line is a list of (msg,
- # format enum) tuples
-
- self.contents = [[(torInterpretor.PROMPT, torInterpretor.Formats.PROMPT), (USAGE_INFO, torInterpretor.Formats.USAGE)]]
+ self.previousCommands = [] # user input, newest to oldest
+ self.contents = [PROMPT_LINE] # (msg, format enum) tuples being displayed (oldest to newest)
def prompt(self):
"""
@@ -34,9 +54,7 @@ class InterpretorPanel(panel.Panel):
a blank line.
"""
- if not self.formats: self._initFormats()
self.isInputMode = True
-
panel.CURSES_LOCK.acquire()
while self.isInputMode:
@@ -50,14 +68,17 @@ class InterpretorPanel(panel.Panel):
if len(self.contents) > self.maxY - 1:
xOffset += 3 # offset for scrollbar
- input = self.getstr(min(self.maxY - 1, len(self.contents)), xOffset, "", self.formats[torInterpretor.Formats.INPUT], validator = validator)
+ inputLine = min(self.maxY - 1, len(self.contents))
+ inputFormat = getFormat(torInterpretor.Formats.INPUT)
+ input = self.getstr(inputLine, xOffset, "", inputFormat, validator = validator)
input, isDone = input.strip(), False
if not input:
+ # terminate input when we get a blank line
isDone = True
else:
self.previousCommands.insert(0, input)
- self.previousCommands = self.previousCommands[:COMMAND_BACKLOG]
+ self.previousCommands = self.previousCommands[:BACKLOG_LIMIT]
try:
inputEntry, outputEntry = torInterpretor.handleQuery(input)
@@ -70,7 +91,7 @@ class InterpretorPanel(panel.Panel):
self.contents.append(promptEntry)
# if too long then crop lines
- cropLines = len(self.contents) - LINES_BACKLOG
+ cropLines = len(self.contents) - LINES_LIMIT
if cropLines > 0: self.contents = self.contents[cropLines:]
if isDone:
@@ -80,8 +101,6 @@ class InterpretorPanel(panel.Panel):
panel.CURSES_LOCK.release()
def handleKey(self, key):
- # TODO: allow contents to be searched (with hilighting?)
-
isKeystrokeConsumed = True
if uiTools.isSelectionKey(key):
self.prompt()
@@ -97,8 +116,6 @@ class InterpretorPanel(panel.Panel):
return isKeystrokeConsumed
def draw(self, width, height):
- if not self.formats: self._initFormats()
-
# page title
usageMsg = " (enter \"/help\" for usage or a blank line to stop)" if self.isInputMode else ""
self.addstr(0, 0, "Control Interpretor%s:" % usageMsg, curses.A_STANDOUT)
@@ -118,21 +135,10 @@ class InterpretorPanel(panel.Panel):
cursor = xOffset
for msg, formatEntry in entry:
- format = self.formats.get(formatEntry, curses.A_NORMAL)
+ format = getFormat(formatEntry)
self.addstr(drawLine, cursor, msg, format)
cursor += len(msg)
drawLine += 1
if drawLine >= height: break
- def _initFormats(self):
- self.formats[torInterpretor.Formats.PROMPT] = curses.A_BOLD | uiTools.getColor("green")
- self.formats[torInterpretor.Formats.INPUT] = uiTools.getColor("cyan")
- self.formats[torInterpretor.Formats.INPUT_INTERPRETOR] = curses.A_BOLD | uiTools.getColor("magenta")
- self.formats[torInterpretor.Formats.INPUT_CMD] = curses.A_BOLD | uiTools.getColor("green")
- self.formats[torInterpretor.Formats.INPUT_ARG] = curses.A_BOLD | uiTools.getColor("cyan")
- self.formats[torInterpretor.Formats.OUTPUT] = uiTools.getColor("blue")
- self.formats[torInterpretor.Formats.USAGE] = uiTools.getColor("cyan")
- self.formats[torInterpretor.Formats.HELP] = uiTools.getColor("magenta")
- self.formats[torInterpretor.Formats.ERROR] = curses.A_BOLD | uiTools.getColor("red")
-
1
0
commit aaec744638d997447db3b4c50a3080d93835dd12
Author: Damian Johnson <atagar(a)torproject.org>
Date: Sun Aug 28 17:41:17 2011 -0700
Tab completion for control prompt input
This provides autocompletion for the control prompt based on the capabilities
of the attached tor instance (fetching options from GETINFO info/names,
config/names, etc). This uses readline so it's working for the terminal prompt
but not the panel interpretor (which will need a validator implementation).
---
src/util/torInterpretor.py | 122 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 116 insertions(+), 6 deletions(-)
diff --git a/src/util/torInterpretor.py b/src/util/torInterpretor.py
index 866495d..fecc2ac 100644
--- a/src/util/torInterpretor.py
+++ b/src/util/torInterpretor.py
@@ -62,14 +62,115 @@ def format(msg, *attr):
if encodings:
return (CSI % ";".join(encodings)) + msg + RESET
- else:
- raise IOError("BLARG! %s" % str(attr))
- return msg
+ else: return msg
+
+class TorCommandOptions:
+ """
+ Command autocompleter, fetching the valid options from the attached Tor
+ instance.
+ """
+
+ def __init__(self):
+ self.commands = []
+ conn = torTools.getConn()
+
+ # adds all of the valid GETINFO options
+ infoOptions = conn.getInfo("info/names")
+ if infoOptions:
+ for line in infoOptions.split("\n"):
+ if " " in line:
+ # skipping non-existant options mentioned in:
+ # https://trac.torproject.org/projects/tor/ticket/3844
+
+ if line.startswith("config/*") or line.startswith("dir-usage"):
+ continue
+
+ # strips off the ending asterisk if it accepts a value
+ infoOpt = line.split(" ", 1)[0]
+
+ if infoOpt.endswith("*"):
+ infoOpt = infoOpt[:-1]
+
+ self.commands.append("GETINFO %s" % infoOpt)
+ else: self.commands.append("GETINFO ")
+
+ # adds all of the valid GETCONF / SETCONF / RESETCONF options
+ confOptions = conn.getInfo("config/names")
+ if confOptions:
+ # individual options are '<name> <type>' pairs
+ confEntries = [opt.split(" ", 1)[0] for opt in confOptions.split("\n")]
+ self.commands += ["GETCONF %s" % conf for conf in confEntries]
+ self.commands += ["SETCONF %s " % conf for conf in confEntries]
+ self.commands += ["RESETCONF %s" % conf for conf in confEntries]
+ else:
+ self.commands.append("GETCONF ")
+ self.commands.append("SETCONF ")
+ self.commands.append("RESETCONF ")
+
+ # adds all of the valid SETEVENT options
+ eventOptions = conn.getInfo("events/names")
+ if eventOptions:
+ self.commands += ["SETEVENT %s" % event for event in eventOptions.split(" ")]
+ else: self.commands.append("SETEVENT ")
+
+ # adds all of the valid USEFEATURE options
+ featureOptions = conn.getInfo("features/names")
+ if featureOptions:
+ self.commands += ["USEFEATURE %s" % feature for feature in featureOptions.split(" ")]
+ else: self.commands.append("USEFEATURE ")
+
+ # adds all of the valid SIGNAL options
+ # this can't yet be fetched dynamically, as per:
+ # https://trac.torproject.org/projects/tor/ticket/3842
+
+ signals = ("RELOAD", "SHUTDOWN", "DUMP", "DEBUG", "HALT", "HUP", "INT",
+ "USR1", "USR2", "TERM", "NEWNYM", "CLEARDNSCACHE")
+ self.commands += ["SIGNAL %s" % sig for sig in signals]
+
+ # shouldn't use AUTHENTICATE since we only provide the prompt with an
+ # authenticated controller connection
+ #self.commands.append("AUTHENTICATE")
+
+ # other options
+ self.commands.append("SAVECONF")
+ self.commands.append("MAPADDRESS ")
+ self.commands.append("EXTENDCIRCUIT ")
+ self.commands.append("SETCIRCUITPURPOSE ")
+ self.commands.append("SETROUTERPURPOSE ")
+ self.commands.append("ATTACHSTREAM ")
+ self.commands.append("+POSTDESCRIPTOR ") # TODO: needs to support multiline options for this (ugg)
+ self.commands.append("REDIRECTSTREAM ")
+ self.commands.append("CLOSESTREAM ")
+ self.commands.append("CLOSECIRCUIT ")
+ self.commands.append("RESOLVE ")
+ self.commands.append("PROTOCOLINFO ")
+ self.commands.append("+LOADCONF") # TODO: another multiline...
+ self.commands.append("TAKEOWNERSHIP")
+ self.commands.append("QUIT") # TODO: give a confirmation when the user does this?
+
+ def complete(self, text, state):
+ # provides case insensetive autocompletion options based on self.commands
+ for cmd in self.commands:
+ if cmd.lower().startswith(text.lower()):
+ if not state: return cmd
+ else: state -= 1
def prompt():
prompt = format(">>> ", Color.GREEN, Attr.BOLD)
input = ""
+ # sets up tab autocompetion
+ torCommands = TorCommandOptions()
+ readline.parse_and_bind("tab: complete")
+ readline.set_completer(torCommands.complete)
+
+ # Essentially disables autocompletion by word delimiters. This is because
+ # autocompletion options are full commands (ex. "GETINFO version") so we want
+ # "GETINFO" to match to all the options rather than be treated as a complete
+ # command by itself.
+
+ readline.set_completer_delims("\n")
+
formatMap = {} # mapping of Format to Color and Attr enums
formatMap[Formats.PROMPT] = (Attr.BOLD, Color.GREEN)
formatMap[Formats.INPUT] = (Color.CYAN, )
@@ -82,7 +183,13 @@ def prompt():
formatMap[Formats.ERROR] = (Attr.BOLD, Color.RED)
while input != "/quit":
- input = raw_input(prompt)
+ try:
+ input = raw_input(prompt)
+ except:
+ # moves cursor to the next line and terminates (most commonly
+ # KeyboardInterrupt and EOFErro)
+ print
+ break
_, outputEntry = handleQuery(input)
@@ -129,16 +236,19 @@ def handleQuery(input):
if " " in input: cmd, arg = input.split(" ", 1)
else: cmd, arg = input, ""
+ # makes commands uppercase to match the spec
+ cmd = cmd.upper()
+
inputEntry.append((cmd + " ", Formats.INPUT_CMD))
if arg: inputEntry.append((arg, Formats.INPUT_ARG))
- if cmd.upper() == "GETINFO":
+ if cmd == "GETINFO":
try:
response = conn.getInfo(arg, suppressExc = False)
outputEntry.append((response, Formats.OUTPUT))
except Exception, exc:
outputEntry.append((str(exc), Formats.ERROR))
- elif cmd.upper() == "SETCONF":
+ elif cmd == "SETCONF":
if "=" in arg:
param, value = arg.split("=", 1)
1
0
28 Aug '11
commit 7b58a20d69150d3628b758ddef7c014b740cb5de
Author: Damian Johnson <atagar(a)torproject.org>
Date: Sun Aug 28 18:27:16 2011 -0700
Basic tab completion for interpretor panel
This performs tab completion in the interpretor panel when there's a single
match. This does not, however, provide suggestions or common prefix completion
yet. The suggestions in particular are gonna be a pita...
---
src/cli/interpretorPanel.py | 3 +++
src/util/textInput.py | 34 ++++++++++++++++++++++++++++++++++
src/util/torInterpretor.py | 16 +++++++++++++++-
3 files changed, 52 insertions(+), 1 deletions(-)
diff --git a/src/cli/interpretorPanel.py b/src/cli/interpretorPanel.py
index 162fd19..95866db 100644
--- a/src/cli/interpretorPanel.py
+++ b/src/cli/interpretorPanel.py
@@ -61,8 +61,11 @@ class InterpretorPanel(panel.Panel):
self.redraw(True)
# intercepts input so user can cycle through the history
+ torCommands = torInterpretor.TorCommandOptions()
+
validator = textInput.BasicValidator()
validator = textInput.HistoryValidator(self.previousCommands, validator)
+ validator = textInput.TabCompleter(torCommands.getMatches, validator)
xOffset = len(torInterpretor.PROMPT)
if len(self.contents) > self.maxY - 1:
diff --git a/src/util/textInput.py b/src/util/textInput.py
index c3c229f..31a5305 100644
--- a/src/util/textInput.py
+++ b/src/util/textInput.py
@@ -148,3 +148,37 @@ class HistoryValidator(TextInputValidator):
return PASS
+class TabCompleter(TextInputValidator):
+ """
+ Provides tab completion based on the current input, finishing if there's only
+ a single match. This expects a functor that accepts the current input and
+ provides matches.
+ """
+
+ def __init__(self, completer, nextValidator = None):
+ TextInputValidator.__init__(self, nextValidator)
+
+ # functor that accepts a string and gives a list of matches
+ self.completer = completer
+
+ def handleKey(self, key, textbox):
+ # Matches against the tab key. The ord('\t') is nine, though strangely none
+ # of the curses.KEY_*TAB constants match this...
+ if key == 9:
+ matches = self.completer(textbox.gather().strip())
+
+ if len(matches) == 1:
+ # only a single match, fill it in
+ newInput = matches[0]
+ y, _ = textbox.win.getyx()
+ _, maxX = textbox.win.getmaxyx()
+ textbox.win.clear()
+ textbox.win.addstr(y, 0, newInput[:maxX - 1])
+ textbox.win.move(y, min(len(newInput), maxX - 1))
+ elif len(matches) > 1:
+ pass # TODO: somehow display matches... this is not gonna be fun
+
+ return None
+
+ return PASS
+
diff --git a/src/util/torInterpretor.py b/src/util/torInterpretor.py
index fecc2ac..cffe200 100644
--- a/src/util/torInterpretor.py
+++ b/src/util/torInterpretor.py
@@ -148,8 +148,22 @@ class TorCommandOptions:
self.commands.append("TAKEOWNERSHIP")
self.commands.append("QUIT") # TODO: give a confirmation when the user does this?
+ def getMatches(self, text):
+ """
+ Provides all options that match the given input.
+
+ Arguments:
+ text - user input text to be matched against
+ """
+
+ return [cmd for cmd in self.commands if cmd.lower().startswith(text.lower())]
+
def complete(self, text, state):
- # provides case insensetive autocompletion options based on self.commands
+ """
+ Provides case insensetive autocompletion options, acting as a functor for
+ the readlines set_completer function.
+ """
+
for cmd in self.commands:
if cmd.lower().startswith(text.lower()):
if not state: return cmd
1
0