OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>TryServer Index page</title> | 4 <title>BuildBot Index page</title> |
5 <script> | 5 <script> |
6 var redirect_to = "/waterfall"; | 6 var redirect_to = "/waterfall"; |
7 | 7 |
8 function create_redirect_url(url) { | 8 function create_redirect_url(url) { |
9 var url_no_index = url.replace(/\/index.html$/, ""); | 9 var url_no_index = url.replace(/\/index.html$/, ""); |
10 var args = ""; | 10 var args = ""; |
11 var index_of_arg = url_no_index.indexOf("?"); | 11 var index_of_arg = url_no_index.indexOf("?"); |
12 if (index_of_arg != -1) { | 12 if (index_of_arg != -1) { |
13 args = url_no_index.slice(index_of_arg); | 13 args = url_no_index.slice(index_of_arg); |
14 url_no_index = url_no_index.slice(0, index_of_arg); | 14 url_no_index = url_no_index.slice(0, index_of_arg); |
15 } | 15 } |
16 var url_no_slash = url_no_index.replace(/\/+$/, ""); | 16 var url_no_slash = url_no_index.replace(/\/+$/, ""); |
17 var possible = url_no_slash.slice(url_no_slash.length - redirect_to.length); | 17 var possible = url_no_slash.slice(url_no_slash.length - redirect_to.length); |
18 if (possible == redirect_to) { | 18 if (possible == redirect_to) { |
19 alert("There was an error redirecting you. Please try again later."); | 19 alert("There was an error redirecting you. Please try again later."); |
20 return; | 20 return; |
21 } | 21 } |
22 | 22 |
23 new_url = url_no_slash.replace(/$/, redirect_to) + args; | 23 new_url = url_no_slash.replace(/$/, redirect_to) + args; |
24 document.write("<meta http-equiv='REFRESH' content='0;url=" + new_url + | 24 document.write("<meta http-equiv='REFRESH' content='0;url=" + new_url + |
25 "'>"); | 25 "'>"); |
26 } | 26 } |
27 create_redirect_url(location.href); | 27 create_redirect_url(location.href); |
28 </script> | 28 </script> |
29 </HEAD> | 29 </HEAD> |
30 <BODY> | 30 <BODY> |
31 </BODY> | 31 </BODY> |
32 </HTML> | 32 </HTML> |
OLD | NEW |