add tbb head include
Andrew Lewman

Andrew Lewman commited on 2013-08-02 04:48:38
Zeige 1 geänderte Dateien mit 143 Einfügungen und 0 Löschungen.

... ...
@@ -0,0 +1,143 @@
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
+
17
+  # begin WML to generate css/js paths 
18
+  <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)">">
19
+  <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/master.css">">
20
+
21
+  <link href="$(DOCROOT)/css/tbbproject.css" rel="stylesheet" type="text/css">
22
+  <!--[if lte IE 8]>
23
+  <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie8-and-down.css">
24
+  <![endif]-->
25
+  <!--[if lte IE 7]>
26
+  <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie7-and-down.css">
27
+  <![endif]-->
28
+  <!--[if IE 6]>
29
+  <link rel="stylesheet" type="text/css" href="$(DOCROOT)/css/ie6.css">
30
+  <![endif]-->
31
+#  <script language="javascript" type="text/javascript" src="$(DOCROOT)/global.js"></script>
32
+  # end WML to generate css/js paths 
33
+
34
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
35
+  <meta name="author" content="The Tor Project, Inc.">
36
+  <meta name="keywords" content="anonymity online, tor, tor project, censorship circumvention, traffic analysis, anonymous communications research">
37
+</head>
38
+<body>
39
+<div id="wrap">
40
+  <div id="header">
41
+    <h1 id="logo"><a href="<page index>">Tor</a></h1>
42
+      # navigation menu generation
43
+      <div id="nav">
44
+        <ul>
45
+        <:{
46
+            # create a hash and maintain order of keys
47
+            my %navigation;
48
+            my @keys;
49
+            while (@navigation) {
50
+              my $key = shift @navigation;
51
+              my $val = shift @navigation;
52
+              push @keys, $key;
53
+              $navigation{$key} = $val;
54
+            }
55
+
56
+            my $page = $WML_SRC_BASENAME;
57
+            my $lang = "$(LANG)";
58
+
59
+            for my $key (@keys) {
60
+              my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;  
61
+
62
+              # in directory of active link, set class active 
63
+              my $class;
64
+              if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
65
+                $class = 'class="active"';
66
+              } else {
67
+                $class = '';
68
+              }
69
+
70
+	            $dir = '.' unless defined $dir;
71
+                
72
+              # translated version
73
+              if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
74
+                  printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
75
+                         stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$navigation{$key};
76
+              } 
77
+              # english version
78
+              elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
79
+              	printf '<li><a '.$class.' href="%s">%s</a></li>'."\n",
80
+                  stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $navigation{$key};
81
+              }
82
+              # full url
83
+              elsif ($key =~/^http/) {
84
+                printf '<li><a href="%s">%s</a></li>'."\n", $key, $navigation{$key};
85
+              } else {
86
+                warn "$WML_SRC_FILENAME has a [page $key] (parses to
87
+docdir: $(DOCROOT)/; dir: $dir; base: $base -> $(DOCROOT)/$dir/$lang/$base.wml), but that doesn't exist.";
88
+              }
89
+            }
90
+        }:>
91
+        </ul>
92
+      </div>
93
+      <!-- END NAV -->
94
+     # end navigation generation
95
+      <div id="calltoaction">
96
+        <ul>
97
+          <:{
98
+            my %calltoaction;
99
+            my @keys;
100
+            while (@calltoaction) {
101
+              my $key = shift @calltoaction;
102
+              my $val = shift @calltoaction;
103
+              push @keys, $key;
104
+              $calltoaction{$key} = $val;
105
+            } 
106
+
107
+            my $page = $WML_SRC_BASENAME;
108
+            my $lang = "$(LANG)";
109
+            for my $key (@keys) {
110
+              my ($dir, $base) = $key =~ m,^(?:(.*)/)?(.*?)$,;  
111
+
112
+              # in directory, set active 
113
+              my $class;
114
+              if ((defined $dir) and ($WML_SRC_DIRNAME =~/$dir/) or ($WML_SRC_BASENAME eq $base)) {
115
+              #if ($WML_SRC_BASENAME eq $base) {
116
+                $class = 'class="active"';
117
+              } else {
118
+                $class = '';
119
+              }
120
+
121
+	          $dir = '.' unless defined $dir;
122
+              # try to use a translated version
123
+              if (-e "$(DOCROOT)/$dir/$lang/$base.wml") {
124
+                  printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
125
+                         stripDotSlashs("$(DOCROOT)/$dir/$base.html.$(LANG)"),$calltoaction{$key};
126
+              } 
127
+              # default to english version
128
+              elsif (-e "$(DOCROOT)/$dir/en/$base.wml") {
129
+              	printf '<li class="donate"><a '.$class.' href="%s">%s</a></li>'."\n",
130
+                  stripDotSlashs("$(DOCROOT)/$dir/$base.html"), $calltoaction{$key};
131
+              } else {
132
+                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.";
133
+              }
134
+            }    
135
+          }:>
136
+        </ul>
137
+      </div>
138
+      <!-- END CALLTOACTION -->
139
+  </div>
140
+  <!-- END HEADER -->
141
+
142
+#<ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">
143
+#<ifneq "$(REDIRECT_GLOBAL)" "" "Redirecting to <a href="$(REDIRECT_GLOBAL)">$(REDIRECT_GLOBAL)</a>.">
0 144