Remove character counter from edit profile (#9100)
* Remove display name and bio counter hint, simply limit input * Remove now redundant translations * Fix code style issue
This commit is contained in:
parent
768b0f132d
commit
161aeadbb4
47 changed files with 5 additions and 268 deletions
|
@ -21,7 +21,6 @@ window.addEventListener('message', e => {
|
|||
});
|
||||
|
||||
function main() {
|
||||
const { length } = require('stringz');
|
||||
const IntlMessageFormat = require('intl-messageformat').default;
|
||||
const { timeAgoString } = require('../mastodon/components/relative_timestamp');
|
||||
const { delegate } = require('rails-ujs');
|
||||
|
@ -133,26 +132,13 @@ function main() {
|
|||
});
|
||||
|
||||
delegate(document, '#account_display_name', 'input', ({ target }) => {
|
||||
const nameCounter = document.querySelector('.name-counter');
|
||||
const name = document.querySelector('.card .display-name strong');
|
||||
|
||||
if (nameCounter) {
|
||||
nameCounter.textContent = 30 - length(target.value);
|
||||
}
|
||||
const name = document.querySelector('.card .display-name strong');
|
||||
|
||||
if (name) {
|
||||
name.innerHTML = emojify(target.value);
|
||||
}
|
||||
});
|
||||
|
||||
delegate(document, '#account_note', 'input', ({ target }) => {
|
||||
const noteCounter = document.querySelector('.note-counter');
|
||||
|
||||
if (noteCounter) {
|
||||
noteCounter.textContent = 160 - length(target.value);
|
||||
}
|
||||
});
|
||||
|
||||
delegate(document, '#account_avatar', 'change', ({ target }) => {
|
||||
const avatar = document.querySelector('.card .avatar img');
|
||||
const [file] = target.files || [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue