From b32573138b7607b8d9070100fb792f0241a4ba80 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sun, 11 Feb 2018 23:12:05 +0900 Subject: Add who-to-follow-panel --- src/App.js | 7 +- src/App.vue | 1 + .../who_to_follow_panel/who_to_follow_panel.js | 179 +++++++++++++++++++++ .../who_to_follow_panel/who_to_follow_panel.vue | 37 +++++ src/main.js | 3 +- 5 files changed, 224 insertions(+), 3 deletions(-) create mode 100644 src/components/who_to_follow_panel/who_to_follow_panel.js create mode 100644 src/components/who_to_follow_panel/who_to_follow_panel.vue (limited to 'src') diff --git a/src/App.js b/src/App.js index e9248967..a052e058 100644 --- a/src/App.js +++ b/src/App.js @@ -2,6 +2,7 @@ import UserPanel from './components/user_panel/user_panel.vue' import NavPanel from './components/nav_panel/nav_panel.vue' import Notifications from './components/notifications/notifications.vue' import UserFinder from './components/user_finder/user_finder.vue' +import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue' import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue' import ChatPanel from './components/chat_panel/chat_panel.vue' @@ -12,8 +13,9 @@ export default { NavPanel, Notifications, UserFinder, - ChatPanel, - InstanceSpecificPanel + WhoToFollowPanel, + InstanceSpecificPanel, + ChatPanel }, data: () => ({ mobileActivePanel: 'timeline' @@ -27,6 +29,7 @@ export default { style () { return { 'background-image': `url(${this.background})` } }, sitename () { return this.$store.state.config.name }, chat () { return this.$store.state.chat.channel.state === 'joined' }, + showWhoToFollowPanel () { return this.$store.state.config.showWhoToFollowPanel }, showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel } }, methods: { diff --git a/src/App.vue b/src/App.vue index 2a910bc0..1d8dd6c8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -24,6 +24,7 @@ + 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 new file mode 100644 index 00000000..49653c81 --- /dev/null +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -0,0 +1,179 @@ +const WhoToFollowPanel = { + data: () => ({ + img1: '/images/avi.png', + link1: null, + name1: '', + img2: '/images/avi.png', + link2: null, + name2: '', + img3: '/images/avi.png', + link3: null, + name3: '' + }), + computed: { + user: function () { + return this.$store.state.users.currentUser.screen_name + }, + moreUrl: function () { + var host = window.location.hostname + var user = this.user + var url = 'https://vinayaka.distsn.org/?' + + encodeURIComponent(host) + '+' + encodeURIComponent(user) + return url + }, + showWhoToFollowPanel () { + return this.$store.state.config.showWhoToFollowPanel + } + }, + watch: { + user: function (user, oldUser) { + function showUsers (panel, users, aHost, aUser) { + var cn + var index = 0 + var random = Math.floor(Math.random() * 10) + for (cn = random; cn < users.length; cn = cn + 10) { + var user + user = users[cn] + var host + host = user.host + var username + if (user.username) { + username = user.username + } else { + username = user.user + } + var img + if (user.avatar) { + img = user.avatar + } else { + img = '/images/avi.png' + } + var link = 'https://' + host + '/users/' + username + var name = username + '@' + host + if ((!user.following) && + (!user.blacklisted) && + (!(host === aHost && username === aUser))) { + if (index === 0) { + panel.img1 = img + panel.link1 = link + panel.name1 = name + } else if (index === 1) { + panel.img2 = img + panel.link2 = link + panel.name2 = name + } else if (index === 2) { + panel.img3 = img + panel.link3 = link + panel.name3 = name + } + index = index + 1 + if (index > 2) { + break + } + } + } + } + function getUsers (panel) { + var user = panel.$store.state.users.currentUser.screen_name + if (user) { + panel.name1 = 'Loading...' + 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) + window.fetch(url, {mode: 'cors'}).then(function (response) { + if (response.ok) { + return response.json() + } else { + panel.name1 = '' + panel.name2 = '' + panel.name3 = '' + } + }).then(function (users) { + showUsers(panel, users, host, user) + }) + } + } + if (this.showWhoToFollowPanel) { + getUsers(this) + } + } + }, + mounted: + function () { + function showUsers (panel, users, aHost, aUser) { + var cn + var index = 0 + var random = Math.floor(Math.random() * 10) + for (cn = random; cn < users.length; cn = cn + 10) { + var user + user = users[cn] + var host + host = user.host + var username + if (user.username) { + username = user.username + } else { + username = user.user + } + var img + if (user.avatar) { + img = user.avatar + } else { + img = '/images/avi.png' + } + var link = 'https://' + host + '/users/' + username + var name = username + '@' + host + if ((!user.following) && + (!user.blacklisted) && + (!(host === aHost && username === aUser))) { + if (index === 0) { + panel.img1 = img + panel.link1 = link + panel.name1 = name + } else if (index === 1) { + panel.img2 = img + panel.link2 = link + panel.name2 = name + } else if (index === 2) { + panel.img3 = img + panel.link3 = link + panel.name3 = name + } + index = index + 1 + if (index > 2) { + break + } + } + } + } + function getUsers (panel) { + var user = panel.user + if (user) { + panel.name1 = 'Loading...' + 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) + window.fetch(url, {mode: 'cors'}).then(function (response) { + if (response.ok) { + return response.json() + } else { + panel.name1 = '' + panel.name2 = '' + panel.name3 = '' + } + }).then(function (users) { + showUsers(panel, users, host, user) + }) + } + } + if (this.showWhoToFollowPanel) { + getUsers(this) + } + } +} + +export default WhoToFollowPanel diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue new file mode 100644 index 00000000..fff966ab --- /dev/null +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/main.js b/src/main.js index 6f8c00f0..5c74da3a 100644 --- a/src/main.js +++ b/src/main.js @@ -88,10 +88,11 @@ window.fetch('/api/statusnet/config.json') window.fetch('/static/config.json') .then((res) => res.json()) .then((data) => { - const {theme, background, logo, showInstanceSpecificPanel} = data + const {theme, background, logo, showWhoToFollowPanel, 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: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) if (data['chatDisabled']) { store.dispatch('disableChat') -- cgit v1.2.3-70-g09d2 From 96426425b8a20a1ff270e2b1f289528aa8e4dc8f Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Wed, 28 Mar 2018 15:57:11 +0900 Subject: refactoring --- .../who_to_follow_panel/who_to_follow_panel.js | 210 +++++++-------------- 1 file changed, 72 insertions(+), 138 deletions(-) (limited to 'src') 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 49653c81..e3f06ab6 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 @@ -1,3 +1,73 @@ +function showWhoToFollow (panel, users, aHost, aUser) { + var cn + var index = 0 + var random = Math.floor(Math.random() * 10) + for (cn = random; cn < users.length; cn = cn + 10) { + var user + user = users[cn] + var host + host = user.host + var username + if (user.username) { + username = user.username + } else { + username = user.user + } + var img + if (user.avatar) { + img = user.avatar + } else { + img = '/images/avi.png' + } + var link = 'https://' + host + '/users/' + username + var name = username + '@' + host + if ((!user.following) && + (!user.blacklisted) && + (!(host === aHost && username === aUser))) { + if (index === 0) { + panel.img1 = img + panel.link1 = link + panel.name1 = name + } else if (index === 1) { + panel.img2 = img + panel.link2 = link + panel.name2 = name + } else if (index === 2) { + panel.img3 = img + panel.link3 = link + panel.name3 = name + } + index = index + 1 + if (index > 2) { + break + } + } + } +} + +function getWhoToFollow (panel) { + var user = panel.$store.state.users.currentUser.screen_name + if (user) { + panel.name1 = 'Loading...' + 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) + window.fetch(url, {mode: 'cors'}).then(function (response) { + if (response.ok) { + return response.json() + } else { + panel.name1 = '' + panel.name2 = '' + panel.name3 = '' + } + }).then(function (users) { + showWhoToFollow(panel, users, host, user) + }) + } +} + const WhoToFollowPanel = { data: () => ({ img1: '/images/avi.png', @@ -27,151 +97,15 @@ const WhoToFollowPanel = { }, watch: { user: function (user, oldUser) { - function showUsers (panel, users, aHost, aUser) { - var cn - var index = 0 - var random = Math.floor(Math.random() * 10) - for (cn = random; cn < users.length; cn = cn + 10) { - var user - user = users[cn] - var host - host = user.host - var username - if (user.username) { - username = user.username - } else { - username = user.user - } - var img - if (user.avatar) { - img = user.avatar - } else { - img = '/images/avi.png' - } - var link = 'https://' + host + '/users/' + username - var name = username + '@' + host - if ((!user.following) && - (!user.blacklisted) && - (!(host === aHost && username === aUser))) { - if (index === 0) { - panel.img1 = img - panel.link1 = link - panel.name1 = name - } else if (index === 1) { - panel.img2 = img - panel.link2 = link - panel.name2 = name - } else if (index === 2) { - panel.img3 = img - panel.link3 = link - panel.name3 = name - } - index = index + 1 - if (index > 2) { - break - } - } - } - } - function getUsers (panel) { - var user = panel.$store.state.users.currentUser.screen_name - if (user) { - panel.name1 = 'Loading...' - 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) - window.fetch(url, {mode: 'cors'}).then(function (response) { - if (response.ok) { - return response.json() - } else { - panel.name1 = '' - panel.name2 = '' - panel.name3 = '' - } - }).then(function (users) { - showUsers(panel, users, host, user) - }) - } - } if (this.showWhoToFollowPanel) { - getUsers(this) + getWhoToFollow(this) } } }, mounted: function () { - function showUsers (panel, users, aHost, aUser) { - var cn - var index = 0 - var random = Math.floor(Math.random() * 10) - for (cn = random; cn < users.length; cn = cn + 10) { - var user - user = users[cn] - var host - host = user.host - var username - if (user.username) { - username = user.username - } else { - username = user.user - } - var img - if (user.avatar) { - img = user.avatar - } else { - img = '/images/avi.png' - } - var link = 'https://' + host + '/users/' + username - var name = username + '@' + host - if ((!user.following) && - (!user.blacklisted) && - (!(host === aHost && username === aUser))) { - if (index === 0) { - panel.img1 = img - panel.link1 = link - panel.name1 = name - } else if (index === 1) { - panel.img2 = img - panel.link2 = link - panel.name2 = name - } else if (index === 2) { - panel.img3 = img - panel.link3 = link - panel.name3 = name - } - index = index + 1 - if (index > 2) { - break - } - } - } - } - function getUsers (panel) { - var user = panel.user - if (user) { - panel.name1 = 'Loading...' - 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) - window.fetch(url, {mode: 'cors'}).then(function (response) { - if (response.ok) { - return response.json() - } else { - panel.name1 = '' - panel.name2 = '' - panel.name3 = '' - } - }).then(function (users) { - showUsers(panel, users, host, user) - }) - } - } if (this.showWhoToFollowPanel) { - getUsers(this) + getWhoToFollow(this) } } } -- cgit v1.2.3-70-g09d2 From caad81800963730f9d3ef1325bf5f55dd29fde9a Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Wed, 28 Mar 2018 16:56:47 +0900 Subject: using internal link to users --- .../who_to_follow_panel/who_to_follow_panel.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') 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 e3f06ab6..2d376ef9 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 @@ -28,14 +28,35 @@ function showWhoToFollow (panel, users, aHost, aUser) { panel.img1 = img panel.link1 = link panel.name1 = name + this.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + this.$store.commit('addNewUsers', [externalUser]) + panel.link1 = 'https://' + host + '/users/' + externalUser.id + } + }) } else if (index === 1) { panel.img2 = img panel.link2 = link panel.name2 = name + this.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + this.$store.commit('addNewUsers', [externalUser]) + panel.link2 = 'https://' + host + '/users/' + externalUser.id + } + }) } else if (index === 2) { panel.img3 = img panel.link3 = link panel.name3 = name + this.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + this.$store.commit('addNewUsers', [externalUser]) + panel.link3 = 'https://' + host + '/users/' + externalUser.id + } + }) } index = index + 1 if (index > 2) { -- cgit v1.2.3-70-g09d2 From 5a97cfb9599fb33b15f878869b940444234e3534 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Wed, 28 Mar 2018 17:45:35 +0900 Subject: who-to-follow-panel using internal user link --- .../who_to_follow_panel/who_to_follow_panel.js | 34 ++++++++++------------ .../who_to_follow_panel/who_to_follow_panel.vue | 6 ++-- 2 files changed, 18 insertions(+), 22 deletions(-) (limited to 'src') 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 2d376ef9..43cd3e2d 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 @@ -19,44 +19,40 @@ function showWhoToFollow (panel, users, aHost, aUser) { } else { img = '/images/avi.png' } - var link = 'https://' + host + '/users/' + username var name = username + '@' + host if ((!user.following) && (!user.blacklisted) && (!(host === aHost && username === aUser))) { if (index === 0) { panel.img1 = img - panel.link1 = link panel.name1 = name - this.$store.state.api.backendInteractor.externalProfile(name) + panel.$store.state.api.backendInteractor.externalProfile(name) .then((externalUser) => { if (!externalUser.error) { - this.$store.commit('addNewUsers', [externalUser]) - panel.link1 = 'https://' + host + '/users/' + externalUser.id - } - }) + panel.$store.commit('addNewUsers', [externalUser]) + panel.link1 = '/users/' + externalUser.id + } + }) } else if (index === 1) { panel.img2 = img - panel.link2 = link panel.name2 = name - this.$store.state.api.backendInteractor.externalProfile(name) + panel.$store.state.api.backendInteractor.externalProfile(name) .then((externalUser) => { if (!externalUser.error) { - this.$store.commit('addNewUsers', [externalUser]) - panel.link2 = 'https://' + host + '/users/' + externalUser.id - } - }) + panel.$store.commit('addNewUsers', [externalUser]) + panel.link2 = '/users/' + externalUser.id + } + }) } else if (index === 2) { panel.img3 = img - panel.link3 = link panel.name3 = name - this.$store.state.api.backendInteractor.externalProfile(name) + panel.$store.state.api.backendInteractor.externalProfile(name) .then((externalUser) => { if (!externalUser.error) { - this.$store.commit('addNewUsers', [externalUser]) - panel.link3 = 'https://' + host + '/users/' + externalUser.id - } - }) + panel.$store.commit('addNewUsers', [externalUser]) + panel.link3 = '/users/' + externalUser.id + } + }) } index = index + 1 if (index > 2) { diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index fff966ab..56adbf41 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -8,9 +8,9 @@ -- cgit v1.2.3-70-g09d2 From ef67bd693e9ee0cb42b4ebd0b10f68e63ba04750 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Wed, 28 Mar 2018 18:18:36 +0900 Subject: using router-link in who-to-follow-panel --- src/components/who_to_follow_panel/who_to_follow_panel.js | 14 +++++++------- src/components/who_to_follow_panel/who_to_follow_panel.vue | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') 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 43cd3e2d..47952d21 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 @@ -30,7 +30,7 @@ function showWhoToFollow (panel, users, aHost, aUser) { .then((externalUser) => { if (!externalUser.error) { panel.$store.commit('addNewUsers', [externalUser]) - panel.link1 = '/users/' + externalUser.id + panel.id1 = externalUser.id } }) } else if (index === 1) { @@ -40,7 +40,7 @@ function showWhoToFollow (panel, users, aHost, aUser) { .then((externalUser) => { if (!externalUser.error) { panel.$store.commit('addNewUsers', [externalUser]) - panel.link2 = '/users/' + externalUser.id + panel.id2 = externalUser.id } }) } else if (index === 2) { @@ -50,7 +50,7 @@ function showWhoToFollow (panel, users, aHost, aUser) { .then((externalUser) => { if (!externalUser.error) { panel.$store.commit('addNewUsers', [externalUser]) - panel.link3 = '/users/' + externalUser.id + panel.id3 = externalUser.id } }) } @@ -88,14 +88,14 @@ function getWhoToFollow (panel) { const WhoToFollowPanel = { data: () => ({ img1: '/images/avi.png', - link1: null, name1: '', + id1: 0, img2: '/images/avi.png', - link2: null, name2: '', + id2: 0, img3: '/images/avi.png', - link3: null, - name3: '' + name3: '', + id3: 0 }), computed: { user: function () { diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index 56adbf41..021b9557 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -8,9 +8,9 @@

- {{ name1 }}
- {{ name2 }}
- {{ name3 }}
+ {{ name1 }}
+ {{ name2 }}
+ {{ name3 }}
More

-- cgit v1.2.3-70-g09d2 From 2ade177d5a8f487014f8e790d2ed1c0f9e8ebb75 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 5 May 2018 00:20:19 +0900 Subject: configurable who to follow panel --- src/components/who_to_follow_panel/who_to_follow_panel.js | 12 ++++++++---- src/main.js | 4 +++- static/config.json | 6 ++++++ 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src') 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') diff --git a/static/config.json b/static/config.json index 2c495142..08664927 100644 --- a/static/config.json +++ b/static/config.json @@ -6,5 +6,11 @@ "redirectRootLogin": "/main/friends", "chatDisabled": false, "showWhoToFollowPanel": false, + "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-simple-api.cgi?{{host}}+{{user}}", + "whoToFollowProviderDummy1": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", + "whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}", + "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", + "whoToFollowLinkDummy1": "https://vinayaka.distsn.org/?{{host}}+{{user}}", + "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false } -- cgit v1.2.3-70-g09d2 From 0691af136732624e9eef143af13d85785a749d90 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Sat, 5 May 2018 00:43:18 +0900 Subject: debug --- src/components/who_to_follow_panel/who_to_follow_panel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 d62a1515..e6638fca 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,7 +69,7 @@ function getWhoToFollow (panel) { panel.name2 = 'Loading...' panel.name3 = 'Loading...' var host = window.location.hostname - var whoToFollowProvider = this.$store.state.config.whoToFollowProvider + var whoToFollowProvider = panel.$store.state.config.whoToFollowProvider var url url = whoToFollowProvider.replace(/{{host}}/g, encodeURIComponent(host)) url = url.replace(/{{user}}/g, encodeURIComponent(user)) -- cgit v1.2.3-70-g09d2 From 2471b71aabdafc0e680795645cb48f89636974a8 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 5 May 2018 00:53:40 +0900 Subject: osa-compatible who to follow provider --- .../who_to_follow_panel/who_to_follow_panel.js | 85 ++++++++++------------ static/config.json | 4 +- 2 files changed, 38 insertions(+), 51 deletions(-) (limited to 'src') 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 e6638fca..bbbb7f4c 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 @@ -1,59 +1,48 @@ -function showWhoToFollow (panel, users, aHost, aUser) { +function showWhoToFollow (panel, reply, aHost, aUser) { + var users = reply.ids var cn var index = 0 var random = Math.floor(Math.random() * 10) for (cn = random; cn < users.length; cn = cn + 10) { var user user = users[cn] - var host - host = user.host - var username - if (user.username) { - username = user.username - } else { - username = user.user - } var img - if (user.avatar) { - img = user.avatar + if (user.icon) { + img = user.icon } else { img = '/images/avi.png' } - var name = username + '@' + host - if ((!user.following) && - (!user.blacklisted) && - (!(host === aHost && username === aUser))) { - if (index === 0) { - panel.img1 = img - panel.name1 = name - panel.$store.state.api.backendInteractor.externalProfile(name) - .then((externalUser) => { - if (!externalUser.error) { - panel.$store.commit('addNewUsers', [externalUser]) - panel.id1 = externalUser.id - } - }) - } else if (index === 1) { - panel.img2 = img - panel.name2 = name - panel.$store.state.api.backendInteractor.externalProfile(name) - .then((externalUser) => { - if (!externalUser.error) { - panel.$store.commit('addNewUsers', [externalUser]) - panel.id2 = externalUser.id - } - }) - } else if (index === 2) { - panel.img3 = img - panel.name3 = name - panel.$store.state.api.backendInteractor.externalProfile(name) - .then((externalUser) => { - if (!externalUser.error) { - panel.$store.commit('addNewUsers', [externalUser]) - panel.id3 = externalUser.id - } - }) - } + var name = user.to_id + if (index === 0) { + panel.img1 = img + panel.name1 = name + panel.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + panel.$store.commit('addNewUsers', [externalUser]) + panel.id1 = externalUser.id + } + }) + } else if (index === 1) { + panel.img2 = img + panel.name2 = name + panel.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + panel.$store.commit('addNewUsers', [externalUser]) + panel.id2 = externalUser.id + } + }) + } else if (index === 2) { + panel.img3 = img + panel.name3 = name + panel.$store.state.api.backendInteractor.externalProfile(name) + .then((externalUser) => { + if (!externalUser.error) { + panel.$store.commit('addNewUsers', [externalUser]) + panel.id3 = externalUser.id + } + }) index = index + 1 if (index > 2) { break @@ -81,8 +70,8 @@ function getWhoToFollow (panel) { panel.name2 = '' panel.name3 = '' } - }).then(function (users) { - showWhoToFollow(panel, users, host, user) + }).then(function (reply) { + showWhoToFollow(panel, reply, host, user) }) } } diff --git a/static/config.json b/static/config.json index 08664927..9cdb22d5 100644 --- a/static/config.json +++ b/static/config.json @@ -6,11 +6,9 @@ "redirectRootLogin": "/main/friends", "chatDisabled": false, "showWhoToFollowPanel": false, - "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-simple-api.cgi?{{host}}+{{user}}", - "whoToFollowProviderDummy1": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", + "whoToFollowProvider": "https://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-osa-api.cgi?{{host}}+{{user}}", "whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}", "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", - "whoToFollowLinkDummy1": "https://vinayaka.distsn.org/?{{host}}+{{user}}", "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false } -- cgit v1.2.3-70-g09d2 From d9d6a497d9b539fe25f73944fa1b12649298be78 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Sat, 5 May 2018 01:02:39 +0900 Subject: debug --- src/components/who_to_follow_panel/who_to_follow_panel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 bbbb7f4c..51b9f469 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 @@ -43,10 +43,10 @@ function showWhoToFollow (panel, reply, aHost, aUser) { panel.id3 = externalUser.id } }) - index = index + 1 - if (index > 2) { - break - } + } + index = index + 1 + if (index > 2) { + break } } } -- cgit v1.2.3-70-g09d2 From 36b1c09831c809722c730a102af3d224597578be Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Sun, 6 May 2018 11:33:53 +0900 Subject: add space --- src/components/who_to_follow_panel/who_to_follow_panel.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue index 021b9557..5af6d0d5 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.vue +++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue @@ -8,9 +8,9 @@

