svn commit: samba-web r421 - in trunk/scripts: .

deryck at samba.org deryck at samba.org
Mon Nov 15 20:26:59 GMT 2004


Author: deryck
Date: 2004-11-15 20:26:58 +0000 (Mon, 15 Nov 2004)
New Revision: 421

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=421

Log:

Now that we've got the random mirroring working, update
the script that will generate the javascript to include.

--deryck

Modified:
   trunk/scripts/js_redirect.py


Changeset:
Modified: trunk/scripts/js_redirect.py
===================================================================
--- trunk/scripts/js_redirect.py	2004-11-15 20:11:53 UTC (rev 420)
+++ trunk/scripts/js_redirect.py	2004-11-15 20:26:58 UTC (rev 421)
@@ -14,12 +14,13 @@
         nline = fluff.sub('', line)
         urls.append(nline)
 
-os.chdir('/data/httpd/html/samba/scripts')
-js = open('redirect.js', 'w')
+js = open('redirect_include.html', 'w')
+js.write('<script language="Javascript" type="text/javascript">\n')
 js.write('randomMirror = new Array;\n')
 for i in range(len(urls)):
     js.write('randomMirror[' + str(i) + '] = ' + urls[i] + '\n')
 js.write('\n')
-js.write('n = Math.floor(Math.random()*' + str(len(urls)) + ')')
+js.write('n = Math.floor(Math.random()*' + str(len(urls)) + ')\n')
+js.write('</script>')
 js.close() 
 



More information about the samba-cvs mailing list