Andrew Lewman commited on 2011-08-29 23:58:43
Zeige 1 geänderte Dateien mit 223 Einfügungen und 0 Löschungen.
... | ... |
@@ -0,0 +1,223 @@ |
1 |
+#! /usr/bin/wml |
|
2 |
+<: use strict; :> |
|
3 |
+<: use warnings; :> |
|
4 |
+#use "perl-globals.wmi" |
|
5 |
+#use "links.wmi" |
|
6 |
+#use "versions.wmi" |
|
7 |
+#use "navigation.wmi" |
|
8 |
+ |
|
9 |
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
|
10 |
+<html> |
|
11 |
+<head> |
|
12 |
+ <title>$(TITLE)</title> |
|
13 |
+ <link rel="shortcut icon" type="image/x-icon" href="$(IMGROOT)/favicon.ico"> |
|
14 |
+ <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)">"> |
|
15 |
+ <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)">"> |
|
16 |
+ <ifeq "$(ANNOUNCE_RSS)" "yes" "<link rel="alternate" title="Tor Project OR-announce" href="http://rss.gmane.org/gmane.network.onion-routing.announce" |
|
17 |
+type="application/rss+xml">"> |
|
18 |
+ |
|
19 |
+ # begin WML to generate css/js paths |
|
20 |
+ <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">"> |
|
21 |
+ <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">"> |
|
22 |
+ |
|
23 |
+ #<link href="css/master.css" rel="stylesheet" type="text/css"> |
|
24 |
+ <!--[if lte IE 8]> |
|
25 |
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie8-and-down.css"> |
|
26 |
+ <![endif]--> |
|
27 |
+ <!--[if lte IE 7]> |
|
28 |
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css"> |
|
29 |
+ <![endif]--> |
|
30 |
+ <!--[if IE 6]> |
|
31 |
+ <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css"> |
|
32 |
+ <![endif]--> |
|
33 |
+ |
|
34 |
+# <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script> |
|
35 |
+ # end WML to generate css/js paths |
|
36 |
+ |
|
37 |
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
|
38 |
+ <meta name="author" content="The Tor Project, Inc."> |
|
39 |
+ <meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research"> |
|
40 |
+ <script type="text/javascript" src="../js/jquery.min.js"> |
|
41 |
+# /* jQuery */ |
|
42 |
+ </script> |
|
43 |
+ <script type="text/javascript" src="../js/jquery.client.min.js"> |
|
44 |
+/* "jQuery Browser And OS Detection Plugin" by Stoimen |
|
45 |
+ Source: http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plugin/ |
|
46 |
+ License: Public Domain (http://www.stoimen.com/blog/2009/07/16/jquery-browser-and-os-detection-plugin/#comment-12498) */ |
|
47 |
+ </script> |
|
48 |
+ <script type="text/javascript" src="../js/dlpage01.js"> |
|
49 |
+# /* Displays detected section */ |
|
50 |
+ </script> |
|
51 |
+ <script async type="text/javascript" src="../js/jquery.accordion.min.js"> |
|
52 |
+/* Modified version of "Stupid Simple jQuery Accordian Menu" originally developed by Ryan Stemkoski |
|
53 |
+ Source: http://www.stemkoski.com/stupid-simple-jquery-accordion-menu/ |
|
54 |
+ License: Public Domain (http://www.stemkoski.com/stupid-simple-jquery-accordion-menu/#comment-32882) */ |
|
55 |
+ </script> |
|
56 |
+ <script async type="text/javascript"> |
|
57 |
+# /* switches package links depending on selection */ |
|
58 |
+ function updateLang() { |
|
59 |
+ var caller = $( this ); |
|
60 |
+ var pkg = caller.attr('id'); |
|
61 |
+ var lang = caller.val(); |
|
62 |
+ var wintbb = '../dist/torbrowser/tor-browser-<version-torbrowserbundle>_'+lang+'.exe'; |
|
63 |
+ var osxtbb = '../dist/torbrowser/osx/TorBrowser-<version-torbrowserbundleosx>-dev-osx-i386-'+lang+'.zip'; |
|
64 |
+ var lintbb32 = '../dist/torbrowser/linux/tor-browser-gnu-linux-i686-<version-torbrowserbundlelinux32>-dev-'+lang+'.tar.gz'; |
|
65 |
+ var lintbb64 = '../dist/torbrowser/linux/tor-browser-gnu-linux-x86_64-<version-torbrowserbundlelinux64>-dev-'+lang+'.tar.gz'; |
|
66 |
+ if(pkg == 'win-tbb'){ |
|
67 |
+ $('.'+pkg).replaceWith('<a class="button win-tbb" href="'+wintbb+'"><span class="strong">Download</span><span class="normal">Tor Browser Bundle</span></a>'); |
|
68 |
+ $('.'+pkg+'-sig').replaceWith('<a class="win-tbb-sig" href="'+wintbb+'.asc">sig</a>'); |
|
69 |
+ }else if(pkg == 'osx-tbb'){ |
|
70 |
+ $('.'+pkg).replaceWith('<a class="button osx-tbb" href="'+osxtbb+'"><span class="strong">Download</span><span class="normal">Tor Browser Bundle (Beta)</span></a>'); |
|
71 |
+ $('.'+pkg+'-sig').replaceWith('<a class="osx-tbb-sig" href="'+osxtbb+'.asc">sig</a>'); |
|
72 |
+ }else if(pkg == 'lin-tbb32'){ |
|
73 |
+ $('.'+pkg).replaceWith('<a class="button lin-tbb32" href="'+lintbb32+'"><span class="strong">Download</span><span class="normal">i686 / 32-bit (Beta)</span></a>'); |
|
74 |
+ $('.'+pkg+'-sig').replaceWith('<a class="lin-tbb32-sig" href="'+lintbb32+'.asc">sig</a>'); |
|
75 |
+ }else if(pkg == 'lin-tbb64'){ |
|
76 |
+ $('.'+pkg).replaceWith('<a class="button lin-tbb64" href="'+lintbb64+'"><span class="strong">Download</span><span class="normal">x86_64 / 64-bit (Beta)</span></a>'); |
|
77 |
+ $('.'+pkg+'-sig').replaceWith('<a class="lin-tbb64-sig" href="'+lintbb64+'.asc">sig</a>'); |
|
78 |
+ } |
|
79 |
+ } |
|
80 |
+ |
|
81 |
+ $(function(){ |
|
82 |
+ $('.lang').ready(updateLang); |
|
83 |
+ $('.lang').change(updateLang); |
|
84 |
+ /* Only show language selector if javascript is enabled */ |
|
85 |
+ $('.lang').css('display', 'block'); |
|
86 |
+ }); |
|
87 |
+ </script> |
|
88 |
+ <script async type="text/javascript"> |
|
89 |
+ function displayVals() { |
|
90 |
+ var t3 = $("#t3").val(); |
|
91 |
+ var amount = $("#amount").val(); |
|
92 |
+ if(t3 != 0){ |
|
93 |
+ $('#a3').val(amount); |
|
94 |
+ $('#p3').val(1); |
|
95 |
+ $('#cmd').val('_xclick-subscriptions'); |
|
96 |
+ $('#item_name').val('Tor Project Membership'); |
|
97 |
+ $('#ppinfo').replaceWith('<h6 id="ppinfo"><small>(Requires a PayPal Account)</small></h6>'); |
|
98 |
+ }else{ |
|
99 |
+ $('#a3').val(0); |
|
100 |
+ $('#p3').val(0); |
|
101 |
+ $('#cmd').val('_donations'); |
|
102 |
+ $('#item_name').val('Donation to the Tor Project'); |
|
103 |
+ $('#ppinfo').replaceWith('<h6 id="ppinfo" style="height:0px;"></h6>'); |
|
104 |
+ } |
|
105 |
+ if( !t3 ) { |
|
106 |
+ $('#cmd').val('_donations'); |
|
107 |
+ $('#item_name').val('Donation to the Tor Project'); |
|
108 |
+ $('#ppinfo').replaceWith('<h6 id="ppinfo" style="height:0px;"></h6>'); |
|
109 |
+ } |
|
110 |
+ } |
|
111 |
+ $(function(){ |
|
112 |
+ $("#amount").change(displayVals); |
|
113 |
+ $("#t3").change(displayVals); |
|
114 |
+ displayVals(); |
|
115 |
+ }); |
|
116 |
+ </script> |
|
117 |
+</head> |
|
118 |
+<body onload="resetAll()" onunload=""> |
|
119 |
+<div id="wrap"> |
|
120 |
+ <div id="header"> |
|
121 |
+ <h1 id="logo"><a href="<page index>">Tor</a></h1> |
|
122 |
+ # navigation menu generation |
|
123 |
+ <div id="nav"> |
|
124 |
+ <ul> |
|
125 |
+ <:{ |
|
126 |
+ # create a hash and maintain order of keys |
|
127 |
+ my %navigation; |
|
128 |
+ my @keys; |
|
129 |
+ while (@navigation) { |
|
130 |
+ my $key = shift @navigation; |
|
131 |
+ my $val = shift @navigation; |
|
132 |
+ push @keys, $key; |
|
133 |
+ $navigation{$key} = $val; |
|
134 |
+ } |
|
135 |
+ |
|
136 |
+ my $page = $WML_SRC_BASENAME; |
|
137 |
+ my $lang = "$(LANG)"; |
|
138 |
+ |
|
139 |
+ for my $key (@keys) { |
|
140 |
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,; |
|
141 |
+ |
|
142 |
+ # in directory of active link, set class active |
|
143 |
+ my $class; |
|
144 |
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) { |
|
145 |
+ $class = 'class="active"'; |
|
146 |
+ } else { |
|
147 |
+ $class = ''; |
|
148 |
+ } |
|
149 |
+ |
|
150 |
+ $dir = '.' unless defined $dir; |
|
151 |
+ |
|
152 |
+ # translated version |
|
153 |
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") { |
|
154 |
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n", |
|
155 |
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key}; |
|
156 |
+ } |
|
157 |
+ # english version |
|
158 |
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") { |
|
159 |
+ printf '<li><a '.$class.' href="%s">%s</a></li>'."\n", |
|
160 |
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key}; |
|
161 |
+ } |
|
162 |
+ # full url |
|
163 |
+ elsif ($key =~/^http/) { |
|
164 |
+ printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key}; |
|
165 |
+ } else { |
|
166 |
+ warn "$WML_SRC_FILENAME has a [page $key] (parses to |
|
167 |
+docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist."; |
|
168 |
+ } |
|
169 |
+ } |
|
170 |
+ }:> |
|
171 |
+ </ul> |
|
172 |
+ </div> |
|
173 |
+ <!-- END NAV --> |
|
174 |
+ # end navigation generation |
|
175 |
+ <div id="calltoaction"> |
|
176 |
+ <ul> |
|
177 |
+ <:{ |
|
178 |
+ my %calltoaction; |
|
179 |
+ my @keys; |
|
180 |
+ while (@calltoaction) { |
|
181 |
+ my $key = shift @calltoaction; |
|
182 |
+ my $val = shift @calltoaction; |
|
183 |
+ push @keys, $key; |
|
184 |
+ $calltoaction{$key} = $val; |
|
185 |
+ } |
|
186 |
+ |
|
187 |
+ my $page = $WML_SRC_BASENAME; |
|
188 |
+ my $lang = "$(LANG)"; |
|
189 |
+ for my $key (@keys) { |
|
190 |
+ my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,; |
|
191 |
+ |
|
192 |
+ # in directory, set active |
|
193 |
+ my $class; |
|
194 |
+ if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) { |
|
195 |
+ #if ($WML_SRC_BASENAME eq $base) { |
|
196 |
+ $class = 'class="active"'; |
|
197 |
+ } else { |
|
198 |
+ $class = ''; |
|
199 |
+ } |
|
200 |
+ |
|
201 |
+ $dir = '.' unless defined $dir; |
|
202 |
+ # try to use a translated version |
|
203 |
+ if (-e "$(DOCROOT)/$dir/$lang/$base.wml") { |
|
204 |
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n", |
|
205 |
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key}; |
|
206 |
+ } |
|
207 |
+ # default to english version |
|
208 |
+ elsif (-e "$(DOCROOT)/$dir/en/$base.wml") { |
|
209 |
+ printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n", |
|
210 |
+ stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key}; |
|
211 |
+ } else { |
|
212 |
+ 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."; |
|
213 |
+ } |
|
214 |
+ } |
|
215 |
+ }:> |
|
216 |
+ </ul> |
|
217 |
+ </div> |
|
218 |
+ <!-- END CALLTOACTION --> |
|
219 |
+ </div> |
|
220 |
+ <!-- END HEADER --> |
|
221 |
+ |
|
222 |
+#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>."> |
|
223 |
+#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>."> |
|
0 | 224 |