Skip to content

Commit bed6110

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/ar.javascript.info
2 parents c5645de + 5f6eab9 commit bed6110

10 files changed

Lines changed: 247 additions & 241 deletions

File tree

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
# Code editors
1+
# محررات الأكواد
22

3-
A code editor is the place where programmers spend most of their time.
3+
محرر الأكواد هو المكان الذي يقضي فيه المبرمجون معظم وقتهم.
44

5-
There are two main types of code editors: IDEs and lightweight editors. Many people use one tool of each type.
5+
يوجد نوعين من محررات الأكواد: IDEs ( بيئة التطوير الكاملة)و المحررات البسيطة. العديد من الناس يستخدمون أداة واحدة لكل نوع.
66

77
## IDE
88

9-
The term [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) refers to a powerful editor with many features that usually operates on a "whole project." As the name suggests, it's not just an editor, but a full-scale "development environment."
9+
مصطلح [IDE](https://en.wikipedia.org/wiki/Integrated_development_environment) (Integrated Development Environment) يشير إلى محرر بإمكانات هائلة، مع العديد من المميزات التي تعمل عادة على " مشروع كامل". كما يوحي الاسم، فهو ليس مجرد محرر أكواد، ولكنه "بيئة تطوير" واسعة النطاق.
1010

11-
An IDE loads the project (which can be many files), allows navigation between files, provides autocompletion based on the whole project (not just the open file), and integrates with a version management system (like [git](https://git-scm.com/)), a testing environment, and other "project-level" stuff.
11+
IDE تقوم بتحميل المشروع ) الذي يمكن أن يتكون من العديد من الملفات)، ويسمح بالتنقل بين الملفات، ويوفر خاصة الإكمال التلقائي المعتمدة على المشروع ككل ( وليس الملف المفتوح فقط) , كما أنه يمكن أن يرتبط مع أنظمة إدارة الإصدار (مثل [git](https://git-scm.com/)), وبيئة الاختبار, وغيرها من الأشياء على مستوى المشروع.
1212

13-
If you haven't selected an IDE yet, consider the following options:
13+
إذا لم تقم باختيار IDE بعد ، ففكر في الخيارات التالية:
1414

15-
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
16-
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
15+
- [فيجوال ستديو كود](https://code.visualstudio.com/) (يعمل على أكثر من نظام تشغيل, مجاني).
16+
- [ويب ستورم](http://www.jetbrains.com/webstorm/) (يعمل على أكثر من نظام تشغيل, مدفوع).
1717

18-
For Windows, there's also "Visual Studio", not to be confused with "Visual Studio Code". "Visual Studio" is a paid and mighty Windows-only editor, well-suited for the .NET platform. It's also good at JavaScript. There's also a free version [Visual Studio Community](https://www.visualstudio.com/vs/community/).
18+
بالنسبة للويندوز، يمكن استخدام برنامج فيجوال ستديو، لايجب الخلط بينه وبين الفيجوال ستديو كود، فيجوال ستديو هو محرر مدفوع يعمل على نظام ويندوز فقك، ومناسب تماماً لبيئة الدوت نت. أنه أيضاً جيد للجافاسكريبت. كما يوجد إصدار مجاني منه [Visual Studio Community](https://www.visualstudio.com/vs/community/).
1919

20-
Many IDEs are paid, but have a trial period. Their cost is usually negligible compared to a qualified developer's salary, so just choose the best one for you.
20+
.عادة ما تكون تكلفتها ضئيلة للغاية مقارنة براتب المطور المؤهل ، لذلك فقط اختر الأفضل بالنسبة لك.العديد من بيئات التطوير مدفوعة، لكن لها فترة سماحية
2121

22-
## Lightweight editors
22+
## المحررات البسيطة
2323

24-
"Lightweight editors" are not as powerful as IDEs, but they're fast, elegant and simple.
24+
المحررات البسيطة" ليست بقوة ال" IDEs لكنها سريعة, وأنيقة وبسيطة
2525

26-
They are mainly used to open and edit a file instantly.
26+
يتم استخدامها بشكل رئيسي لفتح وتحرير ملف على الفور.
2727

28-
The main difference between a "lightweight editor" and an "IDE" is that an IDE works on a project-level, so it loads much more data on start, analyzes the project structure if needed and so on. A lightweight editor is much faster if we need only one file.
28+
الفارق الرئيسي بين المحررات البسيطة و "بيئة التطوير" هو أن بيئة التطوير تعمل على مستوى المشروع، لذلك فإنها تقوم بتحميل المزيد من البيانات عند البدء، وتحليل هيكل المشروع إذا لزم ذلك. أما المحررات البسيطة فإنها أسرع في حال نريد ملف واحد فقط.
2929

30-
In practice, lightweight editors may have a lot of plugins including directory-level syntax analyzers and autocompleters, so there's no strict border between a lightweight editor and an IDE.
30+
من الناحية العملية ، قد تحتوي المحررات البسيطة على الكثير من المكونات الإضافية بما في ذلك محللات بناء الجملة على مستوى الدليل وأجهزة الإكمال التلقائي ، لذلك لا توجد حدود صارمة بين المحرر البسيط و IDE.
3131

32-
The following options deserve your attention:
32+
الخيارات التالية تستحق انتباهك:
3333

34-
- [Atom](https://atom.io/) (cross-platform, free).
35-
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
36-
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
37-
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
38-
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
34+
- [Atom](https://atom.io/) (يعمل على العديد من أنظمة التشغيل, مجاني).
35+
- [Visual Studio Code](https://code.visualstudio.com/) (يعمل على العديد من أنظمة التشغيل, مجاني).
36+
- [Sublime Text](http://www.sublimetext.com) (يعمل على العديد من أنظمة التشغيل, برنامج مشاركة).
37+
- [Notepad++](https://notepad-plus-plus.org/) (الويندوز, مجاني).
38+
- [Vim](http://www.vim.org/) و [Emacs](https://www.gnu.org/software/emacs/) رائعة إذا كنت تعرف كيفية استخدامها.
3939

40-
## Let's not argue
40+
## دعونا لانتشاجر
4141

42-
The editors in the lists above are those that either I or my friends whom I consider good developers have been using for a long time and are happy with.
42+
المحررات التي بالقائمة الأعلى هي التي نقوم باستخدامها أنا وأصدقائي، والذين أعتقد أنهم مطورون جيدون يستخدمونها منذ وقت طويل وتسعدهم.
4343

44-
There are other great editors in our big world. Please choose the one you like the most.
44+
يوجد أيضاً محررات رائعة في عالمنا الكبير، الرجاء اختيار المحرر الذي تفضله.
4545

46-
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
46+
اختيار المحرر، مثل أي أداة أخرى، هو اختيار فردي ويعتمد على مشروعاتك، وعاداتك، وتفضيلاتك الشخصية.
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Outer corners
1+
# الزوايا الخارجية
22

3-
Outer corners are basically what we get from [elem.getBoundingClientRect()](https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
3+
الزوايا الخارجية هي في الأساس ما نحصل عليه من [elem.getBoundingClientRect ()] (https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
44

5-
Coordinates of the upper-left corner `answer1` and the bottom-right corner `answer2`:
5+
إحداثيات الزاوية العلوية اليسرى `answer1` والزاوية اليمنى السفلى` answer2`:
66

77
```js
88
let coords = elem.getBoundingClientRect();
@@ -11,19 +11,17 @@ let answer1 = [coords.left, coords.top];
1111
let answer2 = [coords.right, coords.bottom];
1212
```
1313

14-
# Left-upper inner corner
14+
# الزاوية الداخلية اليسرى العليا
1515

16-
That differs from the outer corner by the border width. A reliable way to get the distance is `clientLeft/clientTop`:
16+
هذا يختلف عن الزاوية الخارجية بعرض الحدود. طريقة موثوقة للحصول على المسافة هي `clientLeft / clientTop`:
1717

1818
```js
1919
let answer3 = [coords.left + field.clientLeft, coords.top + field.clientTop];
2020
```
2121

22-
# Right-bottom inner corner
23-
24-
In our case we need to substract the border size from the outer coordinates.
25-
26-
We could use CSS way:
22+
# الزاوية الداخلية اليمنى السفلية
23+
في حالتنا ، نحتاج إلى طرح حجم الحدود من الإحداثيات الخارجية.
24+
يمكننا استخدام طريقة CSS:
2725

2826
```js
2927
let answer4 = [
@@ -32,11 +30,12 @@ let answer4 = [
3230
];
3331
```
3432

35-
An alternative way would be to add `clientWidth/clientHeight` to coordinates of the left-upper corner. That's probably even better:
33+
هناك طريقة بديلة تتمثل في إضافة "clientWidth / clientHeight" إلى إحداثيات الزاوية العلوية اليسرى. ربما هذا أفضل:
3634

3735
```js
3836
let answer4 = [
3937
coords.left + elem.clientLeft + elem.clientWidth,
4038
coords.top + elem.clientTop + elem.clientHeight
4139
];
4240
```
41+
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
importance: 5
1+
5
22

33
---
44

5-
# Find window coordinates of the field
5+
# البحث عن إحداثيات النافذة للحقل
66

7-
In the iframe below you can see a document with the green "field".
7+
في iframe أدناه ، يمكنك رؤية مستند يحتوي على "الحقل" الأخضر.
88

9-
Use JavaScript to find window coordinates of corners pointed by with arrows.
9+
استخدم JavaScript للعثور على إحداثيات النوافذ ذات الزوايا المشار إليها بالسهام.
1010

11-
There's a small feature implemented in the document for convenience. A click at any place shows coordinates there.
11+
هناك ميزة صغيرة تم تنفيذها في المستند من أجل الراحة. تظهر نقرة في أي مكان إحداثيات هناك.
1212

1313
[iframe border=1 height=360 src="source" link edit]
1414

15-
Your code should use DOM to get window coordinates of:
15+
يجب أن يستخدم الرمز الخاص بك DOM للحصول على إحداثيات النافذة لـ:
1616

17-
1. Upper-left, outer corner (that's simple).
18-
2. Bottom-right, outer corner (simple too).
19-
3. Upper-left, inner corner (a bit harder).
20-
4. Bottom-right, inner corner (there are several ways, choose one).
17+
1. الزاوية العلوية اليسرى ، (هذا بسيط).
18+
2. الزاوية اليمنى السفلية ، (بسيطة أيضًا).
19+
3. الزاوية اليسرى العليا ، الداخلية (أصعب قليلاً).
20+
4. الزاوية اليمنى السفلية (هناك عدة طرق ، اختر واحدة).
2121

22-
The coordinates that you calculate should be the same as those returned by the mouse click.
22+
يجب أن تكون الإحداثيات التي تحسبها هي نفس الإحداثيات التي تم إرجاعها بواسطة النقر بالماوس.
2323

24-
P.S. The code should also work if the element has another size or border, not bound to any fixed values.
24+
ملاحظة. يجب أن تعمل الشفرة أيضًا إذا كان للعنصر حجم أو حد آخر ، غير مرتبط بأي قيم ثابتة.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this task we only need to accurately calculate the coordinates. See the code for details.
1+
في هذه المهمة نحتاج فقط لحساب الإحداثيات بدقة. انظر الرمز للحصول على التفاصيل.
22

3-
Please note: the elements must be in the document to read `offsetHeight` and other properties.
4-
A hidden (`display:none`) or out of the document element has no size.
3+
يرجى ملاحظة: يجب أن تكون العناصر في المستند لقراءة `offsetHeight` وخصائص أخرى.
4+
العنصر المخفي (`display: none`) أو خارج عنصر المستند ليس له حجم.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
importance: 5
2-
1+
درجة الأهمية: 5
32
---
43

5-
# Show a note near the element
4+
# عرض ملاحظة بالقرب من العنصر
65

7-
Create a function `positionAt(anchor, position, elem)` that positions `elem`, depending on `position` near `anchor` element.
6+
إنشاء وظيفة `positionAt (مرساة ، موضع ، elem)` تضع مواضع `elem` ، اعتمادًا على` position` بالقرب من عنصر `anchor`.
87

9-
The `position` must be a string with any one of 3 values:
10-
- `"top"` - position `elem` right above `anchor`
11-
- `"right"` - position `elem` immediately at the right of `anchor`
12-
- `"bottom"` - position `elem` right below `anchor`
8+
يجب أن يكون "الموضع" عبارة عن سلسلة تحتوي على أي قيمة من 3 قيم:
9+
- `` top '' - ضع `elem` فوق` anchor` مباشرة
10+
- "" right "" - ضع "elem" مباشرة على يمين "anchor"
11+
- "أسفل" "- ضع" elem "أسفل" anchor "مباشرة
1312

14-
It's used inside function `showNote(anchor, position, html)`, provided in the task source code, that creates a "note" element with given `html` and shows it at the given `position` near the `anchor`.
13+
يتم استخدامه داخل الوظيفة `showNote (anchor ، position ، html)` ، المتوفرة في شفرة مصدر المهمة ، والتي تنشئ عنصر "note" مع `html` معينًا وتعرضه في" الموضع "القريب من" anchor ".
1514

16-
Here's the demo of notes:
15+
إليك عرض الملاحظات:
1716

1817
[iframe src="solution" height="350" border="1" link]
18+
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The solution is actually pretty simple:
1+
الحل بسيط للغاية:
22

3-
- Use `position:absolute` in CSS instead of `position:fixed` for `.note`.
4-
- Use the function [getCoords()](info:coordinates#getCoords) from the chapter <info:coordinates> to get document-relative coordinates.
3+
- استخدم "الموضع: مطلق" في CSS بدلاً من "الموضع: ثابت" لـ ". ملاحظة".
4+
- استخدم الوظيفة [getCoords ()] (info: إحداثيات # getCoords) من الفصل <info: إحداثيات> للحصول على إحداثيات نسبية للdocument.
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
importance: 5
2+
الأهمية: 5
23

34
---
45

5-
# Show a note near the element (absolute)
6+
# إظهار ملاحظة بالقرب من العنصر (مطلق)
67

7-
Modify the solution of the [previous task](info:task/position-at) so that the note uses `position:absolute` instead of `position:fixed`.
8+
قم بتعديل حل [المهمة السابقة] (info: task / position-at) بحيث تستخدم الملاحظة "الموضع: مطلق" بدلاً من "الموضع: ثابت".
89

9-
That will prevent its "runaway" from the element when the page scrolls.
10+
وذلك سيمنع "هربه" من العنصر عند تمرير الصفحة.
1011

11-
Take the solution of that task as a starting point. To test the scroll, add the style `<body style="height: 2000px">`.
12+
خذ حل هذه المهمة كنقطة انطلاق. لاختبار التمرير ، أضف النمط `<body style =" height: 2000px ">`.
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
importance: 5
1+
الأهمية: 5
22

33
---
44

5-
# Position the note inside (absolute)
5+
# ضع الملاحظة في الداخل (مطلق)
66

7-
Extend the previous task <info:task/position-at-absolute>: teach the function `positionAt(anchor, position, elem)` to insert `elem` inside the `anchor`.
7+
تمديد المهمة السابقة
8+
<info:task/position-at-absolute>: علم الوظيفة `الموضع (المرساة ، الموضع ، العنصر)` لإدراج `عنصر` داخل` المرساة`.
89

9-
New values for `position`:
10+
القيم الجديدة لـ "الموضع":
1011

11-
- `top-out`, `right-out`, `bottom-out` -- work the same as before, they insert the `elem` over/right/under `anchor`.
12-
- `top-in`, `right-in`, `bottom-in` -- insert `elem` inside the `anchor`: stick it to the upper/right/bottom edge.
12+
- `top-out` و` right-out` و` bottom-out` - تعمل كما كانت من قبل ، حيث تقوم بإدخال` elem` over / right / under `anchor`.
13+
- "أعلى" ، "يمين" ، "أسفل" - أدخل "عنصر" داخل "المرساة": ألصقه بالحافة العلوية / اليمنى / السفلية.
1314

14-
For instance:
15+
على سبيل المثال:
1516

1617
```js
1718
// shows the note above blockquote
@@ -21,8 +22,8 @@ positionAt(blockquote, "top-out", note);
2122
positionAt(blockquote, "top-in", note);
2223
```
2324

24-
The result:
25+
النتائج:
2526

26-
[iframe src="solution" height="310" border="1" link]
27+
[iframe src = "solution" height = "310" border = "1" link]
2728

28-
As the source code, take the solution of the task <info:task/position-at-absolute>.
29+
كرمز المصدر ، خذ حل المهمة <info:task/position-at-absolute>.

0 commit comments

Comments
 (0)