@@ -28,13 +28,7 @@ function Portal(sites)
29 this.directory = function()
29 this.directory = function()
31− let html = ""
31+ return `<ul>${this.sites.reduce((acc,val,id) => { return `${acc}<li>${id}) <a href='${val}'>${val.split("//")[1]}</a></li>`},"")}</ul>\n${this.readme()}${this.buttons()}`
33− for(let id in this.sites){
34− let site = this.sites[id]
35− html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
37− return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
40 this.reload = function()
34 this.reload = function()
@@ -56,14 +50,14 @@ function Portal(sites)
57 this.locate = function()
51 this.locate = function()
59− let hash = this.location();
53+ const hash = this.location();
61 if(hash == "random"){
55 if(hash == "random"){
62 return Math.floor(Math.random()*this.sites.length)
56 return Math.floor(Math.random()*this.sites.length)
65− for(let id in this.sites){
59+ for(const id in this.sites){
66− let site = this.sites[id];
60+ const site = this.sites[id];
67 if(site.indexOf(hash) >-1){
61 if(site.indexOf(hash) >-1){
68 return parseInt(id)
62 return parseInt(id)
@@ -78,8 +72,8 @@ function Portal(sites)
79 this.redirect = function()
73 this.redirect = function()
81− let location = this.locate();
75+ const location = this.locate();
82− let target = this.next(location);
76+ const target = this.next(location);
83 this.navigate(target)
77 this.navigate(target)
84 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
78 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
85 <p class='buttons'><a href='#' onClick="portal.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> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
79 <p class='buttons'><a href='#' onClick="portal.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> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`