one wmi per language will make us sad
Roger Dingledine

Roger Dingledine commited on 2011-09-22 00:03:23
Zeige 1 geänderte Dateien mit 0 Einfügungen und 151 Löschungen.

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