@@ -12,6 +12,7 @@ function Wiki (sites) {
12 this._names = document.createElement('div')
12 this._names = document.createElement('div')
13 this._names.id = 'names'
13 this._names.id = 'names'
15 this.index = {}
16 this.index = {}
16 this.categories = {}
17 this.categories = {}
@@ -31,16 +32,23 @@ function Wiki (sites) {
32 this.refresh = () => {
33 this.refresh = () => {
33 console.log(Object.keys(this.index).length + ' terms')
34 console.log(Object.keys(this.index).length + ' terms')
37 let html = ''
36 let html = ''
38 for (const id in this.categories) {
37 for (const id in this.categories) {
39− html += `<li>${id} <span class='right'>${this.categories[id].length}</span></li>`
38+ html += `<li onclick='wiki.go("${id}")' class='${wiki.at(id) ? 'selected' : ''}'>${id} <span class='right'>${this.categories[id].length}</span></li>`
41 this._categories.innerHTML = `${html}`
40 this._categories.innerHTML = `${html}`
48+ this.at = (q = '') => {
49+ return this.loc.toLowerCase() === q.toLowerCase()
44 this.fetch = () => {
52 this.fetch = () => {
45 console.log('Wiki', 'Fetching..')
53 console.log('Wiki', 'Fetching..')
46 for (const site of sites) {
54 for (const site of sites) {