3 this.el = document.createElement("pre");
6 this.install = function()
8 document.body.appendChild(this.el);
11 this.start = function()
14 this.el.innerHTML = window.location.hash ? this.redirect() : this.directory();
17 this.directory = function()
21 for(id in this.sites){
22 var site = this.sites[id]
23 html += `${id}) <a href='${site}'>${site}</a>\n`
25 html += `\n<a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a>`
30 this.reload = function()
32 setTimeout(()=>{ window.location.reload() },500)
35 this.location = function()
37 return window.location.hash.replace("#","").trim();
40 this.locate = function()
42 var hash = this.location();
45 return Math.floor(Math.random()*this.sites.length)
48 for(var id in this.sites){
49 var site = this.sites[id];
50 if(site.indexOf(hash) >-1){
57 this.next = function(loc)
59 return loc == this.sites.length-1 ? this.sites[0] : this.sites[loc+1];
62 this.redirect = function()
64 var location = this.locate();
65 var target = this.next(location);
69 html = `Redirecting to ${target}
70 <meta http-equiv="refresh" content="3; url=${target}">
71<a href='' onClick="window.location.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>`
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list