-
Notifications
You must be signed in to change notification settings - Fork 98
Searching: getElement*, querySelector* #278
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
Searching: getElement*, querySelector* #278
Conversation
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 re-format your translation so that the number of lines match the number of lines in the original version. comment /done when done.
Please make the requested changes. After it, add a comment "/done". |
/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.
Hello again,
First of all, thanks for your contribution and time devoted to this project;
As you have probably guessed, using markdown with two languages which have different directions is a bit challenging; so we kindly ask you to follow the steps mentioned in this repo to bring a local server up and see your changes as they are made to each individual markdown.
all changes should maintain the readability of document; currently, that is not the case with your changes.
Thanks again
Please make the requested changes. After it, add a comment "/done". |
Checking the translation with the server repo isn't that necessary. You can read the article on github since it'll keep the RTL format of Persian (although in some cases it's overridden, but it's ok overall). |
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.
Hi @shahrzadJavadiKoushesh , i have proposed some changes to improve your translation even further. please review them.
``` | ||
|
||
## querySelectorAll [#querySelectorAll] | ||
|
||
By far, the most versatile method, `elem.querySelectorAll(css)` returns all elements inside `elem` matching the given CSS selector. | ||
تا اینجا، همهکارهترین روش `elem.querySelectorAll(css)` بود که تمام elementهای درون `elem` که با css selector داده شده تطابق دارند را انتخاب میکند. |
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.
تا اینجا، همهکارهترین روش `elem.querySelectorAll(css)` بود که تمام elementهای درون `elem` که با css selector داده شده تطابق دارند را انتخاب میکند. | |
با اختلاف، جامعترین روش جستجو، `elem.querySelectorAll(css)` است که تمام elementهای درون `elem` که با css selector داده شده تطابق دارند را انتخاب میکند. |
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.
تا اینجا، همهکارهترین روش `elem.querySelectorAll(css)` بود که تمام elementهای درون `elem` که با css selector داده شده تطابق دارند را انتخاب میکند. | |
تا اینجا، جامعترین روش جستجو `elem.querySelectorAll(css)` بود که تمام elementهای درون `elem` که با css selector داده شده تطابق دارند را انتخاب میکند. |
"By far" translation is correct.
|
||
The method comes in handy when we are iterating over elements (like in an array or something) and trying to filter out those that interest us. | ||
این روش زمانی به کار میآید که میخواهیم روی elementهایی (مثل آرایه یا همچین چیزی) iterate کنیم و آنهایی که مطلوب هستند را فیلتر کنیم. | ||
|
||
For instance: |
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.
For instance: | |
برای مثال: |
|
||
Today, they are mostly history, as `querySelector` is more powerful and shorter to write. | ||
امروزه آنها بیشتر تاریخچه هستند چون `querySelector` قدرتمندتر است و برای نوشتن سریعتر است. |
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.
امروزه آنها بیشتر تاریخچه هستند چون `querySelector` قدرتمندتر است و برای نوشتن سریعتر است. | |
امروزه آنها کمتر استفاده میشوند چون `querySelector` قدرتمندتر است و برای نوشتن سریعتر است. |
@@ -363,12 +365,12 @@ There are 6 main methods to search for nodes in DOM: | |||
</tbody> | |||
</table> | |||
|
|||
By far the most used are `querySelector` and `querySelectorAll`, but `getElement(s)By*` can be sporadically helpful or found in the old scripts. | |||
.های قدیمی یافت شود script هم گاهی به صورت پراکنده میتواند مفید باشد یا در `getElement(s)By` شده است، اما `querySelectorAll` و `querySelector` تا اینجا بیشترین استفاده از |
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.
.های قدیمی یافت شود script هم گاهی به صورت پراکنده میتواند مفید باشد یا در `getElement(s)By` شده است، اما `querySelectorAll` و `querySelector` تا اینجا بیشترین استفاده از | |
.های قدیمی یافت شود script هم گاهی به صورت پراکنده میتواند مفید باشد یا در `getElement(s)By` شده است، اما `querySelectorAll` و `querySelector` با اختلاف بیشترین استفاده از |
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.
The translation is ok, but aren't the words disordered?
It's not a code comment, so if you've changed the order of translation, please turn it back.
And let's mention one more method here to check for the child-parent relationship, as it's sometimes useful: | ||
- `elemA.contains(elemB)` returns true if `elemB` is inside `elemA` (a descendant of `elemA`) or when `elemA==elemB`. | ||
و بیایید اینجا یک روش دیگر برای بررسی رابطه والد و فرزند را چک کنیم،چون بعضی وقتها مفید است: | ||
.را برمیگرداند true مثدار `elemA.contains(elemB)` باشد، عبارت `elemA==elemB` یا وقتی که (`elemA` از فرزندان) باشد `elemA` داخل `elemB` اگر - |
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.
.را برمیگرداند true مثدار `elemA.contains(elemB)` باشد، عبارت `elemA==elemB` یا وقتی که (`elemA` از فرزندان) باشد `elemA` داخل `elemB` اگر - | |
.را برمیگرداند true مقدار `elemA.contains(elemB)` باشد، عبارت `elemA==elemB` یا وقتی که (`elemA` از فرزندان) باشد `elemA` داخل `elemB` اگر - |
alert(elem); // 5 | ||
</script> | ||
``` | ||
|
||
```warn header="Please don't use id-named global variables to access elements" | ||
This behavior is described [in the specification](https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object), but it is supported mainly for compatibility. | ||
```warn header=".ها استفاده نکنیدelement برای دسترسی به global لفطا از متغیرهای" |
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.
```warn header=".ها استفاده نکنیدelement برای دسترسی به global لفطا از متغیرهای" | |
```warn header=".ها استفاده نکنیدelement برای دسترسی به global لطفا از متغیرهای" |
|
||
How to find?... | ||
چگونه پیدا کنیم؟ |
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.
چگونه پیدا کنیم؟ | |
چگونه ... را پیدا کنیم؟ |
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.
چگونه پیدا کنیم؟ | |
چگونه موارد زیر را پیدا کنیم؟ |
The ellipsis refers to the follow-up lines.
Please make the requested changes. After it, add a comment "/done". |
Thanks for the review, @alivarastepour :D |
/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.
LGTM!
Thanks for your contribution, @shahrzadJavadiKoushesh :D |
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉 |
No description provided.