Skip to content

Commit d46262d

Browse files
committed
merging all conflicts
2 parents e846674 + d78b01e commit d46262d

File tree

256 files changed

+4527
-1656
lines changed

Some content is hidden

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

256 files changed

+4527
-1656
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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,42 @@ Pregledač ima ugrađen engine ponekad nazvan "JavaScript virtual machine".
2424

2525
Različite mašine(engines) imaju različita "imena kodova". Na primer:
2626

27+
<<<<<<< HEAD
2728
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- u Chromu i Operi.
2829
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- u Firefox-u.
2930
- ...Postoje druga imena kodova kao "Chakra" za Internet Explorer, "ChakraCore" za Microsoft Edge, "Nitro" i "SquirrelFish" za Safari, i td.
31+
=======
32+
- [V8](https://en.wikipedia.org/wiki/V8_(JavaScript_engine)) -- in Chrome, Opera and Edge.
33+
- [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) -- in Firefox.
34+
- ...There are other codenames like "Chakra" for IE, "JavaScriptCore", "Nitro" and "SquirrelFish" for Safari, etc.
35+
36+
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.
37+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
3038
3139
Dobro je zapamtiti termine iznad zato što se koriste u programerskim člancima na internetu. Mi ćemo ih koristiti takođe. Na primer, ako je "funkcija X podržano od V8", onda verovatno funkcioniše u Chrome-u i Opera-i.
3240
```smart header="How do engines work?"
3341
3442
Engine(mašine) su komplikovane. Ali osnove su im lake.
3543
44+
<<<<<<< HEAD
3645
1. Engine (embedded ako je pretraživač) čita ("parsira") skriptu.
3746
2. Onda prebacuje ("kompajlira") skriptu u jezik mašine.
3847
3. I onda kod radi, prilično brzo.
48+
=======
49+
1. The engine (embedded if it's a browser) reads ("parses") the script.
50+
2. Then it converts ("compiles") the script to machine code.
51+
3. And then the machine code runs, pretty fast.
52+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
3953
4054
Engine omogućava optimizacije na svakom koraku u procesu. Čak posmatra kompajlovanu skriptu dok se izvršava, analizira podatke koji protiču kroz nju, i optimizira dalje kodove mašina zasnovane na tom znanju.
4155
```
4256

4357

58+
<<<<<<< HEAD
4459
## Šta in-browser JavaScript može da radi?
60+
=======
61+
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.
62+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
4563
4664
Moderan JavaScript je "siguran" programski jezik. Ne dozvoljava pristupe niskog nivoa memoriji ili CPU-u, zato što je prvenstveno napravljen za pretraživače koji to ne zahtevaju.
4765

@@ -57,53 +75,86 @@ Na primer, in-browser JavaScript može da:
5775
- Dobija i postavlja kukije, postavlja pitanja posetiocu, pokazuje poruke.
5876
- Pamti informacije sa strane klijenta("local storage").
5977

78+
<<<<<<< HEAD
6079
## Šta in-browser JavaScript ne može da radi?
80+
=======
81+
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.
82+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
6183
6284
JavaScript-ove mogućnosti u pretraživaču su ograničene zbog sigurnosti korisnika. Cilj je da se spreči da zla stranica pristupi privatnim podacima ili da nanese štetu korisnikovim podacima.
6385

6486
Primeri takvih restrikcija uključuju:
6587

6688
- JavaScript na vebstranici ne sme da čita/piše proizvoljne datoteke na hard disku,ne sme da ih kopira ili pokreće program. Nema direktan pristup OS funkcijama.
6789

90+
<<<<<<< HEAD
6891
Moderni pretraživači dozvoljavaju da radi sa datotekama, ali je pristup ograničen i samo omogućen ako korisnik radi određene akcije, na primer "spušta" fajl u prozor pretraživača ili ga selektuje putem `<input>` taga.
6992

7093
Postoje načini za interakciju sa kamerom/mikrofonom, i ostalim uređajima, ali zahtevaju posebnu dozvolu korisnika. Tako da stranica na kojoj je omogućen JavaScript ne sme tajno da uključi Vebkameru, posmatra okolinu i šalje informacije na [NSA](https://en.wikipedia.org/wiki/National_Security_Agency).
7194
- Različiti tabovi/prozori inače ne znaju jedni za druge. Ponekad znaju, na primer kada jedan prozor koristi JavaScript da bi otvorio drugi. Ali čak i u ovom slučaju, JavaScript sa jedne stranice nema pristup drugoj stranici ako dolaze sa različitih sajtova (sa različitog domejna, protokola ili porta).
95+
=======
96+
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).
97+
- 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).
98+
99+
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.
100+
101+
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.
102+
- 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.
103+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
72104
73105
Ovo se zove "Same Origin Policy" (politika istog porekla). Za rad sa njom, *obe stranice* moraju da pristanu na razmenu podataka, i da sadrže poseban JavaScript kod koji podržava tu politiku. Mi ćemo pokriti to u ovom tutorijalu.
74106

