|
1 | 1 | # Developer console |
2 | 2 |
|
3 | | -Code is prone to errors. You will quite likely make errors... Oh, what am I talking about? You are *absolutely* going to make errors, at least if you're a human, not a [robot](https://en.wikipedia.org/wiki/Bender_(Futurama)). |
| 3 | +Kode lengva palikti errorų. Ko gero, tau teks sukelti errorų... Juokauju, tau *tikrai* teks sukelti errorų, nebent esi [robotas](https://en.wikipedia.org/wiki/Bender_(Futurama)). |
4 | 4 |
|
5 | | -But in the browser, users don't see errors by default. So, if something goes wrong in the script, we won't see what's broken and can't fix it. |
| 5 | +Tačiau naršyklėje, useriai by default nemato errorų. Todėl jeigu skripte kažkas veikia ne taip, kaip turėtų, mes to nepamatysim ir negalėsim pataisyt. |
6 | 6 |
|
7 | | -To see errors and get a lot of other useful information about scripts, "developer tools" have been embedded in browsers. |
| 7 | +Tam, kad pamatyti errorus ir gauti daug kitos naudingos informacijos apie skriptus, "developer tools" yra integruoti pačiose naršyklėse. |
8 | 8 |
|
9 | | -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. |
| 9 | +Dauguma programuotojų naudojasi Chrome arba Firefox, nes šios naršyklės turi geriausius developer tools'us. Kitos naršklės taip pat turi developer tools'us, kartais su įdomiais feature'sais, tačiau dažniausiai bando "pasivyti" Chrome arba Firefox. Todėl dauguma programuotojų turi "mėgstamiausią" naršyklę ir įsijungią kitą naršyklę, jeigu problema yra specifinė kažkokiai konkrečiai naršyklei. |
10 | 10 |
|
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'ai turi daug feature'sų. Pradžiai, mes išmoksim kaip juos atidaryti, pažvelgti į error'us ir paleisti JavaScript komandas. |
12 | 12 |
|
13 | 13 | ## Google Chrome |
14 | 14 |
|
15 | | -Open the page [bug.html](bug.html). |
| 15 | +Atidaryk puslapį [bug.html](bug.html). |
16 | 16 |
|
17 | | -There's an error in the JavaScript code on it. It's hidden from a regular visitor's eyes, so let's open developer tools to see it. |
| 17 | +Šio puslapio JavaScript kode yra error'as. Jis paslėptas nuo "parpastų" žmonių, tad atidarykime developer tools'us. |
18 | 18 |
|
19 | | -Press `key:F12` or, if you're on Mac, then `key:Cmd+Opt+J`. |
| 19 | +Spausk `key:F12` arba, jeigu naudoji Mac, `key:Cmd+Opt+J`. |
20 | 20 |
|
21 | | -The developer tools will open on the Console tab by default. |
| 21 | +Developer tools'ai standartiškai atidarys Console tab'ą. |
22 | 22 |
|
23 | | -It looks somewhat like this: |
| 23 | +Turėtų atrodyt kažkas panašaus į tai: |
24 | 24 |
|
25 | 25 |  |
26 | 26 |
|
27 | | -The exact look of developer tools depends on your version of Chrome. It changes from time to time but should be similar. |
| 27 | +Konkretus vaizdas priklauso nuo Chrome versijos, kurią naudoji. Kartais atsiranda pakeitimų, bet visgi vaizdas turėtų būti panašus. |
28 | 28 |
|
29 | | -- Here we can see the red-colored error message. In this case, the script contains an unknown "lalala" command. |
30 | | -- On the right, there is a clickable link to the source `bug.html:12` with the line number where the error has occurred. |
| 29 | +- Čia mes galim pamatyt raudoną error message. Šiuo atveju skriptas turi nežinomą "lalala" komandą. |
| 30 | +- Dešinėje yra clickable link'as į `bug.html:12` su skaičiumi eilutės, kurioje yra error'as. |
31 | 31 |
|
32 | | -Below the error message, there is a blue `>` symbol. It marks a "command line" where we can type JavaScript commands. Press `key:Enter` to run them (`key:Shift+Enter` to input multi-line commands). |
| 32 | +Žemiau error message'o yra mėlynas `>` simbolis. Jis parodo "command line", kuriame mes galime rašyti JavaScript komandas. Spausk `key:Enter` kad jas paleisti (`key:Shift+Enter` kad rašyti komandas per daugiau nei vieną eilutę). |
33 | 33 |
|
34 | | -Now we can see errors, and that's enough for a start. We'll come back to developer tools later and cover debugging more in-depth in the chapter <info:debugging-chrome>. |
| 34 | +Dabar mes galime matyti error'us. Kaip pradžiai, to pakanka. Vėliau mes grįšim į developer tools'us ir kalbėsim apie debugginimą chapteryje <info:debugging-chrome>. |
35 | 35 |
|
36 | 36 |
|
37 | | -## Firefox, Edge, and others |
| 37 | +## Firefox, Edge ir kiti |
38 | 38 |
|
39 | | -Most other browsers use `key:F12` to open developer tools. |
| 39 | +Dauguma kitų naršyklių naudoja `key:F12` developer tools'ų atidarymui. |
40 | 40 |
|
41 | | -The look & feel of them is quite similar. Once you know how to use one of these tools (you can start with Chrome), you can easily switch to another. |
| 41 | +Jų išvaizda gan panaši. Kai išmoksti vieną (gali pradėti nuo Chrome), gali greitai pradėti naudotis kita. |
42 | 42 |
|
43 | 43 | ## Safari |
44 | 44 |
|
45 | | -Safari (Mac browser, not supported by Windows/Linux) is a little bit special here. We need to enable the "Develop menu" first. |
| 45 | +Safari (Mac naršyklė, neveikia Windows/Linux) yra šiek tiek unikali. Iš pradžių mums reikia enablinti "Developer menu". |
46 | 46 |
|
47 | | -Open Preferences and go to the "Advanced" pane. There's a checkbox at the bottom: |
| 47 | +Atidaryk Preferences ir eik į "Advanced". Apačioj bus checkbox'as: |
48 | 48 |
|
49 | 49 |  |
50 | 50 |
|
51 | | -Now `key:Cmd+Opt+C` can toggle the console. Also, note that the new top menu item named "Develop" has appeared. It has many commands and options. |
| 51 | +Dabar `key:Cmd+Opt+C` įjungs konsolę. Taip pat turėk omeny, kad naujas item'as "Develop" atsirado viršutiniam meniu. Jame yra daug komandų ir nustatymų. |
52 | 52 |
|
53 | | -```smart header="Multi-line input" |
54 | | -Usually, when we put a line of code into the console, and then press `key:Enter`, it executes. |
| 53 | +```smart header="Kelių eilučių komandos" |
| 54 | +Dažniausiai, jeigu konsolėje parašome vieną eilutę kodo ir paspaudžiame `key:Enter`, ji suveikia. |
55 | 55 |
|
56 | | -To insert multiple lines, press `key:Shift+Enter`. This way one can enter long fragments of JavaScript code. |
| 56 | +Tam, kad parašyti kelias eilutes, spausk `key:Shift+Enter`. Tokiu būdu mes galime parašyti ilgesnius fragmentus JavaScript kodo. |
57 | 57 | ``` |
58 | 58 |
|
59 | | -## Summary |
| 59 | +## Reziumė |
60 | 60 |
|
61 | | -- Developer tools allow us to see errors, run commands, examine variables, and much more. |
62 | | -- They can be opened with `key:F12` for most browsers on Windows. Chrome for Mac needs `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (need to enable first). |
| 61 | +- Developer tools'ai leidžia mum pamatyti errorus, paleisti komandas, analizuoti kintamuosiuos ir daugiau. |
| 62 | +- Juos paleisti galime su `key:F12` dauguma naršklių Windows'uose. Chrome, jeigu naudojame Mac, reikaluaja `key:Cmd+Opt+J`, Safari: `key:Cmd+Opt+C` (iš pradžių reikia aktyvuoti). |
63 | 63 |
|
64 | | -Now we have the environment ready. In the next section, we'll get down to JavaScript. |
| 64 | +Dabar mes turime paruoštą aplinką. Kitoj pamokoj paragausim JavaScript'o. |
0 commit comments