aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2019-07-05 10:02:14 +0300
committerHenry Jameson <me@hjkos.com>2019-07-05 10:02:14 +0300
commit2c2b84d31dbe906b89dfb995394d887af110e04c (patch)
tree18e70da867cbd2498326cc947916d8ef8b1c6669 /src/components
parent6bea363b9db1c372e0e3add4458ff4c819b7c500 (diff)
npm eslint --fix .
Diffstat (limited to 'src/components')
-rw-r--r--src/components/attachment/attachment.js2
-rw-r--r--src/components/autosuggest/autosuggest.js4
-rw-r--r--src/components/chat_panel/chat_panel.js2
-rw-r--r--src/components/conversation/conversation.js8
-rw-r--r--src/components/emoji-input/emoji-input.js2
-rw-r--r--src/components/favorite_button/favorite_button.js4
-rw-r--r--src/components/login_form/login_form.js4
-rw-r--r--src/components/media_upload/media_upload.js6
-rw-r--r--src/components/mfa_form/recovery_form.js2
-rw-r--r--src/components/mfa_form/totp_form.js2
-rw-r--r--src/components/mobile_post_status_modal/mobile_post_status_modal.js4
-rw-r--r--src/components/moderation_tools/moderation_tools.js12
-rw-r--r--src/components/registration/registration.js4
-rw-r--r--src/components/retweet_button/retweet_button.js4
-rw-r--r--src/components/scope_selector/scope_selector.js8
-rw-r--r--src/components/tab_switcher/tab_switcher.js48
-rw-r--r--src/components/timeline/timeline.js2
-rw-r--r--src/components/user_card/user_card.js14
-rw-r--r--src/components/user_settings/mfa.js2
-rw-r--r--src/components/user_settings/user_settings.js22
-rw-r--r--src/components/who_to_follow/who_to_follow.js2
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.js2
22 files changed, 80 insertions, 80 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 3b7f08dc..e93921fe 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -51,7 +51,7 @@ const Attachment = {
}
},
methods: {
- linkClicked ({target}) {
+ linkClicked ({ target }) {
if (target.tagName === 'A') {
window.open(target.href, '_blank')
}
diff --git a/src/components/autosuggest/autosuggest.js b/src/components/autosuggest/autosuggest.js
index d4efe912..f58f17bb 100644
--- a/src/components/autosuggest/autosuggest.js
+++ b/src/components/autosuggest/autosuggest.js
@@ -2,11 +2,11 @@ const debounceMilliseconds = 500
export default {
props: {
- query: { // function to query results and return a promise
+ query: { // function to query results and return a promise
type: Function,
required: true
},
- filter: { // function to filter results in real time
+ filter: { // function to filter results in real time
type: Function
},
placeholder: {
diff --git a/src/components/chat_panel/chat_panel.js b/src/components/chat_panel/chat_panel.js
index bbc9b49f..f2e3adf0 100644
--- a/src/components/chat_panel/chat_panel.js
+++ b/src/components/chat_panel/chat_panel.js
@@ -16,7 +16,7 @@ const chatPanel = {
},
methods: {
submit (message) {
- this.$store.state.chat.channel.push('new_msg', {text: message}, 10000)
+ this.$store.state.chat.channel.push('new_msg', { text: message }, 10000)
this.currentMessage = ''
},
togglePanel () {
diff --git a/src/components/conversation/conversation.js b/src/components/conversation/conversation.js
index 8ae89421..cc0b0b41 100644
--- a/src/components/conversation/conversation.js
+++ b/src/components/conversation/conversation.js
@@ -86,7 +86,7 @@ const conversation = {
},
replies () {
let i = 1
- return reduce(this.conversation, (result, {id, in_reply_to_status_id}) => {
+ return reduce(this.conversation, (result, { id, in_reply_to_status_id }) => {
/* eslint-disable camelcase */
const irid = in_reply_to_status_id
/* eslint-enable camelcase */
@@ -119,15 +119,15 @@ const conversation = {
methods: {
fetchConversation () {
if (this.status) {
- this.$store.state.api.backendInteractor.fetchConversation({id: this.status.id})
- .then(({ancestors, descendants}) => {
+ this.$store.state.api.backendInteractor.fetchConversation({ id: this.status.id })
+ .then(({ ancestors, descendants }) => {
this.$store.dispatch('addNewStatuses', { statuses: ancestors })
this.$store.dispatch('addNewStatuses', { statuses: descendants })
})
.then(() => this.setHighlight(this.statusId))
} else {
const id = this.$route.params.id
- this.$store.state.api.backendInteractor.fetchStatus({id})
+ this.$store.state.api.backendInteractor.fetchStatus({ id })
.then((status) => this.$store.dispatch('addNewStatuses', { statuses: [status] }))
.then(() => this.fetchConversation())
}
diff --git a/src/components/emoji-input/emoji-input.js b/src/components/emoji-input/emoji-input.js
index b09dc628..fab64a69 100644
--- a/src/components/emoji-input/emoji-input.js
+++ b/src/components/emoji-input/emoji-input.js
@@ -53,7 +53,7 @@ const EmojiInput = {
required: true,
type: String
}
- },
+ },
data () {
return {
input: undefined,
diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js
index a2b4cb65..a24eacbf 100644
--- a/src/components/favorite_button/favorite_button.js
+++ b/src/components/favorite_button/favorite_button.js
@@ -11,9 +11,9 @@ const FavoriteButton = {
methods: {
favorite () {
if (!this.status.favorited) {
- this.$store.dispatch('favorite', {id: this.status.id})
+ this.$store.dispatch('favorite', { id: this.status.id })
} else {
- this.$store.dispatch('unfavorite', {id: this.status.id})
+ this.$store.dispatch('unfavorite', { id: this.status.id })
}
this.animated = true
setTimeout(() => {
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index 4a5b1965..10f52fe2 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -58,7 +58,7 @@ const LoginForm = {
).then((result) => {
if (result.error) {
if (result.error === 'mfa_required') {
- this.requireMFA({app: app, settings: result})
+ this.requireMFA({ app: app, settings: result })
} else {
this.error = result.error
this.focusOnPasswordInput()
@@ -66,7 +66,7 @@ const LoginForm = {
return
}
this.login(result).then(() => {
- this.$router.push({name: 'friends'})
+ this.$router.push({ name: 'friends' })
})
})
})
diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js
index e4b3d460..f457d022 100644
--- a/src/components/media_upload/media_upload.js
+++ b/src/components/media_upload/media_upload.js
@@ -16,7 +16,7 @@ const mediaUpload = {
if (file.size > store.state.instance.uploadlimit) {
const filesize = fileSizeFormatService.fileSizeFormat(file.size)
const allowedsize = fileSizeFormatService.fileSizeFormat(store.state.instance.uploadlimit)
- self.$emit('upload-failed', 'file_too_big', {filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit})
+ self.$emit('upload-failed', 'file_too_big', { filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit })
return
}
const formData = new FormData()
@@ -36,7 +36,7 @@ const mediaUpload = {
},
fileDrop (e) {
if (e.dataTransfer.files.length > 0) {
- e.preventDefault() // allow dropping text like before
+ e.preventDefault() // allow dropping text like before
this.uploadFile(e.dataTransfer.files[0])
}
},
@@ -54,7 +54,7 @@ const mediaUpload = {
this.uploadReady = true
})
},
- change ({target}) {
+ change ({ target }) {
for (var i = 0; i < target.files.length; i++) {
let file = target.files[i]
this.uploadFile(file)
diff --git a/src/components/mfa_form/recovery_form.js b/src/components/mfa_form/recovery_form.js
index fbe9b437..7a3cc22d 100644
--- a/src/components/mfa_form/recovery_form.js
+++ b/src/components/mfa_form/recovery_form.js
@@ -33,7 +33,7 @@ export default {
}
this.login(result).then(() => {
- this.$router.push({name: 'friends'})
+ this.$router.push({ name: 'friends' })
})
})
}
diff --git a/src/components/mfa_form/totp_form.js b/src/components/mfa_form/totp_form.js
index 6c94fe52..778bf8dc 100644
--- a/src/components/mfa_form/totp_form.js
+++ b/src/components/mfa_form/totp_form.js
@@ -32,7 +32,7 @@ export default {
}
this.login(result).then(() => {
- this.$router.push({name: 'friends'})
+ this.$router.push({ name: 'friends' })
})
})
}
diff --git a/src/components/mobile_post_status_modal/mobile_post_status_modal.js b/src/components/mobile_post_status_modal/mobile_post_status_modal.js
index 91b730e7..3cec23c6 100644
--- a/src/components/mobile_post_status_modal/mobile_post_status_modal.js
+++ b/src/components/mobile_post_status_modal/mobile_post_status_modal.js
@@ -96,12 +96,12 @@ const MobilePostStatusModal = {
this.hidden = false
}
this.oldScrollPos = window.scrollY
- }, 100, {leading: true, trailing: false}),
+ }, 100, { leading: true, trailing: false }),
handleScrollEnd: debounce(function () {
this.hidden = false
this.oldScrollPos = window.scrollY
- }, 100, {leading: false, trailing: true})
+ }, 100, { leading: false, trailing: true })
}
}
diff --git a/src/components/moderation_tools/moderation_tools.js b/src/components/moderation_tools/moderation_tools.js
index 3eedeaa1..11de9f93 100644
--- a/src/components/moderation_tools/moderation_tools.js
+++ b/src/components/moderation_tools/moderation_tools.js
@@ -52,12 +52,12 @@ const ModerationTools = {
if (this.tagsSet.has(tag)) {
store.state.api.backendInteractor.untagUser(this.user, tag).then(response => {
if (!response.ok) { return }
- store.commit('untagUser', {user: this.user, tag})
+ store.commit('untagUser', { user: this.user, tag })
})
} else {
store.state.api.backendInteractor.tagUser(this.user, tag).then(response => {
if (!response.ok) { return }
- store.commit('tagUser', {user: this.user, tag})
+ store.commit('tagUser', { user: this.user, tag })
})
}
},
@@ -66,12 +66,12 @@ const ModerationTools = {
if (this.user.rights[right]) {
store.state.api.backendInteractor.deleteRight(this.user, right).then(response => {
if (!response.ok) { return }
- store.commit('updateRight', {user: this.user, right: right, value: false})
+ store.commit('updateRight', { user: this.user, right: right, value: false })
})
} else {
store.state.api.backendInteractor.addRight(this.user, right).then(response => {
if (!response.ok) { return }
- store.commit('updateRight', {user: this.user, right: right, value: true})
+ store.commit('updateRight', { user: this.user, right: right, value: true })
})
}
},
@@ -80,7 +80,7 @@ const ModerationTools = {
const status = !!this.user.deactivated
store.state.api.backendInteractor.setActivationStatus(this.user, status).then(response => {
if (!response.ok) { return }
- store.commit('updateActivationStatus', {user: this.user, status: status})
+ store.commit('updateActivationStatus', { user: this.user, status: status })
})
},
deleteUserDialog (show) {
@@ -89,7 +89,7 @@ const ModerationTools = {
deleteUser () {
const store = this.$store
const user = this.user
- const {id, name} = user
+ const { id, name } = user
store.state.api.backendInteractor.deleteUser(user)
.then(e => {
this.$store.dispatch('markStatusesAsDeleted', status => user.id === status.user.id)
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index 8dc00420..57f3caf0 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -28,7 +28,7 @@ const registration = {
},
created () {
if ((!this.registrationOpen && !this.token) || this.signedIn) {
- this.$router.push({name: 'root'})
+ this.$router.push({ name: 'root' })
}
this.setCaptcha()
@@ -61,7 +61,7 @@ const registration = {
if (!this.$v.$invalid) {
try {
await this.signUp(this.user)
- this.$router.push({name: 'friends'})
+ this.$router.push({ name: 'friends' })
} catch (error) {
console.warn('Registration failed: ' + error)
}
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js
index eb4e4b41..fb543a9c 100644
--- a/src/components/retweet_button/retweet_button.js
+++ b/src/components/retweet_button/retweet_button.js
@@ -11,9 +11,9 @@ const RetweetButton = {
methods: {
retweet () {
if (!this.status.repeated) {
- this.$store.dispatch('retweet', {id: this.status.id})
+ this.$store.dispatch('retweet', { id: this.status.id })
} else {
- this.$store.dispatch('unretweet', {id: this.status.id})
+ this.$store.dispatch('unretweet', { id: this.status.id })
}
this.animated = true
setTimeout(() => {
diff --git a/src/components/scope_selector/scope_selector.js b/src/components/scope_selector/scope_selector.js
index 8a42ee7b..e9ccdefc 100644
--- a/src/components/scope_selector/scope_selector.js
+++ b/src/components/scope_selector/scope_selector.js
@@ -29,10 +29,10 @@ const ScopeSelector = {
},
css () {
return {
- public: {selected: this.currentScope === 'public'},
- unlisted: {selected: this.currentScope === 'unlisted'},
- private: {selected: this.currentScope === 'private'},
- direct: {selected: this.currentScope === 'direct'}
+ public: { selected: this.currentScope === 'public' },
+ unlisted: { selected: this.currentScope === 'unlisted' },
+ private: { selected: this.currentScope === 'private' },
+ direct: { selected: this.currentScope === 'direct' }
}
}
},
diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.js
index c949b458..81e4d333 100644
--- a/src/components/tab_switcher/tab_switcher.js
+++ b/src/components/tab_switcher/tab_switcher.js
@@ -10,6 +10,12 @@ export default Vue.component('tab-switcher', {
active: this.$slots.default.findIndex(_ => _.tag)
}
},
+ beforeUpdate () {
+ const currentSlot = this.$slots.default[this.active]
+ if (!currentSlot.tag) {
+ this.active = this.$slots.default.findIndex(_ => _.tag)
+ }
+ },
methods: {
activateTab (index, dataset) {
return () => {
@@ -20,34 +26,28 @@ export default Vue.component('tab-switcher', {
}
}
},
- beforeUpdate () {
- const currentSlot = this.$slots.default[this.active]
- if (!currentSlot.tag) {
- this.active = this.$slots.default.findIndex(_ => _.tag)
- }
- },
render (h) {
const tabs = this.$slots.default
- .map((slot, index) => {
- if (!slot.tag) return
- const classesTab = ['tab']
- const classesWrapper = ['tab-wrapper']
+ .map((slot, index) => {
+ if (!slot.tag) return
+ const classesTab = ['tab']
+ const classesWrapper = ['tab-wrapper']
- if (index === this.active) {
- classesTab.push('active')
- classesWrapper.push('active')
- }
+ if (index === this.active) {
+ classesTab.push('active')
+ classesWrapper.push('active')
+ }
- return (
- <div class={ classesWrapper.join(' ')}>
- <button
- disabled={slot.data.attrs.disabled}
- onClick={this.activateTab(index)}
- class={classesTab.join(' ')}>
- {slot.data.attrs.label}</button>
- </div>
- )
- })
+ return (
+ <div class={ classesWrapper.join(' ')}>
+ <button
+ disabled={slot.data.attrs.disabled}
+ onClick={this.activateTab(index)}
+ class={classesTab.join(' ')}>
+ {slot.data.attrs.label}</button>
+ </div>
+ )
+ })
const contents = this.$slots.default.map((slot, index) => {
if (!slot.tag) return
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 9dafcbd8..791a8e45 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -139,7 +139,7 @@ const Timeline = {
if (top < 15 &&
!this.paused &&
!(this.unfocused && this.$store.state.config.pauseOnUnfocused)
- ) {
+ ) {
this.showNewStatuses()
} else {
this.paused = true
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index 7c6ffa89..63dfa6ed 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -23,15 +23,15 @@ export default {
computed: {
classes () {
return [{
- 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius
- 'user-card-rounded': this.rounded === true, // set border-radius for all sides
- 'user-card-bordered': this.bordered === true // set border for all sides
+ 'user-card-rounded-t': this.rounded === 'top', // set border-top-left-radius and border-top-right-radius
+ 'user-card-rounded': this.rounded === true, // set border-radius for all sides
+ 'user-card-bordered': this.bordered === true // set border for all sides
}]
},
style () {
const color = this.$store.state.config.customTheme.colors
- ? this.$store.state.config.customTheme.colors.bg // v2
- : this.$store.state.config.colors.bg // v1
+ ? this.$store.state.config.customTheme.colors.bg // v2
+ : this.$store.state.config.colors.bg // v1
if (color) {
const rgb = (typeof color === 'string') ? hex2rgb(color) : color
@@ -110,7 +110,7 @@ export default {
followUser () {
const store = this.$store
this.followRequestInProgress = true
- requestFollow(this.user, store).then(({sent}) => {
+ requestFollow(this.user, store).then(({ sent }) => {
this.followRequestInProgress = false
this.followRequestSent = sent
})
@@ -141,7 +141,7 @@ export default {
store.commit('setProfileView', { v })
}
},
- linkClicked ({target}) {
+ linkClicked ({ target }) {
if (target.tagName === 'SPAN') {
target = target.parentNode
}
diff --git a/src/components/user_settings/mfa.js b/src/components/user_settings/mfa.js
index d44a3ab7..3090138a 100644
--- a/src/components/user_settings/mfa.js
+++ b/src/components/user_settings/mfa.js
@@ -107,7 +107,7 @@ const Mfa = {
this.setupState.setupOTPState = 'confirm'
})
},
- doConfirmOTP () { // handler confirm enable OTP
+ doConfirmOTP () { // handler confirm enable OTP
this.error = null
this.backendInteractor.mfaConfirmOTP({
token: this.otpConfirmToken,
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index ced3efaa..19f4604f 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -99,7 +99,7 @@ const UserSettings = {
return suggestor({ emoji: [
...this.$store.state.instance.emoji,
...this.$store.state.instance.customEmoji
- ]})
+ ] })
},
pleromaBackend () {
return this.$store.state.instance.pleromaBackend
@@ -144,10 +144,10 @@ const UserSettings = {
hide_followers: this.hideFollowers,
show_role: this.showRole
/* eslint-enable camelcase */
- }}).then((user) => {
- this.$store.commit('addNewUsers', [user])
- this.$store.commit('setCurrentUser', user)
- })
+ } }).then((user) => {
+ this.$store.commit('addNewUsers', [user])
+ this.$store.commit('setCurrentUser', user)
+ })
},
updateNotificationSettings () {
this.$store.state.api.backendInteractor
@@ -162,12 +162,12 @@ const UserSettings = {
if (file.size > this.$store.state.instance[slot + 'limit']) {
const filesize = fileSizeFormatService.fileSizeFormat(file.size)
const allowedsize = fileSizeFormatService.fileSizeFormat(this.$store.state.instance[slot + 'limit'])
- this[slot + 'UploadError'] = this.$t('upload.error.base') + ' ' + this.$t('upload.error.file_too_big', {filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit})
+ this[slot + 'UploadError'] = this.$t('upload.error.base') + ' ' + this.$t('upload.error.file_too_big', { filesize: filesize.num, filesizeunit: filesize.unit, allowedsize: allowedsize.num, allowedsizeunit: allowedsize.unit })
return
}
// eslint-disable-next-line no-undef
const reader = new FileReader()
- reader.onload = ({target}) => {
+ reader.onload = ({ target }) => {
const img = target.result
this[slot + 'Preview'] = img
this[slot] = file
@@ -203,7 +203,7 @@ const UserSettings = {
if (!this.bannerPreview) { return }
this.bannerUploading = true
- this.$store.state.api.backendInteractor.updateBanner({banner: this.banner})
+ this.$store.state.api.backendInteractor.updateBanner({ banner: this.banner })
.then((user) => {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
@@ -269,11 +269,11 @@ const UserSettings = {
this.deletingAccount = true
},
deleteAccount () {
- this.$store.state.api.backendInteractor.deleteAccount({password: this.deleteAccountConfirmPasswordInput})
+ this.$store.state.api.backendInteractor.deleteAccount({ password: this.deleteAccountConfirmPasswordInput })
.then((res) => {
if (res.status === 'success') {
this.$store.dispatch('logout')
- this.$router.push({name: 'root'})
+ this.$router.push({ name: 'root' })
} else {
this.deleteAccountError = res.error
}
@@ -322,7 +322,7 @@ const UserSettings = {
})
},
queryUserIds (query) {
- return userSearchApi.search({query, store: this.$store})
+ return userSearchApi.search({ query, store: this.$store })
.then((users) => {
this.$store.dispatch('addNewUsers', users)
return map(users, 'id')
diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js
index 7ae602a2..f8100257 100644
--- a/src/components/who_to_follow/who_to_follow.js
+++ b/src/components/who_to_follow/who_to_follow.js
@@ -37,7 +37,7 @@ const WhoToFollow = {
getWhoToFollow () {
const credentials = this.$store.state.users.currentUser.credentials
if (credentials) {
- apiService.suggestions({credentials: credentials})
+ apiService.suggestions({ credentials: credentials })
.then((reply) => {
this.showWhoToFollow(reply)
})
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index a56a27ea..7d01678b 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -29,7 +29,7 @@ function getWhoToFollow (panel) {
panel.usersToFollow.forEach(toFollow => {
toFollow.name = 'Loading...'
})
- apiService.suggestions({credentials: credentials})
+ apiService.suggestions({ credentials: credentials })
.then((reply) => {
showWhoToFollow(panel, reply)
})