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
Update article.md #308
Update article.md #308
Conversation
Статью перевела. Задание чуть позже сегодня сделаю. Жду комментариев и пожеланий по исправлениям в переводе.
@tay-na отлично, там еще одно задание к главе, его тоже нужно перевести. |
@xcurveballx да, я помню про задание - если вы не против, я его завтра пришлю. |
@tay-na хорошо, особой спешки нет, добавьте перевод задания позднее. |
Please make the requested changes. After it, add a comment "/done". |
внесла изменения
Ок, тогда продолжим ревью после перевода задания. |
|
||
[iframe border="1" src="solution" height=180] | ||
|
||
P.S. For this task we can assume that list items are text-only. No nested tags. | ||
P.P.S. Prevent the native browser selection of the text on clicks. | ||
P.S. Для этого задания можно предположить, что все элементы списка доступны только в текстовом формате. Нет вложенных тэгов. |
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.
тегов
P.S. For this task we can assume that list items are text-only. No nested tags. | ||
P.P.S. Prevent the native browser selection of the text on clicks. | ||
P.S. Для этого задания можно предположить, что все элементы списка доступны только в текстовом формате. Нет вложенных тэгов. | ||
P.P.S. Предотвратите стандартное для браузера выделение текста при клике. |
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.
при кликах
|
||
- A click on a list element selects only that element (adds the class `.selected`), deselects all others. | ||
- If a click is made with `key:Ctrl` (`key:Cmd` for Mac), then the selection is toggled on the element, but other elements are not modified. | ||
- При клике на элемент списка выделяет только этот элемент (добавляется класс `.selected`), отменяется выделение остальных элементов. |
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.
выделяется
Please make the requested changes. After it, add a comment "/done". |
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.
Спасибо! Внеси, пожалуйста, изменения.
|
||
[iframe border="1" src="solution" height=180] | ||
|
||
P.S. For this task we can assume that list items are text-only. No nested tags. | ||
P.P.S. Prevent the native browser selection of the text on clicks. | ||
P.S. Для этого задания можно предположить, что все элементы списка доступны только в текстовом формате. Нет вложенных тегов. |
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.
P.S. В этом задании все элементы списка содержат только текст. Без вложенных тегов.
|
||
The most used simple events are: | ||
Наиболее часто используются простые события: |
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.
Самые часто используемые простые события:
|
||
`click` | ||
: Triggers after `mousedown` and then `mouseup` over the same element if the left mouse button was used. | ||
: Вызывается при `mousedown` , а затем `mouseup` , над одним и тем же элементом, если использовалась левая кнопка мыши. |
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.
: Вызывается при mousedown
, а затем mouseup
над одним и тем же элементом, если использовалась левая кнопка мыши.
|
||
In most cases when Windows/Linux uses `key:Ctrl`, on Mac people use `key:Cmd`. So where a Windows user presses `key:Ctrl+Enter` or `key:Ctrl+A`, a Mac user would press `key:Cmd+Enter` or `key:Cmd+A`, and so on, most apps use `key:Cmd` instead of `key:Ctrl`. | ||
В большинстве случаев, когда в Windows/Linux используется `key:Ctrl`, на Mac люди используют `key:Cmd`. Поэтому, когда пользователь Windows нажимает `key:Ctrl+Enter` и `key:Ctrl+A`, пользователь Mac нажимает `key:Cmd+Enter` или `key:Cmd+A`, и так далее, большинство приложений использует `key:Cmd` вместо `key:Ctrl`. |
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.
В большинстве случаев, когда в Windows/Linux используется key:Ctrl
, на Mac люди используют key:Cmd
. Поэтому, когда пользователь Windows нажимает key:Ctrl+Enter
и key:Ctrl+A
, пользователь Mac нажимает key:Cmd+Enter
или key:Cmd+A
, и так далее, большинство приложений используют key:Cmd
вместо key:Ctrl
.
|
||
Even if we'd like to force Mac users to `key:Ctrl`+click -- that's kind of difficult. The problem is: a left-click with `key:Ctrl` is interpreted as a *right-click* on Mac, and it generates the `contextmenu` event, not `click` like Windows/Linux. | ||
Даже если мы хотим заставить людей использовать `key:Ctrl`+клик на Mac, это довольно сложно. Проблема в том, что левый клик в сочетании с `key:Ctrl` интерпретируется как *правый клик* на Mac и генерирует событие `contextmenu`, а не `click` как на Windows/Linux. |
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.
Даже если мы и хотели бы заставить людей использовать key:Ctrl
+клик на Mac, это довольно сложно. Проблема в том, что левый клик в сочетании с key:Ctrl
интерпретируется как правый клик на Mac и генерирует событие contextmenu
, а не click
как на Windows/Linux.
|
||
The text inside it is still selectable. However, the selection should start not on the text itself, but before or after it. Usually that's fine though. | ||
Текст внутри него по прежнему можно выделить. Однако, выделение должно начаться не на самом тексте, а до него или после. Обычно это нормально. |
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.
Текст внутри него по прежнему можно выделить. Однако, выделение должно начаться не на самом тексте, а до него или после. Обычно это нормально воспринимается пользователями.
<b ondblclick="*!*getSelection().removeAllRanges()*/!*"> | ||
Double-click me | ||
Двойной клик на мне |
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.
Сделайте двойной клик на мне
``` | ||
|
||
If you double-click on the bold element, then the selection appears and then is immediately removed. That doesn't look nice though. | ||
При двойном клике на элементе, выделенном жирным шрифтом, выделение сначала появится, а затем будет немедленно снято. Хотя выглядит это не очень красиво. |
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.
При двойном клике на элементе, выделенном жирным шрифтом, выделение появится и тут же будет немедленно снято ("мигнёт"). Выглядит это не очень красиво.
|
||
It's also important to deal with text selection as an unwanted side-effect of clicks. | ||
Также важно позаботиться о выделении текста, как о нежелательном побочном эффекте кликов. |
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.
Также важно позаботиться о выделении текста, оно может быть нежелательным побочным эффектом кликов.
Есть несколько способов сделать это, например: | ||
1. CSS-свойство `user-select:none` (с префиксами для различных браузеров) полностью отключает выделение текста. | ||
2. Отмена выделения постфактум, используя `getSelection().removeAllRanges()`. | ||
3. Обработать событие `mousedown` и предотвратить его действие по умолчанию (обычно является лучшим решением). |
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.
Добавь плиз строку:
Впрочем, работа с выделением - это отдельная тема, раскрытая в соответствующей главе < info:selection-range >.
Please make the requested changes. After it, add a comment "/done". |
Я внесла поправки, которые вы просили. Что-то нужно ещё изменить в переводе? |
В последней строчке убери плиз пробелы вокруг < ... > =) |
Впрочем, я сам после мержа. Спасибо! |
🚀 |
Статью перевела. Задание пришлю завтра. Жду комментарии и пожелания по исправлениям в переводе.