75107
Ovo ograničenje je, ponovo ponavljamo, zbog sigurnosti korisnika. Stranica sa `http://anysite.com` koju je korisnik otvorio ne sme da ima pristup drugom pretraživaču sa ovim URL-om `http://gmail.com` i da ukrade informacije odatle.
76108
- JavaScript može lako da komunicira preko interneta do servera odakle trenutno stranica dolazi. Ali njegova mugućnost da prima podatke sa drugih sajtova/domejnova je oštećena. Ako je moguće, zahtevaće posebno odobrenje (izraženo u HTTP zaglavljima) Još jednom, to je sigurnosno ograničenje.
77109
![](limitations.svg)
78110

111+
<<<<<<< HEAD
79112
takva ograničenja ne postoje ako je JavaScript korišćen van pretraživača, na pr. na sreveru. Moderni pretraživči takodje dozvoljavaju plagin ekstenzije koji služe za izdavanje dozvole.
113+
=======
114+
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.
115+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
80116
81117
## Šta čini JavaScript jedinstvenim?
82118

83119
Postoje najmanje tri bitne stvari o JavaScriptu:
84120
```compare
121+
<<<<<<< HEAD
85122
+ Potpuna integracija sa HTML/CSS.
86123
+ Jednostavne stvari koje se prosto izvršavaju.
87124
+ Podrška od svih većih pretraživača i dozvola po default-u.
125+
=======
126+
+ Full integration with HTML/CSS.
127+
+ Simple things are done simply.
128+
+ Supported by all major browsers and enabled by default.
129+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
88130
```
89131
JavaScript je jedina brauzer tehnologija koja kombinuje ove tri stavke.
90132

91133
To je ono što čini JavaScript jedinstvenim. Zato je on najrasprostranjenija alatka za stvaranje pretraživačkog interfejsa.
92134

135+
<<<<<<< HEAD
93136
Ovim rečeno, JavaScript omogućuje kreiranje servera, mobilnih aplikacija, i td.
137+
=======
138+
That said, JavaScript can be used to create servers, mobile applications, etc.
139+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
94140
95141
## Jezici "preko" JavaScript-a
96142

97143
JavaScript sintaksa ne ispunjava svačije potrebe. Različiti ljudi zahtevaju različite stvari.
98144

99145
To je očekivano, zato što projekti i zahtevi tih projekata su drugačiji za sve.
100146

147+
<<<<<<< HEAD
101148
Zato se skoro mnoštvo drugih jezika pojavilo, koji su konvertovani u JavaScript pre nego što se pokrenu u pretraživaču.
149+
=======
150+
So, recently a plethora of new languages appeared, which are *transpiled* (converted) to JavaScript before they run in the browser.
151+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
102152
103153
Moderne alatke stvaraju konvertovanje veoma brzim i lakim, zapravo dozvoljavaju programerima da kreiraju kod u drugom jeziku auto-konvertujući njegovu suštinu.
104154

105155
Primeri takvih jezika:
106156

