aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.js12
-rw-r--r--src/main.js4
2 files changed, 11 insertions, 5 deletions
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index 47952d21..d62a1515 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -69,8 +69,10 @@ function getWhoToFollow (panel) {
panel.name2 = 'Loading...'
panel.name3 = 'Loading...'
var host = window.location.hostname
- var url = 'https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-simple-api.cgi?' +
- encodeURIComponent(host) + '+' + encodeURIComponent(user)
+ var whoToFollowProvider = this.$store.state.config.whoToFollowProvider
+ var url
+ url = whoToFollowProvider.replace(/{{host}}/g, encodeURIComponent(host))
+ url = url.replace(/{{user}}/g, encodeURIComponent(user))
window.fetch(url, {mode: 'cors'}).then(function (response) {
if (response.ok) {
return response.json()
@@ -104,8 +106,10 @@ const WhoToFollowPanel = {
moreUrl: function () {
var host = window.location.hostname
var user = this.user
- var url = 'https://vinayaka.distsn.org/?' +
- encodeURIComponent(host) + '+' + encodeURIComponent(user)
+ var whoToFollowLink = this.$store.state.config.whoToFollowLink
+ var url
+ url = whoToFollowLink.replace(/{{host}}/g, encodeURIComponent(host))
+ url = url.replace(/{{user}}/g, encodeURIComponent(user))
return url
},
showWhoToFollowPanel () {
diff --git a/src/main.js b/src/main.js
index a40c51f2..3c4a072b 100644
--- a/src/main.js
+++ b/src/main.js
@@ -88,11 +88,13 @@ window.fetch('/api/statusnet/config.json')
window.fetch('/static/config.json')
.then((res) => res.json())
.then((data) => {
- const {theme, background, logo, showWhoToFollowPanel, showInstanceSpecificPanel} = data
+ const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel} = data
store.dispatch('setOption', { name: 'theme', value: theme })
store.dispatch('setOption', { name: 'background', value: background })
store.dispatch('setOption', { name: 'logo', value: logo })
store.dispatch('setOption', { name: 'showWhoToFollowPanel', value: showWhoToFollowPanel })
+ store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider })
+ store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink })
store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
if (data['chatDisabled']) {
store.dispatch('disableChat')