Merge branch 'betterStorage' into shigusegubu
* betterStorage: translations Added more stuff that's actually being added to instanceConfig, simplified the whitelist. more refactoring some recategorization of options... Initial version seems to be working
This commit is contained in:
commit
cbe81fbd86
15 changed files with 389 additions and 265 deletions
|
@ -60,10 +60,10 @@ export default {
|
|||
},
|
||||
logo () { return this.$store.state.config.logo },
|
||||
style () { return { 'background-image': `url(${this.background})` } },
|
||||
sitename () { return this.$store.state.config.name },
|
||||
sitename () { return this.$store.state.instance.name },
|
||||
chat () { return this.$store.state.chat.channel.state === 'joined' },
|
||||
suggestionsEnabled () { return this.$store.state.config.suggestionsEnabled },
|
||||
showInstanceSpecificPanel () { return this.$store.state.config.showInstanceSpecificPanel }
|
||||
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
|
||||
showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel }
|
||||
},
|
||||
methods: {
|
||||
activatePanel (panelName) {
|
||||
|
|
|
@ -3,11 +3,11 @@ const FeaturesPanel = {
|
|||
chat: function () {
|
||||
return this.$store.state.config.chatAvailable && (!this.$store.state.chatDisabled)
|
||||
},
|
||||
gopher: function () { return this.$store.state.config.gopherAvailable },
|
||||
whoToFollow: function () { return this.$store.state.config.suggestionsEnabled },
|
||||
mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable },
|
||||
scopeOptions: function () { return this.$store.state.config.scopeOptionsEnabled },
|
||||
textlimit: function () { return this.$store.state.config.textlimit }
|
||||
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 },
|
||||
textlimit: function () { return this.$store.state.instance.textlimit }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ const LoginForm = {
|
|||
}),
|
||||
computed: {
|
||||
loggingIn () { return this.$store.state.users.loggingIn },
|
||||
registrationOpen () { return this.$store.state.config.registrationOpen }
|
||||
registrationOpen () { return this.$store.state.instance.registrationOpen }
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
|
|
|
@ -116,10 +116,10 @@ const PostStatusForm = {
|
|||
return this.$store.state.users.users
|
||||
},
|
||||
emoji () {
|
||||
return this.$store.state.config.emoji || []
|
||||
return this.$store.state.instance.emoji || []
|
||||
},
|
||||
customEmoji () {
|
||||
return this.$store.state.config.customEmoji || []
|
||||
return this.$store.state.instance.customEmoji || []
|
||||
},
|
||||
statusLength () {
|
||||
return this.newStatus.status.length
|
||||
|
@ -137,10 +137,10 @@ const PostStatusForm = {
|
|||
return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit)
|
||||
},
|
||||
scopeOptionsEnabled () {
|
||||
return this.$store.state.config.scopeOptionsEnabled
|
||||
return this.$store.state.instance.scopeOptionsEnabled
|
||||
},
|
||||
formattingOptionsEnabled () {
|
||||
return this.$store.state.config.formattingOptionsEnabled
|
||||
return this.$store.state.instance.formattingOptionsEnabled
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -5,16 +5,16 @@ const registration = {
|
|||
registering: false
|
||||
}),
|
||||
created () {
|
||||
if ((!this.$store.state.config.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) {
|
||||
if ((!this.$store.state.instance.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) {
|
||||
if (this.$store.state.instance.registrationOpen && this.token) {
|
||||
this.$router.push('/registration')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
termsofservice () { return this.$store.state.config.tos },
|
||||
termsofservice () { return this.$store.state.instance.tos },
|
||||
token () { return this.$route.params.token }
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -6,25 +6,26 @@ import { filter, trim } from 'lodash'
|
|||
|
||||
const settings = {
|
||||
data () {
|
||||
const config = this.$store.state.config
|
||||
const user = this.$store.state.config
|
||||
const instance = this.$store.state.instance
|
||||
|
||||
return {
|
||||
hideAttachmentsLocal: config.hideAttachments,
|
||||
hideAttachmentsInConvLocal: config.hideAttachmentsInConv,
|
||||
hideNsfwLocal: config.hideNsfw,
|
||||
notificationVisibilityLocal: config.notificationVisibility,
|
||||
replyVisibilityLocal: config.replyVisibility,
|
||||
loopVideoLocal: config.loopVideo,
|
||||
loopVideoSilentOnlyLocal: config.loopVideoSilentOnly,
|
||||
muteWordsString: config.muteWords.join('\n'),
|
||||
autoLoadLocal: config.autoLoad,
|
||||
streamingLocal: config.streaming,
|
||||
pauseOnUnfocusedLocal: config.pauseOnUnfocused,
|
||||
hoverPreviewLocal: config.hoverPreview,
|
||||
collapseMessageWithSubjectLocal: typeof config.collapseMessageWithSubject === 'undefined'
|
||||
? config.defaultCollapseMessageWithSubject
|
||||
: config.collapseMessageWithSubject,
|
||||
stopGifs: config.stopGifs,
|
||||
hideAttachmentsLocal: user.hideAttachments,
|
||||
hideAttachmentsInConvLocal: user.hideAttachmentsInConv,
|
||||
hideNsfwLocal: user.hideNsfw,
|
||||
notificationVisibilityLocal: user.notificationVisibility,
|
||||
replyVisibilityLocal: user.replyVisibility,
|
||||
loopVideoLocal: user.loopVideo,
|
||||
loopVideoSilentOnlyLocal: user.loopVideoSilentOnly,
|
||||
muteWordsString: user.muteWords.join('\n'),
|
||||
autoLoadLocal: user.autoLoad,
|
||||
streamingLocal: user.streaming,
|
||||
pauseOnUnfocusedLocal: user.pauseOnUnfocused,
|
||||
hoverPreviewLocal: user.hoverPreview,
|
||||
collapseMessageWithSubjectLocal: typeof user.collapseMessageWithSubject === 'undefined'
|
||||
? instance.collapseMessageWithSubject
|
||||
: user.collapseMessageWithSubject,
|
||||
stopGifs: user.stopGifs,
|
||||
loopSilentAvailable:
|
||||
// Firefox
|
||||
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
|
||||
|
@ -42,6 +43,9 @@ const settings = {
|
|||
computed: {
|
||||
user () {
|
||||
return this.$store.state.users.currentUser
|
||||
},
|
||||
currentSaveStateNotice () {
|
||||
return this.$store.state.interface.settings.currentSaveStateNotice
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
@ -1,7 +1,21 @@
|
|||
<template>
|
||||
<div class="settings panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{{$t('settings.settings')}}
|
||||
<div class="title">
|
||||
{{$t('settings.settings')}}
|
||||
</div>
|
||||
|
||||
<transition name="fade">
|
||||
<template v-if="currentSaveStateNotice">
|
||||
<div @click.prevent class="alert error" v-if="currentSaveStateNotice.error">
|
||||
{{ $t('settings.saving_err') }}
|
||||
</div>
|
||||
|
||||
<div @click.prevent class="alert transparent" v-if="!currentSaveStateNotice.error">
|
||||
{{ $t('settings.saving_ok') }}
|
||||
</div>
|
||||
</template>
|
||||
</transition>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<tab-switcher>
|
||||
|
|
|
@ -32,10 +32,10 @@ const UserSettings = {
|
|||
return this.$store.state.users.currentUser
|
||||
},
|
||||
pleromaBackend () {
|
||||
return this.$store.state.config.pleromaBackend
|
||||
return this.$store.state.instance.pleromaBackend
|
||||
},
|
||||
scopeOptionsEnabled () {
|
||||
return this.$store.state.config.scopeOptionsEnabled
|
||||
return this.$store.state.instance.scopeOptionsEnabled
|
||||
},
|
||||
vis () {
|
||||
return {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// sed command for converting currently formatted JS to JSON:
|
||||
// sed -i -e "s/'//gm" -e 's/"/\\"/gm' -re 's/^( +)(.+?): ((.+?))?(,?)(\{?)$/\1"\2": "\4"/gm' -e 's/\"\{\"/{/g' -e 's/,"$/",/g' file.json
|
||||
|
||||
const de = {
|
||||
chat: {
|
||||
title: 'Chat'
|
||||
|
@ -282,6 +285,8 @@ const en = {
|
|||
no_retweet_hint: 'Post is marked as followers-only or direct and cannot be repeated'
|
||||
},
|
||||
settings: {
|
||||
saving_ok: 'Settings saved',
|
||||
saving_err: 'Error saving settings',
|
||||
general: 'General',
|
||||
user_settings: 'User Settings',
|
||||
name_bio: 'Name & Bio',
|
||||
|
@ -1652,176 +1657,7 @@ const pt = {
|
|||
}
|
||||
}
|
||||
|
||||
const ru = {
|
||||
chat: {
|
||||
title: 'Чат'
|
||||
},
|
||||
nav: {
|
||||
chat: 'Локальный чат',
|
||||
timeline: 'Лента',
|
||||
mentions: 'Упоминания',
|
||||
public_tl: 'Публичная лента',
|
||||
twkn: 'Федеративная лента'
|
||||
},
|
||||
user_card: {
|
||||
follows_you: 'Читает вас',
|
||||
following: 'Читаю',
|
||||
follow: 'Читать',
|
||||
blocked: 'Заблокирован',
|
||||
block: 'Заблокировать',
|
||||
statuses: 'Статусы',
|
||||
mute: 'Игнорировать',
|
||||
muted: 'Игнорирую',
|
||||
followers: 'Читатели',
|
||||
followees: 'Читаемые',
|
||||
per_day: 'в день',
|
||||
remote_follow: 'Читать удалённо'
|
||||
},
|
||||
timeline: {
|
||||
show_new: 'Показать новые',
|
||||
error_fetching: 'Ошибка при обновлении',
|
||||
up_to_date: 'Обновлено',
|
||||
load_older: 'Загрузить старые статусы',
|
||||
conversation: 'Разговор',
|
||||
collapse: 'Свернуть',
|
||||
repeated: 'повторил(а)',
|
||||
no_retweet_hint: 'Пост помечен как "только для подписчиков" или "личное" и поэтому не может быть повторён'
|
||||
},
|
||||
settings: {
|
||||
general: 'Общие',
|
||||
user_settings: 'Настройки пользователя',
|
||||
name_bio: 'Имя и описание',
|
||||
name: 'Имя',
|
||||
bio: 'Описание',
|
||||
avatar: 'Аватар',
|
||||
current_avatar: 'Текущий аватар',
|
||||
set_new_avatar: 'Загрузить новый аватар',
|
||||
profile_banner: 'Баннер профиля',
|
||||
current_profile_banner: 'Текущий баннер профиля',
|
||||
set_new_profile_banner: 'Загрузить новый баннер профиля',
|
||||
profile_background: 'Фон профиля',
|
||||
set_new_profile_background: 'Загрузить новый фон профиля',
|
||||
settings: 'Настройки',
|
||||
theme: 'Тема',
|
||||
export_theme: 'Сохранить Тему',
|
||||
import_theme: 'Загрузить Тему',
|
||||
presets: 'Пресеты',
|
||||
theme_help: 'Используйте шестнадцатеричные коды цветов (#rrggbb) для настройки темы.',
|
||||
radii_help: 'Скругление углов элементов интерфейса (в пикселях)',
|
||||
background: 'Фон',
|
||||
foreground: 'Передний план',
|
||||
text: 'Текст',
|
||||
links: 'Ссылки',
|
||||
cBlue: 'Ответить, читать',
|
||||
cRed: 'Отменить',
|
||||
cOrange: 'Нравится',
|
||||
cGreen: 'Повторить',
|
||||
btnRadius: 'Кнопки',
|
||||
inputRadius: 'Поля ввода',
|
||||
panelRadius: 'Панели',
|
||||
avatarRadius: 'Аватары',
|
||||
avatarAltRadius: 'Аватары в уведомлениях',
|
||||
tooltipRadius: 'Всплывающие подсказки/уведомления',
|
||||
attachmentRadius: 'Прикреплённые файлы',
|
||||
filtering: 'Фильтрация',
|
||||
filtering_explanation: 'Все статусы, содержащие данные слова, будут игнорироваться, по одному в строке',
|
||||
attachments: 'Вложения',
|
||||
hide_attachments_in_tl: 'Прятать вложения в ленте',
|
||||
hide_attachments_in_convo: 'Прятать вложения в разговорах',
|
||||
stop_gifs: 'Проигрывать GIF анимации только при наведении',
|
||||
nsfw_clickthrough: 'Включить скрытие NSFW вложений',
|
||||
autoload: 'Включить автоматическую загрузку при прокрутке вниз',
|
||||
streaming: 'Включить автоматическую загрузку новых сообщений при прокрутке вверх',
|
||||
pause_on_unfocused: 'Приостановить загрузку когда вкладка не в фокусе',
|
||||
loop_video: 'Зациливать видео',
|
||||
loop_video_silent_only: 'Зацикливать только беззвучные видео (т.е. "гифки" с Mastodon)',
|
||||
reply_link_preview: 'Включить предварительный просмотр ответа при наведении мыши',
|
||||
replies_in_timeline: 'Ответы в ленте',
|
||||
reply_visibility_all: 'Показывать все ответы',
|
||||
reply_visibility_following: 'Показывать только ответы мне и тех на кого я подписан',
|
||||
reply_visibility_self: 'Показывать только ответы мне',
|
||||
notification_visibility: 'Показывать уведомления',
|
||||
notification_visibility_likes: 'Лайки',
|
||||
notification_visibility_mentions: 'Упоминания',
|
||||
notification_visibility_repeats: 'Повторы',
|
||||
notification_visibility_follows: 'Подписки',
|
||||
follow_import: 'Импортировать читаемых',
|
||||
import_followers_from_a_csv_file: 'Импортировать читаемых из файла .csv',
|
||||
follows_imported: 'Список читаемых импортирован. Обработка займёт некоторое время..',
|
||||
follow_import_error: 'Ошибка при импортировании читаемых.',
|
||||
delete_account: 'Удалить аккаунт',
|
||||
delete_account_description: 'Удалить ваш аккаунт и все ваши сообщения.',
|
||||
delete_account_instructions: 'Введите ваш пароль в поле ниже для подтверждения удаления.',
|
||||
delete_account_error: 'Возникла ошибка в процессе удаления вашего аккаунта. Если это повторяется, свяжитесь с администратором вашего сервера.',
|
||||
follow_export: 'Экспортировать читаемых',
|
||||
follow_export_processing: 'Ведётся обработка, скоро вам будет предложено загрузить файл',
|
||||
follow_export_button: 'Экспортировать читаемых в файл .csv',
|
||||
change_password: 'Сменить пароль',
|
||||
current_password: 'Текущий пароль',
|
||||
new_password: 'Новый пароль',
|
||||
confirm_new_password: 'Подтверждение нового пароля',
|
||||
changed_password: 'Пароль изменён успешно.',
|
||||
change_password_error: 'Произошла ошибка при попытке изменить пароль.',
|
||||
lock_account_description: 'Аккаунт доступен только подтверждённым подписчикам',
|
||||
limited_availability: 'Не доступно в вашем браузере',
|
||||
profile_tab: 'Профиль',
|
||||
security_tab: 'Безопасность',
|
||||
data_import_export_tab: 'Импорт / Экспорт данных',
|
||||
collapse_subject: 'Сворачивать посты с темой',
|
||||
interfaceLanguage: 'Язык интерфейса'
|
||||
},
|
||||
notifications: {
|
||||
notifications: 'Уведомления',
|
||||
read: 'Прочесть',
|
||||
followed_you: 'начал(а) читать вас',
|
||||
favorited_you: 'нравится ваш статус',
|
||||
repeated_you: 'повторил(а) ваш статус',
|
||||
broken_favorite: 'Неизвестный статус, ищем...',
|
||||
load_older: 'Загрузить старые уведомления'
|
||||
},
|
||||
login: {
|
||||
login: 'Войти',
|
||||
username: 'Имя пользователя',
|
||||
placeholder: 'e.c. lain',
|
||||
password: 'Пароль',
|
||||
register: 'Зарегистрироваться',
|
||||
logout: 'Выйти'
|
||||
},
|
||||
registration: {
|
||||
registration: 'Регистрация',
|
||||
fullname: 'Отображаемое имя',
|
||||
email: 'Email',
|
||||
bio: 'Описание',
|
||||
password_confirm: 'Подтверждение пароля',
|
||||
token: 'Код приглашения'
|
||||
},
|
||||
post_status: {
|
||||
posting: 'Отправляется',
|
||||
content_warning: 'Тема (не обязательно)',
|
||||
default: 'Что нового?',
|
||||
account_not_locked_warning: 'Ваш аккаунт не {0}. Кто угодно может зафоловить вас чтобы прочитать посты только для подписчиков',
|
||||
account_not_locked_warning_link: 'залочен',
|
||||
direct_warning: 'Этот пост будет видет только упомянутым пользователям',
|
||||
attachments_sensitive: 'Вложения содержат чувствительный контент',
|
||||
scope: {
|
||||
public: 'Публичный - этот пост виден всем',
|
||||
unlisted: 'Непубличный - этот пост не виден на публичных лентах',
|
||||
private: 'Для подписчиков - этот пост видят только подписчики',
|
||||
direct: 'Личное - этот пост видят только те кто в нём упомянут'
|
||||
}
|
||||
},
|
||||
finder: {
|
||||
find_user: 'Найти пользователя',
|
||||
error_fetching_user: 'Пользователь не найден'
|
||||
},
|
||||
general: {
|
||||
submit: 'Отправить',
|
||||
apply: 'Применить'
|
||||
},
|
||||
user_profile: {
|
||||
timeline_title: 'Лента пользователя'
|
||||
}
|
||||
}
|
||||
const ru = require('./ru.json')
|
||||
const nb = {
|
||||
chat: {
|
||||
title: 'Chat'
|
||||
|
|
170
src/i18n/ru.json
Normal file
170
src/i18n/ru.json
Normal file
|
@ -0,0 +1,170 @@
|
|||
{
|
||||
"chat": {
|
||||
"title": "Чат"
|
||||
},
|
||||
"nav": {
|
||||
"chat": "Локальный чат",
|
||||
"timeline": "Лента",
|
||||
"mentions": "Упоминания",
|
||||
"public_tl": "Публичная лента",
|
||||
"twkn": "Федеративная лента"
|
||||
},
|
||||
"user_card": {
|
||||
"follows_you": "Читает вас",
|
||||
"following": "Читаю",
|
||||
"follow": "Читать",
|
||||
"blocked": "Заблокирован",
|
||||
"block": "Заблокировать",
|
||||
"statuses": "Статусы",
|
||||
"mute": "Игнорировать",
|
||||
"muted": "Игнорирую",
|
||||
"followers": "Читатели",
|
||||
"followees": "Читаемые",
|
||||
"per_day": "в день",
|
||||
"remote_follow": "Читать удалённо"
|
||||
},
|
||||
"timeline": {
|
||||
"show_new": "Показать новые",
|
||||
"error_fetching": "Ошибка при обновлении",
|
||||
"up_to_date": "Обновлено",
|
||||
"load_older": "Загрузить старые статусы",
|
||||
"conversation": "Разговор",
|
||||
"collapse": "Свернуть",
|
||||
"repeated": "повторил(а)",
|
||||
"no_retweet_hint": "Пост помечен как \"только для подписчиков\" или \"личное\" и поэтому не может быть повторён"
|
||||
},
|
||||
"settings": {
|
||||
"general": "Общие",
|
||||
"user_settings": "Настройки пользователя",
|
||||
"name_bio": "Имя и описание",
|
||||
"name": "Имя",
|
||||
"bio": "Описание",
|
||||
"avatar": "Аватар",
|
||||
"current_avatar": "Текущий аватар",
|
||||
"set_new_avatar": "Загрузить новый аватар",
|
||||
"profile_banner": "Баннер профиля",
|
||||
"current_profile_banner": "Текущий баннер профиля",
|
||||
"set_new_profile_banner": "Загрузить новый баннер профиля",
|
||||
"profile_background": "Фон профиля",
|
||||
"set_new_profile_background": "Загрузить новый фон профиля",
|
||||
"settings": "Настройки",
|
||||
"theme": "Тема",
|
||||
"export_theme": "Сохранить Тему",
|
||||
"import_theme": "Загрузить Тему",
|
||||
"presets": "Пресеты",
|
||||
"theme_help": "Используйте шестнадцатеричные коды цветов (#rrggbb) для настройки темы.",
|
||||
"radii_help": "Скругление углов элементов интерфейса (в пикселях)",
|
||||
"background": "Фон",
|
||||
"foreground": "Передний план",
|
||||
"text": "Текст",
|
||||
"links": "Ссылки",
|
||||
"cBlue": "Ответить, читать",
|
||||
"cRed": "Отменить",
|
||||
"cOrange": "Нравится",
|
||||
"cGreen": "Повторить",
|
||||
"btnRadius": "Кнопки",
|
||||
"inputRadius": "Поля ввода",
|
||||
"panelRadius": "Панели",
|
||||
"avatarRadius": "Аватары",
|
||||
"avatarAltRadius": "Аватары в уведомлениях",
|
||||
"tooltipRadius": "Всплывающие подсказки/уведомления",
|
||||
"attachmentRadius": "Прикреплённые файлы",
|
||||
"filtering": "Фильтрация",
|
||||
"filtering_explanation": "Все статусы, содержащие данные слова, будут игнорироваться, по одному в строке",
|
||||
"attachments": "Вложения",
|
||||
"hide_attachments_in_tl": "Прятать вложения в ленте",
|
||||
"hide_attachments_in_convo": "Прятать вложения в разговорах",
|
||||
"stop_gifs": "Проигрывать GIF анимации только при наведении",
|
||||
"nsfw_clickthrough": "Включить скрытие NSFW вложений",
|
||||
"autoload": "Включить автоматическую загрузку при прокрутке вниз",
|
||||
"streaming": "Включить автоматическую загрузку новых сообщений при прокрутке вверх",
|
||||
"pause_on_unfocused": "Приостановить загрузку когда вкладка не в фокусе",
|
||||
"loop_video": "Зациливать видео",
|
||||
"loop_video_silent_only": "Зацикливать только беззвучные видео (т.е. \"гифки\" с Mastodon)",
|
||||
"reply_link_preview": "Включить предварительный просмотр ответа при наведении мыши",
|
||||
"replies_in_timeline": "Ответы в ленте",
|
||||
"reply_visibility_all": "Показывать все ответы",
|
||||
"reply_visibility_following": "Показывать только ответы мне и тех на кого я подписан",
|
||||
"reply_visibility_self": "Показывать только ответы мне",
|
||||
"notification_visibility": "Показывать уведомления",
|
||||
"notification_visibility_likes": "Лайки",
|
||||
"notification_visibility_mentions": "Упоминания",
|
||||
"notification_visibility_repeats": "Повторы",
|
||||
"notification_visibility_follows": "Подписки",
|
||||
"follow_import": "Импортировать читаемых",
|
||||
"import_followers_from_a_csv_file": "Импортировать читаемых из файла .csv",
|
||||
"follows_imported": "Список читаемых импортирован. Обработка займёт некоторое время..",
|
||||
"follow_import_error": "Ошибка при импортировании читаемых.",
|
||||
"delete_account": "Удалить аккаунт",
|
||||
"delete_account_description": "Удалить ваш аккаунт и все ваши сообщения.",
|
||||
"delete_account_instructions": "Введите ваш пароль в поле ниже для подтверждения удаления.",
|
||||
"delete_account_error": "Возникла ошибка в процессе удаления вашего аккаунта. Если это повторяется, свяжитесь с администратором вашего сервера.",
|
||||
"follow_export": "Экспортировать читаемых",
|
||||
"follow_export_processing": "Ведётся обработка, скоро вам будет предложено загрузить файл",
|
||||
"follow_export_button": "Экспортировать читаемых в файл .csv",
|
||||
"change_password": "Сменить пароль",
|
||||
"current_password": "Текущий пароль",
|
||||
"new_password": "Новый пароль",
|
||||
"confirm_new_password": "Подтверждение нового пароля",
|
||||
"changed_password": "Пароль изменён успешно.",
|
||||
"change_password_error": "Произошла ошибка при попытке изменить пароль.",
|
||||
"lock_account_description": "Аккаунт доступен только подтверждённым подписчикам",
|
||||
"limited_availability": "Не доступно в вашем браузере",
|
||||
"profile_tab": "Профиль",
|
||||
"security_tab": "Безопасность",
|
||||
"data_import_export_tab": "Импорт / Экспорт данных",
|
||||
"collapse_subject": "Сворачивать посты с темой",
|
||||
"interfaceLanguage": "Язык интерфейса"
|
||||
},
|
||||
"notifications": {
|
||||
"notifications": "Уведомления",
|
||||
"read": "Прочесть",
|
||||
"followed_you": "начал(а) читать вас",
|
||||
"favorited_you": "нравится ваш статус",
|
||||
"repeated_you": "повторил(а) ваш статус",
|
||||
"broken_favorite": "Неизвестный статус, ищем...",
|
||||
"load_older": "Загрузить старые уведомления"
|
||||
},
|
||||
"login": {
|
||||
"login": "Войти",
|
||||
"username": "Имя пользователя",
|
||||
"placeholder": "e.c. lain",
|
||||
"password": "Пароль",
|
||||
"register": "Зарегистрироваться",
|
||||
"logout": "Выйти"
|
||||
},
|
||||
"registration": {
|
||||
"registration": "Регистрация",
|
||||
"fullname": "Отображаемое имя",
|
||||
"email": "Email",
|
||||
"bio": "Описание",
|
||||
"password_confirm": "Подтверждение пароля",
|
||||
"token": "Код приглашения"
|
||||
},
|
||||
"post_status": {
|
||||
"posting": "Отправляется",
|
||||
"content_warning": "Тема (не обязательно)",
|
||||
"default": "Что нового?",
|
||||
"account_not_locked_warning": "Ваш аккаунт не {0}. Кто угодно может зафоловить вас чтобы прочитать посты только для подписчиков",
|
||||
"account_not_locked_warning_link": "залочен",
|
||||
"direct_warning": "Этот пост будет видет только упомянутым пользователям",
|
||||
"attachments_sensitive": "Вложения содержат чувствительный контент",
|
||||
"scope": {
|
||||
"public": "Публичный - этот пост виден всем",
|
||||
"unlisted": "Непубличный - этот пост не виден на публичных лентах",
|
||||
"private": "Для подписчиков - этот пост видят только подписчики",
|
||||
"direct": "Личное - этот пост видят только те кто в нём упомянут"
|
||||
}
|
||||
},
|
||||
"finder": {
|
||||
"find_user": "Найти пользователя",
|
||||
"error_fetching_user": "Пользователь не найден"
|
||||
},
|
||||
"general": {
|
||||
"submit": "Отправить",
|
||||
"apply": "Применить"
|
||||
},
|
||||
"user_profile": {
|
||||
"timeline_title": "Лента пользователя"
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import merge from 'lodash.merge'
|
||||
import objectPath from 'object-path'
|
||||
import localforage from 'localforage'
|
||||
import { throttle, each } from 'lodash'
|
||||
import { each } from 'lodash'
|
||||
|
||||
let loaded = false
|
||||
|
||||
|
@ -12,18 +12,18 @@ const defaultReducer = (state, paths) => (
|
|||
}, {})
|
||||
)
|
||||
|
||||
const saveImmedeatelyActions = [
|
||||
'markNotificationsAsSeen',
|
||||
'clearCurrentUser',
|
||||
'setCurrentUser',
|
||||
'setHighlight',
|
||||
'setOption'
|
||||
]
|
||||
|
||||
const defaultStorage = (() => {
|
||||
return localforage
|
||||
})()
|
||||
|
||||
const defaultSetState = (key, state, storage) => {
|
||||
if (!loaded) {
|
||||
console.log('waiting for old state to be loaded...')
|
||||
} else {
|
||||
return storage.setItem(key, state)
|
||||
}
|
||||
}
|
||||
|
||||
export default function createPersistedState ({
|
||||
key = 'vuex-lz',
|
||||
paths = [],
|
||||
|
@ -31,7 +31,14 @@ export default function createPersistedState ({
|
|||
let value = storage.getItem(key)
|
||||
return value
|
||||
},
|
||||
setState = throttle(defaultSetState, 60000),
|
||||
setState = (key, state, storage) => {
|
||||
if (!loaded) {
|
||||
console.log('waiting for old state to be loaded...')
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
return storage.setItem(key, state)
|
||||
}
|
||||
},
|
||||
reducer = defaultReducer,
|
||||
storage = defaultStorage,
|
||||
subscriber = store => handler => store.subscribe(handler)
|
||||
|
@ -72,7 +79,22 @@ export default function createPersistedState ({
|
|||
|
||||
subscriber(store)((mutation, state) => {
|
||||
try {
|
||||
setState(key, reducer(state, paths), storage)
|
||||
if (saveImmedeatelyActions.includes(mutation.type)) {
|
||||
setState(key, reducer(state, paths), storage)
|
||||
.then(success => {
|
||||
if (typeof success !== 'undefined') {
|
||||
if (mutation.type === 'setOption') {
|
||||
store.dispatch('settingsSaved', { success })
|
||||
}
|
||||
}
|
||||
}, error => {
|
||||
if (mutation.type === 'setOption') {
|
||||
store.dispatch('settingsSaved', { error })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.warn(`Not saving to localStorage for: ${mutation.type}`)
|
||||
}
|
||||
} catch (e) {
|
||||
console.log("Couldn't persist state:")
|
||||
console.log(e)
|
||||
|
|
73
src/main.js
73
src/main.js
|
@ -14,6 +14,8 @@ import Registration from './components/registration/registration.vue'
|
|||
import UserSettings from './components/user_settings/user_settings.vue'
|
||||
import FollowRequests from './components/follow_requests/follow_requests.vue'
|
||||
|
||||
import interfaceModule from './modules/interface.js'
|
||||
import instanceModule from './modules/instance.js'
|
||||
import statusesModule from './modules/statuses.js'
|
||||
import usersModule from './modules/users.js'
|
||||
import apiModule from './modules/api.js'
|
||||
|
@ -45,23 +47,7 @@ Vue.use(VueChatScroll)
|
|||
|
||||
const persistedStateOptions = {
|
||||
paths: [
|
||||
'config.collapseMessageWithSubject',
|
||||
'config.hideAttachments',
|
||||
'config.hideAttachmentsInConv',
|
||||
'config.hideNsfw',
|
||||
'config.replyVisibility',
|
||||
'config.notificationVisibility',
|
||||
'config.autoLoad',
|
||||
'config.hoverPreview',
|
||||
'config.streaming',
|
||||
'config.muteWords',
|
||||
'config.customTheme',
|
||||
'config.highlight',
|
||||
'config.loopVideo',
|
||||
'config.loopVideoSilentOnly',
|
||||
'config.pauseOnUnfocused',
|
||||
'config.stopGifs',
|
||||
'config.interfaceLanguage',
|
||||
'config',
|
||||
'users.lastLoginName',
|
||||
'statuses.notifications.maxSavedId'
|
||||
]
|
||||
|
@ -69,6 +55,8 @@ const persistedStateOptions = {
|
|||
|
||||
const store = new Vuex.Store({
|
||||
modules: {
|
||||
interface: interfaceModule,
|
||||
instance: instanceModule,
|
||||
statuses: statusesModule,
|
||||
users: usersModule,
|
||||
api: apiModule,
|
||||
|
@ -92,10 +80,11 @@ window.fetch('/api/statusnet/config.json')
|
|||
.then((data) => {
|
||||
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 })
|
||||
console.log(store)
|
||||
store.dispatch('setInstanceOption', { name: 'name', value: name })
|
||||
store.dispatch('setInstanceOption', { name: 'registrationOpen', value: (registrationClosed === '0') })
|
||||
store.dispatch('setInstanceOption', { name: 'textlimit', value: parseInt(textlimit) })
|
||||
store.dispatch('setInstanceOption', { name: 'server', value: server })
|
||||
|
||||
var apiConfig = data.site.pleromafe
|
||||
|
||||
|
@ -119,15 +108,17 @@ window.fetch('/api/statusnet/config.json')
|
|||
var formattingOptionsEnabled = (config.formattingOptionsEnabled)
|
||||
var defaultCollapseMessageWithSubject = (config.collapseMessageWithSubject)
|
||||
|
||||
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: 'logoMask', value: logoMask })
|
||||
store.dispatch('setOption', { name: 'logoMargin', value: logoMargin })
|
||||
store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
|
||||
store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled })
|
||||
store.dispatch('setOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled })
|
||||
store.dispatch('setOption', { name: 'defaultCollapseMessageWithSubject', value: defaultCollapseMessageWithSubject })
|
||||
store.dispatch('setInstanceOption', { name: 'theme', value: theme })
|
||||
store.dispatch('setInstanceOption', { name: 'background', value: background })
|
||||
store.dispatch('setInstanceOption', { name: 'logo', value: logo })
|
||||
store.dispatch('setInstanceOption', { name: 'logoMask', value: logoMask })
|
||||
store.dispatch('setInstanceOption', { name: 'logoMargin', value: logoMargin })
|
||||
store.dispatch('setInstanceOption', { name: 'redirectRootNoLogin', value: redirectRootNoLogin })
|
||||
store.dispatch('setInstanceOption', { name: 'redirectRootLogin', value: redirectRootLogin })
|
||||
store.dispatch('setInstanceOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
|
||||
store.dispatch('setInstanceOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled })
|
||||
store.dispatch('setInstanceOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled })
|
||||
store.dispatch('setInstanceOption', { name: 'collapseMessageWithSubject', value: defaultCollapseMessageWithSubject })
|
||||
if (chatDisabled) {
|
||||
store.dispatch('disableChat')
|
||||
}
|
||||
|
@ -177,7 +168,7 @@ window.fetch('/api/statusnet/config.json')
|
|||
window.fetch('/static/terms-of-service.html')
|
||||
.then((res) => res.text())
|
||||
.then((html) => {
|
||||
store.dispatch('setOption', { name: 'tos', value: html })
|
||||
store.dispatch('setInstanceOption', { name: 'tos', value: html })
|
||||
})
|
||||
|
||||
window.fetch('/api/pleroma/emoji.json')
|
||||
|
@ -188,11 +179,11 @@ window.fetch('/api/pleroma/emoji.json')
|
|||
const emoji = Object.keys(values).map((key) => {
|
||||
return { shortcode: key, image_url: values[key] }
|
||||
})
|
||||
store.dispatch('setOption', { name: 'customEmoji', value: emoji })
|
||||
store.dispatch('setOption', { name: 'pleromaBackend', value: true })
|
||||
store.dispatch('setInstanceOption', { name: 'customEmoji', value: emoji })
|
||||
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: true })
|
||||
},
|
||||
(failure) => {
|
||||
store.dispatch('setOption', { name: 'pleromaBackend', value: false })
|
||||
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: false })
|
||||
}
|
||||
),
|
||||
(error) => console.log(error)
|
||||
|
@ -204,24 +195,24 @@ window.fetch('/static/emoji.json')
|
|||
const emoji = Object.keys(values).map((key) => {
|
||||
return { shortcode: key, image_url: false, 'utf': values[key] }
|
||||
})
|
||||
store.dispatch('setOption', { name: 'emoji', value: emoji })
|
||||
store.dispatch('setInstanceOption', { name: 'emoji', value: emoji })
|
||||
})
|
||||
|
||||
window.fetch('/instance/panel.html')
|
||||
.then((res) => res.text())
|
||||
.then((html) => {
|
||||
store.dispatch('setOption', { name: 'instanceSpecificPanelContent', value: html })
|
||||
store.dispatch('setInstanceOption', { name: 'instanceSpecificPanelContent', value: html })
|
||||
})
|
||||
|
||||
window.fetch('/nodeinfo/2.0.json')
|
||||
.then((res) => res.json())
|
||||
.then((data) => {
|
||||
const metadata = data.metadata
|
||||
store.dispatch('setOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy })
|
||||
store.dispatch('setOption', { name: 'chatAvailable', value: data.metadata.chat })
|
||||
store.dispatch('setOption', { name: 'gopherAvailable', value: data.metadata.gopher })
|
||||
store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy })
|
||||
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: data.metadata.chat })
|
||||
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: data.metadata.gopher })
|
||||
|
||||
const suggestions = metadata.suggestions
|
||||
store.dispatch('setOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
||||
store.dispatch('setOption', { name: 'suggestionsWeb', value: suggestions.web })
|
||||
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
|
||||
store.dispatch('setInstanceOption', { name: 'suggestionsWeb', value: suggestions.web })
|
||||
})
|
||||
|
|
|
@ -4,7 +4,6 @@ import StyleSetter from '../services/style_setter/style_setter.js'
|
|||
const browserLocale = (window.navigator.language || 'en').split('-')[0]
|
||||
|
||||
const defaultState = {
|
||||
name: 'Pleroma FE',
|
||||
colors: {},
|
||||
collapseMessageWithSubject: false,
|
||||
hideAttachments: false,
|
||||
|
@ -45,18 +44,12 @@ const config = {
|
|||
}
|
||||
},
|
||||
actions: {
|
||||
setPageTitle ({state}, option = '') {
|
||||
document.title = `${option} ${state.name}`
|
||||
},
|
||||
setHighlight ({ commit, dispatch }, { user, color, type }) {
|
||||
commit('setHighlight', {user, color, type})
|
||||
},
|
||||
setOption ({ commit, dispatch }, { name, value }) {
|
||||
commit('setOption', {name, value})
|
||||
switch (name) {
|
||||
case 'name':
|
||||
dispatch('setPageTitle')
|
||||
break
|
||||
case 'theme':
|
||||
StyleSetter.setPreset(value, commit)
|
||||
break
|
||||
|
|
58
src/modules/instance.js
Normal file
58
src/modules/instance.js
Normal file
|
@ -0,0 +1,58 @@
|
|||
import { set } from 'vue'
|
||||
|
||||
const defaultState = {
|
||||
// Stuff from static/config.json and apiConfig
|
||||
name: 'Pleroma FE',
|
||||
registrationOpen: true,
|
||||
textlimit: 5000,
|
||||
server: 'http://localhost:4040/',
|
||||
theme: 'pleroma-dark',
|
||||
background: 'img.png',
|
||||
logo: '/static/logo.png',
|
||||
logoMask: true,
|
||||
logoMargin: '.2em',
|
||||
redirectRootNoLogin: '/main/all',
|
||||
redirectRootLogin: '/main/friends',
|
||||
showInstanceSpecificPanel: false,
|
||||
scopeOptionsEnabled: true,
|
||||
formattingOptionsEnabled: false,
|
||||
collapseMessageWithSubject: false,
|
||||
disableChat: false,
|
||||
|
||||
// Nasty stuff
|
||||
pleromaBackend: true,
|
||||
emoji: [],
|
||||
customEmoji: [],
|
||||
|
||||
// Feature-set, apparently, not everything here is reported...
|
||||
mediaProxyAvailable: false,
|
||||
chatAvailable: false,
|
||||
gopherAvailable: false,
|
||||
suggestionsEnabled: false,
|
||||
suggestionsWeb: '',
|
||||
|
||||
// Html stuff
|
||||
instanceSpecificPanelContent: '',
|
||||
tos: ''
|
||||
}
|
||||
|
||||
const instance = {
|
||||
state: defaultState,
|
||||
mutations: {
|
||||
setInstanceOption (state, { name, value }) {
|
||||
set(state, name, value)
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setInstanceOption ({ commit, dispatch }, { name, value }) {
|
||||
commit('setInstanceOption', {name, value})
|
||||
switch (name) {
|
||||
case 'name':
|
||||
dispatch('setPageTitle')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default instance
|
36
src/modules/interface.js
Normal file
36
src/modules/interface.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
import { set, delete as del } from 'vue'
|
||||
|
||||
const defaultState = {
|
||||
settings: {
|
||||
currentSaveStateNotice: null,
|
||||
noticeClearTimeout: null
|
||||
}
|
||||
}
|
||||
|
||||
const interfaceMod = {
|
||||
state: defaultState,
|
||||
mutations: {
|
||||
settingsSaved (state, { success, error }) {
|
||||
if (success) {
|
||||
if (state.noticeClearTimeout) {
|
||||
clearTimeout(state.noticeClearTimeout)
|
||||
}
|
||||
set(state.settings, 'currentSaveStateNotice', { error: false, data: success })
|
||||
set(state.settings, 'noticeClearTimeout',
|
||||
setTimeout(() => del(state.settings, 'currentSaveStateNotice'), 2000))
|
||||
} else {
|
||||
set(state.settings, 'currentSaveStateNotice', { error: true, errorData: error })
|
||||
}
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
setPageTitle ({ rootState }, option = '') {
|
||||
document.title = `${option} ${rootState.instance.name}`
|
||||
},
|
||||
settingsSaved ({ commit, dispatch }, { success, error }) {
|
||||
commit('settingsSaved', { success, error })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default interfaceMod
|
Loading…
Add table
Reference in a new issue