summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/index.js8
-rw-r--r--client/tables.js2
2 files changed, 7 insertions, 3 deletions
diff --git a/client/index.js b/client/index.js
index 90fc22e1..2beb5526 100644
--- a/client/index.js
+++ b/client/index.js
@@ -69,7 +69,8 @@ function runApplets() {
dataset = null
url = opt
} else if (opt.indexOf('assets') === 0) {
- url = 'https://nyc3.digitaloceanspaces.com/megapixels/v1' + window.location.pathname + opt
+ let pathname = window.location.pathname.replace('index.html', '')
+ url = 'https://nyc3.digitaloceanspaces.com/megapixels/v1' + pathname + opt
dataset = null
// console.log(url)
} else {
@@ -80,7 +81,10 @@ function runApplets() {
if (!dataset && !url) {
const path = window.location.pathname.split('/').filter(s => !!s)
if (path.length) {
- dataset = path[path.length - 1]
+ dataset = path.pop()
+ if (dataset === 'index.html') {
+ dataset = path.pop()
+ }
// console.log('dataset from path:', dataset)
} else {
console.log('couldnt determine citations dataset')
diff --git a/client/tables.js b/client/tables.js
index b2b3d39c..2a2699f9 100644
--- a/client/tables.js
+++ b/client/tables.js
@@ -68,7 +68,7 @@ export default function append(el, payload) {
table.setData(data)
el.classList.add('loaded')
} catch (e) {
- console.error("error parsing json:", payload.url)
+ console.error("error making json:", payload.url)
console.error(e)
// console.log(text)
}