From 5e669c828572ae6aba66c8d36573d277bad17c9a Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Tue, 24 Apr 2018 14:33:42 +0200 Subject: [PATCH] Use the Solid client for fetching. --- index.html | 2 +- scripts/YoSource.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 0e38431..dcc3277 100644 --- a/index.html +++ b/index.html @@ -47,7 +47,7 @@

Send a Yo

// Sets the data source based on the field value let source; function updateSource() { - source = new YoSource(elements.source.value); + source = new YoSource(elements.source.value, SolidAuthClient.fetch); displayRandomYo(); } updateSource(); diff --git a/scripts/YoSource.js b/scripts/YoSource.js index aad4bbc..4ba8822 100644 --- a/scripts/YoSource.js +++ b/scripts/YoSource.js @@ -15,7 +15,7 @@ const literals = { class YoSource { // Creates a new Yo source with the given fetcher constructor (source, fetch = (...args) => window.fetch(...args)) { - this._source = source; + this._source = new URL(source, window.location).toString(); this._fetch = fetch; }