Skip to content

Commit e4f4aef

Browse files
committed
merging all conflicts
2 parents d063335 + 540d753 commit e4f4aef

File tree

266 files changed

+6822
-753
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

266 files changed

+6822
-753
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: iliakan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ sftp-config.json
2121
Thumbs.db
2222

2323

24+
/svgs

1-js/01-getting-started/1-intro/article.md

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,17 @@
4949
تعتمد قدرات جافا سكريبت بشكل كبير على البيئة التي تعمل بها. على سبيل المثال ، يدعم [نود.جي إس](https://ar.wikipedia.org/wiki/نود.جي_إس)
5050
الوظائف التي تسمح لجافا سكريبت بقراءة / كتابة ملفات عشوائية ، وتنفيذ طلبات الشبكة، إلخ.
5151

52+
<<<<<<< HEAD
5253
يمكن لجافا سكريبت في المتصفح القيام بكل ما يتعلق بمعالجة صفحات الويب والتفاعل مع المستخدم وخادم الويب.
5354

5455
على سبيل المثال ، يمكن لجافا سكريبت في المتصفح:
56+
=======
57+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
58+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
59+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
60+
61+
The terms above are good to remember because they are used in developer articles on the internet. We'll use them too. For instance, if "a feature X is supported by V8", then it probably works in Chrome, Opera and Edge.
62+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
5563
5664
- إضافة HTML جديد إلى الصفحة ، وتغيير المحتوى الحالي ، وتعديل التصاميم.
5765
- الرد على تفاعلات المستخدم ، والتشغيل على نقرات الفأرة ، وحركات المؤشر ، والضغط على المفاتيح.
@@ -61,17 +69,28 @@
6169

6270
## ما الذي لا يمكن لجافا سكريبت في المتصفح فعله؟
6371

72+
<<<<<<< HEAD
6473
إمكانيات جافا سكريبت في المتصفح محدودة من أجل سلامة المستخدم. الهدف هو منع صفحة ويب شريرة من الوصول إلى المعلومات الخاصة أو الإضرار ببيانات المستخدم.
74+
=======
75+
1. The engine (embedded if it's a browser) reads ("parses") the script.
76+
2. Then it converts ("compiles") the script to machine code.
77+
3. And then the machine code runs, pretty fast.
78+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
6579
6680
من أمثلة هذه القيود:
6781

6882
- جافا سكريبت على صفحة الويب قد لا تقرأ/تكتب ملفات عشوائية على القرص الصلب أو تنسخها أو تنفذ برامج. ليس لديها وصول مباشر إلى وظائف نظام التشغيل.
6983

84+
<<<<<<< HEAD
7085
تسمح المتصفحات الحديثة له بالعمل مع الملفات ، ولكن الوصول محدود ويتم توفيره فقط إذا قام المستخدم بإجراءات معينة ، مثل "إسقاط" ملف في نافذة المتصفح أو تحديده عبر علامة `<input>`.
86+
=======
87+
Modern JavaScript is a "safe" programming language. It does not provide low-level access to memory or the CPU, because it was initially created for browsers which do not require it.
88+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
7189
7290
هناك طرق للتفاعل مع الكاميرا / الميكروفون والأجهزة الأخرى ، لكنها تتطلب إذنًا صريحًا من المستخدم. لذلك قد لا تعمل الصفحة التي تم تمكين جافا سكريبت فيها بشكل خفي على تمكين كاميرا الويب ومراقبة المناطق المحيطة وإرسال المعلومات إلى [آن آس أيه](https://ar.wikipedia.org/wiki/وكالة_الأمن_القومي_الأمريكية)
7391
-بشكل عام لا تعرف علامات التبويب / النوافذ المختلفة حول بعضها البعض. في بعض الأحيان يفعلون ذلك، على سبيل المثال عندما تستخدم إحدى النوافذ جافا سكريبت لفتح النافذة الأخرى. ولكن حتى في هذه الحالة ، قد لا تتمكن جافا سكريبت في إحدى الصفحات من الوصول إلى الصفحة الأخرى إذا كانت تأتي من مواقع مختلفة (من مجال أو بروتوكول أو منفذ مختلف).
7492

93+
<<<<<<< HEAD
7594
وهذا ما يسمى "سياسة المصدر الأوحد". للتغلب على ذلك ، يجب أن توافق *الصفحتان* على تبادل البيانات وتحتوي على كود جافا سكريبت خاص يتعامل معه. سنغطي ذلك في البرنامج التعليمي.
7695

7796
هذا القيد ، مرة أخرى ، لسلامة المستخدم. يجب ألا تتمكن صفحة من `http://anysite.com` فتحها المستخدم من الوصول إلى نافذة متصفح أخرى بعنوان `http://gmail.com` وسرقة المعلومات من هناك.
@@ -80,33 +99,81 @@
8099
![](limitations.svg)
81100

82101
لا توجد مثل هذه الحدود إذا تم استخدام جافا سكريبت خارج المتصفح ، على سبيل المثال على الخادم. تسمح المتصفحات الحديثة أيضًا الإضافات التي قد تطلب تصريحات ممتدة.
102+
=======
103+
In-browser JavaScript can do everything related to webpage manipulation, interaction with the user, and the webserver.
104+
105+
For instance, in-browser JavaScript is able to:
106+
107+
- Add new HTML to the page, change the existing content, modify styles.
108+
- React to user actions, run on mouse clicks, pointer movements, key presses.
109+
- Send requests over the network to remote servers, download and upload files (so-called [AJAX](https://en.wikipedia.org/wiki/Ajax_(programming)) and [COMET](https://en.wikipedia.org/wiki/Comet_(programming)) technologies).
110+
- Get and set cookies, ask questions to the visitor, show messages.
111+
- Remember the data on the client-side ("local storage").
112+
113+
## What CAN'T in-browser JavaScript do?
114+
115+
JavaScript's abilities in the browser are limited to protect the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
116+
117+
Examples of such restrictions include:
118+
119+
- JavaScript on a webpage may not read/write arbitrary files on the hard disk, copy them or execute programs. It has no direct access to OS functions.
120+
121+
Modern browsers allow it to work with files, but the access is limited and only provided if the user does certain actions, like "dropping" a file into a browser window or selecting it via an `<input>` tag.
122+
123+
There are ways to interact with the camera/microphone and other devices, but they require a user's explicit permission. So a JavaScript-enabled page may not sneakily enable a web-camera, observe the surroundings and send the information to the [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
124+
- Different tabs/windows generally do not know about each other. Sometimes they do, for example when one window uses JavaScript to open the other one. But even in this case, JavaScript from one page may not access the other page if they come from different sites (from a different domain, protocol or port).
125+
126+
This is called the "Same Origin Policy". To work around that, *both pages* must agree for data exchange and must contain special JavaScript code that handles it. We'll cover that in the tutorial.
127+
128+
This limitation is, again, for the user's safety. A page from `http://anysite.com` which a user has opened must not be able to access another browser tab with the URL `http://gmail.com`, for example, and steal information from there.
129+
- JavaScript can easily communicate over the net to the server where the current page came from. But its ability to receive data from other sites/domains is crippled. Though possible, it requires explicit agreement (expressed in HTTP headers) from the remote side. Once again, that's a safety limitation.
130+
131+
![](limitations.svg)
132+
133+
Such limitations do not exist if JavaScript is used outside of the browser, for example on a server. Modern browsers also allow plugins/extensions which may ask for extended permissions.
134+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
83135
84136
## ما الذي يجعل جافا سكريبت فريدًا؟
85137

86138
هناك على الأقل *ثلاثة* أشياء رائعة حول جافا سكريبت:
87139

88140
```compare
141+
<<<<<<< HEAD
89142
+ تكامل تام مع HTML / CSS.
90143
+ الأشياء البسيطة تتم ببساطة.
91144
+ مدعوم من قبل جميع المتصفحات الرائدة وتمكينه تلقائيا.
145+
=======
146+
+ Full integration with HTML/CSS.
147+
+ Simple things are done simply.
148+
+ Supported by all major browsers and enabled by default.
149+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
92150
```
93151

94152
جافا سكريبت هي تقنية المتصفح الوحيدة التي تجمع بين هذه الأشياء الثلاثة.
95153

154+
<<<<<<< HEAD
96155
هذا ما يجعل جافا سكريبت فريدًا. هذا هو السبب في أنها الأداة الأكثر انتشارًا لإنشاء واجهات المتصفح.
156+
=======
157+
That said, JavaScript can be used to create servers, mobile applications, etc.
158+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
97159
98160
ومع ذلك، تسمح جافا سكريبت أيضًا بإنشاء خوادم وتطبيقات الجوال، إلخ.
99161

100162
## لغات "فوق" جافا سكريبت
101163

102164
لا تتناسب القواعد اللغوية لجافا سكريبت مع احتياجات الجميع. الناس المختلفون يريدون ميزات مختلفة.
103165

166+
<<<<<<< HEAD
104167
هذا أمر متوقع ، لأن المشاريع والمتطلبات تختلف من شخص لآخر.
168+
=======
169+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
170+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
105171
106172
ظهرت في الآونة الأخيرة عدد كبير من اللغات الجديدة ، والتي *تم تحويلها* إلى جافا سكريبت قبل تشغيلها في المتصفح.
107173

108174
الأدوات الحديثة تجعل الترجمة سريعة وشفافة للغاية ، مما يسمح للمطورين في الواقع بالتشفير بلغة أخرى وتحويلها تلقائيًا "خلف الكواليس".
109175

176+
<<<<<<< HEAD
110177
أمثلة على هذه اللغات:
111178

112179
- [كوفي سكريبت](http://coffeescript.org/) هو "سكر نحوي" لجافا سكريبت. إنه يقدم بناء جمل أقصر ، مما يسمح لنا بكتابة كود أكثر وضوحًا ودقة. عادة ،مطورو روبي يحبونها.
@@ -115,11 +182,27 @@
115182
- [دارت](https://www.dartlang.org/) هي لغة قائمة بذاتها لها محركها الخاص الذي يعمل في بيئات غير المتصفح (مثل تطبيقات الهاتف المحمول) ، ولكن يمكن أيضًا تحويلها إلى جافا سكريبت. من تطوير جوجل.
116183
- [بريثون](https://brython.info/) هو محول من بايثون إلى جافا سكريبت و الذي يمكّن من كتابة التطبيقات بلغة بايثون بشكل كامل بدون جافا سكريبت.
117184
- [كوتلن](https://kotlinlang.org/docs/reference/js-overview.html) هي لغة برمجة حديثة وموجزة وآمنة يمكنها استهداف المتصفح أو نود.
185+
=======
186+
- [CoffeeScript](https://coffeescript.org/) is "syntactic sugar" for JavaScript. It introduces shorter syntax, allowing us to write clearer and more precise code. Usually, Ruby devs like it.
187+
- [TypeScript](https://www.typescriptlang.org/) is concentrated on adding "strict data typing" to simplify the development and support of complex systems. It is developed by Microsoft.
188+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
189+
- [Dart](https://www.dartlang.org/) is a standalone language that has its own engine that runs in non-browser environments (like mobile apps), but also can be transpiled to JavaScript. Developed by Google.
190+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
191+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
192+
193+
There are more. Of course, even if we use one of these transpiled languages, we should also know JavaScript to really understand what we're doing.
194+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
118195
119196
هناك أكثر. بالطبع ، حتى لو استخدمنا إحدى اللغات المترجمة ، يجب أن نعرف أيضًا جافا سكريبت لفهم ما نقوم به حقًا.
120197

198+
<<<<<<< HEAD
121199
## ملخص
122200

123201
- تم إنشاء جافا سكريبت في البداية كلغة للمتصفح فقط ، ولكنها تُستخدم الآن في العديد من البيئات الأخرى أيضًا.
124202
- تتمتع جافا سكريبت اليوم بمكانة فريدة باعتبارها لغة المتصفح الأكثر استخدامًا مع تكاملها التام مع HTML / CSS.
125-
- هناك العديد من اللغات التي يتم "تحويلها" إلى جافا سكريبت وتوفر ميزات معينة. يوصى بإلقاء نظرة عليهم ، على الأقل لفترة وجيزة ، بعد إتقان جافا سكريبت.
203+
- هناك العديد من اللغات التي يتم "تحويلها" إلى جافا سكريبت وتوفر ميزات معينة. يوصى بإلقاء نظرة عليهم ، على الأقل لفترة وجيزة ، بعد إتقان جافا سكريبت.
204+
=======
205+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
206+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
207+
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.
208+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b

1-js/01-getting-started/2-manuals-specifications/article.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@
22

33
هذا الكتاب هو _دورة تعليمية_. يهدف الى تعليمك اللغه تدريجيا. و لكن إذا كنت علي علم بالأساسيات فسوف تحتاج إلى مصدر آخر.
44

5+
<<<<<<< HEAD
56
## الوصف
7+
=======
8+
This book is a *tutorial*. It aims to help you gradually learn the language. But once you're familiar with the basics, you'll need other resources.
9+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
610
711
[وصف The ECMA-262](https://www.ecma-international.org/publications/standards/Ecma-262.htm) يحتوي على المعلومات الأكثر عمقاً وتفصيلاً ورسميةً عن جافا سكريبت. وهي تقوم بتعريف اللغة.
812

913
و لكن كونها بهذه الرسمية، تجعل فهمها من أول مرة صعبا. لذلك إذا كنت تريد مصدر المعلومى الأكثر وثوقاً عن تفاصيل اللغة، الوصف هو المكان الصحيح. لكنها ليست للإستعمال اليومي.
1014

1115
نسخة وصف جديدة تُصدر كل عام. فيما بين هذه الإصدارات، آخر مسودة وصف توجد في <https://tc39.es/ecma262/>.
1216

17+
<<<<<<< HEAD
1318
لكي تقرأ عن خصائص التطور الحاد الجديد، بما فى ذلك "المعايير التقريبية" (ما يسمي "المرحلة 3")، انظر للمقترحات في <https://github.com/tc39/proposals>.
19+
=======
20+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
21+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
1422
1523
أيضاً، إذا كنت تطور من أجل المتصفح، إذا هناك مواصفات أخرى مشمولة في [الجزء الثاني](info:browser-environment) من الدورة التعليمية.
1624

@@ -20,18 +28,31 @@
2028

2129
يمكن أن تجدها في <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
2230

31+
<<<<<<< HEAD
2332
أيضاً، غالباً ما يكون من الأفضل استخدام البحث عبر الإنترنت بدلاً من ذلك. فقط استخدم "[مصطلح] MDN" للإستعلام، مثال <https://google.com/search?q=MDN+parseInt> لتبحث عن دالة `parseInt`.
2433

34+
=======
35+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
36+
37+
Although, it's often best to use an internet search instead. Just use "MDN [term]" in the query, e.g. <https://google.com/search?q=MDN+parseInt> to search for the `parseInt` function.
38+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
2539
2640
## جدول التوافق
2741

2842
جافا سكريبت لغة فى سياق متطور، تضاف إليها خصائص جديدة بانتظام.
2943

3044

45+
<<<<<<< HEAD
3146
لتَّـحَقّـق من الدعم ما بين المتصفحات والمحركات الأخرى، انظر:
3247

3348
- <http://caniuse.com> - جدول الدعم لكل خاصية، مثال: لترى أيًا من المحركات يدعم دوال التشفير الحديث: <http://caniuse.com/#feat=cryptography>.
3449
- <https://kangax.github.io/compat-table> - جدول بمواصفات ومحركات اللغة وقابلية دعم كل محرك لكل خاصية.
50+
=======
51+
- <https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
52+
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
53+
54+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
55+
>>>>>>> 540d753e90789205fc6e75c502f68382c87dea9b
3556
3657
كل هذه المصادر مفيدة في تطوير الحياة الواقعية، لأنها تحتوي علي معلومات قيّمة عن تفاصيل ودعم اللغة.
3758

0 commit comments

Comments
 (0)