Browse Source

字数限制 500 -> 5000

pull/4/head
欧醚 5 years ago
parent
commit
3b326e3a55
3 changed files with 4 additions and 5 deletions
  1. +3
    -3
      app/javascript/mastodon/features/compose/components/compose_form.js
  2. +0
    -1
      app/javascript/mastodon/features/ui/components/columns_area.js
  3. +1
    -1
      app/validators/status_length_validator.rb

+ 3
- 3
app/javascript/mastodon/features/compose/components/compose_form.js View File

@ -88,7 +88,7 @@ class ComposeForm extends ImmutablePureComponent {
const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props;
const fulltext = [this.props.spoilerText, countableText(this.props.text)].join('');
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
if (isSubmitting || isUploading || isChangingUpload || length(fulltext) > 5000 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
return;
}
@ -181,7 +181,7 @@ class ComposeForm extends ImmutablePureComponent {
const { intl, onPaste, showSearch, anyMedia } = this.props;
const disabled = this.props.isSubmitting;
const text = [this.props.spoilerText, countableText(this.props.text)].join('');
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > 500 || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > 5000 || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
let publishText = '';
if (this.props.privacy === 'private' || this.props.privacy === 'direct') {
@ -243,7 +243,7 @@ class ComposeForm extends ImmutablePureComponent {
<PrivacyDropdownContainer />
<SpoilerButtonContainer />
</div>
<div className='character-counter__wrapper'><CharacterCounter max={500} text={text} /></div>
<div className='character-counter__wrapper'><CharacterCounter max={5000} text={text} /></div>
</div>
<div className='compose-form__publish'>

+ 0
- 1
app/javascript/mastodon/features/ui/components/columns_area.js View File

@ -159,7 +159,6 @@ class ColumnsArea extends ImmutablePureComponent {
React.cloneElement(this.props.children) :
<ColumnLoading title={title} icon={icon} />;
console.log(link.props);
return (
<div className='columns-area columns-area--mobile' key={index}>
{

+ 1
- 1
app/validators/status_length_validator.rb View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class StatusLengthValidator < ActiveModel::Validator
MAX_CHARS = 500
MAX_CHARS = 5000
def validate(status)
return unless status.local? && !status.reblog?

Loading…
Cancel
Save