aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rw-r--r--src/components/post_status_form/post_status_form.js23
-rw-r--r--src/components/post_status_form/post_status_form.vue35
-rw-r--r--src/i18n/messages.js172
-rw-r--r--src/main.js3
-rw-r--r--src/services/api/api.service.js4
-rw-r--r--src/services/status_poster/status_poster.service.js4
-rw-r--r--static/config.json3
8 files changed, 232 insertions, 16 deletions
diff --git a/README.md b/README.md
index 2174335a..5a3e2a4b 100644
--- a/README.md
+++ b/README.md
@@ -29,4 +29,6 @@ npm run build
npm run unit
```
-For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
+# Configuration
+
+Edit config.json for configuration. scopeOptionsEnabled gives you input fields for CWs and the scope settings.
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index e6742580..0597d652 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -48,12 +48,21 @@ const PostStatusForm = {
highlighted: 0,
newStatus: {
status: statusText,
- files: []
+ files: [],
+ visibility: 'public'
},
caret: 0
}
},
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 === '@') {
@@ -118,6 +127,9 @@ const PostStatusForm = {
},
isOverLengthLimit () {
return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit)
+ },
+ scopeOptionsEnabled () {
+ return this.$store.state.config.scopeOptionsEnabled
}
},
methods: {
@@ -185,6 +197,8 @@ const PostStatusForm = {
this.posting = true
statusPoster.postStatus({
status: newStatus.status,
+ spoilerText: newStatus.spoilerText || null,
+ visibility: newStatus.visibility,
media: newStatus.files,
store: this.$store,
inReplyToStatusId: this.replyTo
@@ -192,7 +206,8 @@ const PostStatusForm = {
if (!data.error) {
this.newStatus = {
status: '',
- files: []
+ files: [],
+ visibility: newStatus.visibility
}
this.$emit('posted')
let el = this.$el.querySelector('textarea')
@@ -239,6 +254,7 @@ const PostStatusForm = {
e.dataTransfer.dropEffect = 'copy'
},
resize (e) {
+ if (!e.target) { return }
const vertPadding = Number(window.getComputedStyle(e.target)['padding-top'].substr(0, 1)) +
Number(window.getComputedStyle(e.target)['padding-bottom'].substr(0, 1))
e.target.style.height = 'auto'
@@ -249,6 +265,9 @@ const PostStatusForm = {
},
clearError () {
this.error = null
+ },
+ changeVis (visibility) {
+ this.newStatus.visibility = visibility
}
}
}
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 28dd227e..802d51ed 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -2,6 +2,12 @@
<div class="post-status-form">
<form @submit.prevent="postStatus(newStatus)">
<div class="form-group" >
+ <input
+ v-if="scopeOptionsEnabled"
+ type="text"
+ :placeholder="$t('post_status.content_warning')"
+ v-model="newStatus.spoilerText"
+ class="form-cw">
<textarea
ref="textarea"
@click="setCaret"
@@ -18,6 +24,12 @@
@input="resize"
@paste="paste">
</textarea>
+ <div v-if="scopeOptionsEnabled" class="visibility-tray">
+ <i v-on:click="changeVis('direct')" class="icon-mail-alt" :class="vis.direct"></i>
+ <i v-on:click="changeVis('private')" class="icon-lock" :class="vis.private"></i>
+ <i v-on:click="changeVis('unlisted')" class="icon-lock-open-alt" :class="vis.unlisted"></i>
+ <i v-on:click="changeVis('public')" class="icon-globe" :class="vis.public"></i>
+ </div>
</div>
<div style="position:relative;" v-if="candidates">
<div class="autocomplete-panel">
@@ -79,6 +91,17 @@
}
}
+.post-status-form .visibility-tray {
+ font-size: 1.2em;
+ padding: 3px;
+ cursor: pointer;
+
+ .selected {
+ color: $fallback--lightFg;
+ color: var(--lightFg, $fallback--lightFg);
+ }
+}
+
.post-status-form, .login {
.form-bottom {
display: flex;
@@ -143,7 +166,15 @@
line-height:24px;
}
- form textarea {
+ form textarea.form-cw {
+ line-height:16px;
+ resize: none;
+ overflow: hidden;
+ transition: min-height 200ms 100ms;
+ min-height: 1px;
+ }
+
+ form textarea.form-control {
line-height:16px;
resize: none;
overflow: hidden;
@@ -152,7 +183,7 @@
box-sizing: content-box;
}
- form textarea:focus {
+ form textarea.form-control:focus {
min-height: 48px;
}
diff --git a/src/i18n/messages.js b/src/i18n/messages.js
index 8ff79790..c178ab44 100644
--- a/src/i18n/messages.js
+++ b/src/i18n/messages.js
@@ -330,6 +330,7 @@ const en = {
},
post_status: {
posting: 'Posting',
+ content_warning: 'Content warning (optional)',
default: 'Just landed in L.A.'
},
finder: {
@@ -898,10 +899,13 @@ const fr = {
text: 'Texte',
links: 'Liens',
streaming: 'Charger automatiquement les nouveaux statuts lorsque vous êtes au haut de la page',
- follow_import: 'Importer ses abonnements',
- import_followers_from_a_csv_file: 'Importer ses abonnements depuis un fichier csv',
+ follow_import: 'Importer des abonnements',
+ import_followers_from_a_csv_file: 'Importer des abonnements depuis un fichier csv',
follows_imported: 'Abonnements importés ! Le traitement peut prendre un moment.',
follow_import_error: 'Erreur lors de l\'importation des abonnements.',
+ follow_export: 'Exporter les abonnements',
+ follow_export_button: 'Exporter les abonnements en csv',
+ follow_export_processing: 'Exportation en cours...',
cBlue: 'Bleu (Répondre, suivre)',
cRed: 'Rouge (Annuler)',
cOrange: 'Orange (Aimer)',
@@ -914,7 +918,15 @@ const fr = {
tooltipRadius: 'Info-bulles/alertes ',
attachmentRadius: 'Pièces jointes',
radii_help: 'Vous pouvez ici choisir le niveau d\'arrondi des angles de l\'interface (en pixels)',
- stop_gifs: 'N\'animer les GIFS que lors du survol du curseur de la souris'
+ stop_gifs: 'N\'animer les GIFS que lors du survol du curseur de la souris',
+ change_password: 'Modifier son mot de passe',
+ current_password: 'Mot de passe actuel',
+ new_password: 'Nouveau mot de passe',
+ confirm_new_password: 'Confirmation du nouveau mot de passe',
+ delete_account: 'Supprimer le compte',
+ delete_account_description: 'Supprimer définitivement votre compte et tous vos statuts.',
+ delete_account_instructions: 'Indiquez votre mot de passe ci-dessous pour confirmer la suppression de votre compte.',
+ delete_account_error: 'Il y a eu un problème lors de la tentative de suppression de votre compte. Si le problème persiste, contactez l\'administrateur de cette instance.'
},
notifications: {
notifications: 'Notifications',
@@ -1195,13 +1207,14 @@ const pl = {
cOrange: 'Pomarańczowy (ulubione)',
cGreen: 'Zielony (powtórzenia)',
btnRadius: 'Przyciski',
+ inputRadius: 'Pola tekstowe',
panelRadius: 'Panele',
avatarRadius: 'Awatary',
avatarAltRadius: 'Awatary (powiadomienia)',
tooltipRadius: 'Etykiety/alerty',
attachmentRadius: 'Załączniki',
filtering: 'Filtrowanie',
- filtering_explanation: 'Wszystkie statusy zawierające te słowa będą wyciszone. Jedno słowo na linijkę',
+ filtering_explanation: 'Wszystkie statusy zawierające te słowa będą wyciszone. Jedno słowo na linijkę.',
attachments: 'Załączniki',
hide_attachments_in_tl: 'Ukryj załączniki w osi czasu',
hide_attachments_in_convo: 'Ukryj załączniki w rozmowach',
@@ -1213,7 +1226,20 @@ const pl = {
follow_import: 'Import obserwowanych',
import_followers_from_a_csv_file: 'Importuj obserwowanych z pliku CSV',
follows_imported: 'Obserwowani zaimportowani! Przetwarzanie może trochę potrwać.',
- follow_import_error: 'Błąd przy importowaniu obserwowanych'
+ follow_import_error: 'Błąd przy importowaniu obserwowanych',
+ delete_account: 'Usuń konto',
+ delete_account_description: 'Trwale usuń konto i wszystkie posty.',
+ delete_account_instructions: 'Wprowadź swoje hasło w poniższe pole aby potwierdzić usunięcie konta.',
+ delete_account_error: 'Wystąpił problem z usuwaniem twojego konta. Jeżeli problem powtarza się, poinformuj administratora swojej instancji.',
+ follow_export: 'Eksport obserwowanych',
+ follow_export_processing: 'Przetwarzanie, wkrótce twój plik zacznie się ściągać.',
+ follow_export_button: 'Eksportuj swoją listę obserwowanych do pliku CSV',
+ change_password: 'Zmień hasło',
+ current_password: 'Obecne hasło',
+ new_password: 'Nowe hasło',
+ confirm_new_password: 'Potwierdź nowe hasło',
+ changed_password: 'Hasło zmienione poprawnie!',
+ change_password_error: 'Podczas zmiany hasła wystąpił problem.'
},
notifications: {
notifications: 'Powiadomienia',
@@ -1696,6 +1722,139 @@ const nb = {
}
}
+const he = {
+ 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: 'חזר'
+ },
+ settings: {
+ 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: 'תמה',
+ presets: 'ערכים קבועים מראש',
+ theme_help: 'השתמש בקודי צבע הקס (#אדום-אדום-ירוק-ירוק-כחול-כחול) על מנת להתאים אישית את תמת הצבע שלך.',
+ 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: 'החבא צירופים בשיחות',
+ nsfw_clickthrough: 'החל החבאת צירופים לא בטוחים לצפיה בעת עבודה בעזרת לחיצת עכבר',
+ stop_gifs: 'נגן-בעת-ריחוף GIFs',
+ autoload: 'החל טעינה אוטומטית בגלילה לתחתית הדף',
+ streaming: 'החל זרימת הודעות אוטומטית בעת גלילה למעלה הדף',
+ reply_link_preview: 'החל תצוגה מקדימה של לינק-תגובה בעת ריחוף עם העכבר',
+ 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: 'הייתה בעיה בשינוי סיסמתך.'
+ },
+ notifications: {
+ notifications: 'התראות',
+ read: 'קרא!',
+ followed_you: 'עקב אחריך!',
+ favorited_you: 'אהב את הסטטוס שלך',
+ repeated_you: 'חזר על הסטטוס שלך'
+ },
+ login: {
+ login: 'התחבר',
+ username: 'שם המשתמש',
+ password: 'סיסמה',
+ register: 'הירשם',
+ logout: 'התנתק'
+ },
+ registration: {
+ registration: 'הרשמה',
+ fullname: 'שם תצוגה',
+ email: 'אימייל',
+ bio: 'אודות',
+ password_confirm: 'אישור סיסמה'
+ },
+ post_status: {
+ posting: 'מפרסם',
+ default: 'הרגע נחת ב-ל.א.'
+ },
+ finder: {
+ find_user: 'מציאת משתמש',
+ error_fetching_user: 'שגיאה במציאת משתמש'
+ },
+ general: {
+ submit: 'שלח',
+ apply: 'החל'
+ },
+ user_profile: {
+ timeline_title: 'ציר זמן המשתמש'
+ }
+}
+
const messages = {
de,
fi,
@@ -1712,7 +1871,8 @@ const messages = {
es,
pt,
ru,
- nb
+ nb,
+ he
}
export default messages
diff --git a/src/main.js b/src/main.js
index 3c4a072b..0c964dcc 100644
--- a/src/main.js
+++ b/src/main.js
@@ -88,7 +88,7 @@ window.fetch('/api/statusnet/config.json')
window.fetch('/static/config.json')
.then((res) => res.json())
.then((data) => {
- const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel} = data
+ const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled} = data
store.dispatch('setOption', { name: 'theme', value: theme })
store.dispatch('setOption', { name: 'background', value: background })
store.dispatch('setOption', { name: 'logo', value: logo })
@@ -96,6 +96,7 @@ window.fetch('/static/config.json')
store.dispatch('setOption', { name: 'whoToFollowProvider', value: whoToFollowProvider })
store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink })
store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel })
+ store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled })
if (data['chatDisabled']) {
store.dispatch('disableChat')
}
diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js
index 65761aee..0d91851b 100644
--- a/src/services/api/api.service.js
+++ b/src/services/api/api.service.js
@@ -331,12 +331,14 @@ const retweet = ({ id, credentials }) => {
})
}
-const postStatus = ({credentials, status, mediaIds, inReplyToStatusId}) => {
+const postStatus = ({credentials, status, spoilerText, visibility, mediaIds, inReplyToStatusId}) => {
const idsText = mediaIds.join(',')
const form = new FormData()
form.append('status', status)
form.append('source', 'Pleroma FE')
+ if (spoilerText) form.append('spoiler_text', spoilerText)
+ if (visibility) form.append('visibility', visibility)
form.append('media_ids', idsText)
if (inReplyToStatusId) {
form.append('in_reply_to_status_id', inReplyToStatusId)
diff --git a/src/services/status_poster/status_poster.service.js b/src/services/status_poster/status_poster.service.js
index 001ff8a5..3381e9e2 100644
--- a/src/services/status_poster/status_poster.service.js
+++ b/src/services/status_poster/status_poster.service.js
@@ -1,10 +1,10 @@
import { map } from 'lodash'
import apiService from '../api/api.service.js'
-const postStatus = ({ store, status, media = [], inReplyToStatusId = undefined }) => {
+const postStatus = ({ store, status, spoilerText, visibility, media = [], inReplyToStatusId = undefined }) => {
const mediaIds = map(media, 'id')
- return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, mediaIds, inReplyToStatusId})
+ return apiService.postStatus({credentials: store.state.users.currentUser.credentials, status, spoilerText, visibility, mediaIds, inReplyToStatusId})
.then((data) => data.json())
.then((data) => {
if (!data.error) {
diff --git a/static/config.json b/static/config.json
index 9cdb22d5..4dacfebe 100644
--- a/static/config.json
+++ b/static/config.json
@@ -10,5 +10,6 @@
"whoToFollowProviderDummy2": "https://followlink.osa-p.net/api/get_recommend.json?acct=@{{user}}@{{host}}",
"whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}",
"whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html",
- "showInstanceSpecificPanel": false
+ "showInstanceSpecificPanel": false,
+ "scopeOptionsEnabled": false
}