@@ -1,14 +1,55 @@
1function Portal(sites)
1function Portal(sites)
3+ this.el = document.createElement("div");
3 this.sites = sites;
4 this.sites = sites;
5 this.install = function()
6 this.install = function()
7−
8+ document.body.appendChild(this.el)
10 this.start = function()
11 this.start = function()
13+ if(window.location.hash){
21+ this.directory = function()
26+ this.location = function()
31+ this.locate = function()
33+ var hash = window.location.hash.replace("#","").trim();
34+ for(var id in this.sites){
35+ var site = this.sites[id];
36+ if(site.indexOf(hash) >-1){
43+ this.next = function(loc)
45+ return loc == this.sites.length-1 ? this.sites[0] : this.sites[loc+1];
48+ this.redirect = function()
50+ var location = this.locate();
51+ var target = this.next(location);
53+ console.log(location,target)