[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Mirror thingie in every page



--- mirrors.wml 2001/06/09 16:47:53     1.13
+++ mirrors.wml 2001/06/10 08:02:30
@@ -51,7 +51,9 @@
 <if "$(usefonts)" "</font>">
 <br>
 # note: the values for site don't have an ending slash on purpose, that's page
-<select name="site"<if "$(small)" " style=font-size:90%;">>
+<select name="site"<if "$(small)" " style=font-size:90%;" > onChange="location.href=this.options[this.selectedIndex].value+this.form.page.value;">
+
+>
 <perl>
 my %mirrors = (
     "<ATc>" => "at",

What would you think about this?  This one adds JavaScript to page
so that everyone having JavaScript on in his/her browser doesn't need
to use CGI and doesn't need to press Go, it automatically goes to
wanted mirror.  And works without JavaScript too, then it just uses
CGI as it does now every time.

@@ -81,10 +83,10 @@
 }
 foreach $l (keys %$mirrors_lang) {
   foreach $m (sort langcmp keys %{$mirrors_lang->{$l}}) {
-  <perl:print>  [$l:<option value=\"http://www.$mirrors_lang->{$l}->{$m}.debian.org\">$m</option>\n:]</perl:print>
+  <perl:print>[$l:<option value=\"http://www.$mirrors_lang->{$l}->{$m}.debian.org\">$m</option>\n:]</perl:print>
   }

I think this is important, it removes 376(!) bytes of white chars per page.

 }
-</perl>
+</perl>\
 #      <option value="http://www.at.debian.org";><ATc></option>
 #      <option value="http://www.au.debian.org";><AUc></option>
 #      <option value="http://www.bg.debian.org";><BGc></option>

This removes useless empty line.

@@ -103,7 +105,7 @@
 #      <option value="http://www.tr.debian.org";><TRc></option>
 #      <option value="http://www.uk.debian.org";><UKc></option>
 ##  \/ <option value="http://www.us.debian.org";><USc></option>
-       <option value="http://www.debian.org"; selected>www.debian.org</option>
+<option value="http://www.debian.org"; selected>www.debian.org</option>
 </select>
 <input type="SUBMIT" value=" <go> "<if "$(small)" " style=font-size:90%;">>
 <br>

After this www.debian.org will be intended similar to generated list
of mirrors.

All things in one patch file:
Index: mirrors.wml
===================================================================
RCS file: /cvs/webwml/webwml/english/template/debian/mirrors.wml,v
retrieving revision 1.13
diff -u -r1.13 mirrors.wml
--- mirrors.wml	2001/06/09 16:47:53	1.13
+++ mirrors.wml	2001/06/10 08:07:11
@@ -51,7 +51,9 @@
 <if "$(usefonts)" "</font>">
 <br>
 # note: the values for site don't have an ending slash on purpose, that's page
-<select name="site"<if "$(small)" " style=font-size:90%;">>
+<select name="site"<if "$(small)" " style=font-size:90%;" > onChange="location.href=this.options[this.selectedIndex].value+this.form.page.value;">
+
+>
 <perl>
 my %mirrors = (
     "<ATc>" => "at",
@@ -81,10 +83,10 @@
 }
 foreach $l (keys %$mirrors_lang) {
   foreach $m (sort langcmp keys %{$mirrors_lang->{$l}}) {
-  <perl:print>  [$l:<option value=\"http://www.$mirrors_lang->{$l}->{$m}.debian.org\">$m</option>\n:]</perl:print>
+  <perl:print>[$l:<option value=\"http://www.$mirrors_lang->{$l}->{$m}.debian.org\">$m</option>\n:]</perl:print>
   }
 }
-</perl>
+</perl>\
 #	<option value="http://www.at.debian.org";><ATc></option>
 #	<option value="http://www.au.debian.org";><AUc></option>
 #	<option value="http://www.bg.debian.org";><BGc></option>
@@ -103,7 +105,7 @@
 #	<option value="http://www.tr.debian.org";><TRc></option>
 #	<option value="http://www.uk.debian.org";><UKc></option>
 ##  \/	<option value="http://www.us.debian.org";><USc></option>
-	<option value="http://www.debian.org"; selected>www.debian.org</option>
+<option value="http://www.debian.org"; selected>www.debian.org</option>
 </select>
 <input type="SUBMIT" value=" <go> "<if "$(small)" " style=font-size:90%;">>
 <br>
But of course, applying this also make big rebuild again.

-- 
Tommi Vainikainen

Reply to: