@ -48,12 +48,21 @@ const PostStatusForm = {
highlighted : 0 ,
highlighted : 0 ,
newStatus : {
newStatus : {
status : statusText ,
status : statusText ,
files : [ ]
files : [ ] ,
visibility : 'public'
} ,
} ,
caret : 0
caret : 0
}
}
} ,
} ,
computed : {
computed : {
vis ( ) {
return {
public : { selected : this . newStatus . visibility === 'public' } ,
unlisted : { selected : this . newStatus . visibility === 'unlisted' } ,
private : { selected : this . newStatus . visibility === 'private' } ,
direct : { selected : this . newStatus . visibility === 'direct' }
}
} ,
candidates ( ) {
candidates ( ) {
const firstchar = this . textAtCaret . charAt ( 0 )
const firstchar = this . textAtCaret . charAt ( 0 )
if ( firstchar === '@' ) {
if ( firstchar === '@' ) {
@ -118,6 +127,9 @@ const PostStatusForm = {
} ,
} ,
isOverLengthLimit ( ) {
isOverLengthLimit ( ) {
return this . hasStatusLengthLimit && ( this . statusLength > this . statusLengthLimit )
return this . hasStatusLengthLimit && ( this . statusLength > this . statusLengthLimit )
} ,
scopeOptionsEnabled ( ) {
return this . $store . state . config . scopeOptionsEnabled
}
}
} ,
} ,
methods : {
methods : {
@ -185,6 +197,8 @@ const PostStatusForm = {
this . posting = true
this . posting = true
statusPoster . postStatus ( {
statusPoster . postStatus ( {
status : newStatus . status ,
status : newStatus . status ,
spoilerText : newStatus . spoilerText || null ,
visibility : newStatus . visibility ,
media : newStatus . files ,
media : newStatus . files ,
store : this . $store ,
store : this . $store ,
inReplyToStatusId : this . replyTo
inReplyToStatusId : this . replyTo
@ -192,7 +206,8 @@ const PostStatusForm = {
if ( ! data . error ) {
if ( ! data . error ) {
this . newStatus = {
this . newStatus = {
status : '' ,
status : '' ,
files : [ ]
files : [ ] ,
visibility : newStatus . visibility
}
}
this . $emit ( 'posted' )
this . $emit ( 'posted' )
let el = this . $el . querySelector ( 'textarea' )
let el = this . $el . querySelector ( 'textarea' )
@ -239,6 +254,7 @@ const PostStatusForm = {
e . dataTransfer . dropEffect = 'copy'
e . dataTransfer . dropEffect = 'copy'
} ,
} ,
resize ( e ) {
resize ( e ) {
if ( ! e . target ) { return }
const vertPadding = Number ( window . getComputedStyle ( e . target ) [ 'padding-top' ] . substr ( 0 , 1 ) ) +
const vertPadding = Number ( window . getComputedStyle ( e . target ) [ 'padding-top' ] . substr ( 0 , 1 ) ) +
Number ( window . getComputedStyle ( e . target ) [ 'padding-bottom' ] . substr ( 0 , 1 ) )
Number ( window . getComputedStyle ( e . target ) [ 'padding-bottom' ] . substr ( 0 , 1 ) )
e . target . style . height = 'auto'
e . target . style . height = 'auto'
@ -249,6 +265,9 @@ const PostStatusForm = {
} ,
} ,
clearError ( ) {
clearError ( ) {
this . error = null
this . error = null
} ,
changeVis ( visibility ) {
this . newStatus . visibility = visibility
}
}
}
}
}
}