11c72e898f12b69f0b726ff85747169f6df4ccff
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">
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 19 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" />
Peter Palfrader WMLify eff/

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 19 years ago

21) </head>
22) 
23) <body>
24) 
25) <div class="center">
26) <table class="banner" border="0" cellpadding="0" cellspacing="0">
27)     <tr>
28)         <td class="banner-left"></td>
29)         <td class="banner-middle">
Peter Palfrader also use "use warnings"

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 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 19 years ago

55) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

59) 	  my $page = $WML_SRC_FILENAME;
Roger Dingledine this is a better hack. stil...

Roger Dingledine authored 18 years ago

60) 	  my $numlangs = 0;
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 18 years ago

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

Roger Dingledine authored 18 years ago

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

Peter Palfrader authored 18 years ago

64) 	      if ($dir eq '$(LANG)') {
65) 	        printf('<img src="$(IMGROOT)/%s.png" alt="%s" /> ', $dir, $LANGUAGES{$dir});
66) 	      } else {
Peter Palfrader Add gui and minor fixes

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 18 years ago

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

Peter Palfrader authored 19 years ago

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

Peter Palfrader authored 19 years ago

73) 	}:>
Peter Palfrader Move website to wml

Peter Palfrader authored 19 years ago

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