-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Правда или действие #11
Правда или действие #11
Conversation
js/form.js
Outdated
COMMENT_MAXLENGTH_ERROR: `Максимальная длина комментария ${COMMENT_MAXLENGTH} символов`, | ||
HASHTAG_MAXLENGTH_ERROR: `Максимальная длина хэштега ${HASHTAG_MAXLENGTH} символов`, | ||
HASHTAG_COUNT_ERROR: `Нельзя указать больше ${HASHTAGS_MAXQUANTITY} хэштегов`, | ||
INVALID_HASHTAG_STRING: 'Хэштег должен начинаться с #, состоять из букв и чисел без пробелов и не может состоять только из одной решётки', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
константы получаемые на основе других значений именуем в camelCase.
В данном случае в виде словаря
const errorMessage = {
commentMaxLenght: `Максимальная длина комментария ${COMMENT_MAXLENGTH} символов`,
};
js/form.js
Outdated
const onFormSubmit = (evt) => { | ||
evt.preventDefault(); | ||
pristine.validate(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ошибка линтера
js/form.js
Outdated
pristine.addValidator(commentTextarea, validateComment, errorHashtagMessages.COMMENT_MAXLENGTH_ERROR); | ||
|
||
// Валидация хештегов | ||
const getHashtags = (value) => value.toLowerCase().trim().split(' '); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
будет некорректно работать, например в таких случаях: #ffff #4444 #dfgddfk
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
♻️ Я собрал ваш пулреквест. Посмотреть можно здесь. |
🎓 Правда или действие
💥 https://htmlacademy-javascript.github.io/1582959-kekstagram-2/11/