Merge remote-tracking branch 'upstream/develop' into tusooa/stylelint
This commit is contained in:
commit
d2ba67d565
@ -36,6 +36,7 @@ library.add(
|
|||||||
const Attachment = {
|
const Attachment = {
|
||||||
props: [
|
props: [
|
||||||
'attachment',
|
'attachment',
|
||||||
|
'compact',
|
||||||
'description',
|
'description',
|
||||||
'hideDescription',
|
'hideDescription',
|
||||||
'nsfw',
|
'nsfw',
|
||||||
@ -71,7 +72,8 @@ const Attachment = {
|
|||||||
{
|
{
|
||||||
'-loading': this.loading,
|
'-loading': this.loading,
|
||||||
'-nsfw-placeholder': this.hidden,
|
'-nsfw-placeholder': this.hidden,
|
||||||
'-editable': this.edit !== undefined
|
'-editable': this.edit !== undefined,
|
||||||
|
'-compact': this.compact
|
||||||
},
|
},
|
||||||
'-type-' + this.type,
|
'-type-' + this.type,
|
||||||
this.size && '-size-' + this.size,
|
this.size && '-size-' + this.size,
|
||||||
|
@ -266,4 +266,10 @@
|
|||||||
&.-loading {
|
&.-loading {
|
||||||
cursor: progress;
|
cursor: progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.-compact {
|
||||||
|
.placeholder-container {
|
||||||
|
padding-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,10 +162,11 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
size="5x"
|
:size="compact ? '2x' : '5x'"
|
||||||
:icon="placeholderIconClass"
|
:icon="placeholderIconClass"
|
||||||
|
:title="localDescription"
|
||||||
/>
|
/>
|
||||||
<p>
|
<p v-if="!compact">
|
||||||
{{ localDescription }}
|
{{ localDescription }}
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
class="button-unstyled nav-icon"
|
class="button-unstyled nav-icon"
|
||||||
@click="openSettingsModal"
|
@click.stop="openSettingsModal"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
fixed-width
|
fixed-width
|
||||||
@ -65,7 +65,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="currentUser"
|
v-if="currentUser"
|
||||||
class="button-unstyled nav-icon"
|
class="button-unstyled nav-icon"
|
||||||
@click.prevent="logout"
|
@click.stop.prevent="logout"
|
||||||
>
|
>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
fixed-width
|
fixed-width
|
||||||
|
@ -244,7 +244,7 @@ const EmojiPicker = {
|
|||||||
if (!this.$refs['emoji-groups']) {
|
if (!this.$refs['emoji-groups']) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.width = this.$refs['emoji-groups'].$el.offsetWidth
|
this.width = this.$refs['emoji-groups'].$el.clientWidth
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,7 @@ $emoji-picker-emoji-size: 32px;
|
|||||||
|
|
||||||
.emoji-picker {
|
.emoji-picker {
|
||||||
width: 25em;
|
width: 25em;
|
||||||
max-width: 100vw;
|
max-width: calc(100vw - 20px); // popover gives 10px margin from window edge
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: $fallback--bg;
|
background-color: $fallback--bg;
|
||||||
|
@ -83,6 +83,7 @@
|
|||||||
:emit-update="true"
|
:emit-update="true"
|
||||||
@update="onScroll"
|
@update="onScroll"
|
||||||
@visible="recalculateItemPerRow"
|
@visible="recalculateItemPerRow"
|
||||||
|
@resize="recalculateItemPerRow"
|
||||||
>
|
>
|
||||||
<template #default="{ item: group, index, active }">
|
<template #default="{ item: group, index, active }">
|
||||||
<DynamicScrollerItem
|
<DynamicScrollerItem
|
||||||
|
@ -4,6 +4,7 @@ import { sumBy, set } from 'lodash'
|
|||||||
const Gallery = {
|
const Gallery = {
|
||||||
props: [
|
props: [
|
||||||
'attachments',
|
'attachments',
|
||||||
|
'compact',
|
||||||
'limitRows',
|
'limitRows',
|
||||||
'descriptions',
|
'descriptions',
|
||||||
'limit',
|
'limit',
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
v-for="(attachment, attachmentIndex) in row.items"
|
v-for="(attachment, attachmentIndex) in row.items"
|
||||||
:key="attachment.id"
|
:key="attachment.id"
|
||||||
class="gallery-item"
|
class="gallery-item"
|
||||||
|
:compact="compact"
|
||||||
:nsfw="nsfw"
|
:nsfw="nsfw"
|
||||||
:attachment="attachment"
|
:attachment="attachment"
|
||||||
:size="size"
|
:size="size"
|
||||||
|
@ -63,6 +63,11 @@ const MediaModal = {
|
|||||||
},
|
},
|
||||||
type () {
|
type () {
|
||||||
return this.currentMedia ? this.getType(this.currentMedia) : null
|
return this.currentMedia ? this.getType(this.currentMedia) : null
|
||||||
|
},
|
||||||
|
swipeDisableClickThreshold () {
|
||||||
|
// If there is only one media, allow more mouse movements to close the modal
|
||||||
|
// because there is less chance that the user wants to switch to another image
|
||||||
|
return () => this.canNavigate ? 1 : 30
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
class="modal-image-container"
|
class="modal-image-container"
|
||||||
:direction="swipeDirection"
|
:direction="swipeDirection"
|
||||||
:threshold="swipeThreshold"
|
:threshold="swipeThreshold"
|
||||||
|
:disable-click-threshold="swipeDisableClickThreshold"
|
||||||
@preview-requested="handleSwipePreview"
|
@preview-requested="handleSwipePreview"
|
||||||
@swipe-finished="handleSwipeEnd"
|
@swipe-finished="handleSwipeEnd"
|
||||||
@swipeless-clicked="hide"
|
@swipeless-clicked="hide"
|
||||||
|
@ -41,7 +41,7 @@ const ReactButton = {
|
|||||||
},
|
},
|
||||||
focusInput () {
|
focusInput () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const input = this.$el.querySelector('input')
|
const input = document.querySelector('.reaction-picker-filter > input')
|
||||||
if (input) input.focus()
|
if (input) input.focus()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { filter, trim } from 'lodash'
|
import { filter, trim, debounce } from 'lodash'
|
||||||
import BooleanSetting from '../helpers/boolean_setting.vue'
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
||||||
import ChoiceSetting from '../helpers/choice_setting.vue'
|
import ChoiceSetting from '../helpers/choice_setting.vue'
|
||||||
import IntegerSetting from '../helpers/integer_setting.vue'
|
import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
@ -29,11 +29,16 @@ const FilteringTab = {
|
|||||||
},
|
},
|
||||||
set (value) {
|
set (value) {
|
||||||
this.muteWordsStringLocal = value
|
this.muteWordsStringLocal = value
|
||||||
|
this.debouncedSetMuteWords(value)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
debouncedSetMuteWords () {
|
||||||
|
return debounce((value) => {
|
||||||
this.$store.dispatch('setOption', {
|
this.$store.dispatch('setOption', {
|
||||||
name: 'muteWords',
|
name: 'muteWords',
|
||||||
value: filter(value.split('\n'), (word) => trim(word).length > 0)
|
value: filter(value.split('\n'), (word) => trim(word).length > 0)
|
||||||
})
|
})
|
||||||
}
|
}, 1000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Updating nested properties
|
// Updating nested properties
|
||||||
|
@ -153,7 +153,7 @@ const ProfileTab = {
|
|||||||
return false
|
return false
|
||||||
},
|
},
|
||||||
deleteField (index, event) {
|
deleteField (index, event) {
|
||||||
this.$delete(this.newFields, index)
|
this.newFields.splice(index, 1)
|
||||||
},
|
},
|
||||||
uploadFile (slot, e) {
|
uploadFile (slot, e) {
|
||||||
const file = e.target.files[0]
|
const file = e.target.files[0]
|
||||||
|
@ -84,7 +84,7 @@
|
|||||||
:user="statusoid.user"
|
:user="statusoid.user"
|
||||||
/>
|
/>
|
||||||
<div class="right-side faint">
|
<div class="right-side faint">
|
||||||
<span
|
<bdi
|
||||||
class="status-username repeater-name"
|
class="status-username repeater-name"
|
||||||
:title="retweeter"
|
:title="retweeter"
|
||||||
>
|
>
|
||||||
@ -101,7 +101,7 @@
|
|||||||
v-else
|
v-else
|
||||||
:to="retweeterProfileLink"
|
:to="retweeterProfileLink"
|
||||||
>{{ retweeter }}</router-link>
|
>{{ retweeter }}</router-link>
|
||||||
</span>
|
</bdi>
|
||||||
{{ ' ' }}
|
{{ ' ' }}
|
||||||
<FAIcon
|
<FAIcon
|
||||||
icon="retweet"
|
icon="retweet"
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
<gallery
|
<gallery
|
||||||
v-if="status.attachments.length !== 0"
|
v-if="status.attachments.length !== 0"
|
||||||
class="attachments media-body"
|
class="attachments media-body"
|
||||||
|
:compact="compact"
|
||||||
:nsfw="nsfwClickthrough"
|
:nsfw="nsfwClickthrough"
|
||||||
:attachments="status.attachments"
|
:attachments="status.attachments"
|
||||||
:limit="compact ? 1 : 0"
|
:limit="compact ? 1 : 0"
|
||||||
|
@ -5,6 +5,8 @@ import GestureService from '../../services/gesture_service/gesture_service'
|
|||||||
* direction: a vector that indicates the direction of the intended swipe
|
* direction: a vector that indicates the direction of the intended swipe
|
||||||
* threshold: the minimum distance in pixels the swipe has moved on `direction'
|
* threshold: the minimum distance in pixels the swipe has moved on `direction'
|
||||||
* for swipe-finished() to have a non-zero sign
|
* for swipe-finished() to have a non-zero sign
|
||||||
|
* disableClickThreshold: the minimum distance in pixels for the swipe to
|
||||||
|
* not trigger a click
|
||||||
* perpendicularTolerance: see gesture_service
|
* perpendicularTolerance: see gesture_service
|
||||||
*
|
*
|
||||||
* Events:
|
* Events:
|
||||||
@ -34,6 +36,10 @@ const SwipeClick = {
|
|||||||
type: Function,
|
type: Function,
|
||||||
default: () => 30
|
default: () => 30
|
||||||
},
|
},
|
||||||
|
disableClickThreshold: {
|
||||||
|
type: Function,
|
||||||
|
default: () => 1
|
||||||
|
},
|
||||||
perpendicularTolerance: {
|
perpendicularTolerance: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 1.0
|
default: 1.0
|
||||||
@ -72,6 +78,7 @@ const SwipeClick = {
|
|||||||
this.$gesture = new GestureService.SwipeAndClickGesture({
|
this.$gesture = new GestureService.SwipeAndClickGesture({
|
||||||
direction: this.direction,
|
direction: this.direction,
|
||||||
threshold: this.threshold,
|
threshold: this.threshold,
|
||||||
|
disableClickThreshold: this.disableClickThreshold,
|
||||||
perpendicularTolerance: this.perpendicularTolerance,
|
perpendicularTolerance: this.perpendicularTolerance,
|
||||||
swipePreviewCallback: this.preview,
|
swipePreviewCallback: this.preview,
|
||||||
swipeEndCallback: this.end,
|
swipeEndCallback: this.end,
|
||||||
|
@ -765,6 +765,7 @@ const statuses = {
|
|||||||
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
|
return store.rootState.api.backendInteractor.search2({ q, resolve, limit, offset, following, type })
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
store.commit('addNewUsers', data.accounts)
|
store.commit('addNewUsers', data.accounts)
|
||||||
|
store.commit('addNewUsers', data.statuses.map(s => s.user).filter(u => u))
|
||||||
store.commit('addNewStatuses', { statuses: data.statuses })
|
store.commit('addNewStatuses', { statuses: data.statuses })
|
||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
|
@ -734,26 +734,22 @@ const fetchTimeline = ({
|
|||||||
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
const queryString = map(params, (param) => `${param[0]}=${param[1]}`).join('&')
|
||||||
url += `?${queryString}`
|
url += `?${queryString}`
|
||||||
|
|
||||||
let status = ''
|
|
||||||
let statusText = ''
|
|
||||||
|
|
||||||
let pagination = {}
|
|
||||||
return fetch(url, { headers: authHeaders(credentials) })
|
return fetch(url, { headers: authHeaders(credentials) })
|
||||||
.then((data) => {
|
.then(async (response) => {
|
||||||
status = data.status
|
const success = response.ok
|
||||||
statusText = data.statusText
|
|
||||||
pagination = parseLinkHeaderPagination(data.headers.get('Link'), {
|
const data = await response.json()
|
||||||
flakeId: timeline !== 'bookmarks' && timeline !== 'notifications'
|
|
||||||
})
|
if (success && !data.errors) {
|
||||||
return data
|
const pagination = parseLinkHeaderPagination(response.headers.get('Link'), {
|
||||||
})
|
flakeId: timeline !== 'bookmarks' && timeline !== 'notifications'
|
||||||
.then((data) => data.json())
|
})
|
||||||
.then((data) => {
|
|
||||||
if (!data.errors) {
|
|
||||||
return { data: data.map(isNotifications ? parseNotification : parseStatus), pagination }
|
return { data: data.map(isNotifications ? parseNotification : parseStatus), pagination }
|
||||||
} else {
|
} else {
|
||||||
data.status = status
|
data.errors ||= []
|
||||||
data.statusText = statusText
|
data.status = response.status
|
||||||
|
data.statusText = response.statusText
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user