Wasn't happy with performance on sending news to any random mirror,
authorDeryck Hodge <deryck@samba.org>
Thu, 2 Dec 2004 21:28:02 +0000 (21:28 +0000)
committerDeryck Hodge <deryck@samba.org>
Thu, 2 Dec 2004 21:28:02 +0000 (21:28 +0000)
so I'm reverting to sending news.samba.org only to US mirrors, even
if there are only 2 viable ones.

--deryck

git-svn-id: file:///home/svn/samba-web/trunk@449 44aeb9d7-1cd8-0310-b257-a505e0beeac2

news/header2.html
scripts/js_redirect.py

index 87d5d2a473a48b5c85c10d153a0cf5911be3398d..c85d56cc61d00aba4ca94a032021c1055d421657 100755 (executable)
@@ -27,7 +27,20 @@ body {
 }
 </style>
 
-<!--#include virtual="/samba/redirect_news.html" -->
+<script language="Javascript" type="text/javascript">
+<!-- Hide from old browsers
+newsMirrors = new Array
+newsMirrors[0] = "http://us1.samba.org/samba/news/"
+newsMirrors[1] = "http://us4.samba.org/samba/news/"
+
+n = Math.floor(Math.random()*2)
+
+if (document.location == "http://samba.org/samba/news/" || document.location == "http://www.samba.org/samba/news/") {
+
+    document.location = newsMirrors[n]
+}
+// end hide -->
+</script>
 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="Content-Language" content="en-us" />
index c71293b8acb97030f059edb303345cc6bae27d70..afeae2fe60e418fc1f2c89ce46901e2a5d0a9163 100755 (executable)
@@ -36,18 +36,4 @@ for m in mlist:
     menu.write('<option value=' + m + '">' + mirrors[m] + '</option>\n')
 menu.close()
 
-# For news redirect
-jsnews = open('redirect_news.html', 'w')
-jsnews.write('<script language="Javascript" type="text/javascript">\n')
-jsnews.write('<!-- Hide from old browsers\n')
-jsnews.write('newsMirrors = new Array\n')
-for i in range(len(mlist)):
-    jsnews.write('newsMirrors[' + str(i) + '] = ' + mlist[i] + 'news/"\n')
-jsnews.write('\n')
-jsnews.write('n = Math.floor(Math.random()*' + str(len(mirrors.keys())) + ')\n\n')
-jsnews.write('if (document.location == "http://samba.org/samba/news/" || document.location == "http://www.samba.org/samba/news/") {\n\n')
-jsnews.write('    document.location = newsMirrors[n]\n}\n')
-jsnews.write('// end hide -->\n')
-jsnews.write('</script>')
-jsnews.close() 
+