Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
pleroma-fe
Commits
e536a562
Commit
e536a562
authored
5 years ago
by
HJ
Browse files
Options
Downloads
Patches
Plain Diff
Linting
parent
4d12cd61
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!1028
`master` refresh with `develop`
,
!824
EmojiInput refactoring
Pipeline
#12966
passed
5 years ago
Stage: lint
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/post_status_form/post_status_form.js
+17
-16
17 additions, 16 deletions
src/components/post_status_form/post_status_form.js
with
17 additions
and
16 deletions
src/components/post_status_form/post_status_form.js
+
17
−
16
View file @
e536a562
...
...
@@ -3,17 +3,16 @@ import MediaUpload from '../media_upload/media_upload.vue'
import
ScopeSelector
from
'
../scope_selector/scope_selector.vue
'
import
EmojiInput
from
'
../emoji-input/emoji-input.vue
'
import
fileTypeService
from
'
../../services/file_type/file_type.service.js
'
import
Completion
from
'
../../services/completion/completion.js
'
import
{
take
,
filter
,
reject
,
map
,
uniqBy
}
from
'
lodash
'
import
{
reject
,
map
,
uniqBy
}
from
'
lodash
'
import
suggestor
from
'
../emoji-input/suggestor.js
'
const
buildMentionsString
=
({
user
,
attentions
},
currentUser
)
=>
{
const
buildMentionsString
=
({
user
,
attentions
},
currentUser
)
=>
{
let
allAttentions
=
[...
attentions
]
allAttentions
.
unshift
(
user
)
allAttentions
=
uniqBy
(
allAttentions
,
'
id
'
)
allAttentions
=
reject
(
allAttentions
,
{
id
:
currentUser
.
id
})
allAttentions
=
reject
(
allAttentions
,
{
id
:
currentUser
.
id
})
let
mentions
=
map
(
allAttentions
,
(
attention
)
=>
{
return
`@
${
attention
.
screen_name
}
`
...
...
@@ -49,17 +48,17 @@ const PostStatusForm = {
let
statusText
=
preset
||
''
const
scopeCopy
=
typeof
this
.
$store
.
state
.
config
.
scopeCopy
===
'
undefined
'
?
this
.
$store
.
state
.
instance
.
scopeCopy
:
this
.
$store
.
state
.
config
.
scopeCopy
?
this
.
$store
.
state
.
instance
.
scopeCopy
:
this
.
$store
.
state
.
config
.
scopeCopy
if
(
this
.
replyTo
)
{
const
currentUser
=
this
.
$store
.
state
.
users
.
currentUser
statusText
=
buildMentionsString
({
user
:
this
.
repliedUser
,
attentions
:
this
.
attentions
},
currentUser
)
}
const
scope
=
(
this
.
copyMessageScope
&&
scopeCopy
||
this
.
copyMessageScope
===
'
direct
'
)
?
this
.
copyMessageScope
:
this
.
$store
.
state
.
users
.
currentUser
.
default_scope
const
scope
=
(
(
this
.
copyMessageScope
&&
scopeCopy
)
||
this
.
copyMessageScope
===
'
direct
'
)
?
this
.
copyMessageScope
:
this
.
$store
.
state
.
users
.
currentUser
.
default_scope
const
contentType
=
typeof
this
.
$store
.
state
.
config
.
postContentType
===
'
undefined
'
?
this
.
$store
.
state
.
instance
.
postContentType
...
...
@@ -91,8 +90,8 @@ const PostStatusForm = {
},
showAllScopes
()
{
const
minimalScopesMode
=
typeof
this
.
$store
.
state
.
config
.
minimalScopesMode
===
'
undefined
'
?
this
.
$store
.
state
.
instance
.
minimalScopesMode
:
this
.
$store
.
state
.
config
.
minimalScopesMode
?
this
.
$store
.
state
.
instance
.
minimalScopesMode
:
this
.
$store
.
state
.
config
.
minimalScopesMode
return
!
minimalScopesMode
},
emojiUserSuggestor
()
{
...
...
@@ -105,10 +104,12 @@ const PostStatusForm = {
})
},
emojiSuggestor
()
{
return
suggestor
({
emoji
:
[
...
this
.
$store
.
state
.
instance
.
emoji
,
...
this
.
$store
.
state
.
instance
.
customEmoji
]})
return
suggestor
({
emoji
:
[
...
this
.
$store
.
state
.
instance
.
emoji
,
...
this
.
$store
.
state
.
instance
.
customEmoji
]
})
},
emoji
()
{
return
this
.
$store
.
state
.
instance
.
emoji
||
[]
...
...
@@ -238,7 +239,7 @@ const PostStatusForm = {
},
fileDrop
(
e
)
{
if
(
e
.
dataTransfer
.
files
.
length
>
0
)
{
e
.
preventDefault
()
// allow dropping text like before
e
.
preventDefault
()
// allow dropping text like before
this
.
dropFiles
=
e
.
dataTransfer
.
files
}
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment