diff options
| -rw-r--r-- | build/dev-server.js | 9 | ||||
| -rw-r--r-- | src/components/emoji-input/emoji-input.js | 8 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 19 | ||||
| -rw-r--r-- | src/components/status/status.vue | 1 | ||||
| -rw-r--r-- | src/components/timeline/timeline.js | 2 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.js | 2 | ||||
| -rw-r--r-- | src/i18n/oc.json | 44 | ||||
| -rw-r--r-- | src/modules/statuses.js | 5 | ||||
| -rw-r--r-- | src/services/entity_normalizer/entity_normalizer.service.js | 3 | ||||
| -rw-r--r-- | src/services/version/version.service.js | 2 | ||||
| -rw-r--r-- | test/unit/specs/modules/statuses.spec.js | 4 | ||||
| -rw-r--r-- | test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js | 7 | ||||
| -rw-r--r-- | test/unit/specs/services/version/version.service.spec.js | 11 |
13 files changed, 88 insertions, 29 deletions
diff --git a/build/dev-server.js b/build/dev-server.js index 9c3d4e00..48574214 100644 --- a/build/dev-server.js +++ b/build/dev-server.js @@ -31,8 +31,13 @@ var hotMiddleware = require('webpack-hot-middleware')(compiler) // force page reload when html-webpack-plugin template changes compiler.plugin('compilation', function (compilation) { compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) { - hotMiddleware.publish({ action: 'reload' }) - cb() + // FIXME: This supposed to reload whole page when index.html is changed, + // however now it reloads entire page on every breath, i suppose the order + // of plugins changed or something. It's a minor thing and douesn't hurt + // disabling it, constant reloads hurt much more + + // hotMiddleware.publish({ action: 'reload' }) + // cb() }) }) diff --git a/src/components/emoji-input/emoji-input.js b/src/components/emoji-input/emoji-input.js index cd0247df..b09dc628 100644 --- a/src/components/emoji-input/emoji-input.js +++ b/src/components/emoji-input/emoji-input.js @@ -105,6 +105,7 @@ const EmojiInput = { input.elm.addEventListener('keyup', this.onKeyUp) input.elm.addEventListener('keydown', this.onKeyDown) input.elm.addEventListener('transitionend', this.onTransition) + input.elm.addEventListener('compositionupdate', this.onCompositionUpdate) }, unmounted () { const { input } = this @@ -115,6 +116,7 @@ const EmojiInput = { input.elm.removeEventListener('keyup', this.onKeyUp) input.elm.removeEventListener('keydown', this.onKeyDown) input.elm.removeEventListener('transitionend', this.onTransition) + input.elm.removeEventListener('compositionupdate', this.onCompositionUpdate) } }, methods: { @@ -225,6 +227,12 @@ const EmojiInput = { } }, onInput (e) { + this.setCaret(e) + this.$emit('input', e.target.value) + }, + onCompositionUpdate (e) { + this.setCaret(e) + this.resize() this.$emit('input', e.target.value) }, setCaret ({ target: { selectionStart } }) { diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 67cdc721..52d1b43c 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -74,6 +74,13 @@ </p> </EmojiInput> <div class="visibility-tray"> + <scope-selector + :showAll="showAllScopes" + :userDefault="userDefaultScope" + :originalScope="copyMessageScope" + :initialScope="newStatus.visibility" + :onScopeChange="changeVis"/> + <div class="text-format" v-if="postFormats.length > 1"> <label for="post-content-type" class="select"> <select id="post-content-type" v-model="newStatus.contentType" class="form-control"> @@ -84,18 +91,11 @@ <i class="icon-down-open"></i> </label> </div> - <div class="text-format" v-if="postFormats.length === 1"> + <div class="text-format" v-if="postFormats.length === 1 && postFormats[0] !== 'text/plain'"> <span class="only-format"> {{$t(`post_status.content_type["${postFormats[0]}"]`)}} </span> </div> - - <scope-selector - :showAll="showAllScopes" - :userDefault="userDefaultScope" - :originalScope="copyMessageScope" - :initialScope="newStatus.visibility" - :onScopeChange="changeVis"/> </div> </div> <poll-form @@ -170,7 +170,6 @@ .visibility-tray { display: flex; justify-content: space-between; - flex-direction: row-reverse; padding-top: 5px; } } @@ -217,7 +216,7 @@ .icon-chart-bar { cursor: pointer; } - + .error { text-align: center; diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 440e1957..b16d8694 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -453,6 +453,7 @@ $status-margin: 0.75em; .status-content { font-family: var(--postFont, sans-serif); line-height: 1.4em; + white-space: pre-wrap; img, video { max-width: 100%; diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js index 9dafcbd8..b1c7edf8 100644 --- a/src/components/timeline/timeline.js +++ b/src/components/timeline/timeline.js @@ -86,7 +86,7 @@ const Timeline = { if (this.newStatusCount === 0) return if (this.timeline.flushMarker !== 0) { - this.$store.commit('clearTimeline', { timeline: this.timelineName }) + this.$store.commit('clearTimeline', { timeline: this.timelineName, excludeUserId: true }) this.$store.commit('queueFlush', { timeline: this.timelineName, id: 0 }) this.fetchOlderStatuses() } else { diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index eab330e7..7eb4ed3a 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -31,6 +31,8 @@ const UserProfile = { } }, created () { + // Make sure that timelines used in this page are empty + this.cleanUp() const routeParams = this.$route.params this.load(routeParams.name || routeParams.id) }, diff --git a/src/i18n/oc.json b/src/i18n/oc.json index ec7f5740..6100a4d2 100644 --- a/src/i18n/oc.json +++ b/src/i18n/oc.json @@ -78,6 +78,20 @@ "repeated_you": "a repetit vòstre estatut", "no_more_notifications": "Pas mai de notificacions" }, + "polls": { +"add_poll": "Ajustar un sondatge", + "add_option": "Ajustar d’opcions", + "option": "Opcion", + "votes": "vòtes", + "vote": "Votar", + "type": "Tipe de sondatge", + "single_choice": "Causida unica", + "multiple_choices": "Causida multipla", + "expiry": "Durada del sondatge", + "expires_in": "Lo sondatge s’acabarà {0}", + "expired": "Sondatge acabat {0}", + "not_enough_options": "I a pas pro d’opcions" + }, "post_status": { "new_status": "Publicar d’estatuts novèls", "account_not_locked_warning": "Vòstre compte es pas {0}. Qual que siá pòt vos seguir per veire vòstras publicacions destinadas pas qu’a vòstres seguidors.", @@ -197,6 +211,7 @@ "loop_video": "Bocla vidèo", "loop_video_silent_only": "Legir en bocla solament las vidèos sens son (coma los « Gifs » de Mastodon)", "mutes_tab": "Agamats", + "interactions_tab": "Interaccions", "play_videos_in_modal": "Legir las vidèos dirèctament dins la visualizaira mèdia", "use_contain_fit": "Talhar pas las pèças juntas per las vinhetas", "name": "Nom", @@ -264,8 +279,15 @@ "false": "non", "true": "òc" }, - "notifications": "Notificacions", - "enable_web_push_notifications": "Activar las notificacions web push", + "notifications": "Notificacions", + "notification_setting": "Receber las notificacions de :", + "notification_setting_follows": "Utilizaires que seguissètz", + "notification_setting_non_follows": "Utilizaires que seguissètz pas", + "notification_setting_followers": "Utilizaires que vos seguisson", + "notification_setting_non_followers": "Utilizaires que vos seguisson pas", + "notification_mutes": "Per receber pas mai d’un utilizaire en particular, botatz-lo en silenci.", + "notification_blocks": "Blocar un utilizaire arrèsta totas las notificacions tan coma quitar de los seguir.", + "enable_web_push_notifications": "Activar las notificacions web push", "style": { "switcher": { "keep_color": "Gardar las colors", @@ -386,14 +408,14 @@ "days": "{0} jorns", "day_short": "{0} jorn", "days_short": "{0} jorns", - "hour": "{0} hour", - "hours": "{0} hours", + "hour": "{0} ora", + "hours": "{0} oras", "hour_short": "{0}h", "hours_short": "{0}h", - "in_future": "in {0}", + "in_future": "d’aquí {0}", "in_past": "fa {0}", - "minute": "{0} minute", - "minutes": "{0} minutes", + "minute": "{0} minuta", + "minutes": "{0} minutas", "minute_short": "{0}min", "minutes_short": "{0}min", "month": "{0} mes", @@ -402,12 +424,12 @@ "months_short": "{0} meses", "now": "ara meteis", "now_short": "ara meteis", - "second": "{0} second", - "seconds": "{0} seconds", + "second": "{0} segonda", + "seconds": "{0} segondas", "second_short": "{0}s", "seconds_short": "{0}s", - "week": "{0} setm.", - "weeks": "{0} setm.", + "week": "{0} setmana.", + "weeks": "{0} setmanas.", "week_short": "{0} setm.", "weeks_short": "{0} setm.", "year": "{0} an", diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 9b11a13e..e58a9b4c 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -395,8 +395,9 @@ export const mutations = { state[key] = value }) }, - clearTimeline (state, { timeline }) { - state.timelines[timeline] = emptyTl(state.timelines[timeline].userId) + clearTimeline (state, { timeline, excludeUserId = false }) { + const userId = excludeUserId ? state.timelines[timeline].userId : undefined + state.timelines[timeline] = emptyTl(userId) }, clearNotifications (state) { state.notifications = emptyNotifications() diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 9af71e4f..df6747a6 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -70,6 +70,9 @@ export const parseUser = (data) => { output.muted = relationship.muting } + output.hide_follows = data.pleroma.hide_follows + output.hide_followers = data.pleroma.hide_followers + output.rights = { moderator: data.pleroma.is_moderator, admin: data.pleroma.is_admin diff --git a/src/services/version/version.service.js b/src/services/version/version.service.js index a750b0dd..2e11bf3a 100644 --- a/src/services/version/version.service.js +++ b/src/services/version/version.service.js @@ -1,6 +1,6 @@ export const extractCommit = versionString => { - const regex = /-g(\w+)$/i + const regex = /-g(\w+)/i const matches = versionString.match(regex) return matches ? matches[1] : '' } diff --git a/test/unit/specs/modules/statuses.spec.js b/test/unit/specs/modules/statuses.spec.js index 0bbcb25a..e4661e2a 100644 --- a/test/unit/specs/modules/statuses.spec.js +++ b/test/unit/specs/modules/statuses.spec.js @@ -258,11 +258,11 @@ describe('Statuses module', () => { }) describe('clearTimeline', () => { - it('keeps userId when clearing user timeline', () => { + it('keeps userId when clearing user timeline when excludeUserId param is true', () => { const state = defaultState() state.timelines.user.userId = 123 - mutations.clearTimeline(state, { timeline: 'user' }) + mutations.clearTimeline(state, { timeline: 'user', excludeUserId: true }) expect(state.timelines.user.userId).to.eql(123) }) diff --git a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js index 3d34c5cc..b3491c61 100644 --- a/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js +++ b/test/unit/specs/services/entity_normalizer/entity_normalizer.spec.js @@ -282,6 +282,13 @@ describe('API Entities normalizer', () => { expect(parsedUser).to.have.property('description_html').that.contains('<img') }) + + it('adds hide_follows and hide_followers user settings', () => { + const user = makeMockUserMasto({ pleroma: { hide_followers: true, hide_follows: false } }) + + expect(parseUser(user)).to.have.property('hide_followers', true) + expect(parseUser(user)).to.have.property('hide_follows', false) + }) }) // We currently use QvitterAPI notifications only, and especially due to MastoAPI lacking is_seen, support for MastoAPI diff --git a/test/unit/specs/services/version/version.service.spec.js b/test/unit/specs/services/version/version.service.spec.js new file mode 100644 index 00000000..519145ee --- /dev/null +++ b/test/unit/specs/services/version/version.service.spec.js @@ -0,0 +1,11 @@ +import { extractCommit } from 'src/services/version/version.service.js' + +describe('extractCommit', () => { + it('return short commit hash following "-g" characters', () => { + expect(extractCommit('1.0.0-45-g5e7aeebc')).to.eql('5e7aeebc') + }) + + it('return short commit hash without branch name', () => { + expect(extractCommit('1.0.0-45-g5e7aeebc-branch')).to.eql('5e7aeebc') + }) +}) |
