From 3373d287012d66c642249bbe2da48febaa69b12e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 5 Aug 2018 09:18:04 +0300 Subject: [PATCH 01/14] Fixes selects having unreadable text on some browsers/OSes. Added bonus: theme switcher select now has styled options that show preview of what theme's bg/fg colors are --- src/App.scss | 7 +++++++ src/components/style_switcher/style_switcher.vue | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/App.scss b/src/App.scss index f830a33bc..2426b9982 100644 --- a/src/App.scss +++ b/src/App.scss @@ -168,6 +168,13 @@ input, textarea, .select { } } +option { + color: $fallback--fg; + color: var(--fg, $fallback--fg); + background-color: $fallback--bg; + background-color: var(--bg, $fallback--bg); +} + i[class*=icon-] { color: $fallback--icon; color: var(--icon, $fallback--icon) diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/style_switcher/style_switcher.vue index 7acba1dc4..112bbc1e1 100644 --- a/src/components/style_switcher/style_switcher.vue +++ b/src/components/style_switcher/style_switcher.vue @@ -3,7 +3,10 @@
{{$t('settings.presets')}} From 9cebb00faa9107f93d038bf3550a3ad1d61be9bf Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 5 Aug 2018 10:01:38 +0300 Subject: [PATCH 02/14] the missing piece for invites system --- src/components/registration/registration.js | 10 ++++++++-- src/components/registration/registration.vue | 4 ++++ src/i18n/messages.js | 6 ++++-- src/main.js | 1 + src/services/api/api.service.js | 1 + 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js index 771b3b275..738406082 100644 --- a/src/components/registration/registration.js +++ b/src/components/registration/registration.js @@ -5,17 +5,23 @@ const registration = { registering: false }), created () { - if (!this.$store.state.config.registrationOpen || !!this.$store.state.users.currentUser) { + if ((!this.$store.state.config.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) { this.$router.push('/main/all') } + // Seems like this doesn't work at first page open for some reason + if (this.$store.state.config.registrationOpen && this.token) { + this.$router.push('/registration') + } }, computed: { - termsofservice () { return this.$store.state.config.tos } + termsofservice () { return this.$store.state.config.tos }, + token () { return this.$route.params.token } }, methods: { submit () { this.registering = true this.user.nickname = this.user.username + this.user.token = this.token this.$store.state.api.backendInteractor.register(this.user).then( (response) => { if (response.ok) { diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue index 00f665af3..087cab6bf 100644 --- a/src/components/registration/registration.vue +++ b/src/components/registration/registration.vue @@ -38,6 +38,10 @@
--> +
+ + +
diff --git a/src/i18n/messages.js b/src/i18n/messages.js index e9d6e1768..003df68cd 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -354,7 +354,8 @@ const en = { fullname: 'Display name', email: 'Email', bio: 'Bio', - password_confirm: 'Password confirmation' + password_confirm: 'Password confirmation', + token: 'Invite token' }, post_status: { posting: 'Posting', @@ -1643,7 +1644,8 @@ const ru = { fullname: 'Отображаемое имя', email: 'Email', bio: 'Описание', - password_confirm: 'Подтверждение пароля' + password_confirm: 'Подтверждение пароля', + token: 'Код приглашения' }, post_status: { posting: 'Отправляется', diff --git a/src/main.js b/src/main.js index bacd7f6d6..883e1a317 100644 --- a/src/main.js +++ b/src/main.js @@ -119,6 +119,7 @@ window.fetch('/static/config.json') { name: 'mentions', path: '/:username/mentions', component: Mentions }, { name: 'settings', path: '/settings', component: Settings }, { name: 'registration', path: '/registration', component: Registration }, + { name: 'registration', path: '/registration/:token', component: Registration }, { name: 'friend-requests', path: '/friend-requests', component: FollowRequests }, { name: 'user-settings', path: '/user-settings', component: UserSettings } ] diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index adf598b74..13cc47960 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -159,6 +159,7 @@ const updateProfile = ({credentials, params}) => { // bio // homepage // location +// token const register = (params) => { const form = new FormData() From fd484a1a628c29bcd0bed6b68488ee28b5497fd0 Mon Sep 17 00:00:00 2001 From: Toromino Date: Sun, 5 Aug 2018 19:17:11 +0000 Subject: [PATCH 03/14] Textarea is now focused when replying --- src/components/post_status_form/post_status_form.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4f4c6aca4..b1a1acb78 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -31,6 +31,10 @@ const PostStatusForm = { }, mounted () { this.resize(this.$refs.textarea) + + if (this.replyTo) { + this.$refs.textarea.focus() + } }, data () { const preset = this.$route.query.message From 88a81406e3feaa4241a7f76278b2c4b126e2496b Mon Sep 17 00:00:00 2001 From: Toromino Date: Sun, 5 Aug 2018 19:41:34 +0000 Subject: [PATCH 04/14] Remove trailing whitespace --- src/components/post_status_form/post_status_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index b1a1acb78..dcb2c6e35 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -31,7 +31,7 @@ const PostStatusForm = { }, mounted () { this.resize(this.$refs.textarea) - + if (this.replyTo) { this.$refs.textarea.focus() } From d3d5a84868b1eaf9a0c8311a2df5b5c243434439 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 6 Aug 2018 07:58:34 +0300 Subject: [PATCH 05/14] Made it so that unfocused tab doesn't autostream posts when scrolled to the top --- src/components/timeline/timeline.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index f24626f91..5c1795677 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -13,7 +13,8 @@ const Timeline = { ], data () { return { - paused: false + paused: false, + unfocused: false } }, computed: { @@ -65,8 +66,15 @@ const Timeline = { this.fetchFollowers() } }, + mounted () { + if (typeof document.hidden !== 'undefined') { + document.addEventListener('visibilitychange', this.handleVisibilityChange, false) + this.unfocused = document.hidden + } + }, destroyed () { window.removeEventListener('scroll', this.scrollLoad) + if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false) this.$store.commit('setLoading', { timeline: this.timelineName, value: false }) }, methods: { @@ -113,6 +121,9 @@ const Timeline = { (window.innerHeight + window.pageYOffset) >= (height - 750)) { this.fetchOlderStatuses() } + }, + handleVisibilityChange () { + this.unfocused = document.hidden } }, watch: { @@ -122,7 +133,7 @@ const Timeline = { } if (count > 0) { // only 'stream' them when you're scrolled to the top - if (window.pageYOffset < 15 && !this.paused) { + if (window.pageYOffset < 15 && !this.paused && !this.unfocused) { this.showNewStatuses() } else { this.paused = true From 976444064f19fbfc1a4085b421196f36d690d820 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 6 Aug 2018 09:45:22 +0300 Subject: [PATCH 06/14] Fixes broken custom emoji in autocomplete when proxying to remote BE --- src/components/post_status_form/post_status_form.js | 2 +- src/main.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4f4c6aca4..aa9cd160b 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -91,7 +91,7 @@ const PostStatusForm = { screen_name: `:${shortcode}:`, name: '', utf: utf || '', - img: image_url, + img: utf ? '' : this.$store.state.config.server + image_url, highlighted: index === this.highlighted })) } else { diff --git a/src/main.js b/src/main.js index bacd7f6d6..fa955063e 100644 --- a/src/main.js +++ b/src/main.js @@ -79,11 +79,12 @@ const i18n = new VueI18n({ window.fetch('/api/statusnet/config.json') .then((res) => res.json()) .then((data) => { - const {name, closed: registrationClosed, textlimit} = data.site + const {name, closed: registrationClosed, textlimit, server} = data.site store.dispatch('setOption', { name: 'name', value: name }) store.dispatch('setOption', { name: 'registrationOpen', value: (registrationClosed === '0') }) store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) }) + store.dispatch('setOption', { name: 'server', value: server }) }) window.fetch('/static/config.json') From d5efa10946239dc1c9e0aa646dc1238a2737c456 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 6 Aug 2018 09:52:07 +0300 Subject: [PATCH 07/14] hopefully, fix linter --- src/components/post_status_form/post_status_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index aa9cd160b..34c02325a 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -87,10 +87,10 @@ const PostStatusForm = { return false } return map(take(matchedEmoji, 5), ({shortcode, image_url, utf}, index) => ({ - // eslint-disable-next-line camelcase screen_name: `:${shortcode}:`, name: '', utf: utf || '', + // eslint-disable-next-line camelcase img: utf ? '' : this.$store.state.config.server + image_url, highlighted: index === this.highlighted })) From da36cd11e8e7b5a1cefafb71e622ebbeb494d8ae Mon Sep 17 00:00:00 2001 From: dtluna Date: Mon, 6 Aug 2018 11:57:27 +0300 Subject: [PATCH 08/14] Hide all status actions if not logged in --- src/components/status/status.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f88c810d1..13fb9b7d7 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -82,8 +82,8 @@ -
-
+
+
From 5cfc247c6b7f5dcdf7ef7e552d85f31615129eab Mon Sep 17 00:00:00 2001 From: dtluna Date: Mon, 6 Aug 2018 09:08:50 +0000 Subject: [PATCH 09/14] Revert "Merge branch 'feature/hide-all-status-actions-if-not-logged-in' into 'develop'" This reverts merge request !301 --- src/components/status/status.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 13fb9b7d7..f88c810d1 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -82,8 +82,8 @@
-
-
+
+
From e60fde233b50ee1b2ed273f49f3fc5831508143c Mon Sep 17 00:00:00 2001 From: Toromino Date: Wed, 8 Aug 2018 14:39:22 +0000 Subject: [PATCH 10/14] Update status.vue --- src/components/status/status.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f88c810d1..11865d0f8 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -88,7 +88,7 @@
- +
From 876f7633fe34039c6f25831fa63ecc55d99081ff Mon Sep 17 00:00:00 2001 From: eal Date: Thu, 9 Aug 2018 12:52:34 +0300 Subject: [PATCH 11/14] Use serverside html rendering in usernames and bios if available. --- src/components/notification/notification.vue | 3 ++- src/components/status/status.js | 1 + src/components/status/status.vue | 6 ++++-- src/components/user_card/user_card.vue | 10 ++++++++-- src/components/user_card_content/user_card_content.vue | 6 ++++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index eed598a86..208e389c2 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -10,7 +10,8 @@
- {{ notification.action.user.name }} + + {{ notification.action.user.name }} {{$t('notifications.favorited_you')}} diff --git a/src/components/status/status.js b/src/components/status/status.js index 87ef90d88..eb7d24d65 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -40,6 +40,7 @@ const Status = { }, retweet () { return !!this.statusoid.retweeted_status }, retweeter () { return this.statusoid.user.name }, + retweeterHtml () { return this.statusoid.user.name_html }, status () { if (this.retweet) { return this.statusoid.retweeted_status diff --git a/src/components/status/status.vue b/src/components/status/status.vue index f88c810d1..e49958aa9 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -11,7 +11,8 @@
- {{retweeter}} + + {{retweeter}} {{$t('timeline.repeated')}}
@@ -30,7 +31,8 @@
-
+
+ + + {{ $t('user_card.follows_you') }} + +
+
{{ user.name }} - {{ $t('user_card.follows_you') }} + {{ $t('user_card.follows_you') }}
@{{ user.screen_name }}
diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 09e91271b..969237863 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -13,7 +13,8 @@
-
{{user.name}}
+
+
{{user.name}}
@{{user.screen_name}} {{dailyAvg}} {{ $t('user_card.per_day') }} @@ -88,7 +89,8 @@ {{user.followers_count}}
-

{{user.description}}

+

+

{{ user.description }}

From 316692ee854fbd9b15f9838cf915966956ec8ca8 Mon Sep 17 00:00:00 2001 From: Toromino Date: Thu, 9 Aug 2018 16:45:52 +0000 Subject: [PATCH 12/14] Update retweet_button.vue --- src/components/retweet_button/retweet_button.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index 1bee3d08f..f5b005994 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -1,9 +1,9 @@