971c0bff4d790bd042a3a8aaf1be6a3c8fd2b550
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

1) #! /usr/bin/wml
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

2) <: use strict; :>
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

3) <: use warnings; :>
4) #use "perl-globals.wmi"
5) #use "links.wmi"
6) #use "versions.wmi"
7) #use "navigation.wmi"
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

8) 
Peter Palfrader We don't claim to do XML an...

Peter Palfrader authored 18 years ago

9) #<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Sebastian Hahn Change our doctype to refer...

Sebastian Hahn authored 15 years ago

10) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/1998/REC-html40-19980424/loose.dtd">
Peter Palfrader We don't claim to do XML an...

Peter Palfrader authored 18 years ago

11) #<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
12) <html>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

13) <head>
Roger Dingledine stop prefacing everything w...

Roger Dingledine authored 16 years ago

14)   <title>$(TITLE)</title>
Andrew Lewman change the author to tor, s...

Andrew Lewman authored 14 years ago

15)   <meta name="Author" content="The Tor Project, Inc." />
Roger Dingledine mandate UTF-8 on all wml pages

Roger Dingledine authored 14 years ago

16)   <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
Jacob Appelbaum A new header that selects e...

Jacob Appelbaum authored 16 years ago

17)   <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)" />">
18)   <ifeq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/stylesheet-ltr.css" />">
Roger Dingledine make the favicon.ico link r...

Roger Dingledine authored 18 years ago

19)   <link rel="shortcut icon" type="image/x-icon" href="$(DOCROOT)/favicon.ico" />
Roger Dingledine Hack weasel's wml voodoo to...

Roger Dingledine authored 18 years ago

20)   <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)" />">
Sebastian Hahn Add a REDIRECT_GLOBAL varia...

Sebastian Hahn authored 14 years ago

21)   <ifneq "$(REDIRECT_GLOBAL)" "" "<meta http-equiv="refresh" content="0;url=$(REDIRECT_GLOBAL)" />">
Sebastian Hahn Attempt to create valid htm...

Sebastian Hahn authored 15 years ago

22)   <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" />">
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

23) </head>
24) 
25) <body>
26) 
27) <div class="center">
28) <table class="banner" border="0" cellpadding="0" cellspacing="0">
29)     <tr>
Andrew Lewman Updated the url to www.tp.o...

Andrew Lewman authored 17 years ago

30)         <td class="banner-left"><a href="https://www.torproject.org/"><img src="$(DOCROOT)/images/top-left.png" alt="Click to go to home page" width="193" height="79"></a></td>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

31)         <td class="banner-middle">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

32) 	<:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

33) 	    my %navigation;
34) 	    my @keys;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

35) 	    while (@navigation) {
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

36) 	      my $key = shift @navigation;
37) 	      my $val = shift @navigation;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

38) 	      push @keys, $key;
39) 	      $navigation{$key} = $val;
40) 	    }
41) 
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

42) 	    for my $key (@keys) {
43) 	      my $page = $WML_SRC_FILENAME;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

44) 	      $page =~ s/\.wml//;
45) 	      if ($page ne $key) {
Peter Palfrader Add gui and minor fixes

Peter Palfrader authored 18 years ago

46) 	        if (-e "$(DOCROOT)/$(LANG)/$key.wml") {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 18 years ago

47) 	          printf '<a href="%s">%s</a>'."\n",
48) 	                 stripDotSlashs("$(DOCROOT)/$key.html.$(LANG)"), $navigation{$key};
Roger Dingledine link to the blog from the n...

Roger Dingledine authored 16 years ago

49) 	        } elsif ($key =~ /^http/) {
50) 	          printf '<a href="%s">%s</a>'."\n", $key, $navigation{$key};
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

51) 	        } else {
Peter Palfrader Remove ././././././ from links

Peter Palfrader authored 18 years ago

52) 	          printf '<a href="%s">%s</a>'."\n",
53) 	                 stripDotSlashs("$(DOCROOT)/$key.html"), $navigation{$key};
Roger Dingledine bugfix on the website: the...

Roger Dingledine authored 18 years ago

54) 	        }
55) 	      } else {
56) 	       printf '<a class="current">%s</a>'."\n", $navigation{$key};
57) 	      }
58) 	    }
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

59) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

60)         </td>
61)         <td class="banner-right">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

62) 	<:{
Peter Palfrader Make translation status mor...

Peter Palfrader authored 19 years ago

63) 	  my $page = $WML_SRC_FILENAME;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

64) 	  $page =~ s/\.wml//;
Peter Palfrader Add russian translation

Peter Palfrader authored 18 years ago

65) 	  for my $dir (@LANGUAGES) {
Roger Dingledine this is a better hack. stil...

Roger Dingledine authored 18 years ago

66) 	    if (-e "$dir/$WML_SRC_FILENAME") {
Peter Palfrader More languages in the top r...

Peter Palfrader authored 18 years ago

67) 	      if ($dir eq '$(LANG)') {
Roger Dingledine make mouseovers of our lang...

Roger Dingledine authored 18 years ago

68) 	        printf('<acronym title="%s"><img src="$(IMGROOT)/%s.png" alt="%s" /></acronym> ', $LANGUAGES{$dir}, $dir, $LANGUAGES{$dir});
Peter Palfrader More languages in the top r...

Peter Palfrader authored 18 years ago

69) 	      } else {
Roger Dingledine make mouseovers of our lang...

Roger Dingledine authored 18 years ago

70) 	        printf('<a href="%s.html.%s"><acronym title="%s"><img src="$(IMGROOT)/%s.png" alt="%s" /></acronym></a> ', $page, $dir, $LANGUAGES{$dir}, $dir, $LANGUAGES{$dir});
Peter Palfrader More languages in the top r...

Peter Palfrader authored 18 years ago

71) 	      };
72) 	    } else {
73) 	      printf('<img src="$(IMGROOT)/green-flagspace.png"/> ');
74) 	    };
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

75) 	  };
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

76) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

77)         </td>
78)     </tr>
79) </table>
80) 
Roger Dingledine Hack weasel's wml voodoo to...

Roger Dingledine authored 18 years ago

81) <ifneq "$(REDIRECT)" "" "Redirecting to <a href="$(DOCROOT)/$(REDIRECT)">$(DOCROOT)/$(REDIRECT)</a>.">