on master help sign in
Merge pull request #34 from jai-dv/patch-3

random redirect support for Firefox and Edge

commit25f840275d49f43e348dc7831f22792faf651419 authorЛu Лinveгa <aliceffekt@gmail.com> dateFri 18 May 2018, 12:09 (8 years ago) parentd050311d996d50
1 file changed+12−3
portal.js+12−3
portal.js+12−3
@@ -31,6 +31,13 @@ function Portal(sites)
3131 {
3232 setTimeout(()=>{ window.location.reload() },500)
3333 }
34+
35+ this.navigate = function(target)
36+ {
37+ setTimeout(() => {
38+ window.location.href = target
39+ },3000)
40+ }
3441
3542 this.location = function()
3643 {
@@ -63,12 +70,14 @@ function Portal(sites)
6370 {
6471 var location = this.locate();
6572 var target = this.next(location);
73+ this.navigate(target)
6674
6775 var html = ""
6876
6977 html = `Redirecting to ${target}
70− <meta http-equiv="refresh" content="3; url=${target}">
71−<a href='' onClick="window.location.reload()">Directory</a> | <a href='#${target}' onClick="portal.reload('random')">Skip</a> | <a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a>`
78+<meta http-equiv="refresh" content="3; url=${target}">
79+<a href='' onClick="window.location.reload()">Directory</a> | <a href='#${target}' onClick="portal.reload('random')">Skip</a> | <a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a>
80+`
7281 return html
7382 }
74−}
83+}