Skip to content

Commit f721a03

Browse files
authored
Merge branch 'javascript-tutorial:master' into master
2 parents 67b2af9 + 1d24444 commit f721a03

13 files changed

Lines changed: 232 additions & 237 deletions

File tree

1-js/10-error-handling/2-custom-errors/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Error {
3838

3939
حالا بیایید با `ValidationError` آن را ارث‌بری کنیم و در عمل امتحانش کنیم:
4040

41-
```js run untrusted
41+
```js run
4242
*!*
4343
class ValidationError extends Error {
4444
*/!*

1-js/13-modules/01-modules-intro/article.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@
99

1010
این ها نمونه هایی از این کتابخانه ها است (این بخش صرفا جنبه تاریخی دارد):
1111

12-
<<<<<<< HEAD
1312
- [AMD](https://en.wikipedia.org/wiki/Asynchronous_module_definition) -- یکی از قدیمی ترین سیستم های ماژول بندی، که اولین بار توسط کتابخانه [require.js](http://requirejs.org/) پیاده سازی شد .
1413
- [CommonJS](http://wiki.commonjs.org/wiki/Modules/1.1) -- سیستم ماژول بندی که برای سرورها Node.js درست شد.
1514
- [UMD](https://github.com/umdjs/umd) -- یک سیستم ماژول بندی که به عنوان یک سیستم جامع شناخته شده و با هردو سیستم AMD و CommonJS همخوانی دارد.
16-
=======
17-
- [AMD](https://en.wikipedia.org/wiki/Asynchronous_module_definition) -- one of the most ancient module systems, initially implemented by the library [require.js](https://requirejs.org/).
18-
- [CommonJS](https://wiki.commonjs.org/wiki/Modules/1.1) -- the module system created for Node.js server.
19-
- [UMD](https://github.com/umdjs/umd) -- one more module system, suggested as a universal one, compatible with AMD and CommonJS.
20-
>>>>>>> 5dff42ba283bce883428c383c080fa9392b71df8
2115

2216
همه این سیستم ها کم کم تبدیل به بخشی از تاریخ شدند اما هنوز هم می توان آن ها را در اسکریپت های قدیمی مشاهده کرد.
2317

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
There are many ways to do it.
1+
راه‌های زیادی برای آن وجود دارد.
22

3-
Here are some of them:
3+
اینجا برخی از آن‌ها را می‌بینیم:
44

55
```js
6-
// 1. The table with `id="age-table"`.
6+
// 1. جدول یا `id="age-table"`
77
let table = document.getElementById('age-table')
88

9-
// 2. All label elements inside that table
9+
// 2. تمام عناصر label داخل آن جدول
1010
table.getElementsByTagName('label')
11-
// or
11+
// یا
1212
document.querySelectorAll('#age-table label')
1313

14-
// 3. The first td in that table (with the word "Age")
14+
// 3. اولین td داخل آن جدول (با کلمه‌ی "Age")
1515
table.rows[0].cells[0]
16-
// or
16+
// یا
1717
table.getElementsByTagName('td')[0]
18-
// or
18+
// یا
1919
table.querySelector('td')
2020

21-
// 4. The form with the name "search"
22-
// assuming there's only one element with name="search" in the document
21+
// 4. form با نام "search"
22+
// با فرض اینکه فقط یک element با نام "search" در document است.
2323
let form = document.getElementsByName('search')[0]
24-
// or, form specifically
24+
// یا به طور خاص،‌form.
2525
document.querySelector('form[name="search"]')
2626

27-
// 5. The first input in that form.
27+
// 5. اولین input درون form
2828
form.getElementsByTagName('input')[0]
29-
// or
29+
// یا
3030
form.querySelector('input')
3131

32-
// 6. The last input in that form
33-
let inputs = form.querySelectorAll('input') // find all inputs
34-
inputs[inputs.length-1] // take the last one
32+
// 6. آخرین input در آن فرم
33+
let inputs = form.querySelectorAll('input') // تمام inputها را پیدا می‌کند.
34+
inputs[inputs.length-1] // آخری را می‌گیرد
3535
```

2-ui/1-document/04-searching-elements-dom/1-find-elements/table.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<body>
44
<form name="search">
5-
<label>Search the site:
5+
<label>جستجوی سایت:
66
<input type="text" name="search">
77
</label>
88
<input type="submit" value="Search!">
@@ -11,22 +11,22 @@
1111
<hr>
1212

1313
<form name="search-person">
14-
Search the visitors:
14+
جستجوی بازدیدکنندگان:
1515
<table id="age-table">
1616
<tr>
17-
<td>Age:</td>
17+
<td>سن:</td>
1818
<td id="age-list">
1919
<label>
20-
<input type="radio" name="age" value="young">less than 18</label>
20+
<input type="radio" name="age" value="young">کمتر از 18</label>
2121
<label>
2222
<input type="radio" name="age" value="mature">18-50</label>
2323
<label>
24-
<input type="radio" name="age" value="senior">more than 50</label>
24+
<input type="radio" name="age" value="senior">بیشتر از 50</label>
2525
</td>
2626
</tr>
2727

2828
<tr>
29-
<td>Additionally:</td>
29+
<td>علاوه بر این:</td>
3030
<td>
3131
<input type="text" name="info[0]">
3232
<input type="text" name="info[1]">

2-ui/1-document/04-searching-elements-dom/1-find-elements/task.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ importance: 4
22

33
---
44

5-
# Search for elements
5+
# جستجوی elementها
66

7-
Here's the document with the table and form.
7+
اینجا document مربوط به table و form را می‌بینیم.
88

9-
How to find?...
9+
چگونه موارد زیر را پیدا کنیم؟
1010

11-
1. The table with `id="age-table"`.
12-
2. All `label` elements inside that table (there should be 3 of them).
13-
3. The first `td` in that table (with the word "Age").
14-
4. The `form` with `name="search"`.
15-
5. The first `input` in that form.
16-
6. The last `input` in that form.
11+
1. جدول با شناسه‌ی `id="age-table"`.
12+
2. تمام `label` های درون آن table (باید سه تا باشند)
13+
3. اولین `td` درون آن table (با کلمه‌ی "Age")
14+
4. `form` با `name="search"`
15+
5. اولین `input` در آن فرم
16+
6. آخرین `input` در آن فرم
1717

18-
Open the page [table.html](table.html) in a separate window and make use of browser tools for that.
18+
صفحه‌ی [table.html](table.html) را در یک پنجره‌ی جدا باز کنید و از ابزارهای مرورگر برای آن استفاده کنید.

0 commit comments

Comments
 (0)