From 1946661911c97651ba5356db22a0ddd00ba04864 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 9 Nov 2019 00:27:09 -0600 Subject: [PATCH 001/259] update terms of service instructions --- static/terms-of-service.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/terms-of-service.html b/static/terms-of-service.html index c02cb719..c880b72c 100644 --- a/static/terms-of-service.html +++ b/static/terms-of-service.html @@ -1,7 +1,8 @@

Terms of Service

-

This is a placeholder ToS.

+

This is the default placeholder ToS. You should change it to fit the needs of your instance.

-

Edit "/static/terms-of-service.html" to make it fit the needs of your instance.

+

To do so, place a file at "/instance/static/terms-of-service.html" in your + Pleroma install containing the real ToS for your instance.


- + From ca4d5950d08aec6fe016b56f7125f7328c1e19a1 Mon Sep 17 00:00:00 2001 From: kPherox Date: Sat, 16 Nov 2019 03:12:16 +0900 Subject: [PATCH 002/259] Display user profile fields --- src/components/user_profile/user_profile.js | 8 ++++ src/components/user_profile/user_profile.vue | 50 ++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 00055707..c5ab5f26 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -123,6 +123,14 @@ const UserProfile = { onTabSwitch (tab) { this.tab = tab this.$router.replace({ query: { tab } }) + }, + linkClicked ({ target }) { + if (target.tagName === 'SPAN') { + target = target.parentNode + } + if (target.tagName === 'A') { + window.open(target.href, '_blank') + } } }, watch: { diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 14082e83..f979eff4 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -11,6 +11,44 @@ :allow-zooming-avatar="true" rounded="top" /> + +
+
+
+ {{ field.name }} +
+
+ {{ field.value }} +
+
+
Date: Mon, 18 Nov 2019 00:27:14 +0900 Subject: [PATCH 003/259] Fix emoji size --- src/components/user_profile/user_profile.vue | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index f979eff4..d5aa514e 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -152,6 +152,18 @@ flex-basis: 500px; .user-profile-fields { + img { + object-fit: contain; + vertical-align: middle; + max-width: 100%; + max-height: 400px; + + &.emoji { + width: 32px; + height: 32px; + } + } + dl { margin: 1em 1.5em; From 004827a7f17a0bc349baf1257aa5debe3c6f6060 Mon Sep 17 00:00:00 2001 From: kPherox Date: Mon, 18 Nov 2019 02:16:37 +0900 Subject: [PATCH 004/259] Change profile fields design to horizontal --- src/components/user_profile/user_profile.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index d5aa514e..fdff0385 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -159,15 +159,31 @@ max-height: 400px; &.emoji { - width: 32px; - height: 32px; + width: 18px; + height: 18px; } } dl { + display: flex; margin: 1em 1.5em; + dt { + flex: 0 0 auto; + font-weight: 500; + color: var(--lightText); + width: 30%; + min-width: 120px; + } + + dd { + flex: 1 1 auto; + color: var(--text); + margin-left: 10px; + } + dt, dd { + line-height: 18px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; From 87940ead8a9bedd312f10635462933a02e0ffb1c Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 20 Nov 2019 18:59:37 +0900 Subject: [PATCH 005/259] Change css selectors to classname from elementname --- src/components/user_profile/user_profile.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index fdff0385..c1337411 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -18,6 +18,7 @@ -
-
-
- {{ field.name }} -
-
- {{ field.value }} -
-
-
Date: Wed, 20 Nov 2019 19:25:11 +0900 Subject: [PATCH 008/259] Change field name to right justify --- src/components/user_profile/user_profile.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 0268e5da..5bffba3a 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -158,6 +158,7 @@ .user-profile-field-name { flex: 0 0 auto; font-weight: 500; + text-align: right; color: var(--lightText); width: 30%; min-width: 120px; From 44dea9f3646a5c27083dfe6cd6b1522e11c7dc69 Mon Sep 17 00:00:00 2001 From: xenofem Date: Sun, 9 Feb 2020 17:25:24 -0500 Subject: [PATCH 009/259] Allow emoji suggestions based on a match anywhere in the emoji name, but improve sorting --- src/components/emoji_input/suggestor.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index aec5c39d..9e437ccc 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -29,17 +29,21 @@ export default data => input => { export const suggestEmoji = emojis => input => { const noPrefix = input.toLowerCase().substr(1) return emojis - .filter(({ displayText }) => displayText.toLowerCase().startsWith(noPrefix)) + .filter(({ displayText }) => displayText.toLowerCase().match(noPrefix)) .sort((a, b) => { let aScore = 0 let bScore = 0 - // Make custom emojis a priority - aScore += a.imageUrl ? 10 : 0 - bScore += b.imageUrl ? 10 : 0 + // Prioritize emoji that start with the input string + aScore += a.displayText.toLowerCase().startsWith(noPrefix) ? 10 : 0 + bScore += b.displayText.toLowerCase().startsWith(noPrefix) ? 10 : 0 - // Sort alphabetically - const alphabetically = a.displayText > b.displayText ? 1 : -1 + // Sort by length + aScore -= a.displayText.length + bScore -= b.displayText.length + + // Break ties alphabetically + const alphabetically = a.displayText > b.displayText ? 0.5 : -0.5 return bScore - aScore + alphabetically }) From 02864bc07b2ab2f08232ba1c4c27079454dc87ef Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 10 Feb 2020 09:32:07 -0500 Subject: [PATCH 010/259] Prioritize custom emoji a lot and boost exact matches to the top --- src/components/emoji_input/suggestor.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/emoji_input/suggestor.js b/src/components/emoji_input/suggestor.js index 9e437ccc..15a71eff 100644 --- a/src/components/emoji_input/suggestor.js +++ b/src/components/emoji_input/suggestor.js @@ -34,7 +34,15 @@ export const suggestEmoji = emojis => input => { let aScore = 0 let bScore = 0 - // Prioritize emoji that start with the input string + // An exact match always wins + aScore += a.displayText.toLowerCase() === noPrefix ? 200 : 0 + bScore += b.displayText.toLowerCase() === noPrefix ? 200 : 0 + + // Prioritize custom emoji a lot + aScore += a.imageUrl ? 100 : 0 + bScore += b.imageUrl ? 100 : 0 + + // Prioritize prefix matches somewhat aScore += a.displayText.toLowerCase().startsWith(noPrefix) ? 10 : 0 bScore += b.displayText.toLowerCase().startsWith(noPrefix) ? 10 : 0 From da55b0d4352d2daf4a8d9f4130d34546e9f01555 Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 19 Feb 2020 20:57:58 +0900 Subject: [PATCH 011/259] Add fields_text for tooltip --- .../entity_normalizer/entity_normalizer.service.js | 6 ++++++ .../entity_normalizer/entity_normalizer.spec.js | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index ca79df6f..ca2075a4 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -53,6 +53,12 @@ export const parseUser = (data) => { value: addEmojis(field.value, data.emojis) } }) + output.fields_text = data.fields.map(field => { + return { + name: field.name.replace(/<[^>]*>/g, ''), + value: field.value.replace(/<[^>]*>/g, '') + } + }) // Utilize avatar_static for gif avatars? output.profile_image_url = data.avatar diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index cfb380ba..9df84575 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -290,6 +290,19 @@ describe('API Entities normalizer', () => { expect(field).to.have.property('value').that.contains(' { + const user = makeMockUserMasto({ emojis: makeMockEmojiMasto(), fields: [{ name: 'user', value: '@user' }] }) + + const parsedUser = parseUser(user) + + expect(parsedUser).to.have.property('fields_text').to.be.an('array') + + const field = parsedUser.fields_text[0] + + expect(field).to.have.property('name').that.equal('user') + expect(field).to.have.property('value').that.equal('@user') + }) + it('adds hide_follows and hide_followers user settings', () => { const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false, hide_followers_count: false, hide_follows_count: true } }) From 064b59812c715d60526727d42c124375a2bc89d5 Mon Sep 17 00:00:00 2001 From: kPherox Date: Wed, 19 Feb 2020 21:00:39 +0900 Subject: [PATCH 012/259] Change to use tags removed fields instead of raw fields --- src/components/user_profile/user_profile.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index 5bffba3a..54f2d4b3 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -22,13 +22,13 @@ >