on master help sign in
*
d499c0dDevine Lu Linvega
404.html+2−2
@@ -9,8 +9,8 @@ permalink: /404.html
9</head>
9</head>
10<body style='background:black'>
10<body style='background:black'>
11 <script>
11 <script>
12− var parts = window.location.pathname.split("/")
12+ let parts = window.location.pathname.split("/")
13− var target = parts.slice(-1);
13+ let target = parts.slice(-1);
14 parts.splice(-1)
14 parts.splice(-1)
15 document.location.href = parts.join("/")+"/#"+target
15 document.location.href = parts.join("/")+"/#"+target
16 </script>
16 </script>
index.html+2−2
@@ -11,7 +11,7 @@
11<body>
11<body>
12 <script>
12 <script>
13 // protocole://url.domain.ext
13 // protocole://url.domain.ext
14− var sites = [
14+ let sites = [
15 "https://wiki.xxiivv.com"
15 "https://wiki.xxiivv.com"
16 , "http://estevancarlos.com"
16 , "http://estevancarlos.com"
17 , "https://electro.pizza"
17 , "https://electro.pizza"
@@ -73,7 +73,7 @@
73 , "https://ricky.codes"
73 , "https://ricky.codes"
74 // Don't forget the comma! No trailing slashes
74 // Don't forget the comma! No trailing slashes
75 ]
75 ]
76− var portal = new Portal(sites);
76+ let portal = new Portal(sites);
77 portal.start();
77 portal.start();
78 </script>
78 </script>
79</body>
79</body>
scripts/portal.js+10−8
@@ -1,3 +1,5 @@
1+'use strict';
2+
1function Portal(sites)
3function Portal(sites)
2{
4{
3 this.el = document.createElement("div");
5 this.el = document.createElement("div");
@@ -26,10 +28,10 @@ function Portal(sites)
26
28
27 this.directory = function()
29 this.directory = function()
28 {
30 {
29− var html = ""
31+ let html = ""
30
32
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>`
34 }
36 }
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)
54
56
55 this.locate = function()
57 this.locate = function()
56 {
58 {
57− var hash = this.location();
59+ let hash = this.location();
58
60
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)
61 }
63 }
62
64
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)
67 }
69 }
@@ -76,8 +78,8 @@ function Portal(sites)
76
78
77 this.redirect = function()
79 this.redirect = function()
78 {
80 {
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>`