on master help sign in
*
commitd499c0d1c1b22d28e37f5f7d03c69cf1cb3a3d9f authorDevine Lu Linvega <aliceffekt@gmail.com> dateWed 29 Aug 2018, 12:57 (8 years ago) parent8638e42
3 files changed+14−12
404.html+2−2 index.html+2−2 scripts/portal.js+10−8
404.html+2−2
@@ -9,8 +9,8 @@ permalink: /404.html
99</head>
1010<body style='background:black'>
1111 <script>
12− var parts = window.location.pathname.split("/")
13− var target = parts.slice(-1);
12+ let parts = window.location.pathname.split("/")
13+ let target = parts.slice(-1);
1414 parts.splice(-1)
1515 document.location.href = parts.join("/")+"/#"+target
1616 </script>
index.html+2−2
@@ -11,7 +11,7 @@
1111<body>
1212 <script>
1313 // protocole://url.domain.ext
14− var sites = [
14+ let sites = [
1515 "https://wiki.xxiivv.com"
1616 , "http://estevancarlos.com"
1717 , "https://electro.pizza"
@@ -73,7 +73,7 @@
7373 , "https://ricky.codes"
7474 // Don't forget the comma! No trailing slashes
7575 ]
76− var portal = new Portal(sites);
76+ let portal = new Portal(sites);
7777 portal.start();
7878 </script>
7979</body>
scripts/portal.js+10−8
@@ -1,3 +1,5 @@
1+'use strict';
2+
13function Portal(sites)
24{
35 this.el = document.createElement("div");
@@ -26,10 +28,10 @@ function Portal(sites)
2628
2729 this.directory = function()
2830 {
29− var html = ""
31+ let html = ""
3032
31− for(var id in this.sites){
32− var site = this.sites[id]
33+ for(let id in this.sites){
34+ let site = this.sites[id]
3335 html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
3436 }
3537 return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
@@ -54,14 +56,14 @@ function Portal(sites)
5456
5557 this.locate = function()
5658 {
57− var hash = this.location();
59+ let hash = this.location();
5860
5961 if(hash == "random"){
6062 return Math.floor(Math.random()*this.sites.length)
6163 }
6264
63− for(var id in this.sites){
64− var site = this.sites[id];
65+ for(let id in this.sites){
66+ let site = this.sites[id];
6567 if(site.indexOf(hash) >-1){
6668 return parseInt(id)
6769 }
@@ -76,8 +78,8 @@ function Portal(sites)
7678
7779 this.redirect = function()
7880 {
79− var location = this.locate();
80− var target = this.next(location);
81+ let location = this.locate();
82+ let target = this.next(location);
8183 this.navigate(target)
8284 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
8385 <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>`