From 6184c88ac70b33e66a87222142344f693406bd87 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 3 Mar 2019 15:15:41 +0200 Subject: [PATCH 01/22] Initial work on deprecating scopeModesEnabled in favor of minimalScopeMode --- src/boot/after_store.js | 2 +- .../features_panel/features_panel.js | 2 +- .../post_status_form/post_status_form.js | 27 +++++---- .../post_status_form/post_status_form.vue | 13 +++-- .../scope_selector/scope_selector.js | 55 +++++++++++++++++++ .../scope_selector/scope_selector.vue | 30 ++++++++++ src/components/settings/settings.js | 10 +++- src/components/settings/settings.vue | 6 ++ src/components/user_settings/user_settings.js | 6 +- .../user_settings/user_settings.vue | 10 ++-- src/i18n/en.json | 1 + src/i18n/ru.json | 10 ++++ src/modules/config.js | 3 +- src/modules/instance.js | 2 +- static/config.json | 3 +- 15 files changed, 149 insertions(+), 31 deletions(-) create mode 100644 src/components/scope_selector/scope_selector.js create mode 100644 src/components/scope_selector/scope_selector.vue diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 53ecc083..73b6f227 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -78,7 +78,7 @@ const afterStoreSetup = ({ store, i18n }) => { copyInstanceOption('redirectRootNoLogin') copyInstanceOption('redirectRootLogin') copyInstanceOption('showInstanceSpecificPanel') - copyInstanceOption('scopeOptionsEnabled') + copyInstanceOption('minimalScopesMode') copyInstanceOption('formattingOptionsEnabled') copyInstanceOption('collapseMessageWithSubject') copyInstanceOption('loginMethod') diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js index e0b7a118..0a7234cc 100644 --- a/src/components/features_panel/features_panel.js +++ b/src/components/features_panel/features_panel.js @@ -6,7 +6,7 @@ const FeaturesPanel = { gopher: function () { return this.$store.state.instance.gopherAvailable }, whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled }, mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable }, - scopeOptions: function () { return this.$store.state.instance.scopeOptionsEnabled }, + scopeOptionsMinimal: function () { return this.$store.state.instance.scopeOptionsMinimal }, textlimit: function () { return this.$store.state.instance.textlimit } } } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index c28c51bf..b0882f70 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -1,5 +1,6 @@ import statusPoster from '../../services/status_poster/status_poster.service.js' import MediaUpload from '../media_upload/media_upload.vue' +import ScopeSelector from '../scope_selector/scope_selector.vue' import fileTypeService from '../../services/file_type/file_type.service.js' import Completion from '../../services/completion/completion.js' import { take, filter, reject, map, uniqBy } from 'lodash' @@ -28,7 +29,8 @@ const PostStatusForm = { 'subject' ], components: { - MediaUpload + MediaUpload, + ScopeSelector }, mounted () { this.resize(this.$refs.textarea) @@ -78,14 +80,6 @@ const PostStatusForm = { } }, computed: { - vis () { - return { - public: { selected: this.newStatus.visibility === 'public' }, - unlisted: { selected: this.newStatus.visibility === 'unlisted' }, - private: { selected: this.newStatus.visibility === 'private' }, - direct: { selected: this.newStatus.visibility === 'direct' } - } - }, candidates () { const firstchar = this.textAtCaret.charAt(0) if (firstchar === '@') { @@ -133,6 +127,15 @@ const PostStatusForm = { users () { return this.$store.state.users.users }, + userDefaultScope () { + return this.$store.state.users.currentUser.default_scope + }, + showAllScopes () { + const minimalScopesMode = typeof this.$store.state.config.minimalScopesMode === 'undefined' + ? this.$store.state.instance.minimalScopesMode + : this.$store.state.config.minimalScopesMode + return !minimalScopesMode + }, emoji () { return this.$store.state.instance.emoji || [] }, @@ -157,8 +160,8 @@ const PostStatusForm = { isOverLengthLimit () { return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, - scopeOptionsEnabled () { - return this.$store.state.instance.scopeOptionsEnabled + scopeOptionsMinimal () { + return this.$store.state.instance.scopeOptionsMinimal }, alwaysShowSubject () { if (typeof this.$store.state.config.alwaysShowSubjectInput !== 'undefined') { @@ -166,7 +169,7 @@ const PostStatusForm = { } else if (typeof this.$store.state.instance.alwaysShowSubjectInput !== 'undefined') { return this.$store.state.instance.alwaysShowSubjectInput } else { - return this.$store.state.instance.scopeOptionsEnabled + return true } }, formattingOptionsEnabled () { diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 5085570b..b3d731cd 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -44,12 +44,13 @@ -
- - - - -
+
diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js new file mode 100644 index 00000000..578f1ba5 --- /dev/null +++ b/src/components/scope_selector/scope_selector.js @@ -0,0 +1,55 @@ +const ScopeSelector = { + props: [ + 'showAll', + 'userEnabled', + 'userDefault', + 'originalScope', + 'initialScope', + 'onScopeChange' + ], + data () { + return { + currentScope: this.initialScope + } + }, + computed: { + showNothing () { + return !this.showPublic && !this.showUnlisted && !this.showPrivate && !this.showDirect + }, + showPublic () { + return this.originalScope !== 'direct' && this.shouldShow('public') + }, + showUnlisted () { + return this.originalScope !== 'direct' && this.shouldShow('unlisted') + }, + showPrivate () { + return this.originalScope !== 'direct' && this.shouldShow('private') + }, + showDirect () { + return this.shouldShow('direct') + }, + css () { + return { + public: {selected: this.currentScope === 'public'}, + unlisted: {selected: this.currentScope === 'unlisted'}, + private: {selected: this.currentScope === 'private'}, + direct: {selected: this.currentScope === 'direct'} + } + } + }, + methods: { + shouldShow (scope) { + return this.showAll || + this.currentScope === scope || + this.originalScope === scope || + this.userDefault === scope || + this.userEnabled.includes(scope) + }, + changeVis (scope) { + this.currentScope = scope + this.onScopeChange && this.onScopeChange(scope) + } + } +} + +export default ScopeSelector diff --git a/src/components/scope_selector/scope_selector.vue b/src/components/scope_selector/scope_selector.vue new file mode 100644 index 00000000..33ea488f --- /dev/null +++ b/src/components/scope_selector/scope_selector.vue @@ -0,0 +1,30 @@ + + + diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 6e2dff7b..104be1a8 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -60,13 +60,18 @@ const settings = { alwaysShowSubjectInputLocal: typeof user.alwaysShowSubjectInput === 'undefined' ? instance.alwaysShowSubjectInput : user.alwaysShowSubjectInput, - alwaysShowSubjectInputDefault: instance.alwaysShowSubjectInput, + alwaysShowSubjectInputDefault: this.$t('settings.values.' + instance.alwaysShowSubjectInput), scopeCopyLocal: typeof user.scopeCopy === 'undefined' ? instance.scopeCopy : user.scopeCopy, scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), + minimalScopesModeLocal: typeof user.minimalScopesMode === 'undefined' + ? instance.minimalScopesMode + : user.minimalScopesMode, + minimalScopesModeDefault: this.$t('settings.values.' + instance.minimalScopesMode), + stopGifs: user.stopGifs, webPushNotificationsLocal: user.webPushNotifications, loopVideoSilentOnlyLocal: user.loopVideosSilentOnly, @@ -175,6 +180,9 @@ const settings = { postContentTypeLocal (value) { this.$store.dispatch('setOption', { name: 'postContentType', value }) }, + minimalScopesModeLocal (value) { + this.$store.dispatch('setOption', { name: 'minimalScopesMode', value }) + }, stopGifs (value) { this.$store.dispatch('setOption', { name: 'stopGifs', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 5041b3a3..d9b72ee0 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -122,6 +122,12 @@
+
  • + + +
  • diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index d6972737..1911ab23 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -4,6 +4,7 @@ import get from 'lodash/get' import TabSwitcher from '../tab_switcher/tab_switcher.js' import ImageCropper from '../image_cropper/image_cropper.vue' import StyleSwitcher from '../style_switcher/style_switcher.vue' +import ScopeSelector from '../scope_selector/scope_selector.vue' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' import BlockCard from '../block_card/block_card.vue' import MuteCard from '../mute_card/mute_card.vue' @@ -66,6 +67,7 @@ const UserSettings = { }, components: { StyleSwitcher, + ScopeSelector, TabSwitcher, ImageCropper, BlockList, @@ -78,8 +80,8 @@ const UserSettings = { pleromaBackend () { return this.$store.state.instance.pleromaBackend }, - scopeOptionsEnabled () { - return this.$store.state.instance.scopeOptionsEnabled + scopeOptionsMinimal () { + return this.$store.state.instance.scopeOptionsMinimal }, vis () { return { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index a1123638..7bd391ba 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -29,13 +29,13 @@

    -
    +
    - - - - +

    diff --git a/src/i18n/en.json b/src/i18n/en.json index c5a4a90d..fb8fcfcc 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -211,6 +211,7 @@ "saving_ok": "Settings saved", "security_tab": "Security", "scope_copy": "Copy scope when replying (DMs are always copied)", + "minimal_scopes_mode": "Minimize post scope selection options", "set_new_avatar": "Set new avatar", "set_new_profile_background": "Set new profile background", "set_new_profile_banner": "Set new profile banner", diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 6799cc96..89aa43f4 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -111,6 +111,8 @@ "import_theme": "Загрузить Тему", "inputRadius": "Поля ввода", "checkboxRadius": "Чекбоксы", + "instance_default": "(по умолчанию: {value})", + "instance_default_simple": "(по умолчанию)", "interface": "Интерфейс", "interfaceLanguage": "Язык интерфейса", "limited_availability": "Не доступно в вашем браузере", @@ -149,7 +151,11 @@ "reply_visibility_all": "Показывать все ответы", "reply_visibility_following": "Показывать только ответы мне и тех на кого я подписан", "reply_visibility_self": "Показывать только ответы мне", + "saving_err": "Не удалось сохранить настройки", + "saving_ok": "Сохранено", "security_tab": "Безопасность", + "scope_copy": "Копировать видимость поста при ответе (всегда включено для Личных Сообщений)", + "minimal_scopes_mode": "Минимизировать набор опций видимости поста", "set_new_avatar": "Загрузить новый аватар", "set_new_profile_background": "Загрузить новый фон профиля", "set_new_profile_banner": "Загрузить новый баннер профиля", @@ -164,6 +170,10 @@ "theme_help_v2_2": "Под некоторыми полями ввода это идикаторы контрастности, наведите на них мышью чтобы узнать больше. Приспользовании прозрачности контраст расчитывается для наихудшего варианта.", "tooltipRadius": "Всплывающие подсказки/уведомления", "user_settings": "Настройки пользователя", + "values": { + "false": "нет", + "true": "да" + }, "style": { "switcher": { "keep_color": "Оставить цвета", diff --git a/src/modules/config.js b/src/modules/config.js index 1c30c203..6d8aad35 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -32,7 +32,8 @@ const defaultState = { scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default - postContentType: undefined // instance default + postContentType: undefined, // instance default + minimalScopesMode: undefined // instance default } const config = { diff --git a/src/modules/instance.js b/src/modules/instance.js index c31d02b9..7b67890f 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -15,7 +15,6 @@ const defaultState = { redirectRootNoLogin: '/main/all', redirectRootLogin: '/main/friends', showInstanceSpecificPanel: false, - scopeOptionsEnabled: true, formattingOptionsEnabled: false, alwaysShowSubjectInput: true, collapseMessageWithSubject: false, @@ -31,6 +30,7 @@ const defaultState = { vapidPublicKey: undefined, noAttachmentLinks: false, showFeaturesPanel: true, + minimalScopesMode: false, // Nasty stuff pleromaBackend: true, diff --git a/static/config.json b/static/config.json index 533a5b08..b436daae 100644 --- a/static/config.json +++ b/static/config.json @@ -21,5 +21,6 @@ "webPushNotifications": false, "noAttachmentLinks": false, "nsfwCensorImage": "", - "showFeaturesPanel": true + "showFeaturesPanel": true, + "minimalScopesMode": false } From b97a03383990d54573bd5e68393a1ad11e33608b Mon Sep 17 00:00:00 2001 From: jared Date: Mon, 25 Mar 2019 22:38:15 -0400 Subject: [PATCH 02/22] #255 - add emoji input component --- src/components/emoji-input/emoji-input.js | 106 ++++++++++++++++++ src/components/emoji-input/emoji-input.vue | 99 ++++++++++++++++ .../post_status_form/post_status_form.js | 4 +- .../post_status_form/post_status_form.vue | 5 +- 4 files changed, 211 insertions(+), 3 deletions(-) create mode 100644 src/components/emoji-input/emoji-input.js create mode 100644 src/components/emoji-input/emoji-input.vue diff --git a/src/components/emoji-input/emoji-input.js b/src/components/emoji-input/emoji-input.js new file mode 100644 index 00000000..56414358 --- /dev/null +++ b/src/components/emoji-input/emoji-input.js @@ -0,0 +1,106 @@ +import Completion from '../../services/completion/completion.js' +import { take, filter, map } from 'lodash' + +const EmojiInput = { + props: [ + 'value', + 'placeholder', + 'type' + ], + data () { + return { + highlighted: 0, + caret: 0 + } + }, + computed: { + suggestions () { + const firstchar = this.textAtCaret.charAt(0) + if (firstchar === ':') { + if (this.textAtCaret === ':') { return } + const matchedEmoji = filter(this.emoji.concat(this.customEmoji), (emoji) => emoji.shortcode.startsWith(this.textAtCaret.slice(1))) + if (matchedEmoji.length <= 0) { + return false + } + return map(take(matchedEmoji, 5), ({shortcode, image_url, utf}, index) => ({ + shortcode: `:${shortcode}:`, + utf: utf || '', + // eslint-disable-next-line camelcase + img: utf ? '' : this.$store.state.instance.server + image_url, + highlighted: index === this.highlighted + })) + } else { + return false + } + }, + textAtCaret () { + return (this.wordAtCaret || {}).word || '' + }, + wordAtCaret () { + const word = Completion.wordAtPosition(this.value, this.caret - 1) || {} + return word + }, + emoji () { + return this.$store.state.instance.emoji || [] + }, + customEmoji () { + return this.$store.state.instance.customEmoji || [] + } + }, + methods: { + replace (replacement) { + const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement) + this.$emit('input', newValue) + this.caret = 0 + }, + replaceEmoji (e) { + const len = this.suggestions.length || 0 + if (this.textAtCaret === ':' || e.ctrlKey) { return } + if (len > 0) { + e.preventDefault() + const emoji = this.suggestions[this.highlighted] + const replacement = emoji.utf || (emoji.shortcode + ' ') + const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement) + this.$emit('input', newValue) + this.caret = 0 + this.highlighted = 0 + } + }, + cycleBackward (e) { + const len = this.suggestions.length || 0 + if (len > 0) { + e.preventDefault() + this.highlighted -= 1 + if (this.highlighted < 0) { + this.highlighted = this.suggestions.length - 1 + } + } else { + this.highlighted = 0 + } + }, + cycleForward (e) { + const len = this.suggestions.length || 0 + if (len > 0) { + if (e.shiftKey) { return } + e.preventDefault() + this.highlighted += 1 + if (this.highlighted >= len) { + this.highlighted = 0 + } + } else { + this.highlighted = 0 + } + }, + onKeydown (e) { + e.stopPropagation() + }, + onInput (e) { + this.$emit('input', e.target.value) + }, + setCaret ({target: {selectionStart}}) { + this.caret = selectionStart + } + } +} + +export default EmojiInput diff --git a/src/components/emoji-input/emoji-input.vue b/src/components/emoji-input/emoji-input.vue new file mode 100644 index 00000000..95606305 --- /dev/null +++ b/src/components/emoji-input/emoji-input.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index c5f30ca6..229aefb7 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -1,5 +1,6 @@ import statusPoster from '../../services/status_poster/status_poster.service.js' import MediaUpload from '../media_upload/media_upload.vue' +import EmojiInput from '../emoji-input/emoji-input.vue' import fileTypeService from '../../services/file_type/file_type.service.js' import Completion from '../../services/completion/completion.js' import { take, filter, reject, map, uniqBy } from 'lodash' @@ -28,7 +29,8 @@ const PostStatusForm = { 'subject' ], components: { - MediaUpload + MediaUpload, + EmojiInput }, mounted () { this.resize(this.$refs.textarea) diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 612f87c1..9d449b74 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -10,12 +10,13 @@ {{ $t('post_status.account_not_locked_warning_link') }}

    {{ $t('post_status.direct_warning') }}

    - + class="form-cw" + />
    +

    From 6dc2cedab07d14ef796640644c8b7ce6ec480665 Mon Sep 17 00:00:00 2001 From: jared Date: Tue, 26 Mar 2019 13:42:27 -0400 Subject: [PATCH 04/22] #255 - clean up user settings page with self-closing html tags --- src/components/user_settings/user_settings.vue | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index 27c2f47d..52df143c 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -70,7 +70,7 @@

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

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

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

    - +

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

    @@ -78,12 +78,11 @@

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

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

    - +

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

    - - +
    - +
    @@ -95,10 +94,9 @@

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

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

    - - +
    - +
    @@ -174,7 +172,7 @@

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

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

    - +
    From 8fe9101f0b134978212bf05ed6e73894f47c617e Mon Sep 17 00:00:00 2001 From: jared Date: Tue, 26 Mar 2019 14:53:27 -0400 Subject: [PATCH 05/22] #255 - clean up autocomplete form --- src/App.scss | 51 +++++++++++++++ src/components/emoji-input/emoji-input.vue | 51 --------------- .../post_status_form/post_status_form.vue | 65 ++++--------------- 3 files changed, 63 insertions(+), 104 deletions(-) diff --git a/src/App.scss b/src/App.scss index 244b3474..ae068e4f 100644 --- a/src/App.scss +++ b/src/App.scss @@ -767,3 +767,54 @@ nav { .btn.btn-default { min-height: 28px; } + +.autocomplete { + &-panel { + position: relative; + + &-body { + margin: 0 0.5em 0 0.5em; + border-radius: $fallback--tooltipRadius; + border-radius: var(--tooltipRadius, $fallback--tooltipRadius); + position: absolute; + z-index: 1; + box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); + // this doesn't match original but i don't care, making it uniform. + box-shadow: var(--popupShadow); + min-width: 75%; + background: $fallback--bg; + background: var(--bg, $fallback--bg); + color: $fallback--lightText; + color: var(--lightText, $fallback--lightText); + } + } + + &-item { + cursor: pointer; + padding: 0.2em 0.4em 0.2em 0.4em; + border-bottom: 1px solid rgba(0, 0, 0, 0.4); + display: flex; + + img { + width: 24px; + height: 24px; + object-fit: contain; + } + + span { + line-height: 24px; + margin: 0 0.1em 0 0.2em; + } + + small { + margin-left: .5em; + color: $fallback--faint; + color: var(--faint, $fallback--faint); + } + + &.highlighted { + background-color: $fallback--fg; + background-color: var(--lightBg, $fallback--fg); + } + } +} \ No newline at end of file diff --git a/src/components/emoji-input/emoji-input.vue b/src/components/emoji-input/emoji-input.vue index 568bd080..338b77cd 100644 --- a/src/components/emoji-input/emoji-input.vue +++ b/src/components/emoji-input/emoji-input.vue @@ -61,55 +61,4 @@ width: 100%; } } - -.autocomplete { - &-panel { - position: relative; - - &-body { - margin: 0 0.5em 0 0.5em; - border-radius: $fallback--tooltipRadius; - border-radius: var(--tooltipRadius, $fallback--tooltipRadius); - position: absolute; - z-index: 1; - box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); - // this doesn't match original but i don't care, making it uniform. - box-shadow: var(--popupShadow); - min-width: 75%; - background: $fallback--bg; - background: var(--bg, $fallback--bg); - color: $fallback--lightText; - color: var(--lightText, $fallback--lightText); - } - } - - &-item { - cursor: pointer; - padding: 0.2em 0.4em 0.2em 0.4em; - border-bottom: 1px solid rgba(0, 0, 0, 0.4); - display: flex; - - img { - width: 24px; - height: 24px; - object-fit: contain; - } - - span { - line-height: 24px; - margin: 0 0.1em 0 0.2em; - } - - small { - margin-left: .5em; - color: $fallback--faint; - color: var(--faint, $fallback--faint); - } - - &.highlighted { - background-color: $fallback--fg; - background-color: var(--lightBg, $fallback--fg); - } - } -} diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index b2a1dc58..9f9f16ba 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -56,14 +56,18 @@
    -
    -
    -
    -
    - - {{candidate.utf}} - {{candidate.screen_name}}{{candidate.name}} -
    +
    +
    +
    + + {{candidate.utf}} + {{candidate.screen_name}}{{candidate.name}}
    @@ -262,50 +266,5 @@ cursor: pointer; z-index: 4; } - - .autocomplete-panel { - margin: 0 0.5em 0 0.5em; - border-radius: $fallback--tooltipRadius; - border-radius: var(--tooltipRadius, $fallback--tooltipRadius); - position: absolute; - z-index: 1; - box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5); - // this doesn't match original but i don't care, making it uniform. - box-shadow: var(--popupShadow); - min-width: 75%; - background: $fallback--bg; - background: var(--bg, $fallback--bg); - color: $fallback--lightText; - color: var(--lightText, $fallback--lightText); - } - - .autocomplete { - cursor: pointer; - padding: 0.2em 0.4em 0.2em 0.4em; - border-bottom: 1px solid rgba(0, 0, 0, 0.4); - display: flex; - - img { - width: 24px; - height: 24px; - object-fit: contain; - } - - span { - line-height: 24px; - margin: 0 0.1em 0 0.2em; - } - - small { - margin-left: .5em; - color: $fallback--faint; - color: var(--faint, $fallback--faint); - } - - &.highlighted { - background-color: $fallback--fg; - background-color: var(--lightBg, $fallback--fg); - } - } } From ab99d5ef952998cfe277dfbb32dd9fe238c91f48 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 26 Mar 2019 13:35:08 -0700 Subject: [PATCH 06/22] Fix warnings in user profile routing --- src/components/basic_user_card/basic_user_card.js | 1 + .../user_profile_link_generator.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js index 87085a28..a80e6cf0 100644 --- a/src/components/basic_user_card/basic_user_card.js +++ b/src/components/basic_user_card/basic_user_card.js @@ -20,6 +20,7 @@ const BasicUserCard = { this.userExpanded = !this.userExpanded }, userProfileLink (user) { + console.log('22222222222222222222222222222') return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) } } diff --git a/src/services/user_profile_link_generator/user_profile_link_generator.js b/src/services/user_profile_link_generator/user_profile_link_generator.js index a214ca48..5b430328 100644 --- a/src/services/user_profile_link_generator/user_profile_link_generator.js +++ b/src/services/user_profile_link_generator/user_profile_link_generator.js @@ -3,8 +3,8 @@ import { includes } from 'lodash' const generateProfileLink = (id, screenName, restrictedNicknames) => { const complicated = (isExternal(screenName) || includes(restrictedNicknames, screenName)) return { - name: (complicated ? 'external-user-profile' : 'user-profile'), - params: (complicated ? { id } : { name: screenName }) + name: (!screenName || complicated ? 'external-user-profile' : 'user-profile'), + params: (!screenName || complicated ? { id } : { name: screenName }) } } From 26955af60be26cf7ecba5d9b6ae03c11e111c1a4 Mon Sep 17 00:00:00 2001 From: jasper Date: Tue, 26 Mar 2019 13:36:33 -0700 Subject: [PATCH 07/22] Remove console log --- src/components/basic_user_card/basic_user_card.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/basic_user_card/basic_user_card.js b/src/components/basic_user_card/basic_user_card.js index a80e6cf0..87085a28 100644 --- a/src/components/basic_user_card/basic_user_card.js +++ b/src/components/basic_user_card/basic_user_card.js @@ -20,7 +20,6 @@ const BasicUserCard = { this.userExpanded = !this.userExpanded }, userProfileLink (user) { - console.log('22222222222222222222222222222') return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) } } From 8e4ddcb843e9ba6422ae1e053a84a7148031f995 Mon Sep 17 00:00:00 2001 From: Brenden Bice Date: Thu, 28 Mar 2019 13:20:09 -0400 Subject: [PATCH 08/22] update store according to retweeted status --- src/modules/statuses.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/modules/statuses.js b/src/modules/statuses.js index a16342e0..95262183 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -363,6 +363,15 @@ export const mutations = { }, setRetweeted (state, { status, value }) { const newStatus = state.allStatusesObject[status.id] + + if (newStatus.repeated !== value) { + if (value) { + newStatus.repeat_num++ + } else { + newStatus.repeat_num-- + } + } + newStatus.repeated = value }, setDeleted (state, { status }) { From e6f9b1517b6a0b8e58c5d9c3552b70850f05c528 Mon Sep 17 00:00:00 2001 From: jasper Date: Thu, 28 Mar 2019 18:43:03 -0700 Subject: [PATCH 09/22] Fix: Change condition --- .../user_profile_link_generator.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/services/user_profile_link_generator/user_profile_link_generator.js b/src/services/user_profile_link_generator/user_profile_link_generator.js index 5b430328..16f1531d 100644 --- a/src/services/user_profile_link_generator/user_profile_link_generator.js +++ b/src/services/user_profile_link_generator/user_profile_link_generator.js @@ -1,10 +1,10 @@ import { includes } from 'lodash' const generateProfileLink = (id, screenName, restrictedNicknames) => { - const complicated = (isExternal(screenName) || includes(restrictedNicknames, screenName)) + const complicated = !screenName || (isExternal(screenName) || includes(restrictedNicknames, screenName)) return { - name: (!screenName || complicated ? 'external-user-profile' : 'user-profile'), - params: (!screenName || complicated ? { id } : { name: screenName }) + name: (complicated ? 'external-user-profile' : 'user-profile'), + params: (complicated ? { id } : { name: screenName }) } } From bf927122df94853593a000ae873e8c840674258f Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:25:23 +0200 Subject: [PATCH 10/22] Review --- BREAKING_CHANGES.md | 6 ++++++ src/components/post_status_form/post_status_form.vue | 1 - src/components/scope_selector/scope_selector.js | 3 +-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 BREAKING_CHANGES.md diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md new file mode 100644 index 00000000..915aa74c --- /dev/null +++ b/BREAKING_CHANGES.md @@ -0,0 +1,6 @@ +# v1.0 +## Removed features/radically changed behavior +* As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) +Reasoning is that scopeOptions option originally existed mostly as a backwards-compatibility with GNU Social which only had `public` scope available and using scope selector would''t work. Since at some point we dropped GNU Social support, this option was mostly a nuisance (being default `false`'), however some people think scopes are an annoyance to a certain degree and want as less of that feature as possible. +Solution - to only show minimal set among: *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from UI. +*This setting is admin-default, user-configurable. Admin can choose different default for their instance but user can override it.* diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index b3d731cd..8beb73a9 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -46,7 +46,6 @@ Date: Sat, 30 Mar 2019 12:26:53 +0200 Subject: [PATCH 11/22] fix formatting --- BREAKING_CHANGES.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 915aa74c..b1d9ea13 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,6 +1,9 @@ # v1.0 ## Removed features/radically changed behavior -* As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) +As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) + Reasoning is that scopeOptions option originally existed mostly as a backwards-compatibility with GNU Social which only had `public` scope available and using scope selector would''t work. Since at some point we dropped GNU Social support, this option was mostly a nuisance (being default `false`'), however some people think scopes are an annoyance to a certain degree and want as less of that feature as possible. + Solution - to only show minimal set among: *Direct*, *User default* and *Scope of post replying to*. This also makes it impossible to reply to a DM with a non-DM post from UI. + *This setting is admin-default, user-configurable. Admin can choose different default for their instance but user can override it.* From e89a62200532a4d61de35d73299c33555aad8bed Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:29:28 +0200 Subject: [PATCH 12/22] fix formatting --- BREAKING_CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index b1d9ea13..45f7c74b 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,5 +1,6 @@ # v1.0 ## Removed features/radically changed behavior +### scopeOptionsMinimal As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) Reasoning is that scopeOptions option originally existed mostly as a backwards-compatibility with GNU Social which only had `public` scope available and using scope selector would''t work. Since at some point we dropped GNU Social support, this option was mostly a nuisance (being default `false`'), however some people think scopes are an annoyance to a certain degree and want as less of that feature as possible. From 995daf70b731f33c95ca654ee9daccb399d6c92d Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:34:13 +0200 Subject: [PATCH 13/22] fix lint --- src/components/scope_selector/scope_selector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js index 4693d066..8a42ee7b 100644 --- a/src/components/scope_selector/scope_selector.js +++ b/src/components/scope_selector/scope_selector.js @@ -42,7 +42,7 @@ const ScopeSelector = { this.currentScope === scope || this.originalScope === scope || this.userDefault === scope || - 'direct' === scope + scope === 'direct' }, changeVis (scope) { this.currentScope = scope From 4dc64438e929169770347c8868daa1e1c907290e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:41:42 +0200 Subject: [PATCH 14/22] aaaaggghh --- BREAKING_CHANGES.md | 4 ++-- src/components/features_panel/features_panel.js | 2 +- src/components/post_status_form/post_status_form.js | 4 ++-- src/components/user_settings/user_settings.js | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BREAKING_CHANGES.md b/BREAKING_CHANGES.md index 45f7c74b..924c38da 100644 --- a/BREAKING_CHANGES.md +++ b/BREAKING_CHANGES.md @@ -1,7 +1,7 @@ # v1.0 ## Removed features/radically changed behavior -### scopeOptionsMinimal -As of !633, `scopeOptions` is no longer available and instead is changed for `scopeOptionsMinimal` (default: `false`) +### minimalScopesMode +As of !633, `scopeOptions` is no longer available and instead is changed for `minimalScopesMode` (default: `false`) Reasoning is that scopeOptions option originally existed mostly as a backwards-compatibility with GNU Social which only had `public` scope available and using scope selector would''t work. Since at some point we dropped GNU Social support, this option was mostly a nuisance (being default `false`'), however some people think scopes are an annoyance to a certain degree and want as less of that feature as possible. diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js index 0a7234cc..5f0b7b25 100644 --- a/src/components/features_panel/features_panel.js +++ b/src/components/features_panel/features_panel.js @@ -6,7 +6,7 @@ const FeaturesPanel = { gopher: function () { return this.$store.state.instance.gopherAvailable }, whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled }, mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable }, - scopeOptionsMinimal: function () { return this.$store.state.instance.scopeOptionsMinimal }, + minimalScopesMode: function () { return this.$store.state.instance.minimalScopesMode }, textlimit: function () { return this.$store.state.instance.textlimit } } } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 499cbbfb..40e2610e 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -162,8 +162,8 @@ const PostStatusForm = { isOverLengthLimit () { return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, - scopeOptionsMinimal () { - return this.$store.state.instance.scopeOptionsMinimal + minimalScopesMode () { + return this.$store.state.instance.minimalScopesMode }, alwaysShowSubject () { if (typeof this.$store.state.config.alwaysShowSubjectInput !== 'undefined') { diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 4b277b6c..b6a0479d 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -82,8 +82,8 @@ const UserSettings = { pleromaBackend () { return this.$store.state.instance.pleromaBackend }, - scopeOptionsMinimal () { - return this.$store.state.instance.scopeOptionsMinimal + minimalScopesMode () { + return this.$store.state.instance.minimalScopesMode }, vis () { return { From 07927328226f7643d6df1762031f3147d121798e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sat, 30 Mar 2019 12:42:42 +0200 Subject: [PATCH 15/22] final touches --- README.md | 2 +- src/components/features_panel/features_panel.vue | 2 +- static/config.json | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 80938c45..889f0837 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ FE Build process also leaves current commit hash in global variable `___pleromaf # Configuration -Edit config.json for configuration. scopeOptionsEnabled gives you input fields for CWs and the scope settings. +Edit config.json for configuration. ## Options diff --git a/src/components/features_panel/features_panel.vue b/src/components/features_panel/features_panel.vue index 445143e9..7a263e01 100644 --- a/src/components/features_panel/features_panel.vue +++ b/src/components/features_panel/features_panel.vue @@ -12,7 +12,7 @@
  • {{$t('features_panel.gopher')}}
  • {{$t('features_panel.who_to_follow')}}
  • {{$t('features_panel.media_proxy')}}
  • -
  • {{$t('features_panel.scope_options')}}
  • +
  • {{$t('features_panel.scope_options')}}
  • {{$t('features_panel.text_limit')}} = {{textlimit}}
  • diff --git a/static/config.json b/static/config.json index b436daae..04cbb97b 100644 --- a/static/config.json +++ b/static/config.json @@ -8,7 +8,6 @@ "redirectRootLogin": "/main/friends", "chatDisabled": false, "showInstanceSpecificPanel": false, - "scopeOptionsEnabled": false, "formattingOptionsEnabled": false, "collapseMessageWithSubject": false, "scopeCopy": true, From 4a2f676f2e7fe40727b0aac573b8c0f9b88eb0fe Mon Sep 17 00:00:00 2001 From: jasper Date: Mon, 1 Apr 2019 07:26:13 -0700 Subject: [PATCH 16/22] Fix user card in notification --- src/components/notification/notification.js | 11 ++++++++++- src/components/notification/notification.vue | 4 ++-- src/components/user_profile/user_profile.js | 3 --- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index fe5b7018..1289616c 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -31,7 +31,16 @@ const Notification = { const highlight = this.$store.state.config.highlight const user = this.notification.action.user return highlightStyle(highlight[user.screen_name]) - } + }, + userInStore () { + return this.$store.getters.findUser(this.notification.action.user.id) + }, + user () { + if (this.userInStore) { + return this.userInStore + } + return {} + }, } } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 5e9cef97..8f532747 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,11 +1,11 @@