@ -1,4 +1,5 @@
import React from 'react' ;
import React from 'react' ;
import CharacterCounter from './character_counter' ;
import ImmutablePropTypes from 'react-immutable-proptypes' ;
import ImmutablePropTypes from 'react-immutable-proptypes' ;
import PropTypes from 'prop-types' ;
import PropTypes from 'prop-types' ;
import ReplyIndicatorContainer from '../containers/reply_indicator_container' ;
import ReplyIndicatorContainer from '../containers/reply_indicator_container' ;
@ -11,13 +12,12 @@ import UploadFormContainer from '../containers/upload_form_container';
import WarningContainer from '../containers/warning_container' ;
import WarningContainer from '../containers/warning_container' ;
import { isMobile } from 'flavours/glitch/is_mobile' ;
import { isMobile } from 'flavours/glitch/is_mobile' ;
import ImmutablePureComponent from 'react-immutable-pure-component' ;
import ImmutablePureComponent from 'react-immutable-pure-component' ;
import { length } from 'stringz' ;
import { countableText } from '../util/counter' ;
import { countableText } from '../util/counter' ;
import { maxChars } from 'flavours/glitch/initial_state' ;
import OptionsContainer from '../containers/options_container' ;
import OptionsContainer from '../containers/options_container' ;
import Publisher from './publisher' ;
import Publisher from './publisher' ;
import TextareaIcons from './textarea_icons' ;
import TextareaIcons from './textarea_icons' ;
import { maxChars } from 'flavours/glitch/initial_state' ;
import CharacterCounter from './character_counter' ;
import { length } from 'stringz' ;
const messages = defineMessages ( {
const messages = defineMessages ( {
placeholder : { id : 'compose_form.placeholder' , defaultMessage : 'What is on your mind?' } ,
placeholder : { id : 'compose_form.placeholder' , defaultMessage : 'What is on your mind?' } ,
@ -76,7 +76,6 @@ class ComposeForm extends ImmutablePureComponent {
preselectOnReply : PropTypes . bool ,
preselectOnReply : PropTypes . bool ,
onChangeSpoilerness : PropTypes . func ,
onChangeSpoilerness : PropTypes . func ,
onChangeVisibility : PropTypes . func ,
onChangeVisibility : PropTypes . func ,
onPaste : PropTypes . func ,
onMediaDescriptionConfirm : PropTypes . func ,
onMediaDescriptionConfirm : PropTypes . func ,
} ;
} ;
@ -164,11 +163,11 @@ class ComposeForm extends ImmutablePureComponent {
} ;
} ;
/ / S e l e c t s a s u g g e s t i o n f r o m t h e a u t o f i l l .
/ / S e l e c t s a s u g g e s t i o n f r o m t h e a u t o f i l l .
on SuggestionSelected = ( tokenStart , token , value ) => {
handle SuggestionSelected = ( tokenStart , token , value ) => {
this . props . onSuggestionSelected ( tokenStart , token , value , [ 'text' ] ) ;
this . props . onSuggestionSelected ( tokenStart , token , value , [ 'text' ] ) ;
} ;
} ;
on SpoilerSuggestionSelected = ( tokenStart , token , value ) => {
handle SpoilerSuggestionSelected = ( tokenStart , token , value ) => {
this . props . onSuggestionSelected ( tokenStart , token , value , [ 'spoiler_text' ] ) ;
this . props . onSuggestionSelected ( tokenStart , token , value , [ 'spoiler_text' ] ) ;
} ;
} ;
@ -177,7 +176,7 @@ class ComposeForm extends ImmutablePureComponent {
this . handleSubmit ( ) ;
this . handleSubmit ( ) ;
}
}
if ( e . keyCode == 13 && e . altKey ) {
if ( e . keyCode == = 13 && e . altKey ) {
this . handleSecondarySubmit ( ) ;
this . handleSecondarySubmit ( ) ;
}
}
} ;
} ;
@ -281,9 +280,7 @@ class ComposeForm extends ImmutablePureComponent {
const {
const {
handleEmojiPick ,
handleEmojiPick ,
handleSecondarySubmit ,
handleSecondarySubmit ,
handleSelect ,
handleSubmit ,
handleSubmit ,
handleRefTextarea ,
} = this ;
} = this ;
const {
const {
advancedOptions ,
advancedOptions ,
@ -291,7 +288,6 @@ class ComposeForm extends ImmutablePureComponent {
isSubmitting ,
isSubmitting ,
layout ,
layout ,
onChangeSpoilerness ,
onChangeSpoilerness ,
onChangeVisibility ,
onClearSuggestions ,
onClearSuggestions ,
onFetchSuggestions ,
onFetchSuggestions ,
onPaste ,
onPaste ,
@ -322,10 +318,10 @@ class ComposeForm extends ImmutablePureComponent {
onKeyDown = { this . handleKeyDown }
onKeyDown = { this . handleKeyDown }
disabled = { ! spoiler }
disabled = { ! spoiler }
ref = { this . handleRefSpoilerText }
ref = { this . handleRefSpoilerText }
suggestions = { this . props . suggestions }
suggestions = { suggestions }
onSuggestionsFetchRequested = { onFetchSuggestions }
onSuggestionsFetchRequested = { onFetchSuggestions }
onSuggestionsClearRequested = { onClearSuggestions }
onSuggestionsClearRequested = { onClearSuggestions }
onSuggestionSelected = { this . on SpoilerSuggestionSelected}
onSuggestionSelected = { this . handle SpoilerSuggestionSelected}
searchTokens = { [ ':' ] }
searchTokens = { [ ':' ] }
id = 'glitch.composer.spoiler.input'
id = 'glitch.composer.spoiler.input'
className = 'spoiler-input__input'
className = 'spoiler-input__input'
@ -342,11 +338,11 @@ class ComposeForm extends ImmutablePureComponent {
value = { this . props . text }
value = { this . props . text }
onChange = { this . handleChange }
onChange = { this . handleChange }
onKeyDown = { this . handleKeyDown }
onKeyDown = { this . handleKeyDown }
suggestions = { this . props . suggestions }
suggestions = { suggestions }
onFocus = { this . handleFocus }
onFocus = { this . handleFocus }
onSuggestionsFetchRequested = { onFetchSuggestions }
onSuggestionsFetchRequested = { onFetchSuggestions }
onSuggestionsClearRequested = { onClearSuggestions }
onSuggestionsClearRequested = { onClearSuggestions }
onSuggestionSelected = { this . on SuggestionSelected}
onSuggestionSelected = { this . handle SuggestionSelected}
onPaste = { onPaste }
onPaste = { onPaste }
autoFocus = { ! showSearch && ! isMobile ( window . innerWidth , layout ) }
autoFocus = { ! showSearch && ! isMobile ( window . innerWidth , layout ) }
lang = { this . props . lang }
lang = { this . props . lang }