@@ -1,3 +1,5 @@
1function Portal(sites)
3function Portal(sites)
3 this.el = document.createElement("div");
5 this.el = document.createElement("div");
@@ -26,10 +28,10 @@ function Portal(sites)
27 this.directory = function()
29 this.directory = function()
29− var html = ""
31+ let html = ""
31− for(var id in this.sites){
33+ for(let id in this.sites){
32− var site = this.sites[id]
34+ let site = this.sites[id]
33 html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
35 html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
35 return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
37 return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
@@ -54,14 +56,14 @@ function Portal(sites)
55 this.locate = function()
57 this.locate = function()
57− var hash = this.location();
59+ let hash = this.location();
59 if(hash == "random"){
61 if(hash == "random"){
60 return Math.floor(Math.random()*this.sites.length)
62 return Math.floor(Math.random()*this.sites.length)
63− for(var id in this.sites){
65+ for(let id in this.sites){
64− var site = this.sites[id];
66+ let site = this.sites[id];
65 if(site.indexOf(hash) >-1){
67 if(site.indexOf(hash) >-1){
66 return parseInt(id)
68 return parseInt(id)
@@ -76,8 +78,8 @@ function Portal(sites)
77 this.redirect = function()
79 this.redirect = function()
79− var location = this.locate();
81+ let location = this.locate();
80− var target = this.next(location);
82+ let target = this.next(location);
81 this.navigate(target)
83 this.navigate(target)
82 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
84 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
83 <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>`
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>`