157+
<<<<<<< HEAD
107158
- [CoffeeScript](http://coffeescript.org/) je "sintetički šećer" za JavaScript. Upoznaje nas sa kraćom sintaksom, dozvoljavajući nam da pišemo čistije i preciznije kodove. Inače *Rubi* developeri ga vole.
108159
- [TypeScript](http://www.typescriptlang.org/) je koncentrisan na dodavanje "strogog pisanje podataka" da bi pojednostavilo razvijanje i podršku kompleksnih sistema. Razvijen je od strane Microsoft-a.
109160
- [Flow](http://flow.org/) takođe dodaje pisanje podataka, ali na drugi način. Razvijen od Fejsbuk-a.
@@ -112,9 +163,25 @@ Primeri takvih jezika:
112163
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) je moderan, sažet i siguran programski jezik koji cilja na pretraživač ili Node.
113164

114165
Ima ih više. Naravno, čak iako smo se navikli na neki od konvertovanih jezika, trebali bismo da poznajemo JavaScript da bismo stvarno razumeli šta činimo.
166+
=======
167+
- [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.
168+
- [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.
169+
- [Flow](https://flow.org/) also adds data typing, but in a different way. Developed by Facebook.
170+
- [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.
171+
- [Brython](https://brython.info/) is a Python transpiler to JavaScript that enables the writing of applications in pure Python without JavaScript.
172+
- [Kotlin](https://kotlinlang.org/docs/reference/js-overview.html) is a modern, concise and safe programming language that can target the browser or Node.
173+
174+
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.
175+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
115176
116177
## Rezime
117178

179+
<<<<<<< HEAD
118180
- JavaScript je prvobitno stvoren kao jezik samo za pretraživače, ali se sada koristi i u mnogim drugim okruženjima.
119181
- Danas, JavaScript ima jedinstvenu poziciju kao najprihvaćeniji pretraživački jezik potpuno integrisan u HTML/CSS.
120182
- Postoje mnogi jezici koji su "pretočeni" u JavaScript i daju razne mogućnosti. Preporučujemo da ih istražite, barem nakon usavršavanja JavaScript-a.
183+
=======
184+
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
185+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
186+
- 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.
187+
>>>>>>> d78b01e9833009fab534462e05c03cffc51bf0e3
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

22
# Manuals and specifications
33

4-
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 sources.
4+
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.
55

66
## Specification
77

88
[The ECMA-262 specification](https://www.ecma-international.org/publications/standards/Ecma-262.htm) contains the most in-depth, detailed and formalized information about JavaScript. It defines the language.
99

1010
But being that formalized, it's difficult to understand at first. So if you need the most trustworthy source of information about the language details, the specification is the right place. But it's not for everyday use.
1111

12-
A new specification version is released every year. In-between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
12+
A new specification version is released every year. Between these releases, the latest specification draft is at <https://tc39.es/ecma262/>.
1313

1414
To read about new bleeding-edge features, including those that are "almost standard" (so-called "stage 3"), see proposals at <https://github.com/tc39/proposals>.
1515

@@ -19,19 +19,19 @@ Also, if you're developing for the browser, then there are other specifications
1919

2020
- **MDN (Mozilla) JavaScript Reference** is the main manual with examples and other information. It's great to get in-depth information about individual language functions, methods etc.
2121

22-
One can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
22+
You can find it at <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference>.
2323

24-
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 `parseInt` function.
24+
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.
2525

2626
## Compatibility tables
2727

2828
JavaScript is a developing language, new features get added regularly.
2929

3030
To see their support among browser-based and other engines, see:
3131

32-
- <http://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <http://caniuse.com/#feat=cryptography>.
32+
- <https://caniuse.com> - per-feature tables of support, e.g. to see which engines support modern cryptography functions: <https://caniuse.com/#feat=cryptography>.
3333
- <https://kangax.github.io/compat-table> - a table with language features and engines that support those or don't support.
3434

35-
All these resources are useful in real-life development, as they contain valuable information about language details, their support etc.
35+
All these resources are useful in real-life development, as they contain valuable information about language details, their support, etc.
3636

3737
Please remember them (or this page) for the cases when you need in-depth information about a particular feature.

1-js/01-getting-started/3-code-editors/article.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An IDE loads the project (which can be many files), allows navigation between fi
1313
If you haven't selected an IDE yet, consider the following options:
1414

1515
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
16-
- [WebStorm](http://www.jetbrains.com/webstorm/) (cross-platform, paid).
16+
- [WebStorm](https://www.jetbrains.com/webstorm/) (cross-platform, paid).
1717

1818
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/).
1919

@@ -29,13 +29,11 @@ The main difference between a "lightweight editor" and an "IDE" is that an IDE w
2929

3030
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.
3131

32-
The following options deserve your attention:
32+
There are many options, for instance:
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).
34+
- [Sublime Text](https://www.sublimetext.com/) (cross-platform, shareware).
3735
- [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.
36+
- [Vim](https://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.
3937

4038
## Let's not argue
4139

@@ -44,3 +42,8 @@ The editors in the lists above are those that either I or my friends whom I cons
4442
There are other great editors in our big world. Please choose the one you like the most.
4543

4644
The choice of an editor, like any other tool, is individual and depends on your projects, habits, and personal preferences.
45+
46+
The author's personal opinion:
47+
48+
- I'd use [Visual Studio Code](https://code.visualstudio.com/) if I develop mostly frontend.
49+
- Otherwise, if it's mostly another language/platform and partially frontend, then consider other editors, such as XCode (Mac), Visual Studio (Windows) or Jetbrains family (Webstorm, PHPStorm, RubyMine etc, depending on the language).

1-js/01-getting-started/4-devtools/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To see errors and get a lot of other useful information about scripts, "develope
88

99
Most developers lean towards Chrome or Firefox for development because those browsers have the best developer tools. Other browsers also provide developer tools, sometimes with special features, but are usually playing "catch-up" to Chrome or Firefox. So most developers have a "favorite" browser and switch to others if a problem is browser-specific.
1010

11-
Developer tools are potent, they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
11+
Developer tools are potent; they have many features. To start, we'll learn how to open them, look at errors, and run JavaScript commands.
1212

1313
## Google Chrome
1414

@@ -22,7 +22,7 @@ The developer tools will open on the Console tab by default.
2222

2323
It looks somewhat like this:
2424

25-
![chrome](chrome.png)
25+
![chrome](chrome.webp)
2626

2727
The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar.
2828

@@ -49,7 +49,7 @@ The look & feel of them is quite similar. Once you know how to use one of these
4949

5050
Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first.
5151

52-
Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom:
52+
Open Settings and go to the "Advanced" pane. There's a checkbox at the bottom:
5353

5454
![safari](safari.png)
5555

-41.1 KB
Binary file not shown.
22.2 KB
Loading
48.3 KB
Loading
-67.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)