diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/App.vue | 9 | ||||
| -rw-r--r-- | src/components/post_status_modal/post_status_modal.js | 25 | ||||
| -rw-r--r-- | src/components/post_status_modal/post_status_modal.vue | 3 | ||||
| -rw-r--r-- | src/components/side_drawer/side_drawer.vue | 11 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.js | 6 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.vue | 30 | ||||
| -rw-r--r-- | src/components/who_to_follow/who_to_follow.js | 14 | ||||
| -rw-r--r-- | src/i18n/en.json | 4 | ||||
| -rw-r--r-- | src/i18n/ja.json | 27 | ||||
| -rw-r--r-- | src/i18n/ja_pedantic.json | 25 | ||||
| -rw-r--r-- | src/i18n/ru.json | 2 | ||||
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 9 |
12 files changed, 146 insertions, 19 deletions
diff --git a/src/App.vue b/src/App.vue index 8d7f6c79..dbe842ec 100644 --- a/src/App.vue +++ b/src/App.vue @@ -54,6 +54,15 @@ /> </router-link> <a + v-if="currentUser && currentUser.role === 'admin'" + href="/pleroma/admin/#/login-pleroma" + class="mobile-hidden" + target="_blank" + ><i + class="button-icon icon-gauge nav-icon" + :title="$t('nav.administration')" + /></a> + <a v-if="currentUser" href="#" class="mobile-hidden" diff --git a/src/components/post_status_modal/post_status_modal.js b/src/components/post_status_modal/post_status_modal.js index 1033ba11..38258296 100644 --- a/src/components/post_status_modal/post_status_modal.js +++ b/src/components/post_status_modal/post_status_modal.js @@ -1,24 +1,41 @@ import PostStatusForm from '../post_status_form/post_status_form.vue' +import get from 'lodash/get' const PostStatusModal = { components: { PostStatusForm }, + data () { + return { + resettingForm: false + } + }, computed: { isLoggedIn () { return !!this.$store.state.users.currentUser }, - isOpen () { - return this.isLoggedIn && this.$store.state.postStatus.modalActivated + modalActivated () { + return this.$store.state.postStatus.modalActivated + }, + isFormVisible () { + return this.isLoggedIn && !this.resettingForm && this.modalActivated }, params () { return this.$store.state.postStatus.params || {} } }, watch: { - isOpen (val) { + params (newVal, oldVal) { + if (get(newVal, 'repliedUser.id') !== get(oldVal, 'repliedUser.id')) { + this.resettingForm = true + this.$nextTick(() => { + this.resettingForm = false + }) + } + }, + isFormVisible (val) { if (val) { - this.$nextTick(() => this.$el.querySelector('textarea').focus()) + this.$nextTick(() => this.$el && this.$el.querySelector('textarea').focus()) } } }, diff --git a/src/components/post_status_modal/post_status_modal.vue b/src/components/post_status_modal/post_status_modal.vue index 3f8eec69..d3a82389 100644 --- a/src/components/post_status_modal/post_status_modal.vue +++ b/src/components/post_status_modal/post_status_modal.vue @@ -1,6 +1,7 @@ <template> <div - v-if="isOpen" + v-if="isLoggedIn && !resettingForm" + v-show="modalActivated" class="post-form-modal-view modal-view" @click="closeModal" > diff --git a/src/components/side_drawer/side_drawer.vue b/src/components/side_drawer/side_drawer.vue index 5b2d4473..214b8e0c 100644 --- a/src/components/side_drawer/side_drawer.vue +++ b/src/components/side_drawer/side_drawer.vue @@ -123,6 +123,17 @@ </router-link> </li> <li + v-if="currentUser && currentUser.role === 'admin'" + @click="toggleDrawer" + > + <a + href="/pleroma/admin/#/login-pleroma" + target="_blank" + > + {{ $t("nav.administration") }} + </a> + </li> + <li v-if="currentUser" @click="toggleDrawer" > diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index ae04ce73..f12cccae 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -41,8 +41,11 @@ const UserSettings = { newDefaultScope: this.$store.state.users.currentUser.default_scope, hideFollows: this.$store.state.users.currentUser.hide_follows, hideFollowers: this.$store.state.users.currentUser.hide_followers, + hideFollowsCount: this.$store.state.users.currentUser.hide_follows_count, + hideFollowersCount: this.$store.state.users.currentUser.hide_followers_count, showRole: this.$store.state.users.currentUser.show_role, role: this.$store.state.users.currentUser.role, + discoverable: this.$store.state.users.currentUser.discoverable, pickAvatarBtnVisible: true, bannerUploading: false, backgroundUploading: false, @@ -142,6 +145,9 @@ const UserSettings = { no_rich_text: this.newNoRichText, hide_follows: this.hideFollows, hide_followers: this.hideFollowers, + discoverable: this.discoverable, + hide_follows_count: this.hideFollowsCount, + hide_followers_count: this.hideFollowersCount, show_role: this.showRole /* eslint-enable camelcase */ } }).then((user) => { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index 97833acb..ef75ac52 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -90,6 +90,15 @@ > <label for="account-hide-follows">{{ $t('settings.hide_follows_description') }}</label> </p> + <p class="setting-subitem"> + <input + id="account-hide-follows-count" + v-model="hideFollowsCount" + type="checkbox" + :disabled="!hideFollows" + > + <label for="account-hide-follows-count">{{ $t('settings.hide_follows_count_description') }}</label> + </p> <p> <input id="account-hide-followers" @@ -98,6 +107,15 @@ > <label for="account-hide-followers">{{ $t('settings.hide_followers_description') }}</label> </p> + <p class="setting-subitem"> + <input + id="account-hide-followers-count" + v-model="hideFollowersCount" + type="checkbox" + :disabled="!hideFollowers" + > + <label for="account-hide-followers-count">{{ $t('settings.hide_followers_count_description') }}</label> + </p> <p> <input id="account-show-role" @@ -113,6 +131,14 @@ for="account-show-role" >{{ $t('settings.show_moderator_badge') }}</label> </p> + <p> + <input + id="discoverable" + v-model="discoverable" + type="checkbox" + > + <label for="discoverable">{{ $t('settings.discoverable') }}</label> + </p> <button :disabled="newName && newName.length === 0" class="btn btn-default" @@ -619,5 +645,9 @@ width: 10em; } } + + .setting-subitem { + margin-left: 1.75em; + } } </style> diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js index 1aa3a4cd..ecd97dd7 100644 --- a/src/components/who_to_follow/who_to_follow.js +++ b/src/components/who_to_follow/who_to_follow.js @@ -16,21 +16,11 @@ const WhoToFollow = { methods: { showWhoToFollow (reply) { reply.forEach((i, index) => { - const user = { - id: 0, - name: i.display_name, - screen_name: i.acct, - profile_image_url: i.avatar || '/images/avi.png', - profile_image_url_original: i.avatar || '/images/avi.png', - statusnet_profile_url: i.url - } - this.users.push(user) - - this.$store.state.api.backendInteractor.fetchUser({ id: user.screen_name }) + this.$store.state.api.backendInteractor.fetchUser({ id: i.acct }) .then((externalUser) => { if (!externalUser.error) { this.$store.commit('addNewUsers', [externalUser]) - user.id = externalUser.id + this.users.push(externalUser) } }) }) diff --git a/src/i18n/en.json b/src/i18n/en.json index dff88590..b58112e3 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -68,6 +68,7 @@ }, "nav": { "about": "About", + "administration": "Administration", "back": "Back", "chat": "Local Chat", "friend_requests": "Follow Requests", @@ -231,6 +232,7 @@ "delete_account_description": "Permanently delete your account and all your messages.", "delete_account_error": "There was an issue deleting your account. If this persists please contact your instance administrator.", "delete_account_instructions": "Type your password in the input below to confirm account deletion.", + "discoverable": "Allow discovery of this account in search results and other services", "avatar_size_instruction": "The recommended minimum size for avatar images is 150x150 pixels.", "pad_emoji": "Pad emoji with spaces when adding from picker", "export_theme": "Save preset", @@ -284,6 +286,8 @@ "no_mutes": "No mutes", "hide_follows_description": "Don't show who I'm following", "hide_followers_description": "Don't show who's following me", + "hide_follows_count_description": "Don't show follow count", + "hide_followers_count_description": "Don't show follower count", "show_admin_badge": "Show Admin badge in my profile", "show_moderator_badge": "Show Moderator badge in my profile", "nsfw_clickthrough": "Enable clickthrough NSFW attachment hiding", diff --git a/src/i18n/ja.json b/src/i18n/ja.json index b4c6015d..592a7257 100644 --- a/src/i18n/ja.json +++ b/src/i18n/ja.json @@ -106,6 +106,15 @@ "expired": "いれふだは {0} まえに、おわりました", "not_enough_options": "ユニークなオプションが、たりません" }, + "emoji": { + "stickers": "ステッカー", + "emoji": "えもじ", + "keep_open": "ピッカーをあけたままにする", + "search_emoji": "えもじをさがす", + "add_emoji": "えもじをうちこむ", + "custom": "カスタムえもじ", + "unicode": "ユニコードえもじ" + }, "stickers": { "add_sticker": "ステッカーをふやす" }, @@ -224,9 +233,11 @@ "default_vis": "デフォルトのこうかいはんい", "delete_account": "アカウントをけす", "delete_account_description": "あなたのアカウントとメッセージが、きえます。", - "delete_account_error": "アカウントをけすことが、できなかったかもしれません。インスタンスのかんりしゃに、れんらくしてください。", + "delete_account_error": "アカウントをけすことが、できなかったかもしれません。インスタンスのアドミニストレーターに、おといあわせください。", "delete_account_instructions": "ほんとうにアカウントをけしてもいいなら、パスワードをかいてください。", + "discoverable": "けんさくなどのサービスで、このアカウントをみつけてもよい", "avatar_size_instruction": "アバターのおおきさは、150×150ピクセルか、それよりもおおきくするといいです。", + "pad_emoji": "えもじをピッカーでえらんだとき、えもじのまわりにスペースをいれる", "export_theme": "セーブ", "filtering": "フィルタリング", "filtering_explanation": "これらのことばをふくむすべてのものがミュートされます。1ぎょうに1つのことばをかいてください。", @@ -279,6 +290,8 @@ "no_mutes": "ミュートしていません", "hide_follows_description": "フォローしているひとをみせない", "hide_followers_description": "フォロワーをみせない", + "hide_follows_count_description": "フォローしているひとのかずをみせない", + "hide_followers_count_description": "フォロワーのかずをみせない", "show_admin_badge": "アドミンのしるしをみせる", "show_moderator_badge": "モデレーターのしるしをみせる", "nsfw_clickthrough": "NSFWなファイルをかくす", @@ -531,6 +544,7 @@ "follows_you": "フォローされました!", "its_you": "これはあなたです!", "media": "メディア", + "mention": "メンション", "mute": "ミュート", "muted": "ミュートしています!", "per_day": "/日", @@ -610,5 +624,16 @@ "person_talking": "{count} にんが、はなしています", "people_talking": "{count} にんが、はなしています", "no_results": "みつかりませんでした" + }, + "password_reset": { + "forgot_password": "パスワードを、わすれましたか?", + "password_reset": "パスワードリセット", + "instruction": "あなたのメールアドレスかユーザーめいをいれてください。パスワードをリセットするためのリンクをおくります。", + "placeholder": "あなたのメールアドレスかユーザーめい", + "check_email": "パスワードをリセットするためのリンクがかかれたメールが、とどいているかどうか、みてください。", + "return_home": "ホームページにもどる", + "not_found": "そのメールアドレスまたはユーザーめいを、みつけることができませんでした。", + "too_many_requests": "パスワードリセットを、ためすことが、おおすぎます。しばらくしてから、ためしてください。", + "password_reset_disabled": "このインスタンスでは、パスワードリセットは、できません。インスタンスのアドミニストレーターに、おといあわせください。" } } diff --git a/src/i18n/ja_pedantic.json b/src/i18n/ja_pedantic.json index 42bb53d4..2ca7dca8 100644 --- a/src/i18n/ja_pedantic.json +++ b/src/i18n/ja_pedantic.json @@ -106,6 +106,15 @@ "expired": "投票は {0} 前に終了しました", "not_enough_options": "相異なる選択肢が不足しています" }, + "emoji": { + "stickers": "ステッカー", + "emoji": "絵文字", + "keep_open": "ピッカーを開いたままにする", + "search_emoji": "絵文字を検索", + "add_emoji": "絵文字を挿入", + "custom": "カスタム絵文字", + "unicode": "Unicode絵文字" + }, "stickers": { "add_sticker": "ステッカーを追加" }, @@ -226,7 +235,9 @@ "delete_account_description": "あなたのアカウントとメッセージが、消えます。", "delete_account_error": "アカウントを消すことが、できなかったかもしれません。インスタンスの管理者に、連絡してください。", "delete_account_instructions": "本当にアカウントを消してもいいなら、パスワードを入力してください。", + "discoverable": "検索などのサービスでこのアカウントを見つけることを許可する", "avatar_size_instruction": "アバターの大きさは、150×150ピクセルか、それよりも大きくするといいです。", + "pad_emoji": "ピッカーから絵文字を挿入するとき、絵文字の両側にスペースを入れる", "export_theme": "保存", "filtering": "フィルタリング", "filtering_explanation": "これらの言葉を含むすべてのものがミュートされます。1行に1つの言葉を書いてください。", @@ -279,6 +290,8 @@ "no_mutes": "ミュートはありません", "hide_follows_description": "フォローしている人を見せない", "hide_followers_description": "フォロワーを見せない", + "hide_follows_count_description": "フォローしている人の数を見せない", + "hide_followers_count_description": "フォロワーの数を見せない", "show_admin_badge": "管理者のバッジを見せる", "show_moderator_badge": "モデレーターのバッジを見せる", "nsfw_clickthrough": "NSFWなファイルを隠す", @@ -531,6 +544,7 @@ "follows_you": "フォローされました!", "its_you": "これはあなたです!", "media": "メディア", + "mention": "メンション", "mute": "ミュート", "muted": "ミュートしています!", "per_day": "/日", @@ -610,5 +624,16 @@ "person_talking": "{count} 人が話しています", "people_talking": "{count} 人が話しています", "no_results": "見つかりませんでした" + }, + "password_reset": { + "forgot_password": "パスワードを忘れましたか?", + "password_reset": "パスワードリセット", + "instruction": "メールアドレスまたはユーザー名を入力してください。パスワードをリセットするためのリンクを送信します。", + "placeholder": "メールアドレスまたはユーザー名", + "check_email": "パスワードをリセットするためのリンクが記載されたメールが届いているか確認してください。", + "return_home": "ホームページに戻る", + "not_found": "メールアドレスまたはユーザー名が見つかりませんでした。", + "too_many_requests": "試行回数の制限に達しました。しばらく時間を置いてから再試行してください。", + "password_reset_disabled": "このインスタンスではパスワードリセットは無効になっています。インスタンスの管理者に連絡してください。" } } diff --git a/src/i18n/ru.json b/src/i18n/ru.json index 3af65f40..16268425 100644 --- a/src/i18n/ru.json +++ b/src/i18n/ru.json @@ -178,6 +178,8 @@ "no_rich_text_description": "Убрать форматирование из всех постов", "hide_follows_description": "Не показывать кого я читаю", "hide_followers_description": "Не показывать кто читает меня", + "hide_follows_count_description": "Не показывать число читаемых пользователей", + "hide_followers_count_description": "Не показывать число моих подписчиков", "show_admin_badge": "Показывать значок администратора в моем профиле", "show_moderator_badge": "Показывать значок модератора в моем профиле", "nsfw_clickthrough": "Включить скрытие NSFW вложений", diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 906838fd..5f45660d 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -75,6 +75,8 @@ export const parseUser = (data) => { output.hide_follows = data.pleroma.hide_follows output.hide_followers = data.pleroma.hide_followers + output.hide_follows_count = data.pleroma.hide_follows_count + output.hide_followers_count = data.pleroma.hide_followers_count output.rights = { moderator: data.pleroma.is_moderator, @@ -96,6 +98,7 @@ export const parseUser = (data) => { if (data.source.pleroma) { output.no_rich_text = data.source.pleroma.no_rich_text output.show_role = data.source.pleroma.show_role + output.discoverable = data.source.pleroma.discoverable } } @@ -141,6 +144,8 @@ export const parseUser = (data) => { output.default_scope = data.default_scope output.hide_follows = data.hide_follows output.hide_followers = data.hide_followers + output.hide_follows_count = data.hide_follows_count + output.hide_followers_count = data.hide_followers_count output.background_image = data.background_image // on mastoapi this info is contained in a "relationship" output.following = data.following @@ -192,9 +197,11 @@ export const parseAttachment = (data) => { return output } export const addEmojis = (string, emojis) => { + const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g return emojis.reduce((acc, emoji) => { + const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\$&') return acc.replace( - new RegExp(`:${emoji.shortcode}:`, 'g'), + new RegExp(`:${regexSafeShortCode}:`, 'g'), `<img src='${emoji.url}' alt='${emoji.shortcode}' title='${emoji.shortcode}' class='emoji' />` ) }, string) |
