@@ -28,13 +28,7 @@ function Portal(sites)
2828
2929 this.directory = function()
3030 {
31− let html = ""
32−
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>`
36− }
37− return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
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()}`
3832 }
3933
4034 this.reload = function()
@@ -56,14 +50,14 @@ function Portal(sites)
5650
5751 this.locate = function()
5852 {
59− let hash = this.location();
53+ const hash = this.location();
6054
6155 if(hash == "random"){
6256 return Math.floor(Math.random()*this.sites.length)
6357 }
6458
65− for(let id in this.sites){
66− let site = this.sites[id];
59+ for(const id in this.sites){
60+ const site = this.sites[id];
6761 if(site.indexOf(hash) >-1){
6862 return parseInt(id)
6963 }
@@ -78,8 +72,8 @@ function Portal(sites)
7872
7973 this.redirect = function()
8074 {
81− let location = this.locate();
82− let target = this.next(location);
75+ const location = this.locate();
76+ const target = this.next(location);
8377 this.navigate(target)
8478 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
8579 <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>`