41b2de4079aff19955c692a9214abd3ef050c1e0
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 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 18 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">
10) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
11) #<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
12) <html>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 16 years ago

14)   <title>$(TITLE)</title>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

15)   <meta name="Author" content="Roger Dingledine" />
Peter Palfrader Add russian translation

Peter Palfrader authored 18 years ago

16)   <ifneq "$(CHARSET)" "" "<meta http-equiv="content-type" content="text/html; charset=$(CHARSET)" />">
17)   <ifeq "$(CHARSET)" "" "<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />">
Jacob Appelbaum A new header that selects e...

Jacob Appelbaum authored 15 years ago

18)   <ifneq "$(STYLESHEET)" "" "<link rel="stylesheet" type="text/css" href="$(DOCROOT)/$(STYLESHEET)" />">
19)   <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

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

Roger Dingledine authored 17 years ago

21)   <ifneq "$(REDIRECT)" "" "<meta http-equiv="refresh" content="0;url=$(DOCROOT)/$(REDIRECT)" />">
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Andrew Lewman authored 16 years ago

29)         <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 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 16 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

58) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 17 years ago

67) 	        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

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

Roger Dingledine authored 17 years ago

69) 	        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

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

75) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

76)         </td>
77)     </tr>
78) </table>
79)