diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index e99d676e..b6db0554 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -55,6 +55,14 @@ const pxStringToNumber = (str) => {
const PostStatusForm = {
props: [
+ 'statusId',
+ 'statusText',
+ 'statusIsSensitive',
+ 'statusPoll',
+ 'statusFiles',
+ 'statusMediaDescriptions',
+ 'statusScope',
+ 'statusContentType',
'replyTo',
'quoteId',
'repliedUser',
@@ -63,6 +71,7 @@ const PostStatusForm = {
'subject',
'disableSubject',
'disableScopeSelector',
+ 'disableVisibilitySelector',
'disableNotice',
'disableLockWarning',
'disablePolls',
@@ -120,23 +129,40 @@ const PostStatusForm = {
const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject } = this.$store.getters.mergedConfig
+ let statusParams = {
+ spoilerText: this.subject || '',
+ status: statusText,
+ sensitiveByDefault,
+ nsfw: !!sensitiveByDefault,
+ files: [],
+ poll: {},
+ mediaDescriptions: {},
+ visibility: this.suggestedVisibility(),
+ contentType
+ }
+
+ if (this.statusId) {
+ const statusContentType = this.statusContentType || contentType
+ statusParams = {
+ spoilerText: this.subject || '',
+ status: this.statusText || '',
+ sensitiveIfSubject,
+ nsfw: this.statusIsSensitive || !!sensitiveByDefault,
+ files: this.statusFiles || [],
+ poll: this.statusPoll || {},
+ mediaDescriptions: this.statusMediaDescriptions || {},
+ visibility: this.statusScope || this.suggestedVisibility(),
+ contentType: statusContentType
+ }
+ }
+
return {
dropFiles: [],
uploadingFiles: false,
error: null,
posting: false,
highlighted: 0,
- newStatus: {
- spoilerText: this.subject || '',
- status: statusText,
- sensitiveIfSubject,
- nsfw: !!sensitiveByDefault,
- files: [],
- poll: {},
- mediaDescriptions: {},
- visibility: this.suggestedVisibility(),
- contentType
- },
+ newStatus: statusParams,
caret: 0,
pollFormVisible: false,
showDropIcon: 'hide',
@@ -232,6 +258,9 @@ const PostStatusForm = {
uploadFileLimitReached () {
return this.newStatus.files.length >= this.fileLimit
},
+ isEdit () {
+ return typeof this.statusId !== 'undefined' && this.statusId.trim() !== ''
+ },
...mapGetters(['mergedConfig']),
...mapState({
mobileLayout: state => state.interface.mobileLayout
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index a1368fa7..b6a29d86 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -66,6 +66,13 @@
{{ $t('post_status.direct_warning_to_first_only') }}
{{ $t('post_status.direct_warning_to_all') }}
+
+
{{ $t('post_status.edit_remote_warning') }}
+
{{ $t('post_status.edit_unsupported_warning') }}
+
:first-child {
+ margin-top: 0;
+ }
+
+ > :last-child {
+ margin-bottom: 0;
+ }
+ }
+
.media-upload-icon, .poll-icon, .emoji-icon {
font-size: 1.85em;
line-height: 1.1;
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index 981da55b..9fe47eaf 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -43,6 +43,11 @@ const GeneralTab = {
value: mode,
label: this.$t(`settings.third_column_mode_${mode}`)
})),
+ userProfileDefaultTabOptions: ['statuses', 'replies'].map(tab => ({
+ key: tab,
+ value: tab,
+ label: this.$t(`user_card.${tab}`)
+ })),
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
@@ -50,6 +55,7 @@ const GeneralTab = {
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
// Future spec, still not supported in Nightly 63 as of 08/2018
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks')
+
}
},
components: {
@@ -82,11 +88,23 @@ const GeneralTab = {
this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
}
},
+ translationLanguages () {
+ return (this.$store.getters.mergedConfig.supportedTranslationLanguages.target || []).map(lang => ({ key: lang.code, value: lang.code, label: lang.name }))
+ },
+ translationLanguage: {
+ get: function () { return this.$store.getters.mergedConfig.translationLanguage },
+ set: function (val) {
+ this.$store.dispatch('setOption', { name: 'translationLanguage', value: val })
+ }
+ },
...SharedComputedObject()
},
methods: {
changeDefaultScope (value) {
this.$store.dispatch('setServerSideOption', { name: 'defaultScope', value })
+ },
+ setTranslationLanguage (value) {
+ this.$store.dispatch('setOption', { name: 'translationLanguage', value })
}
}
}
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index bb738f43..09d479e4 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -129,41 +129,7 @@
{{ $t('settings.virtual_scrolling') }}
-
-
- {{ $t('settings.disable_sticky_headers') }}
-
-
-
-
- {{ $t('settings.show_scrollbars') }}
-
-
-
-
- {{ $t('settings.third_column_mode') }}
-
-
-
-
- {{ $t('settings.minimal_scopes_mode') }}
-
-
-
-
- {{ $t('settings.sensitive_by_default') }}
-
-
-
-
- {{ $t('settings.sensitive_if_subject') }}
-
-
+
{{ $t('settings.render_mfm') }}
@@ -181,6 +147,25 @@
+
+
+ {{ $t('settings.user_profile_default_tab') }}
+
+
+
+
+ {{ $t('settings.translation_language') }}
+
+
+
+
+ {{ $t('settings.minimal_scopes_mode') }}
+
+
{{ $t('settings.sensitive_by_default') }}
+
+
+ {{ $t('settings.sensitive_if_subject') }}
+
+
+
+
+
+
+
+
+
fileType.fileType(file.mimetype))
},
+ translationLanguages () {
+ return (this.$store.getters.mergedConfig.supportedTranslationLanguages.source || []).map(lang => ({ key: lang.code, value: lang.code, label: lang.name }))
+ },
...mapGetters(['mergedConfig'])
},
components: {
- RichContent
+ RichContent,
+ Select
},
mounted () {
this.status.attentions && this.status.attentions.forEach(attn => {
@@ -126,6 +132,10 @@ const StatusContent = {
},
generateTagLink (tag) {
return `/tag/${tag}`
+ },
+ translateStatus () {
+ const translateTo = this.$store.getters.mergedConfig.translationLanguage || this.$store.state.instance.interfaceLanguage
+ this.$store.dispatch('translateStatus', { id: this.status.id, language: translateTo, from: this.translateFrom })
}
}
}
diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss
index 0f946f79..230a27ac 100644
--- a/src/components/status_body/status_body.scss
+++ b/src/components/status_body/status_body.scss
@@ -4,6 +4,12 @@
display: flex;
flex-direction: column;
+ .translation {
+ border: 1px solid var(--accent, $fallback--link);
+ border-radius: var(--panelRadius, $fallback--panelRadius);
+ margin-top: 1em;
+ padding: 0.5em;
+ }
.emoji {
--_still_image-label-scale: 0.5;
--emoji-size: 38px;
diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue
index 321f3c4b..509aa856 100644
--- a/src/components/status_body/status_body.vue
+++ b/src/components/status_body/status_body.vue
@@ -56,6 +56,44 @@
:attentions="status.attentions"
@parseReady="onParseReady"
/>
+
+
{{ $t(`languages.translated_from.${status.translation.detected_language.toLowerCase()}`) }}
+
+
+
+ {{ ' ' }}
+
+ {{ ' ' }}
+
+
+