- {{ name1 }}
- {{ name2 }}
- {{ name3 }}
+ {{ name1 }}
+ {{ name2 }}
+ {{ name3 }}
More

-- cgit v1.2.3-70-g09d2 From c46795c6922bdfc3f3669d71f0c5867cb2f1577a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Apr 2018 06:02:01 +0300 Subject: use semi-transparent faint color + fix --- src/_variables.scss | 2 +- src/components/notifications/notifications.scss | 2 +- src/services/style_setter/style_setter.js | 5 +---- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/_variables.scss b/src/_variables.scss index d90a1d48..3cd55868 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -4,7 +4,7 @@ $darkened-background: whitesmoke; $fallback--bg: #121a24; $fallback--btn: #182230; -$fallback--faint: #999; +$fallback--faint: rgba(185, 185, 186, .5); $fallback--fg: #b9b9ba; $fallback--link: #d8a070; $fallback--icon: #666; diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss index 9cbb1226..008530b4 100644 --- a/src/components/notifications/notifications.scss +++ b/src/components/notifications/notifications.scss @@ -98,7 +98,7 @@ .status { padding: 0.25em 0; color: $fallback--faint; - color: var($fallback--faint, --faint); + color: var(--faint, $fallback--faint); } padding: 0; .media-body { diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 9dc4a3e1..3e96f54d 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -72,10 +72,7 @@ const setColors = (col, commit) => { colors.lightBg = rgb2hex((col.bg.r + col.fg.r) / 2, (col.bg.g + col.fg.g) / 2, (col.bg.b + col.fg.b) / 2) // hilighted bg colors.btn = rgb2hex(col.fg.r, col.fg.g, col.fg.b) // panels & buttons colors.border = rgb2hex(col.fg.r - mod, col.fg.g - mod, col.fg.b - mod) // borders - colors.faint = rgb2hex( - col.text.r * 0.45 + col.fg.r * 0.55, - col.text.g * 0.45 + col.fg.g * 0.55, - col.text.b * 0.45 + col.fg.b * 0.55) // faint text + colors.faint = `rgba(${col.text.r}, ${col.text.g}, ${col.text.b}, .5)` colors.fg = rgb2hex(col.text.r, col.text.g, col.text.b) // text colors.lightFg = rgb2hex(col.text.r - mod, col.text.g - mod, col.text.b - mod) // strong text -- cgit v1.2.3-70-g09d2 From 2b64432f9af868edf347214964177bd424d56664 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Apr 2018 06:03:57 +0300 Subject: semi-transparent inputbox style --- src/App.scss | 8 ++++---- src/_variables.scss | 1 + src/services/style_setter/style_setter.js | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/App.scss b/src/App.scss index a8601220..fb7ef067 100644 --- a/src/App.scss +++ b/src/App.scss @@ -93,8 +93,8 @@ input, textarea, .select { border-bottom: 1px solid rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 2px black inset; - background-color: $fallback--lightBg; - background-color: var(--lightBg, $fallback--lightBg); + background-color: $fallback--input; + background-color: var(--input, $fallback--input); color: $fallback--lightFg; color: var(--lightFg, $fallback--lightFg); font-family: sans-serif; @@ -154,8 +154,8 @@ input, textarea, .select { border-top: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 2px black inset; margin-right: .5em; - background-color: $fallback--btn; - background-color: var(--btn, $fallback--btn); + background-color: $fallback--input; + background-color: var(--input $fallback--input); vertical-align: top; text-align: center; line-height: 1.1em; diff --git a/src/_variables.scss b/src/_variables.scss index 3cd55868..427cc36b 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -4,6 +4,7 @@ $darkened-background: whitesmoke; $fallback--bg: #121a24; $fallback--btn: #182230; +$fallback--input: #182230; $fallback--faint: rgba(185, 185, 186, .5); $fallback--fg: #b9b9ba; $fallback--link: #d8a070; diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 3e96f54d..4a6c4d8f 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -71,6 +71,7 @@ const setColors = (col, commit) => { colors.bg = rgb2hex(col.bg.r, col.bg.g, col.bg.b) // background colors.lightBg = rgb2hex((col.bg.r + col.fg.r) / 2, (col.bg.g + col.fg.g) / 2, (col.bg.b + col.fg.b) / 2) // hilighted bg colors.btn = rgb2hex(col.fg.r, col.fg.g, col.fg.b) // panels & buttons + colors.input = `rgba(${col.fg.r}, ${col.fg.g}, ${col.fg.b}, .5)` colors.border = rgb2hex(col.fg.r - mod, col.fg.g - mod, col.fg.b - mod) // borders colors.faint = `rgba(${col.text.r}, ${col.text.g}, ${col.text.b}, .5)` colors.fg = rgb2hex(col.text.r, col.text.g, col.text.b) // text -- cgit v1.2.3-70-g09d2 From e23986e239e66cea5bae6f26982463cb5d705774 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Apr 2018 06:04:17 +0300 Subject: unnecessary styles removed (fixes transparent color userstyle) --- src/components/nav_panel/nav_panel.vue | 2 -- src/components/status/status.vue | 2 -- 2 files changed, 4 deletions(-) (limited to 'src') diff --git a/src/components/nav_panel/nav_panel.vue b/src/components/nav_panel/nav_panel.vue index 6f949afb..2e1a6c7a 100644 --- a/src/components/nav_panel/nav_panel.vue +++ b/src/components/nav_panel/nav_panel.vue @@ -45,8 +45,6 @@ border-bottom: 1px solid; border-color: $fallback--border; border-color: var(--border, $fallback--border); - background-color: $fallback--bg; - background-color: var(--bg, $fallback--bg); padding: 0; &:first-child a { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f1163fd9..4b198905 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -165,8 +165,6 @@ border-left-width: 0px; line-height: 18px; min-width: 0; - background-color: $fallback--bg; - background-color: var(--bg, $fallback--bg); border-color: $fallback--border; border-color: var(--border, $fallback--border); -- cgit v1.2.3-70-g09d2 From 008b36dc24942058034d545402c3e404fc62d76b Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Apr 2018 06:04:48 +0300 Subject: gave text some shadow-outline to make it more readable on white backgrounds + fixed weird layout (WHY) --- .../user_card_content/user_card_content.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index ca8428ca..a88c0712 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -112,17 +112,14 @@ } .profile-panel-body { - top: -0em; - padding-top: 4em; word-wrap: break-word; - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80%); - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%) + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80px); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80px) } .user-info { color: white; padding: 0 16px 16px 16px; - margin-bottom: -4em; .container { padding: 16px 10px 4px 10px; @@ -154,7 +151,11 @@ } } - text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0); + text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0), + 1px 1px 0px rgba(0, 0, 0, .2), + -1px 1px 0px rgba(0, 0, 0, .2), + 1px -1px 0px rgba(0, 0, 0, .2), + -1px -1px 0px rgba(0, 0, 0, .2); .usersettings { color: #fff; @@ -240,6 +241,12 @@ line-height:16px; padding: 1em 1.5em 0em 1em; text-align: center; + + text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0), + 1px 1px 0px rgba(0, 0, 0, .2), + -1px 1px 0px rgba(0, 0, 0, .2), + 1px -1px 0px rgba(0, 0, 0, .2), + -1px -1px 0px rgba(0, 0, 0, .2); } .user-count { -- cgit v1.2.3-70-g09d2 From a6fa913f45e79734ff13fe85c7ed71cb7b2e5477 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 15 Apr 2018 07:25:59 +0300 Subject: Input fields separate radii --- src/App.scss | 4 ++-- src/_variables.scss | 1 + src/components/style_switcher/style_switcher.js | 3 +++ src/components/style_switcher/style_switcher.vue | 6 ++++++ src/i18n/messages.js | 2 ++ src/services/style_setter/style_setter.js | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/App.scss b/src/App.scss index fb7ef067..55b0de94 100644 --- a/src/App.scss +++ b/src/App.scss @@ -88,8 +88,8 @@ label.select { input, textarea, .select { border: none; - border-radius: $fallback--btnRadius; - border-radius: var(--btnRadius, $fallback--btnRadius); + border-radius: $fallback--inputRadius; + border-radius: var(--inputRadius, $fallback--inputRadius); border-bottom: 1px solid rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 2px black inset; diff --git a/src/_variables.scss b/src/_variables.scss index 427cc36b..b5222a6a 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -22,6 +22,7 @@ $fallback--cAlertRed: rgba(211,16,20,.5); $fallback--panelRadius: 10px; $fallback--checkBoxRadius: 2px; $fallback--btnRadius: 4px; +$fallback--inputRadius: 4px; $fallback--tooltipRadius: 5px; $fallback--avatarRadius: 4px; $fallback--avatarAltRadius: 10px; diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 08bc7113..6f4845c4 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -14,6 +14,7 @@ export default { greenColorLocal: '', orangeColorLocal: '', btnRadiusLocal: '', + inputRadiusLocal: '', panelRadiusLocal: '', avatarRadiusLocal: '', avatarAltRadiusLocal: '', @@ -42,6 +43,7 @@ export default { this.orangeColorLocal = rgbstr2hex(this.$store.state.config.colors.cOrange) this.btnRadiusLocal = this.$store.state.config.radii.btnRadius || 4 + this.inputRadiusLocal = this.$store.state.config.radii.inputRadius || 4 this.panelRadiusLocal = this.$store.state.config.radii.panelRadius || 10 this.avatarRadiusLocal = this.$store.state.config.radii.avatarRadius || 5 this.avatarAltRadiusLocal = this.$store.state.config.radii.avatarAltRadius || 50 @@ -85,6 +87,7 @@ export default { cGreen: greenRgb, cOrange: orangeRgb, btnRadius: this.btnRadiusLocal, + inputRadius: this.inputRadiusLocal, panelRadius: this.panelRadiusLocal, avatarRadius: this.avatarRadiusLocal, avatarAltRadius: this.avatarAltRadiusLocal, diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index 9c39b245..7acba1dc 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -58,6 +58,11 @@ +
+ + + +
@@ -86,6 +91,7 @@
{{user.name}}
- -
@{{user.screen_name}}
+ + @{{user.screen_name}} + {{dailyAvg}} {{ $t('user_card.per_day') }}
@@ -74,17 +75,17 @@
-
+
{{ $t('user_card.statuses') }}
{{ $t('user_card.statuses') }}
- {{user.statuses_count}}
{{dailyAvg}} {{ $t('user_card.per_day') }}
+ {{user.statuses_count}}
-
+
{{ $t('user_card.followees') }}
{{ $t('user_card.followees') }}
{{user.friends_count}}
-
+
{{ $t('user_card.followers') }}
{{ $t('user_card.followers') }}
{{user.followers_count}} @@ -113,16 +114,16 @@ .profile-panel-body { word-wrap: break-word; - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80px); - background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80px) + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), $fallback--bg 80%); + background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--bg, $fallback--bg) 80%) } .user-info { color: white; - padding: 0 16px 16px 16px; + padding: 0 16px; .container { - padding: 16px 10px 4px 10px; + padding: 16px 10px 6px 10px; display: flex; max-height: 56px; overflow: hidden; @@ -151,11 +152,7 @@ } } - text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0), - 1px 1px 0px rgba(0, 0, 0, .2), - -1px 1px 0px rgba(0, 0, 0, .2), - 1px -1px 0px rgba(0, 0, 0, .2), - -1px -1px 0px rgba(0, 0, 0, .2); + text-shadow: $usercard-text-shadow; .usersettings { color: #fff; @@ -179,7 +176,8 @@ .user-screen-name { color: white; - font-weight: lighter; + display: inline-block; + font-weight: light; font-size: 15px; padding-right: 0.1em; } @@ -192,14 +190,12 @@ div { flex: 1; } - margin-top: 0.7em; - margin-bottom: -1.0em; .following { color: white; font-size: 14px; flex: 0 0 100%; - margin: -0.7em 0.0em 0.3em 0.0em; + margin: 0 0 .4em 0; padding-left: 16px; text-align: left; } @@ -239,18 +235,22 @@ .user-counts { display: flex; line-height:16px; - padding: 1em 1.5em 0em 1em; + padding: .5em 1.5em 0em 1.5em; text-align: center; - - text-shadow: 0px 1px 1.5px rgba(0, 0, 0, 1.0), - 1px 1px 0px rgba(0, 0, 0, .2), - -1px 1px 0px rgba(0, 0, 0, .2), - 1px -1px 0px rgba(0, 0, 0, .2), - -1px -1px 0px rgba(0, 0, 0, .2); + justify-content: space-between; + text-shadow: $usercard-text-shadow; } .user-count { flex: 1; + padding: .5em 0 .5em 0; + margin: 0 .5em; + + &.selected { + background-color: rgba(0,0,0,.35); + border-radius: $fallback--btnRadius; + border-radius: var(--btnRadius, $fallback--btnRadius); + } h5 { font-size:1em; @@ -263,7 +263,8 @@ } .dailyAvg { - font-size: 0.8em; - opacity: 0.5; + margin-left: 1em; + font-size: 0.7em; + color: #CCC; } diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 838a43ab..f8502907 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,7 +1,7 @@ diff --git a/src/i18n/messages.js b/src/i18n/messages.js index a13d7f58..897f95d2 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -289,7 +289,11 @@ const en = { follow_import: 'Follow import', import_followers_from_a_csv_file: 'Import follows from a csv file', follows_imported: 'Follows imported! Processing them will take a while.', - follow_import_error: 'Error importing followers' + follow_import_error: 'Error importing followers', + delete_account: 'Delete Account', + delete_account_description: 'Permanantly delete your account and all your messages.', + delete_account_instructions: 'Type your password in the input below to confirm account deletion.', + delete_account_error: 'There was an issue deleting your account. If this persists please contact your instance administrator.' }, notifications: { notifications: 'Notifications', diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index f14bfd6d..fd401068 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -30,6 +30,7 @@ const BLOCKING_URL = '/api/blocks/create.json' const UNBLOCKING_URL = '/api/blocks/destroy.json' const USER_URL = '/api/users/show.json' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' +const DELETE_ACCOUNT_URL = '/api/pleroma/delete_account' import { each, map } from 'lodash' import 'whatwg-fetch' @@ -373,6 +374,19 @@ const followImport = ({params, credentials}) => { .then((response) => response.ok) } +const deleteAccount = ({credentials, password}) => { + const form = new FormData() + + form.append('password', password) + + return fetch(DELETE_ACCOUNT_URL, { + body: form, + method: 'POST', + headers: authHeaders(credentials) + }) + .then((response) => response.json()) +} + const fetchMutes = ({credentials}) => { const url = '/api/qvitter/mutes.json' @@ -408,7 +422,8 @@ const apiService = { updateProfile, updateBanner, externalProfile, - followImport + followImport, + deleteAccount } export default apiService diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index 52b8286b..c5807bed 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -61,6 +61,8 @@ const backendInteractorService = (credentials) => { const externalProfile = (profileUrl) => apiService.externalProfile({profileUrl, credentials}) const followImport = ({params}) => apiService.followImport({params, credentials}) + const deleteAccount = ({password}) => apiService.deleteAccount({credentials, password}) + const backendInteractorServiceInstance = { fetchStatus, fetchConversation, @@ -82,7 +84,8 @@ const backendInteractorService = (credentials) => { updateBanner, updateProfile, externalProfile, - followImport + followImport, + deleteAccount } return backendInteractorServiceInstance -- cgit v1.2.3-70-g09d2 From fae7a40aebc4266260c8cb0dcac929ac03500590 Mon Sep 17 00:00:00 2001 From: aka Date: Sun, 13 May 2018 20:47:08 -0300 Subject: Adds an option to export follows --- src/components/user_settings/user_settings.js | 29 ++++++++++++++++++++++++++ src/components/user_settings/user_settings.vue | 7 +++++++ src/i18n/messages.js | 5 ++++- 3 files changed, 40 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 25ee1f35..602052ca 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -8,6 +8,7 @@ const UserSettings = { followList: null, followImportError: false, followsImported: false, + enableFollowsExport: true, uploading: [ false, false, false, false ], previews: [ null, null, null ] } @@ -137,6 +138,34 @@ const UserSettings = { this.uploading[3] = false }) }, + /* This function takes an Array of Users + * and outputs a file with all the addresses for the user to download + */ + exportPeople(Users) { + // Get all the friends addresses + var UserAddresses = Users.map(function(user) { + // check is it's a local user + if(user && user.is_local) { + // append the instance address + user.screen_name += '@' + location.hostname; + } + return user.screen_name; + }).join('\n'); + // Make the user download the file + var fileToDownload = document.createElement('a'); + fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(UserAddresses)); + fileToDownload.setAttribute('download', 'friends.csv'); + fileToDownload.style.display = 'none'; + document.body.appendChild(fileToDownload); + fileToDownload.click(); + document.body.removeChild(fileToDownload); + }, + exportFollows() { + this.enableFollowsExport = false; + this.$store.state.api.backendInteractor + .fetchFriends({id: this.$store.state.users.currentUser.id}) + .then(this.exportPeople); + }, followListChange () { // eslint-disable-next-line no-undef let formData = new FormData() diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index ed1864cc..184d158d 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -66,6 +66,13 @@

{{$t('settings.follow_import_error')}}

+
+

{{$t('settings.follow_export')}}

+ +
+
+

{{$t('settings.follow_export_processing')}}

+
diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 168548cf..473fd9b1 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -288,7 +288,10 @@ const en = { follow_import: 'Follow import', import_followers_from_a_csv_file: 'Import follows from a csv file', follows_imported: 'Follows imported! Processing them will take a while.', - follow_import_error: 'Error importing followers' + follow_import_error: 'Error importing followers', + follow_export: 'Follow export', + follow_export_processing: 'Processing, you\'ll soon be aked to download your file', + follow_export_button: 'Export your follows to a csv file' }, notifications: { notifications: 'Notifications', -- cgit v1.2.3-70-g09d2 From 1ff089a175eb5c77f86896b89728aa9066a4699f Mon Sep 17 00:00:00 2001 From: Exilat Date: Tue, 15 May 2018 05:14:59 +0000 Subject: Update messages.js --- src/i18n/messages.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index a13d7f58..46da4404 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -1018,7 +1018,7 @@ const oc = { timeline: { show_new: 'Ne veire mai', error_fetching: 'Error en cercant de mesas a jorn', - up_to_date: 'Actualizat', + up_to_date: 'A jorn', load_older: 'Ne veire mai', conversation: 'Conversacion', collapse: 'Tampar', @@ -1050,6 +1050,7 @@ const oc = { cRed: 'Roge (Anullar)', cOrange: 'Irange (Metre en favorit)', cGreen: 'Verd (Repartajar)', + inputRadius: 'Camps tèxte', btnRadius: 'Botons', panelRadius: 'Panèls', avatarRadius: 'Avatars', @@ -1074,7 +1075,7 @@ const oc = { notifications: { notifications: 'Notficacions', read: 'Legit !', - followed_you: 'vos a seguit', + followed_you: 'vos sèc', favorited_you: 'a aimat vòstre estatut', repeated_you: 'a repetit your vòstre estatut' }, @@ -1105,7 +1106,7 @@ const oc = { apply: 'Aplicar' }, user_profile: { - timeline_title: 'Flux a l’utilizaire' + timeline_title: 'Flux utilizaire' } } -- cgit v1.2.3-70-g09d2 From 1487474c187cac17233f7e7942ddec2a5b8b700a Mon Sep 17 00:00:00 2001 From: Azurolu Date: Tue, 15 May 2018 11:17:32 +0000 Subject: Added inputRadius french translation and improved french translation as discussed with Chip. --- src/i18n/messages.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index a13d7f58..4ddf3309 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -851,32 +851,32 @@ const fr = { user_settings: 'Paramètres utilisateur', name_bio: 'Nom & Bio', name: 'Nom', - bio: 'Bioraphie', + bio: 'Biographie', avatar: 'Avatar', - current_avatar: 'Votre avatar', + current_avatar: 'Avatar actuel', set_new_avatar: 'Changer d\'avatar', - profile_banner: 'Bannière du profil', - current_profile_banner: 'Bannière du profil', + profile_banner: 'Bannière de profil', + current_profile_banner: 'Bannière de profil actuelle', set_new_profile_banner: 'Changer de bannière', profile_background: 'Image de fond', set_new_profile_background: 'Changer d\'image de fond', settings: 'Paramètres', theme: 'Thème', filtering: 'Filtre', - filtering_explanation: 'Tout les statuts contenant ces mots vont être cachés, un mot par ligne.', + filtering_explanation: 'Tout les statuts contenant ces mots seront masqués. Un mot par ligne.', attachments: 'Pièces jointes', - hide_attachments_in_tl: 'Cacher les pièces jointes dans le journal', - hide_attachments_in_convo: 'Cacher les pièces jointes dans les conversations', - nsfw_clickthrough: 'Activer le clic pour afficher les images marquées comme contenu adulte ou sensible', - autoload: 'Activer le chargement automatique une fois le bas de la page atteint', + hide_attachments_in_tl: 'Masquer les pièces jointes dans le journal', + hide_attachments_in_convo: 'Masquer les pièces jointes dans les conversations', + nsfw_clickthrough: 'Masquer les images marquées comme contenu adulte ou sensible', + autoload: 'Charger la suite automatiquement une fois le bas de la page atteint', reply_link_preview: 'Activer un aperçu d\'une réponse sur passage de la souris', presets: 'Thèmes prédéfinis', - theme_help: 'Utilisez les codes de couleur hexadécimaux (#aabbcc) pour customiser les couleurs de votre thème.', + theme_help: 'Spécifiez des codes couleur hexadécimaux (#aabbcc) pour personnaliser les couleurs du thème', background: 'Arrière plan', foreground: 'Premier plan', text: 'Texte', links: 'Liens', - streaming: 'Active le défilement automatique de nouveaux statuts lorsqu\'on est au haut de la page', + streaming: 'Charger automatiquement les nouveaux statuts lorsque vous êtes au haut de la page', follow_import: 'Importer ses abonnements', import_followers_from_a_csv_file: 'Importer ses abonnements depuis un fichier csv', follows_imported: 'Abonnements importés ! Le traitement peut prendre un moment.', @@ -887,12 +887,13 @@ const fr = { cGreen: 'Vert (Partager)', btnRadius: 'Boutons', panelRadius: 'Fenêtres', + inputRadius: 'Champs de texte', avatarRadius: 'Avatars', avatarAltRadius: 'Avatars (Notifications)', tooltipRadius: 'Info-bulles/alertes ', attachmentRadius: 'Pièces jointes', radii_help: 'Mettre en place l\'arondissement des coins de l\'interface (en pixels)', - stop_gifs: 'Passer la souris sur un GIF pour l\'animer' + stop_gifs: 'N\'animer les GIFS que lors du survol du curseur de la souris' }, notifications: { notifications: 'Notifications', @@ -910,10 +911,10 @@ const fr = { }, registration: { registration: 'Inscription', - fullname: 'Nom affiché', + fullname: 'Pseudonyme', email: 'Adresse email', bio: 'Biographie', - password_confirm: 'Confirmez le mot de passe' + password_confirm: 'Confirmation le mot de passe' }, post_status: { posting: 'Envoi en cours', @@ -921,7 +922,7 @@ const fr = { }, finder: { find_user: 'Chercher un utilisateur', - error_fetching_user: 'Une erreur est survenue lors de la recherche de l\'utilisateur' + error_fetching_user: 'Erreur lors de la recherche de l\'utilisateur' }, general: { submit: 'Envoyer', -- cgit v1.2.3-70-g09d2 From fc2bb104442f8e3bbbe661abdee670ebb2776199 Mon Sep 17 00:00:00 2001 From: Azurolu Date: Wed, 16 May 2018 01:42:54 +0000 Subject: Improved french translation thanks to Chip's suggestions, added inputRadius' french translation. --- src/i18n/messages.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 4ddf3309..846d123f 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -831,8 +831,8 @@ const fr = { blocked: 'Bloqué', block: 'Bloquer', statuses: 'Statuts', - mute: 'Mettre en muet', - muted: 'Mis en muet', + mute: 'Masquer', + muted: 'Masqué', followers: 'Vous suivent', followees: 'Suivis', per_day: 'par jour', @@ -840,7 +840,7 @@ const fr = { }, timeline: { show_new: 'Afficher plus', - error_fetching: 'Erreur en cherchant des mises à jours', + error_fetching: 'Erreur en cherchant les mises à jour', up_to_date: 'À jour', load_older: 'Afficher plus', conversation: 'Conversation', @@ -869,7 +869,7 @@ const fr = { hide_attachments_in_convo: 'Masquer les pièces jointes dans les conversations', nsfw_clickthrough: 'Masquer les images marquées comme contenu adulte ou sensible', autoload: 'Charger la suite automatiquement une fois le bas de la page atteint', - reply_link_preview: 'Activer un aperçu d\'une réponse sur passage de la souris', + reply_link_preview: 'Afficher un aperçu lors du survol de liens vers une réponse', presets: 'Thèmes prédéfinis', theme_help: 'Spécifiez des codes couleur hexadécimaux (#aabbcc) pour personnaliser les couleurs du thème', background: 'Arrière plan', @@ -887,24 +887,24 @@ const fr = { cGreen: 'Vert (Partager)', btnRadius: 'Boutons', panelRadius: 'Fenêtres', - inputRadius: 'Champs de texte', + inputRadius: 'Champs de texte', avatarRadius: 'Avatars', avatarAltRadius: 'Avatars (Notifications)', tooltipRadius: 'Info-bulles/alertes ', attachmentRadius: 'Pièces jointes', - radii_help: 'Mettre en place l\'arondissement des coins de l\'interface (en pixels)', + radii_help: 'Vous pouvez ici choisir le niveau d\'arrondi des angles de l\'interface (en pixels)', stop_gifs: 'N\'animer les GIFS que lors du survol du curseur de la souris' }, notifications: { notifications: 'Notifications', read: 'Lu !', - followed_you: 'vous a suivi', + followed_you: 'a commencé à vous suivre', favorited_you: 'a aimé votre statut', repeated_you: 'a partagé votre statut' }, login: { login: 'Connexion', - username: 'Nom d\'utilisateur', + username: 'Identifiant', password: 'Mot de passe', register: 'S\'inscrire', logout: 'Déconnexion' -- cgit v1.2.3-70-g09d2 From 954e6e076333e622134ad05cc51e07dcd1c940a7 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 16 May 2018 13:01:17 +0200 Subject: Make nsfw image easier to understand. --- src/assets/nsfw.png | Bin 18166 -> 17071 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/assets/nsfw.png b/src/assets/nsfw.png index bb6556b4..42749033 100644 Binary files a/src/assets/nsfw.png and b/src/assets/nsfw.png differ -- cgit v1.2.3-70-g09d2 From fed87815833bfb847be192b79782f3edca99cf5f Mon Sep 17 00:00:00 2001 From: aka Date: Wed, 16 May 2018 19:51:52 -0300 Subject: fix linting --- src/components/user_settings/user_settings.js | 43 ++++++++++++++------------- src/i18n/messages.js | 2 +- 2 files changed, 24 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 602052ca..2c08b2f8 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -141,30 +141,33 @@ const UserSettings = { /* This function takes an Array of Users * and outputs a file with all the addresses for the user to download */ - exportPeople(Users) { + exportPeople (users, filename) { // Get all the friends addresses - var UserAddresses = Users.map(function(user) { - // check is it's a local user - if(user && user.is_local) { - // append the instance address - user.screen_name += '@' + location.hostname; - } - return user.screen_name; - }).join('\n'); + var UserAddresses = users.map(function (user) { + // check is it's a local user + if (user && user.is_local) { + // append the instance address + // eslint-disable-next-line no-undef + user.screen_name += '@' + location.hostname + } + return user.screen_name + }).join('\n') // Make the user download the file - var fileToDownload = document.createElement('a'); - fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(UserAddresses)); - fileToDownload.setAttribute('download', 'friends.csv'); - fileToDownload.style.display = 'none'; - document.body.appendChild(fileToDownload); - fileToDownload.click(); - document.body.removeChild(fileToDownload); + var fileToDownload = document.createElement('a') + fileToDownload.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(UserAddresses)) + fileToDownload.setAttribute('download', filename) + fileToDownload.style.display = 'none' + document.body.appendChild(fileToDownload) + fileToDownload.click() + document.body.removeChild(fileToDownload) }, - exportFollows() { - this.enableFollowsExport = false; + exportFollows () { + this.enableFollowsExport = false this.$store.state.api.backendInteractor - .fetchFriends({id: this.$store.state.users.currentUser.id}) - .then(this.exportPeople); + .fetchFriends({id: this.$store.state.users.currentUser.id}) + .then(function (friendList) { + this.exportPeople(friendList, 'friends.csv') + }.bind(this)) }, followListChange () { // eslint-disable-next-line no-undef diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 473fd9b1..bb3f2d39 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -290,7 +290,7 @@ const en = { follows_imported: 'Follows imported! Processing them will take a while.', follow_import_error: 'Error importing followers', follow_export: 'Follow export', - follow_export_processing: 'Processing, you\'ll soon be aked to download your file', + follow_export_processing: 'Processing, you\'ll soon be asked to download your file', follow_export_button: 'Export your follows to a csv file' }, notifications: { -- cgit v1.2.3-70-g09d2 From 3c525d6a3b4a815bd600261298d08a4ac6deaa35 Mon Sep 17 00:00:00 2001 From: aka Date: Fri, 18 May 2018 07:34:36 -0300 Subject: use es6 notation for exportFollows --- src/components/user_settings/user_settings.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 2c08b2f8..708d1988 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -165,9 +165,9 @@ const UserSettings = { this.enableFollowsExport = false this.$store.state.api.backendInteractor .fetchFriends({id: this.$store.state.users.currentUser.id}) - .then(function (friendList) { + .then((friendList) => { this.exportPeople(friendList, 'friends.csv') - }.bind(this)) + }) }, followListChange () { // eslint-disable-next-line no-undef -- cgit v1.2.3-70-g09d2 From 8bd561c285aa48d750cf026d4492d4169f2fb040 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 18 May 2018 21:39:21 +0200 Subject: Correct typo in french translation --- src/i18n/messages.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/i18n/messages.js b/src/i18n/messages.js index f00bb6c5..43a224ce 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -917,7 +917,7 @@ const fr = { fullname: 'Pseudonyme', email: 'Adresse email', bio: 'Biographie', - password_confirm: 'Confirmation le mot de passe' + password_confirm: 'Confirmation du mot de passe' }, post_status: { posting: 'Envoi en cours', -- cgit v1.2.3-70-g09d2 From fcc1ab1d85ce5ba5944821f8a8c3cc593997f949 Mon Sep 17 00:00:00 2001 From: chip Date: Sat, 19 May 2018 20:35:14 +0200 Subject: Pass the "Collapse" label throught the translation function --- src/components/conversation/conversation.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 308e5e7d..bfcd3fe7 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -3,7 +3,7 @@
{{ $t('timeline.conversation') }} - Collapse + {{ $t('timeline.collapse') }}
-- cgit v1.2.3-70-g09d2 From f06fef26b169a07d95afbf1d40764f9196ee37de Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 20 May 2018 18:28:01 +0200 Subject: Display visibility if available. --- src/components/status/status.js | 12 ++++++++++++ src/components/status/status.vue | 1 + static/font/config.json | 24 ++++++++++++++++++++++++ static/font/css/fontello-codes.css | 4 ++++ static/font/css/fontello-embedded.css | 16 ++++++++++------ static/font/css/fontello-ie7-codes.css | 4 ++++ static/font/css/fontello-ie7.css | 4 ++++ static/font/css/fontello.css | 18 +++++++++++------- static/font/demo.html | 18 ++++++++++++------ static/font/font/fontello.eot | Bin 12348 -> 15124 bytes static/font/font/fontello.svg | 8 ++++++++ static/font/font/fontello.ttf | Bin 12180 -> 14956 bytes static/font/font/fontello.woff | Bin 7512 -> 9176 bytes static/font/font/fontello.woff2 | Bin 6408 -> 7812 bytes 14 files changed, 90 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/components/status/status.js b/src/components/status/status.js index 73f4a7aa..c93d81ff 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -104,6 +104,18 @@ const Status = { StillImage }, methods: { + visibilityIcon(visibility) { + switch(visibility) { + case "private": + return "icon-lock" + case "unlisted": + return "icon-lock-open-alt" + case "direct": + return "icon-mail-alt" + default: + return "icon-globe" + } + }, linkClicked ({target}) { if (target.tagName === 'SPAN') { target = target.parentNode diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 7902cde0..ace141cd 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -55,6 +55,7 @@ +