mirror of
https://github.com/kikobar/mastodon.git
synced 2024-11-16 20:22:18 +00:00
Add support for 11000 characters per post
This commit is contained in:
parent
4fcc026f0f
commit
82c9528a21
|
@ -100,7 +100,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
const fulltext = this.getFulltextForCharacterCounting();
|
const fulltext = this.getFulltextForCharacterCounting();
|
||||||
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
const isOnlyWhitespace = fulltext.length !== 0 && fulltext.trim().length === 0;
|
||||||
|
|
||||||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
|
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 11000 || (isOnlyWhitespace && !anyMedia));
|
||||||
};
|
};
|
||||||
|
|
||||||
handleSubmit = (e) => {
|
handleSubmit = (e) => {
|
||||||
|
@ -297,7 +297,7 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='character-counter__wrapper'>
|
<div className='character-counter__wrapper'>
|
||||||
<CharacterCounter max={500} text={this.getFulltextForCharacterCounting()} />
|
<CharacterCounter max={11000} text={this.getFulltextForCharacterCounting()} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,7 +11,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
|
|
||||||
attributes :domain, :title, :version, :source_url, :description,
|
attributes :domain, :title, :version, :source_url, :description,
|
||||||
:usage, :thumbnail, :languages, :configuration,
|
:usage, :thumbnail, :languages, :configuration,
|
||||||
:registrations
|
:registrations, :max_toot_chars
|
||||||
|
|
||||||
has_one :contact, serializer: ContactSerializer
|
has_one :contact, serializer: ContactSerializer
|
||||||
has_many :rules, serializer: REST::RuleSerializer
|
has_many :rules, serializer: REST::RuleSerializer
|
||||||
|
@ -89,6 +89,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def max_toot_chars
|
||||||
|
11000
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def registrations_enabled?
|
def registrations_enabled?
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class StatusLengthValidator < ActiveModel::Validator
|
class StatusLengthValidator < ActiveModel::Validator
|
||||||
MAX_CHARS = 500
|
MAX_CHARS = 11000
|
||||||
URL_PLACEHOLDER_CHARS = 23
|
URL_PLACEHOLDER_CHARS = 23
|
||||||
URL_PLACEHOLDER = 'x' * 23
|
URL_PLACEHOLDER = 'x' * 23
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue