Skip to content

Commit c7e160f

Browse files
authored
2.1.1 Çevirisi yapıldı
1 parent 2e1e5ad commit c7e160f

File tree

1 file changed

+70
-59
lines changed

1 file changed

+70
-59
lines changed
Lines changed: 70 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,122 @@
1-
# Browser environment, specs
1+
# Tarayıcı Ortamı, Özellikleri
22

3-
The JavaScript language was initially created for web browsers. Since then, it has evolved and become a language with many uses and platforms.
3+
Javascript dili başlangıçta internet tarayıcıları için oluşturuldu. O zamandan beri geliştirildi ve bir çok kullanımı ve platformu ile bir dil haline geldi.
44

5-
A platform may be a browser, or a web-server, or a washing machine, or another *host*. Each of them provides platform-specific functionality. The JavaScript specification calls that a *host environment*.
65

7-
A host environment provides platform-specific objects and functions additional to the language core. Web browsers give a means to control web pages. Node.js provides server-side features, and so on.
6+
Bir platform tarayıcı veya bir web sunucusu veya bir çamaşır makinesi veya başka bir sunucu olabilir. Bunların her biri platforma özgü fonksiyonlar sağlar. Javascript özelliği bunu bir sunucu ortamı olarak adlandırılır.
87

9-
Here's a bird's-eye view of what we have when JavaScript runs in a web-browser:
8+
Bir sunucu ortamı dil çekirdeğine ek olarak platforma özgü nesneler ve fonksiyonlar sağlar. İnternet tarayıcıları internet sayfalarını kontrol etmek için bir yol sunar. Node.js sunucu tarafı özellikleri vb.
109

11-
![](windowObjects.svg)
1210

13-
There's a "root" object called `window`. It has two roles:
11+
İşte javascriptin internet tarayıcısında çalıştığında elimizde ne olduğunu gösteren bir kuş bakışı.
1412

15-
1. First, it is a global object for JavaScript code, as described in the chapter <info:global-object>.
16-
2. Second, it represents the "browser window" and provides methods to control it.
13+
![](windowObjects.png)
1714

18-
For instance, here we use it as a global object:
15+
`window` denilen bir "kök" nesnesi var. İki rolü vardır.
16+
17+
1. Birincisi, Javascript kodu için evrensel bir nesnedir. bölümde açıklandığı gibi [Evrensel nesneler](https://github.com/sahinyanlik/javascript-tutorial-tr/blob/master/1-js/06-advanced-functions/05-global-object/article.md)
18+
2. İkincisi, "tarayıcı penceresini" temsil eder ve kontrol etmek için yöntemler sağlar.
19+
20+
Örneğin, burada `window`u evrensel bir nesne olarak kullandık.
1921

2022
```js run
21-
function sayHi() {
22-
alert("Hello");
23+
function selamSoyle() {
24+
alert("Selam");
2325
}
2426

25-
// global functions are accessible as properties of window
26-
window.sayHi();
27+
// evrensel değişkenler `window` özellikleri olarak erişilebilir.
28+
window.selamSoyle();
2729
```
2830

29-
And here we use it as a browser window, to see the window height:
31+
Ve burada `window`u pencerenin yüksekliğini görmek için tarayıcı penceresi olarak kullandık:
3032

3133
```js run
32-
alert(window.innerHeight); // inner window height
34+
alert(window.innerHeight); // İç pencere yüksekliği
3335
```
3436

35-
There are more window-specific methods and properties, we'll cover them later.
37+
Daha fazla `window`a özgü yöntemler ve özellikler var, bunlardan daha sonra bahsedeceğiz.
3638

37-
## DOM (Document Object Model)
39+
## Document Object Model (DOM) (Belge Nesneli Modeli)
3840

39-
The `document` object gives access to the page content. We can change or create anything on the page using it.
41+
`document` nesnesi sayfa içeriğine erişimi sağlar. Sayfada herhangi bir şeyi değiştirebilir ya da oluşturabiliriz.
4042

41-
For instance:
43+
Örneğin:
4244
```js run
43-
// change the background color to red
44-
document.body.style.background = "red";
45+
// arka plan rengini kırmızı olarak değiştirelim.
46+
document.body.style.background = 'red';
4547

46-
// change it back after 1 second
47-
setTimeout(() => document.body.style.background = "", 1000);
48+
// 1 saniye sonra tekrar değiştirelim
49+
setTimeout(() => document.body.style.background = '', 1000);
4850
```
4951

50-
Here we used `document.body.style`, but there's much, much more. Properties and methods are described in the specification:
52+
Burada `document.body.style` kullandık but daha fazla parametreler var. Özellikleri ve yöntemleri tanımlamada açıklanmıştır. Tesadüf ki, bunu geliştiren iki grup vardır.
53+
54+
1. [W3C](https://en.wikipedia.org/wiki/World_Wide_Web_Consortium) -- belgesi <https://www.w3.org/TR/dom> linktedir.
55+
2. [WhatWG](https://en.wikipedia.org/wiki/WHATWG), <https://dom.spec.whatwg.org> 'da yayınlanır..
56+
57+
Burada olduğu gibi, 2 grup her zaman aynı fikirde değil. Bu yüzden 2 standartımız var fakat birbirileri ile temasta ve sonuç olarak bir noktada birleşiyorlar. Yani bu kaynaklardan bulabileceğiniz bilgiler birbirlerine çok yakın, 99% gibi bir eşleşme var. Farklılıklar var ama büyük ihtimal bunu fark etmeyeceksiniz.
58+
59+
Şahsen <https://dom.spec.whatwg.org> kullanmayı daha keyifli buluyorum.
5160

52-
- **DOM Living Standard** at <https://dom.spec.whatwg.org>
61+
Eskiden hiç bir standart yoktu. -- her tarayıcı her ne istiyorsa onu uyguladı. Bu yüzden farklı tarayıcıların aynı şeyler için farklı metotları ve özellikleri vardı ve geliştiriciler her bir tarayıcı için farklı kodlar yazmak zorunda kalıyordu. Karanlık ve dağaınık zamanlar.
5362

54-
```smart header="DOM is not only for browsers"
55-
The DOM specification explains the structure of a document and provides objects to manipulate it. There are non-browser instruments that use it too.
63+
Şimdi bile bazen tarayıcıları özgü özellikleri kullanan ve uyumsuzluklar etrafında çalışan eski kodlarla çalışabiliriz ama bu derste modern şeyler kullanacağız: Onlara ihtiyacın olana kadar eski şeyler öğrenmeye gerek yok (şansın yüksek değil).
5664

57-
For instance, server-side tools that download HTML pages and process them use the DOM. They may support only a part of the specification though.
65+
Daha sonra herkesi ortak noktada toplamak için DOM standartı belirlendi. İlk versiyon "DOM Level 1" idi, sonra DOM Level 2 tarafından genişletildi, sonra DOM Level 3 ve şimdi DOM Level 4. WhatWG grubundan insanlar sürümden sıkıldılar ve numara olmadan sadece DOM olarak adlandırdılar. Öyleyse biz yapacağız.
66+
67+
```smart header="DOM yalnızca tarayıcı için değildir."
68+
DOM özelliği bir belgenin yapısını açıklar ve onu işlemek için nesne sağlar. Onu kullanan tarayıcı olmayan araçlarda var.
69+
70+
Örneğin, HTML sayfalarını indiren ve işleyen sunucu-taraflı araçlar. Ancak DOM spesifikasyonunun sadece bir bölümü destekleyebilir.
5871
```
5972

60-
```smart header="CSSOM for styling"
61-
CSS rules and stylesheets are not structured like HTML. There's a separate specification [CSSOM](https://www.w3.org/TR/cssom-1/) that explains how they are represented as objects, and how to read and write them.
73+
```smart header="Stil için CSSOM"
74+
CSS kuralları ve stil sayfaları HTML yapısına benzemez. Bu yüzden nesneler olarak nasıl temsil edildiklerini ve nasıl okunup yazılacağını açıklayan bir tanımlama vardır. [CSSOM](https://www.w3.org/TR/cssom-1/)
6275
63-
CSSOM is used together with DOM when we modify style rules for the document. In practice though, CSSOM is rarely required, because usually CSS rules are static. We rarely need to add/remove CSS rules from JavaScript, so we won't cover it right now.
76+
CSSOM, belgi için stil kurallarını değiştirdiğimizde DOM ile birlikte kullanılıyor. Pratikte olsa CSSOM nadiren gereklidir. Çünkü genelde CSS kuralları statiktir. Javascript'e CSS kuralları ekleme/çıkarma nadiren ihtiyacımız var. Bu yüzden onu kapatmayız.
6477
```
6578

66-
## BOM (Browser object model)
79+
## BOM (HTML'in bir parçası)
6780

68-
Browser Object Model (BOM) are additional objects provided by the browser (host environment) to work with everything except the document.
81+
HTML'in bir parçası (BOM), belge dışında her şey ile çalışmak için tarayıcı (sunucu ortamı) tarafından sağlanan ek nesnelerdir.
6982

70-
For instance:
83+
Örneğin:
7184

72-
- The [navigator](mdn:api/Window/navigator) object provides background information about the browser and the operating system. There are many properties, but the two most widely known are: `navigator.userAgent` -- about the current browser, and `navigator.platform` -- about the platform (can help to differ between Windows/Linux/Mac etc).
73-
- The [location](mdn:api/Window/location) object allows us to read the current URL and can redirect the browser to a new one.
85+
- [navigator](mdn:api/Window/navigator) nesnesi tarayıcı ve işletim sistemi hakkında arkaplan bilgisi sağlar. Bir çok özelliği var, fakat en çok bilinen ikisi şunlardır: `navigator.userAgent` -- mevcut tarayıcı hakkında, ve `navigator.platform` -- platform hakkımda (Windows/Linux/Mac arasında farklılık olacağından yardım gerekebilir).
86+
- [location](mdn:api/Window/location) nesnesi geçerli adresi okumayı ve tarayıcıyı yenisine yönlendirmeyi sağlar
7487

75-
Here's how we can use the `location` object:
88+
`location` nesnesini bu şekilde kullanabiliriz:
7689

7790
```js run
78-
alert(location.href); // shows current URL
79-
if (confirm("Go to wikipedia?")) {
80-
location.href = "https://wikipedia.org"; // redirect the browser to another URL
91+
alert(location.href); // Geçerli URL'yi gösterir
92+
if (confirm("wikipedia'ya git?")) {
93+
location.href = 'https://tr.wikipedia.org'; // Tarayıcı başka bir URL'ye yönlendirir.
8194
}
8295
```
8396

84-
Functions `alert/confirm/prompt` are also a part of BOM: they are directly not related to the document, but represent pure browser methods of communicating with the user.
85-
86-
BOM is the part of the general [HTML specification](https://html.spec.whatwg.org).
97+
`alert/confirm/prompt` fonksiyonları da BOM'un bir parçasıdır: Bunlar doğrudan belge ile ilgili değildir ancak kullanıcı ile tarayıcının saf iletişim kurmasını temsil eder.
8798

88-
Yes, you heard that right. The HTML spec at <https://html.spec.whatwg.org> is not only about the "HTML language" (tags, attributes), but also covers a bunch of objects, methods and browser-specific DOM extensions. That's "HTML in broad terms". Also, some parts have additional specs listed at <https://spec.whatwg.org>.
99+
```smart header="HTML specification"
100+
BOM genel kısmıdır[HTML specification](https://html.spec.whatwg.org).
89101
90-
## Summary
91-
92-
Talking about standards, we have:
102+
Evet, doğru duydun. <https://html.spec.whatwg.org>'deki HTML özelliği yalnızca "HTML dili" (etiketler, nitelikler) ile ilgili değil, aynı zamanda birçok nesne, yöntem ve tarayıca özgü DOM uzantılarını da kapsar. Bu "geniş anlamda HTML"dir.
103+
```
93104

94-
DOM specification
95-
: Describes the document structure, manipulations and events, see <https://dom.spec.whatwg.org>.
105+
## Özet
96106

97-
CSSOM specification
98-
: Describes stylesheets and style rules, manipulations with them and their binding to documents, see <https://www.w3.org/TR/cssom-1/>.
107+
Standar hakkında konuşurken:
99108

100-
HTML specification
101-
: Describes the HTML language (e.g. tags) and also the BOM (browser object model) -- various browser functions: `setTimeout`, `alert`, `location` and so on, see <https://html.spec.whatwg.org>. It takes the DOM specification and extends it with many additional properties and methods.
109+
DOM tanımlaması
110+
: belge yapısını, manipülasyonları, olayları açıklar, Bkz <https://dom.spec.whatwg.org>.
102111

103-
Additionally, some classes are described separately at <https://spec.whatwg.org/>.
112+
CSSOM tanımlaması
113+
: stil sayfaları ve stil kurallarını açıklar, bunlarla yapılan manipülasyonları ve belge bağlanmalarını sağlar, Bkz <https://www.w3.org/TR/cssom-1/>.
104114

105-
Please note these links, as there's so much stuff to learn it's impossible to cover and remember everything.
115+
HTML tanımlaması
116+
: HTML dilini (etiketler vs.) ve ayrıca BOM (tarayıcı nesne modeli) -- çeşitli tarayıcı fonksiyonlar: `setTimeout`, `alert`, `location` vb açıklar, Bkz <https://html.spec.whatwg.org>. DOM özelliğini alır ve bir çok ek özellik ve yöntemle geliştirir.
106117

107-
When you'd like to read about a property or a method, the Mozilla manual at <https://developer.mozilla.org/en-US/search> is also a nice resource, but the corresponding spec may be better: it's more complex and longer to read, but will make your fundamental knowledge sound and complete.
118+
Şimdi DOM öğrenmeye başlayacağız. Çünkü belge, kullanıcı arayüzünde önemli bir rol oynuyor, ayrıca onunla çalışmak en karmaşık kısımdır.
108119

109-
To find something, it's often convenient to use an internet search "WHATWG [term]" or "MDN [term]", e.g <https://google.com?q=whatwg+localstorage>, <https://google.com?q=mdn+localstorage>.
120+
Lütfen yukarıdaki bağlantıları kontrol edin. Çünkü öğrenecek bir çok şey var. Her şeyi hatırlamak imkansızdır.
110121

111-
Now we'll get down to learning DOM, because the document plays the central role in the UI.
122+
Bir özellik ve yöntem hakkında okumak istediğinizde -- Mozilla kılavuzu <https://developer.mozilla.org/en-US/search> güzel klavuzlardan bir tanesidir, ancak ilgili spesifikasyonun okunması daha iyi olabilir: daha karmaşık ve okunması uzun fakat temel bilginiz eksiksiz ve sağlam hale gelecektir.

0 commit comments

Comments
 (0)