Author: deryck Date: 2004-12-02 21:28:02 +0000 (Thu, 02 Dec 2004) New Revision: 449
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=449 Log: Wasn't happy with performance on sending news to any random mirror, so I'm reverting to sending news.samba.org only to US mirrors, even if there are only 2 viable ones. --deryck Modified: trunk/news/header2.html trunk/scripts/js_redirect.py Changeset: Modified: trunk/news/header2.html =================================================================== --- trunk/news/header2.html 2004-12-02 19:39:59 UTC (rev 448) +++ trunk/news/header2.html 2004-12-02 21:28:02 UTC (rev 449) @@ -27,8 +27,21 @@ } </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" /> <meta name="keywords" content="Samba SMB CIFS" /> Modified: trunk/scripts/js_redirect.py =================================================================== --- trunk/scripts/js_redirect.py 2004-12-02 19:39:59 UTC (rev 448) +++ trunk/scripts/js_redirect.py 2004-12-02 21:28:02 UTC (rev 449) @@ -36,18 +36,4 @@ 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() - +