-
Notifications
You must be signed in to change notification settings - Fork 180
Mutation observer #372
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
Mutation observer #372
Conversation
Згадав, що у вас тут було прийнято замість апострофа використовували одинарну праву лапку. Це досі актуально, чи мій "стандартний" апостроф теж згодиться? |
@AdriandeCita дякую за переклад, стандартний апостроф підійде :) Дивлюся :) |
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.
Дякую за чудовий переклад!
Подивіться, будь ласка, мої коментарі, напишіть мені, якщо не згодні з чимось :)
|
||
`MutationObserver` is a built-in object that observes a DOM element and fires a callback when it detects a change. | ||
`MutationObserver` -- це вбудований об'єкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну. |
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.
`MutationObserver` -- це вбудований об'єкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну. | |
`MutationObserver` -- це вбудований об’єкт, який спостерігає за елементом DOM і викликає функцію зворотного виклику кожного разу, коли він помічає зміну. |
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.
FYI, ви пропонуєте замінити стандартний апостроф на символ правої одинарної лапки.
'
- https://unicode-table.com/en/0027/
’
- https://unicode-table.com/en/2019/
Загалом я не проти, просто це виглядає дивним
- `attributes` -- attributes of `node`, | ||
- `attributeFilter` -- an array of attribute names, to observe only selected ones. | ||
- `characterData` -- whether to observe `node.data` (text content), | ||
`config` -- це об'єкт із булевими опціями, які вказують "на якого роду зміни слід реагувати": |
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.
`config` -- це об'єкт із булевими опціями, які вказують "на якого роду зміни слід реагувати": | |
`config` -- це об’єкт із булевими опціями, які вказують "на якого роду зміни слід реагувати": |
|
||
Then after any changes, the `callback` is executed: changes are passed in the first argument as a list of [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) objects, and the observer itself as the second argument. | ||
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку об'єктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач. |
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.
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку об'єктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач. | |
Далі після будь-яких змін виконується `callback`: зміни передаються першим аргументом у вигляді списку об’єктів типу [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord), а другим аргументом передається сам спостерігач. |
|
||
[MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) objects have properties: | ||
Об'єкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості: |
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.
Об'єкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості: | |
Об’єкти [MutationRecord](https://dom.spec.whatwg.org/#mutationrecord) містять такі властивості: |
- `target` -- де саме відбулася зміна: для `"attributes"` це елемент, або текстовий вузол у випадку `"characterData"`, або елемент для мутації типу `"childList"`, | ||
- `addedNodes/removedNodes` -- вузли, які було додано/прибрано, | ||
- `previousSibling/nextSibling` -- відповідно попередній та наступний елемент відносно доданих/прибраних вузлів, | ||
- `attributeName/attributeNamespace` -- ім'я/простір імен (для XML) зміненого атрибута, |
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.
- `attributeName/attributeNamespace` -- ім'я/простір імен (для XML) зміненого атрибута, | |
- `attributeName/attributeNamespace` -- ім’я/простір імен (для XML) зміненого атрибута, |
|
||
If you run this code, it starts observing the element below and highlighting any code snippets that appear there: | ||
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який з'являтиметься там: |
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.
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який з'являтиметься там: | |
Якщо ви запустите цей код, він почне спостерігати за наведеним нижче елементом, і підсвічувати будь який фрагмент коду, який з’являтиметься там: |
// should be called before disconnecting, | ||
// if you care about possibly unhandled recent mutations | ||
// отримання переліку необроблених мутацій | ||
// повинно викликатись перед роз'єднанням, |
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". |
Co-authored-by: Stanislav <s.dolgachov@gmail.com>
@stas-dolgachov прийняв усі зауваження, окрім лапок. Стосовно них я залишив коментар вище 🙂 |
Згоден, щодо апострофу. Думаю, ми спробуємо найближчим часом привести все до ладу у цьому питанні якось автоматично :) Дякую, за ваш внесок! |
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉 |
No description provided.