48b84714405c1582282013a3d37b82641acbb4ef
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>
14)   <title>Tor: $(TITLE)</title>
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" />">
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

18)   <link rel="stylesheet" type="text/css" href="$(DOCROOT)/stylesheet.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 17 years ago

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

Peter Palfrader authored 18 years ago

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

Andrew Lewman authored 16 years ago

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

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

55) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 17 years ago

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

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

Roger Dingledine authored 17 years ago

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

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

72) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 18 years ago

73)         </td>
74)     </tr>
75) </table>
76)