Merge branch 'eslint-update' into 'develop'

update ESLint

See merge request pleroma/pleroma-fe!1576
This commit is contained in:
HJ 2022-08-01 11:46:57 +00:00
commit 8e7f3ea074
140 changed files with 990 additions and 901 deletions

View File

@ -1,7 +1,7 @@
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
@ -21,6 +21,7 @@ module.exports = {
'generator-star-spacing': 0,
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'vue/require-prop-types': 0
'vue/require-prop-types': 0,
'vue/multi-word-component-names': 0
}
}

View File

@ -5,6 +5,8 @@ var projectRoot = path.resolve(__dirname, '../')
var ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin')
var CopyPlugin = require('copy-webpack-plugin');
var { VueLoaderPlugin } = require('vue-loader')
var ESLintPlugin = require('eslint-webpack-plugin');
var env = process.env.NODE_ENV
// check env & config/index.js to decide weither to enable CSS Sourcemaps for the
@ -45,20 +47,6 @@ module.exports = {
module: {
noParse: /node_modules\/localforage\/dist\/localforage.js/,
rules: [
{
enforce: 'pre',
test: /\.(js|vue)$/,
include: projectRoot,
exclude: /node_modules/,
use: {
loader: 'eslint-loader',
options: {
formatter: require('eslint-friendly-formatter'),
sourceMap: config.build.productionSourceMap,
extract: true
}
}
},
{
enforce: 'post',
test: /\.(json5?|ya?ml)$/, // target json, json5, yaml and yml files
@ -120,6 +108,10 @@ module.exports = {
entry: path.join(__dirname, '..', 'src/sw.js'),
filename: 'sw-pleroma.js'
}),
new ESLintPlugin({
extensions: ['js', 'vue'],
formatter: require('eslint-formatter-friendly')
}),
new VueLoaderPlugin(),
// This copies Ruffle's WASM to a directory so that JS side can access it
new CopyPlugin({

View File

@ -50,6 +50,7 @@
"@babel/plugin-transform-runtime": "7.18.9",
"@babel/preset-env": "7.18.9",
"@babel/register": "7.18.9",
"@babel/eslint-parser": "7.18.9",
"@intlify/vue-i18n-loader": "^5.0.0",
"@ungap/event-target": "0.2.3",
"@vue/babel-helper-vue-jsx-merge-props": "1.2.1",
@ -57,7 +58,6 @@
"@vue/compiler-sfc": "3.2.37",
"@vue/test-utils": "2.0.2",
"autoprefixer": "6.7.7",
"babel-eslint": "7.2.3",
"babel-loader": "8.2.5",
"babel-plugin-lodash": "3.3.4",
"chai": "3.5.0",
@ -68,15 +68,14 @@
"cross-spawn": "4.0.2",
"css-loader": "0.28.11",
"custom-event-polyfill": "1.0.7",
"eslint": "5.16.0",
"eslint-config-standard": "12.0.0",
"eslint-friendly-formatter": "2.0.7",
"eslint-loader": "2.2.1",
"eslint": "8.20.0",
"eslint-config-standard": "17.0.0",
"eslint-formatter-friendly": "7.0.0",
"eslint-webpack-plugin": "2.7.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-node": "7.0.1",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-standard": "4.1.0",
"eslint-plugin-vue": "5.2.3",
"eslint-plugin-n": "15.2.4",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-vue": "9.3.0",
"eventsource-polyfill": "0.9.6",
"express": "4.18.1",
"file-loader": "3.0.1",

View File

@ -15,8 +15,12 @@
class="app-layout container"
:class="classes"
>
<div class="underlay"/>
<div id="sidebar" class="column -scrollable" :class="{ '-show-scrollbar': showScrollbars }">
<div class="underlay" />
<div
id="sidebar"
class="column -scrollable"
:class="{ '-show-scrollbar': showScrollbars }"
>
<user-panel />
<template v-if="layoutType !== 'mobile'">
<nav-panel />
@ -26,7 +30,11 @@
<div id="notifs-sidebar" />
</template>
</div>
<div id="main-scroller" class="column main" :class="{ '-full-height': isChats }">
<div
id="main-scroller"
class="column main"
:class="{ '-full-height': isChats }"
>
<div
v-if="!currentUser"
class="login-hint panel panel-default"
@ -40,7 +48,11 @@
</div>
<router-view />
</div>
<div id="notifs-column" class="column -scrollable" :class="{ '-show-scrollbar': showScrollbars }"/>
<div
id="notifs-column"
class="column -scrollable"
:class="{ '-show-scrollbar': showScrollbars }"
/>
</div>
<MediaModal />
<shout-panel

View File

@ -156,7 +156,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
copyInstanceOption('hideSitename')
copyInstanceOption('sidebarRight')
return store.dispatch('setTheme', config['theme'])
return store.dispatch('setTheme', config.theme)
}
const getTOS = async ({ store }) => {
@ -197,7 +197,7 @@ const getStickers = async ({ store }) => {
const stickers = (await Promise.all(
Object.entries(values).map(async ([name, path]) => {
const resPack = await window.fetch(path + 'pack.json')
var meta = {}
let meta = {}
if (resPack.ok) {
meta = await resPack.json()
}
@ -319,6 +319,7 @@ const setConfig = async ({ store }) => {
}
const checkOAuthToken = async ({ store }) => {
// eslint-disable-next-line no-async-promise-executor
return new Promise(async (resolve, reject) => {
if (store.getters.getUserToken()) {
try {

View File

@ -31,7 +31,8 @@ export default (store) => {
}
let routes = [
{ name: 'root',
{
name: 'root',
path: '/',
redirect: _to => {
return (store.state.users.currentUser
@ -45,12 +46,14 @@ export default (store) => {
{ name: 'tag-timeline', path: '/tag/:tag', component: TagTimeline },
{ name: 'bookmarks', path: '/bookmarks', component: BookmarkTimeline },
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
{ name: 'remote-user-profile-acct',
{
name: 'remote-user-profile-acct',
path: '/remote-users/:_(@)?:username([^/@]+)@:hostname([^/@]+)',
component: RemoteUserResolver,
beforeEnter: validateAuthenticatedRoute
},
{ name: 'remote-user-profile',
{
name: 'remote-user-profile',
path: '/remote-users/:hostname/:username',
component: RemoteUserResolver,
beforeEnter: validateAuthenticatedRoute

View File

@ -8,7 +8,7 @@
</div>
</template>
<script src="./about.js" ></script>
<script src="./about.js"></script>
<style lang="scss">
</style>

View File

@ -6,7 +6,7 @@
:bound-to="{ x: 'container' }"
remove-padding
>
<template v-slot:content>
<template #content>
<div class="dropdown-menu">
<template v-if="relationship.following">
<button
@ -57,7 +57,7 @@
</button>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<button class="button-unstyled ellipsis-button">
<FAIcon
class="icon"

View File

@ -14,7 +14,7 @@
</div>
</template>
<script src="./avatar_list.js" ></script>
<script src="./avatar_list.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -1,10 +1,13 @@
<template>
<div class="basic-user-card">
<router-link @click.prevent :to="userProfileLink(user)">
<router-link
:to="userProfileLink(user)"
@click.prevent
>
<UserPopover
:userId="user.id"
:overlayCenters="true"
overlayCentersSelector=".avatar"
:user-id="user.id"
:overlay-centers="true"
overlay-centers-selector=".avatar"
>
<UserAvatar
class="user-avatar avatar"

View File

@ -107,7 +107,7 @@ const Chat = {
}
})
},
'$route': function () {
$route: function () {
this.startFetching()
},
mastoUserSocketStatus (newValue) {

View File

@ -23,7 +23,7 @@
class="timeline"
>
<List :items="sortedChatList">
<template v-slot:item="{item}">
<template #item="{item}">
<ChatListItem
:key="item.id"
:compact="false"

View File

@ -16,7 +16,7 @@
>
<UserPopover
v-if="chatViewItem.isHead"
:userId="author.id"
:user-id="author.id"
>
<UserAvatar
:compact="true"
@ -50,7 +50,7 @@
@show="menuOpened = true"
@close="menuOpened = false"
>
<template v-slot:content>
<template #content>
<div class="dropdown-menu">
<button
class="button-default dropdown-item dropdown-item-icon"
@ -60,7 +60,7 @@
</button>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<button
class="button-default menu-icon"
:title="$t('chats.more')"
@ -75,7 +75,7 @@
:status="messageForStatusContent"
:full-content="true"
>
<template v-slot:footer>
<template #footer>
<span
class="created-at"
>
@ -96,7 +96,7 @@
</div>
</template>
<script src="./chat_message.js" ></script>
<script src="./chat_message.js"></script>
<style lang="scss">
@import './chat_message.scss';

View File

@ -4,9 +4,9 @@
:title="title"
>
<UserPopover
class="avatar-container"
v-if="withAvatar && user"
:userId="user.id"
class="avatar-container"
:user-id="user.id"
>
<UserAvatar
class="titlebar-avatar"

View File

@ -22,12 +22,12 @@
<script>
export default {
emits: ['update:modelValue'],
props: [
'modelValue',
'indeterminate',
'disabled'
]
],
emits: ['update:modelValue']
}
</script>

View File

@ -46,7 +46,6 @@
</div>
</div>
</template>
<style lang="scss" src="./color_input.scss"></style>
<script>
import Checkbox from '../checkbox/checkbox.vue'
import { hex2rgb } from '../../services/color_convert/color_convert.js'
@ -108,6 +107,7 @@ export default {
}
}
</script>
<style lang="scss" src="./color_input.scss"></style>
<style lang="scss">
.color-control {

View File

@ -271,7 +271,7 @@ const conversation = {
result[irid] = result[irid] || []
result[irid].push({
name: `#${i}`,
id: id
id
})
}
i++

View File

@ -31,8 +31,8 @@
keypath="status.show_all_conversation_with_icon"
tag="button"
class="button-unstyled -link"
@click.prevent="diveToTopLevel"
scope="global"
@click.prevent="diveToTopLevel"
>
<template #icon>
<FAIcon

View File

@ -46,21 +46,25 @@ export default {
enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },
logoStyle () {
return {
'visibility': this.enableMask ? 'hidden' : 'visible'
visibility: this.enableMask ? 'hidden' : 'visible'
}
},
logoMaskStyle () {
return this.enableMask ? {
return this.enableMask
? {
'mask-image': `url(${this.$store.state.instance.logo})`
} : {
}
: {
'background-color': this.enableMask ? '' : 'transparent'
}
},
logoBgStyle () {
return Object.assign({
'margin': `${this.$store.state.instance.logoMargin} 0`,
margin: `${this.$store.state.instance.logoMargin} 0`,
opacity: this.searchBarHidden ? 1 : 0
}, this.enableMask ? {} : {
}, this.enableMask
? {}
: {
'background-color': this.enableMask ? '' : 'transparent'
})
},

View File

@ -9,7 +9,7 @@
class="btn button-default"
>
{{ $t('domain_mute_card.unmute') }}
<template v-slot:progress>
<template #progress>
{{ $t('domain_mute_card.unmute_progress') }}
</template>
</ProgressButton>
@ -19,7 +19,7 @@
class="btn button-default"
>
{{ $t('domain_mute_card.mute') }}
<template v-slot:progress>
<template #progress>
{{ $t('domain_mute_card.mute_progress') }}
</template>
</ProgressButton>

View File

@ -321,7 +321,7 @@ const EmojiInput = {
}
},
scrollIntoView () {
const rootRef = this.$refs['picker'].$el
const rootRef = this.$refs.picker.$el
/* Scroller is either `window` (replies in TL), sidebar (main post form,
* replies in notifs) or mobile post form. Note that getting and setting
* scroll is different for `Window` and `Element`s

View File

@ -25,7 +25,7 @@ const filterByKeyword = (list, keyword = '') => {
if (keyword === '') return list
const keywordLowercase = keyword.toLowerCase()
let orderedEmojiList = []
const orderedEmojiList = []
for (const emoji of list) {
const indexOfKeyword = emoji.displayText.toLowerCase().indexOf(keywordLowercase)
if (indexOfKeyword > -1) {

View File

@ -26,7 +26,7 @@
</div>
</template>
<script src="./emoji_reactions.js" ></script>
<script src="./emoji_reactions.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -25,7 +25,7 @@ library.add(
)
const ExtraButtons = {
props: [ 'status' ],
props: ['status'],
components: { Popover },
methods: {
deleteStatus () {

View File

@ -7,7 +7,7 @@
:bound-to="{ x: 'container' }"
remove-padding
>
<template v-slot:content="{close}">
<template #content="{close}">
<div class="dropdown-menu">
<button
v-if="canMute && !status.thread_muted"
@ -120,7 +120,7 @@
</button>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<span class="button-unstyled popover-trigger">
<FAIcon
class="fa-scale-110 fa-old-padding"
@ -131,7 +131,7 @@
</Popover>
</template>
<script src="./extra_buttons.js" ></script>
<script src="./extra_buttons.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -29,7 +29,7 @@
</div>
</template>
<script src="./favorite_button.js" ></script>
<script src="./favorite_button.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -32,7 +32,7 @@
</div>
</template>
<script src="./features_panel.js" ></script>
<script src="./features_panel.js"></script>
<style lang="scss">
.features-panel li {

View File

@ -11,7 +11,7 @@ library.add(
)
const Flash = {
props: [ 'src' ],
props: ['src'],
data () {
return {
player: false, // can be true, "hidden", false. hidden = element exists

View File

@ -47,7 +47,7 @@
</div>
</template>
<script src="./font_control.js" ></script>
<script src="./font_control.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -14,6 +14,6 @@
</span>
</template>
<script src="./hashtag_link.js"/>
<script src="./hashtag_link.js" />
<style lang="scss" src="./hashtag_link.scss"/>
<style lang="scss" src="./hashtag_link.scss" />

View File

@ -95,7 +95,7 @@ const ImageCropper = {
const fileInput = this.$refs.input
if (fileInput.files != null && fileInput.files[0] != null) {
this.file = fileInput.files[0]
let reader = new window.FileReader()
const reader = new window.FileReader()
reader.onload = (e) => {
this.dataUrl = e.target.result
this.$emit('open')

View File

@ -10,4 +10,4 @@
</div>
</template>
<script src="./instance_specific_panel.js" ></script>
<script src="./instance_specific_panel.js"></script>

View File

@ -12,7 +12,7 @@ const Interactions = {
data () {
return {
allowFollowingMove: this.$store.state.users.currentUser.allow_following_move,
filterMode: tabModeDict['mentions']
filterMode: tabModeDict.mentions
}
},
methods: {

View File

@ -25,6 +25,7 @@ import Select from '../select/select.vue'
export default {
components: {
// eslint-disable-next-line vue/no-reserved-component-names
Select
},
props: {

View File

@ -83,7 +83,7 @@ const LoginForm = {
},
clearError () { this.error = false },
focusOnPasswordInput () {
let passwordInput = this.$refs.passwordInput
const passwordInput = this.$refs.passwordInput
passwordInput.focus()
passwordInput.setSelectionRange(0, passwordInput.value.length)
}

View File

@ -90,7 +90,7 @@
</div>
</template>
<script src="./login_form.js" ></script>
<script src="./login_form.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -42,7 +42,8 @@ const mediaUpload = {
.then((fileData) => {
self.$emit('uploaded', fileData)
self.decreaseUploadCount()
}, (error) => { // eslint-disable-line handle-callback-err
}, (error) => {
console.error('Error uploading file', error)
self.$emit('upload-failed', 'default')
self.decreaseUploadCount()
})
@ -73,7 +74,7 @@ const mediaUpload = {
'disabled'
],
watch: {
'dropFiles': function (fileInfos) {
dropFiles: function (fileInfos) {
if (!this.uploading) {
this.multiUpload(fileInfos)
}

View File

@ -26,7 +26,7 @@
</label>
</template>
<script src="./media_upload.js" ></script>
<script src="./media_upload.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -12,7 +12,7 @@
/><!-- eslint-enable vue/no-v-html -->
<UserPopover
v-else
:userId="user.id"
:user-id="user.id"
:disabled="!shouldShowTooltip"
>
<span
@ -54,7 +54,10 @@
:class="{ '-you': shouldBoldenYou }"
> {{ ' ' + $t('status.you') }}</span>
<!-- eslint-enable vue/no-v-html -->
</a><span class="full" ref="full">
</a><span
ref="full"
class="full"
>
<!-- eslint-disable vue/no-v-html -->
@<span v-html="userName" /><span v-html="'@' + serverName" />
<!-- eslint-enable vue/no-v-html -->
@ -64,6 +67,6 @@
</span>
</template>
<script src="./mention_link.js"/>
<script src="./mention_link.js" />
<style lang="scss" src="./mention_link.scss"/>
<style lang="scss" src="./mention_link.scss" />

View File

@ -36,5 +36,5 @@
</span>
</span>
</template>
<script src="./mentions_line.js" ></script>
<script src="./mentions_line.js"></script>
<style lang="scss" src="./mentions_line.scss" />

View File

@ -69,4 +69,4 @@
</div>
</div>
</template>
<script src="./recovery_form.js" ></script>
<script src="./recovery_form.js"></script>

View File

@ -67,11 +67,10 @@
</a>
</div>
<div
class="mobile-notifications"
id="mobile-notifications"
class="mobile-notifications"
@scroll="onScroll"
>
</div>
/>
</div>
<SideDrawer
ref="sideDrawer"

View File

@ -12,6 +12,9 @@
<script>
export default {
provide: {
popoversZLayer: 'modals'
},
props: {
isOpen: {
type: Boolean,
@ -22,14 +25,11 @@ export default {
default: false
}
},
provide: {
popoversZLayer: 'modals'
},
computed: {
classes () {
return {
'modal-background': !this.noBackground,
'open': this.isOpen
open: this.isOpen
}
}
}

View File

@ -8,7 +8,7 @@
@show="setToggled(true)"
@close="setToggled(false)"
>
<template v-slot:content>
<template #content>
<div class="dropdown-menu">
<span v-if="user.is_local">
<button
@ -122,7 +122,7 @@
</span>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<button
class="btn button-default btn-block moderation-tools-button"
:class="{ toggled }"
@ -137,11 +137,11 @@
v-if="showDeleteUserDialog"
:on-cancel="deleteUserDialog.bind(this, false)"
>
<template v-slot:header>
<template #header>
{{ $t('user_card.admin_menu.delete_user') }}
</template>
<p>{{ $t('user_card.admin_menu.delete_user_confirmation') }}</p>
<template v-slot:footer>
<template #footer>
<button
class="btn button-default"
@click="deleteUserDialog(false)"

View File

@ -9,10 +9,10 @@ import { get } from 'lodash'
*/
const toInstanceReasonObject = (instances, info, key) => {
return instances.map(instance => {
if (info[key] && info[key][instance] && info[key][instance]['reason']) {
return { instance: instance, reason: info[key][instance]['reason'] }
if (info[key] && info[key][instance] && info[key][instance].reason) {
return { instance, reason: info[key][instance].reason }
}
return { instance: instance, reason: '' }
return { instance, reason: '' }
})
}

View File

@ -90,7 +90,7 @@
</div>
</template>
<script src="./nav_panel.js" ></script>
<script src="./nav_panel.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -40,7 +40,7 @@ const Notification = {
unmuted: false
}
},
props: [ 'notification' ],
props: ['notification'],
components: {
StatusContent,
UserAvatar,

View File

@ -37,8 +37,8 @@
@click.prevent
>
<UserPopover
:userId="notification.from_profile.id"
:overlayCenters="true"
:user-id="notification.from_profile.id"
:overlay-centers="true"
>
<UserAvatar
class="post-avatar"

View File

@ -5,7 +5,7 @@
placement="bottom"
:bound-to="{ x: 'container' }"
>
<template v-slot:content>
<template #content>
<div class="dropdown-menu">
<button
class="button-default dropdown-item"
@ -72,7 +72,7 @@
</button>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<button class="filter-trigger-button button-unstyled">
<FAIcon icon="filter" />
</button>

View File

@ -1,5 +1,8 @@
<template>
<teleport :disabled="minimalMode || disableTeleport" :to="teleportTarget">
<teleport
:disabled="minimalMode || disableTeleport"
:to="teleportTarget"
>
<div
:class="{ minimal: minimalMode }"
class="Notifications"

View File

@ -104,18 +104,22 @@ const Popover = {
// What are the screen bounds for the popover? Viewport vs container
// when using viewport, using default margin values to dodge the navbar
const xBounds = this.boundTo && this.boundTo.x === 'container' ? {
const xBounds = this.boundTo && this.boundTo.x === 'container'
? {
min: parentScreenBox.left + (margin.left || 0),
max: parentScreenBox.right - (margin.right || 0)
} : {
}
: {
min: 0 + (margin.left || 10),
max: window.innerWidth - (margin.right || 10)
}
const yBounds = this.boundTo && this.boundTo.y === 'container' ? {
const yBounds = this.boundTo && this.boundTo.y === 'container'
? {
min: parentScreenBox.top + (margin.top || 0),
max: parentScreenBox.bottom - (margin.bottom || 0)
} : {
}
: {
min: 0 + (margin.top || 50),
max: window.innerHeight - (margin.bottom || 5)
}

View File

@ -41,7 +41,7 @@ const buildMentionsString = ({ user, attentions = [] }, currentUser) => {
allAttentions = uniqBy(allAttentions, 'id')
allAttentions = reject(allAttentions, { id: currentUser.id })
let mentions = map(allAttentions, (attention) => {
const mentions = map(allAttentions, (attention) => {
return `@${attention.screen_name}`
})
@ -242,7 +242,7 @@ const PostStatusForm = {
})
},
watch: {
'newStatus': {
newStatus: {
deep: true,
handler () {
this.statusChanged()
@ -273,7 +273,7 @@ const PostStatusForm = {
this.$refs.textarea.focus()
})
}
let el = this.$el.querySelector('textarea')
const el = this.$el.querySelector('textarea')
el.style.height = 'auto'
el.style.height = undefined
this.error = null
@ -392,7 +392,7 @@ const PostStatusForm = {
this.$emit('resize', { delayed: true })
},
removeMediaFile (fileInfo) {
let index = this.newStatus.files.indexOf(fileInfo)
const index = this.newStatus.files.indexOf(fileInfo)
this.newStatus.files.splice(index, 1)
this.$emit('resize')
},
@ -462,7 +462,7 @@ const PostStatusForm = {
},
onEmojiInputInput (e) {
this.$nextTick(() => {
this.resize(this.$refs['textarea'])
this.resize(this.$refs.textarea)
})
},
resize (e) {
@ -477,8 +477,8 @@ const PostStatusForm = {
return
}
const formRef = this.$refs['form']
const bottomRef = this.$refs['bottom']
const formRef = this.$refs.form
const bottomRef = this.$refs.bottom
/* Scroller is either `window` (replies in TL), sidebar (main post form,
* replies in notifs) or mobile post form. Note that getting and setting
* scroll is different for `Window` and `Element`s
@ -564,7 +564,7 @@ const PostStatusForm = {
this.$refs['emoji-input'].resize()
},
showEmojiPicker () {
this.$refs['textarea'].focus()
this.$refs.textarea.focus()
this.$refs['emoji-input'].triggerShowPicker()
},
clearError () {

View File

@ -45,7 +45,7 @@ const ReactButton = {
emojis () {
if (this.filterWord !== '') {
const filterWordLowercase = trim(this.filterWord.toLowerCase())
let orderedEmojiList = []
const orderedEmojiList = []
for (const emoji of this.$store.state.instance.emoji) {
if (emoji.replacement === this.filterWord) return [emoji]

View File

@ -9,13 +9,13 @@
popover-class="ReactButton popover-default"
@show="focusInput"
>
<template v-slot:content="{close}">
<template #content="{close}">
<div class="reaction-picker-filter">
<input
v-model="filterWord"
@input="$event.target.composing = false"
size="1"
:placeholder="$t('emoji.search_emoji')"
@input="$event.target.composing = false"
>
</div>
<div class="reaction-picker">
@ -41,7 +41,7 @@
<div class="reaction-bottom-fader" />
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<span
class="button-unstyled popover-trigger"
:title="$t('tool_tip.add_reaction')"
@ -55,7 +55,7 @@
</Popover>
</template>
<script src="./react_button.js" ></script>
<script src="./react_button.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -1,5 +1,5 @@
export default {
props: [ 'user' ],
props: ['user'],
computed: {
subscribeUrl () {
// eslint-disable-next-line no-undef

View File

@ -36,7 +36,7 @@
</div>
</template>
<script src="./retweet_button.js" ></script>
<script src="./retweet_button.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -16,7 +16,7 @@ const SearchBar = {
error: false
}),
watch: {
'$route': function (route) {
$route: function (route) {
if (route.name === 'search') {
this.searchTerm = route.query.query
}

View File

@ -24,7 +24,7 @@
:items="items"
:get-key="getKey"
>
<template v-slot:item="{item}">
<template #item="{item}">
<div
class="selectable-list-item-inner"
:class="{ 'selectable-list-item-selected-inner': isSelected(item) }"
@ -41,7 +41,7 @@
/>
</div>
</template>
<template v-slot:empty>
<template #empty>
<slot name="empty" />
</template>
</List>

View File

@ -6,14 +6,14 @@
<Popover
trigger="hover"
>
<template v-slot:trigger>
<template #trigger>
&nbsp;
<FAIcon
icon="wrench"
:aria-label="$t('settings.setting_changed')"
/>
</template>
<template v-slot:content>
<template #content>
<div class="modified-tooltip">
{{ $t('settings.setting_changed') }}
</div>

View File

@ -6,14 +6,14 @@
<Popover
trigger="hover"
>
<template v-slot:trigger>
<template #trigger>
&nbsp;
<FAIcon
icon="server"
:aria-label="$t('settings.setting_server_side')"
/>
</template>
<template v-slot:content>
<template #content>
<div class="serverside-tooltip">
{{ $t('settings.setting_server_side') }}
</div>

View File

@ -53,7 +53,7 @@
:bound-to="{ x: 'container' }"
remove-padding
>
<template v-slot:trigger>
<template #trigger>
<button
class="btn button-default"
:title="$t('general.close')"
@ -65,7 +65,7 @@
/>
</button>
</template>
<template v-slot:content="{close}">
<template #content="{close}">
<div class="dropdown-menu">
<button
class="button-default dropdown-item dropdown-item-icon"

View File

@ -75,12 +75,18 @@
</BooleanSetting>
</li>
<li>
<BooleanSetting path="userPopoverZoom" expert="1">
<BooleanSetting
path="userPopoverZoom"
expert="1"
>
{{ $t('settings.user_popover_avatar_zoom') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="userPopoverOverlay" expert="1">
<BooleanSetting
path="userPopoverOverlay"
expert="1"
>
{{ $t('settings.user_popover_avatar_overlay') }}
</BooleanSetting>
</li>

View File

@ -10,7 +10,7 @@
:query="queryUserIds"
:placeholder="$t('settings.search_user_to_block')"
>
<template v-slot="row">
<template #default="row">
<BlockCard
:user-id="row.item"
/>
@ -21,7 +21,7 @@
:refresh="true"
:get-key="i => i"
>
<template v-slot:header="{selected}">
<template #header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@ -29,7 +29,7 @@
:click="() => blockUsers(selected)"
>
{{ $t('user_card.block') }}
<template v-slot:progress>
<template #progress>
{{ $t('user_card.block_progress') }}
</template>
</ProgressButton>
@ -39,16 +39,16 @@
:click="() => unblockUsers(selected)"
>
{{ $t('user_card.unblock') }}
<template v-slot:progress>
<template #progress>
{{ $t('user_card.unblock_progress') }}
</template>
</ProgressButton>
</div>
</template>
<template v-slot:item="{item}">
<template #item="{item}">
<BlockCard :user-id="item" />
</template>
<template v-slot:empty>
<template #empty>
{{ $t('settings.no_blocks') }}
</template>
</BlockList>
@ -63,7 +63,7 @@
:query="queryUserIds"
:placeholder="$t('settings.search_user_to_mute')"
>
<template v-slot="row">
<template #default="row">
<MuteCard
:user-id="row.item"
/>
@ -74,7 +74,7 @@
:refresh="true"
:get-key="i => i"
>
<template v-slot:header="{selected}">
<template #header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@ -82,7 +82,7 @@
:click="() => muteUsers(selected)"
>
{{ $t('user_card.mute') }}
<template v-slot:progress>
<template #progress>
{{ $t('user_card.mute_progress') }}
</template>
</ProgressButton>
@ -92,16 +92,16 @@
:click="() => unmuteUsers(selected)"
>
{{ $t('user_card.unmute') }}
<template v-slot:progress>
<template #progress>
{{ $t('user_card.unmute_progress') }}
</template>
</ProgressButton>
</div>
</template>
<template v-slot:item="{item}">
<template #item="{item}">
<MuteCard :user-id="item" />
</template>
<template v-slot:empty>
<template #empty>
{{ $t('settings.no_mutes') }}
</template>
</MuteList>
@ -114,7 +114,7 @@
:query="queryKnownDomains"
:placeholder="$t('settings.type_domains_to_mute')"
>
<template v-slot="row">
<template #default="row">
<DomainMuteCard
:domain="row.item"
/>
@ -125,7 +125,7 @@
:refresh="true"
:get-key="i => i"
>
<template v-slot:header="{selected}">
<template #header="{selected}">
<div class="bulk-actions">
<ProgressButton
v-if="selected.length > 0"
@ -133,16 +133,16 @@
:click="() => unmuteDomains(selected)"
>
{{ $t('domain_mute_card.unmute') }}
<template v-slot:progress>
<template #progress>
{{ $t('domain_mute_card.unmute_progress') }}
</template>
</ProgressButton>
</div>
</template>
<template v-slot:item="{item}">
<template #item="{item}">
<DomainMuteCard :domain="item" />
</template>
<template v-slot:empty>
<template #empty>
{{ $t('settings.no_mutes') }}
</template>
</DomainMuteList>

View File

@ -71,10 +71,12 @@ const ProfileTab = {
})
},
emojiSuggestor () {
return suggestor({ emoji: [
return suggestor({
emoji: [
...this.$store.state.instance.emoji,
...this.$store.state.instance.customEmoji
] })
]
})
},
userSuggestor () {
return suggestor({ store: this.$store })

View File

@ -117,8 +117,8 @@
<button
v-if="!isDefaultAvatar && pickAvatarBtnVisible"
:title="$t('settings.reset_avatar')"
@click="resetAvatar"
class="button-unstyled reset-button"
@click="resetAvatar"
>
<FAIcon
icon="times"

View File

@ -32,8 +32,8 @@ const Mfa = {
components: {
'recovery-codes': RecoveryCodes,
'totp-item': TOTP,
'qrcode': VueQrcode,
'confirm': Confirm
qrcode: VueQrcode,
confirm: Confirm
},
computed: {
canSetupOTP () {
@ -139,7 +139,7 @@ const Mfa = {
// fetch settings from server
async fetchSettings () {
let result = await this.backendInteractor.settingsMFA()
const result = await this.backendInteractor.settingsMFA()
if (result.error) return
this.settings = result.settings
this.settings.available = true

View File

@ -10,7 +10,7 @@ export default {
inProgress: false // progress peform request to disable otp method
}),
components: {
'confirm': Confirm
confirm: Confirm
},
computed: {
isActivated () {

View File

@ -13,7 +13,7 @@ const SecurityTab = {
deletingAccount: false,
deleteAccountConfirmPasswordInput: '',
deleteAccountError: false,
changePasswordInputs: [ '', '', '' ],
changePasswordInputs: ['', '', ''],
changedPassword: false,
changePasswordError: false,
moveAccountTarget: '',

View File

@ -29,7 +29,10 @@
{{ $t('settings.style.preview.content') }}
</h4>
<i18n-t scope="global" keypath="settings.style.preview.text">
<i18n-t
scope="global"
keypath="settings.style.preview.text"
>
<code style="font-family: var(--postCodeFont)">
{{ $t('settings.style.preview.mono') }}
</code>

View File

@ -95,11 +95,11 @@ export default {
...Object.keys(SLOT_INHERITANCE)
.map(key => [key, ''])
.reduce((acc, [key, val]) => ({ ...acc, [ key + 'ColorLocal' ]: val }), {}),
.reduce((acc, [key, val]) => ({ ...acc, [key + 'ColorLocal']: val }), {}),
...Object.keys(OPACITIES)
.map(key => [key, ''])
.reduce((acc, [key, val]) => ({ ...acc, [ key + 'OpacityLocal' ]: val }), {}),
.reduce((acc, [key, val]) => ({ ...acc, [key + 'OpacityLocal']: val }), {}),
shadowSelected: undefined,
shadowsLocal: {},
@ -212,12 +212,12 @@ export default {
currentColors () {
return Object.keys(SLOT_INHERITANCE)
.map(key => [key, this[key + 'ColorLocal']])
.reduce((acc, [key, val]) => ({ ...acc, [ key ]: val }), {})
.reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {})
},
currentOpacity () {
return Object.keys(OPACITIES)
.map(key => [key, this[key + 'OpacityLocal']])
.reduce((acc, [key, val]) => ({ ...acc, [ key ]: val }), {})
.reduce((acc, [key, val]) => ({ ...acc, [key]: val }), {})
},
currentRadii () {
return {

View File

@ -112,9 +112,11 @@ export default {
return hex2rgb(this.selected.color)
},
style () {
return this.ready ? {
return this.ready
? {
boxShadow: getCssShadow(this.fallback)
} : {}
}
: {}
}
}
}

View File

@ -215,7 +215,7 @@
</div>
</template>
<script src="./shadow_control.js" ></script>
<script src="./shadow_control.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -11,7 +11,7 @@ library.add(
)
const shoutPanel = {
props: [ 'floating' ],
props: ['floating'],
data () {
return {
currentMessage: '',

View File

@ -32,7 +32,7 @@ library.add(
)
const SideDrawer = {
props: [ 'logout' ],
props: ['logout'],
data: () => ({
closed: true,
closeGesture: undefined

View File

@ -204,7 +204,7 @@
</div>
</template>
<script src="./side_drawer.js" ></script>
<script src="./side_drawer.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -17,8 +17,8 @@ const StaffPanel = {
const groupedStaffAccounts = groupBy(staffAccounts, 'role')
return [
{ role: 'admin', users: groupedStaffAccounts['admin'] },
{ role: 'moderator', users: groupedStaffAccounts['moderator'] }
{ role: 'admin', users: groupedStaffAccounts.admin },
{ role: 'moderator', users: groupedStaffAccounts.moderator }
].filter(group => group.users)
},
...mapGetters([

View File

@ -24,7 +24,7 @@
</div>
</template>
<script src="./staff_panel.js" ></script>
<script src="./staff_panel.js"></script>
<style lang="scss">

View File

@ -361,6 +361,7 @@ const Status = {
return uniqBy(combinedUsers, 'id')
},
tags () {
// eslint-disable-next-line no-prototype-builtins
return this.status.tags.filter(tagObj => tagObj.hasOwnProperty('name')).map(tagObj => tagObj.name).join(' ')
},
hidePostStats () {
@ -448,7 +449,7 @@ const Status = {
scrollIfHighlighted (highlightId) {
const id = highlightId
if (this.status.id === id) {
let rect = this.$el.getBoundingClientRect()
const rect = this.$el.getBoundingClientRect()
if (rect.top < 100) {
// Post is above screen, match its top to screen top
window.scrollBy(0, rect.top - 100)
@ -463,7 +464,7 @@ const Status = {
}
},
watch: {
'highlight': function (id) {
highlight: function (id) {
this.scrollIfHighlighted(id)
},
'status.repeat_num': function (num) {
@ -478,7 +479,7 @@ const Status = {
this.$store.dispatch('fetchFavs', this.status.id)
}
},
'isSuspendable': function (val) {
isSuspendable: function (val) {
this.suspendable = val
}
}

View File

@ -122,10 +122,13 @@
v-if="!noHeading"
class="left-side"
>
<a :href="$router.resolve(userProfileLink).href" @click.prevent>
<a
:href="$router.resolve(userProfileLink).href"
@click.prevent
>
<UserPopover
:userId="status.user.id"
:overlayCenters="true"
:user-id="status.user.id"
:overlay-centers="true"
>
<UserAvatar
class="post-avatar"
@ -488,6 +491,6 @@
</div>
</template>
<script src="./status.js" ></script>
<script src="./status.js"></script>
<style src="./status.scss" lang="scss"></style>

View File

@ -96,5 +96,5 @@
<slot v-if="!hideSubjectStatus" />
</div>
</template>
<script src="./status_body.js" ></script>
<script src="./status_body.js"></script>
<style lang="scss" src="./status_body.scss" />

View File

@ -56,7 +56,7 @@
</div>
</template>
<script src="./status_content.js" ></script>
<script src="./status_content.js"></script>
<style lang="scss">
.StatusContent {
flex: 1;

View File

@ -1,16 +1,16 @@
<template>
<Popover
ref="popover"
trigger="hover"
:stay-on-click="true"
popover-class="popover-default status-popover"
:bound-to="{ x: 'container' }"
@show="enter"
ref="popover"
>
<template v-slot:trigger>
<template #trigger>
<slot />
</template>
<template v-slot:content>
<template #content>
<Status
v-if="status"
:is-preview="true"
@ -37,7 +37,7 @@
</Popover>
</template>
<script src="./status_popover.js" ></script>
<script src="./status_popover.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -31,8 +31,8 @@ const StickerPicker = {
fetch(sticker)
.then((res) => {
res.blob().then((blob) => {
var file = new File([blob], name, { mimetype: 'image/png' })
var formData = new FormData()
const file = new File([blob], name, { mimetype: 'image/png' })
const formData = new FormData()
formData.append('file', file)
statusPosterService.uploadMedia({ store, formData })
.then((fileData) => {

View File

@ -13,7 +13,7 @@
</div>
</template>
<script src="./terms_of_service_panel.js" ></script>
<script src="./terms_of_service_panel.js"></script>
<style lang="scss">
.tos-content {

View File

@ -46,7 +46,10 @@
</div>
</div>
<div :class="classes.footer">
<teleport :to="footerSlipgate" :disabled="!embedded || !footerSlipgate">
<teleport
:to="footerSlipgate"
:disabled="!embedded || !footerSlipgate"
>
<div
v-if="count===0"
class="new-status-notification text-center faint"

View File

@ -4,7 +4,7 @@
class="TimelineQuickSettings"
:bound-to="{ x: 'container' }"
>
<template v-slot:content>
<template #content>
<div class="dropdown-menu">
<div v-if="loggedIn">
<button
@ -80,7 +80,7 @@
</button>
</div>
</template>
<template v-slot:trigger>
<template #trigger>
<button class="button-unstyled">
<FAIcon icon="filter" />
</button>

View File

@ -11,9 +11,9 @@ library.add(faChevronDown)
// because nav panel benefits from the same information.
export const timelineNames = () => {
return {
'friends': 'nav.home_timeline',
'bookmarks': 'nav.bookmarks',
'dms': 'nav.dms',
friends: 'nav.home_timeline',
bookmarks: 'nav.bookmarks',
dms: 'nav.dms',
'public-timeline': 'nav.public_tl',
'public-external-timeline': 'nav.twkn'
}

View File

@ -9,10 +9,10 @@
@show="openMenu"
@close="() => isOpen = false"
>
<template v-slot:content>
<template #content>
<TimelineMenuContent />
</template>
<template v-slot:trigger>
<template #trigger>
<span class="button-unstyled title timeline-menu-title">
<span class="timeline-title">{{ timelineName() }}</span>
<span>
@ -30,7 +30,7 @@
</Popover>
</template>
<script src="./timeline_menu.js" ></script>
<script src="./timeline_menu.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -63,4 +63,4 @@
</ul>
</template>
<script src="./timeline_menu_content.js" ></script>
<script src="./timeline_menu_content.js"></script>

View File

@ -67,7 +67,7 @@ export default {
style () {
return {
backgroundImage: [
`linear-gradient(to bottom, var(--profileTint), var(--profileTint))`,
'linear-gradient(to bottom, var(--profileTint), var(--profileTint))',
`url(${this.user.cover_photo})`
].join(', ')
}

View File

@ -29,10 +29,10 @@
</a>
<UserAvatar
v-else-if="typeof avatarAction === 'function'"
@click="avatarAction"
class="user-info-avatar"
:better-shadow="betterShadow"
:user="user"
@click="avatarAction"
/>
<router-link
v-else

View File

@ -4,10 +4,10 @@
placement="top"
:offset="{ y: 5 }"
>
<template v-slot:trigger>
<template #trigger>
<slot />
</template>
<template v-slot:content>
<template #content>
<div class="user-list-popover">
<template v-if="users.length">
<div
@ -45,7 +45,7 @@
</Popover>
</template>
<script src="./user_list_popover.js" ></script>
<script src="./user_list_popover.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -1,15 +1,15 @@
<template>
<Popover
<Popover
trigger="click"
popover-class="popover-default user-popover"
:overlay-centers-selector="overlayCentersSelector || '.user-info .Avatar'"
:overlay-centers="overlayCenters && userPopoverOverlay"
:disabled="disabled"
>
<template v-slot:trigger>
>
<template #trigger>
<slot />
</template>
<template v-slot:content={close}>
<template #content="{close}">
<UserCard
class="user-popover"
:user-id="userId"
@ -18,10 +18,10 @@
:on-close="close"
/>
</template>
</Popover>
</Popover>
</template>
<script src="./user_popover.js" ></script>
<script src="./user_popover.js"></script>
<style lang="scss">
@import '../../_variables.scss';

View File

@ -56,7 +56,7 @@
:user-id="userId"
:pinned-status-ids="user.pinnedStatusIds"
:in-profile="true"
:footerSlipgate="footerRef"
:footer-slipgate="footerRef"
/>
<div
v-if="followsTabVisible"
@ -65,7 +65,7 @@
:disabled="!user.friends_count"
>
<FriendList :user-id="userId">
<template v-slot:item="{item}">
<template #item="{item}">
<FollowCard :user="item" />
</template>
</FriendList>
@ -77,7 +77,7 @@
:disabled="!user.followers_count"
>
<FollowerList :user-id="userId">
<template v-slot:item="{item}">
<template #item="{item}">
<FollowCard
:user="item"
:no-follows-you="isUs"
@ -95,7 +95,7 @@
:timeline="media"
:user-id="userId"
:in-profile="true"
:footerSlipgate="footerRef"
:footer-slipgate="footerRef"
/>
<Timeline
v-if="isUs"
@ -107,10 +107,13 @@
timeline-name="favorites"
:timeline="favorites"
:in-profile="true"
:footerSlipgate="footerRef"
:footer-slipgate="footerRef"
/>
</tab-switcher>
<div class="panel-footer" :ref="setFooterRef"></div>
<div
:ref="setFooterRef"
class="panel-footer"
/>
</div>
<div
v-else

View File

@ -45,7 +45,7 @@
</div>
<div class="user-reporting-panel-right">
<List :items="statuses">
<template v-slot:item="{item}">
<template #item="{item}">
<div class="status-fadein user-reporting-panel-sitem">
<Status
:in-conversation="false"

View File

@ -28,7 +28,7 @@ const WhoToFollow = {
getWhoToFollow () {
const credentials = this.$store.state.users.currentUser.credentials
if (credentials) {
apiService.suggestions({ credentials: credentials })
apiService.suggestions({ credentials })
.then((reply) => {
this.showWhoToFollow(reply)
})

View File

@ -6,9 +6,9 @@ function showWhoToFollow (panel, reply) {
const shuffled = shuffle(reply)
panel.usersToFollow.forEach((toFollow, index) => {
let user = shuffled[index]
let img = user.avatar || this.$store.state.instance.defaultAvatar
let name = user.acct
const user = shuffled[index]
const img = user.avatar || this.$store.state.instance.defaultAvatar
const name = user.acct
toFollow.img = img
toFollow.name = name
@ -24,12 +24,12 @@ function showWhoToFollow (panel, reply) {
}
function getWhoToFollow (panel) {
var credentials = panel.$store.state.users.currentUser.credentials
const credentials = panel.$store.state.users.currentUser.credentials
if (credentials) {
panel.usersToFollow.forEach(toFollow => {
toFollow.name = 'Loading...'
})
apiService.suggestions({ credentials: credentials })
apiService.suggestions({ credentials })
.then((reply) => {
showWhoToFollow(panel, reply)
})

View File

@ -27,7 +27,7 @@
</div>
</template>
<script src="./who_to_follow_panel.js" ></script>
<script src="./who_to_follow_panel.js"></script>
<style lang="scss">
.who-to-follow * {

View File

@ -46,7 +46,7 @@ const messages = {
},
setLanguage: async (i18n, language) => {
if (loaders[language]) {
let messages = await loaders[language]()
const messages = await loaders[language]()
i18n.setLocaleMessage(language, messages.default)
}
i18n.locale = language

View File

@ -3,8 +3,8 @@
// meant to be used to load the partial i18n we need for
// the service worker.
module.exports = function (source) {
var object = JSON.parse(source)
var smol = {
const object = JSON.parse(source)
const smol = {
notifications: object.notifications || {}
}

Some files were not shown because too many files have changed in this diff Show More