From 869dd2069c695ee7040cd3261713212155819f42 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Mon, 14 Dec 2020 12:18:12 -0500 Subject: final dump 2020-12-14 --- files/ru/tools/index.html | 4 +- files/ru/tools/web_console/index.html | 84 ++++++++++++++++++----------------- 2 files changed, 45 insertions(+), 43 deletions(-) (limited to 'files/ru/tools') diff --git a/files/ru/tools/index.html b/files/ru/tools/index.html index c7cc39bfba..a46c24c94f 100644 --- a/files/ru/tools/index.html +++ b/files/ru/tools/index.html @@ -37,11 +37,11 @@ translation_of: Tools - Щелчек по данной кнопке создает снимок экрана (screenshot) текущей страницы. (Внимание: По-умолчанию данная функция отключена и, при необходимости, должна быть включена в настройках.) + Щелчок по данной кнопке создает снимок экрана (screenshot) текущей страницы. (Внимание: По-умолчанию данная функция отключена и, при необходимости, должна быть включена в настройках.) - Преключение в/из Режима Адаптивного Дизайна (Responsive Design Mode). + Переключение в/из Режима Адаптивного Дизайна (Responsive Design Mode). diff --git a/files/ru/tools/web_console/index.html b/files/ru/tools/web_console/index.html index db38988978..929a5e346e 100644 --- a/files/ru/tools/web_console/index.html +++ b/files/ru/tools/web_console/index.html @@ -12,7 +12,9 @@ tags: - 'веб-разработка:инструменты' translation_of: Tools/Web_Console --- -
{{ToolsSidebar}}

Веб-консоль:

+
{{ToolsSidebar}}
+ +

Веб-консоль:

  1. Выводит информацию, связанную с веб-страницей: сетевые запросы, ошибки и предупреждения JavaScript и CSS, а также сообщения об ошибках, предупреждения и информационные сообщения, выдаваемые кодом JavaScript, выполняющимся в контексте страницы;
  2. @@ -140,7 +142,7 @@ translation_of: Tools/Web_Console -

     

    +

    Нажав мышкой на сообщение вы увидите следующее окно с более детальной информацией о запросе и ответе на него:

    @@ -194,7 +196,7 @@ translation_of: Tools/Web_Console

    Тем не менее, если какой-то JavaScript код читает что стиль был изменен, то браузер должен выполнить синхронное переформатирование в порядке вычисленным расчетом стиля чтобы вернуться. Например, код как этот хочет  вызовать немедленное, синхронное, переформатирование, когда вызовет window.getComputedStyle(thing).height:

    -
    var thing = document.getElementById("the-thing");
    +
    var thing = document.getElementById("the-thing");
     thing.style.display = "inline-block";
     var thingHeight = window.getComputedStyle(thing).height;
    @@ -299,12 +301,12 @@ var thingHeight = window.getComputedStyle(thing).height;

    The argument to error().

    -
    +    
     console.error("an error");

    The console will display a full stack trace for errors:

    -
    +    
     function error() {
       console.error("an error");
     }
    @@ -327,12 +329,12 @@ call_error();

    If the assertion succeeds, nothing. If the assertion fails, the argument:

    -
    +    
     console.assert(false, "My assertion always fails");

    The console will display a full stack trace for assertions:

    -
    +    
     function assertion() {
       console.assert(false, "assertion failed");
     }
    @@ -364,7 +366,7 @@ call_assertion();

    The argument to warn().

    -
    +    
     console.warn("a warning");
    @@ -386,7 +388,7 @@ console.warn("a warning");

    The argument to info().

    -
    +    
     console.info("some info");
    @@ -408,7 +410,7 @@ console.info("some info");

    The label supplied, if any, and the number of times this occurrence of count() has been called with the given label:

    -
    +    
     console.count(user.value);

    @@ -419,7 +421,7 @@ console.count(user.value);

    Listing of the object's properties:

    -
    +    
     var user = document.getElementById('user');
     console.dir(user);
    @@ -433,10 +435,10 @@ console.dir(user);

    The argument to log().

    -
    +    
     console.log("logged");
    -

     

    +

    Если аргумент — это узел DOM, консоль выдаст его в виде инспектируемого rich text:

    @@ -454,7 +456,7 @@ console.log("logged");

    Notification that the specified timer started.

    -
    +    
     console.time("t");
    @@ -463,7 +465,7 @@ console.time("t");

    Duration for the specified timer.

    -
    +    
     console.timeEnd("t");
    @@ -472,7 +474,7 @@ console.timeEnd("t");

    Stack trace:

    -
    +    
     console.trace();
    @@ -487,7 +489,7 @@ console.trace();

    Начиная с Firefox 31, вы можете использовать спецификатор формата "%c" для стилизации консольных сообщений:

    -
    console.log("%cMy stylish message", "color: red; font-style: italic");
    +
    console.log("%cMy stylish message", "color: red; font-style: italic");
    @@ -534,21 +536,21 @@ console.trace();

    -

    Accessing variables

    +

    Получение переменных

    -

    You can access variables defined in the page, both built-in variables like window and variables added by JavaScript like jQuery:

    +

    Вы можете получить доступ к переменным на странице; это могут быть как внутренние переменные например в объекте window , так и переменные, добавленные с помощью Javascript кода - например с помощью jQuery:

    -

    Автозавершение

    +

    Автоподстановка

    -

    The command line has autocomplete: enter the first few letters and a popup appears with possible completions:

    +

    У командной строки есть функционал автоподстановки: начните вводить несколько начальных букв - и появится всплывающее окно с возможными вариантами завершения команды:

    -

    Type Enter or Tab to accept the suggestion, use the up/down arrows to move to a different suggestion, or just keep typing if you don't like any of the suggestions.

    +

    Нажмите Enter или Tab, чтобы принять нужную подсказку, перемещайтесь вверх/вниз с помощью стрелок к другим вариантам подсказок или просто продолжайте набирать текст, если Вам не подходит ни один из вариантов.

    -

    The console suggests completions from the scope of the currently executing stack frame. This means that if you've hit a breakpoint in a function you get autocomplete for objects local to the function.

    +

    Консоль выдает подсказки из области видимости текущего активного фрейма. Это значит, что если Вы уже достигли точки останова в функции, то у Вас будут доступны автоподстановки только для объектов, которые находятся в одной области видимости с этой функцией.

    -

    You get autocomplete suggestions for array elements, as well:

    +

    Вы можете получать такие же подсказки для элементов массива:

    @@ -566,30 +568,30 @@ console.trace();

    Работа с iframes

    -

    If a page contains embedded iframes, you can use the cd() command to change the console's scope to a specific iframe, and then you can execute functions defined in the document hosted by that iframe. There are three ways to select an iframe using cd():

    +

    Если страница содержит встроенные iframes, Вы можете использовать команду cd() чтобы изменить область видимости в консоли на область определенного iframe, и после этого Вы сможете выполнять функции, которые содержит объект document в этом iframe. Существует три способа выбрать iframe используя cd():

    -

    You can pass the iframe DOM element:

    +

    Вы можете передать DOM-элемент для определенного iframe :

    -
    var frame = document.getElementById("frame1");
    +
    var frame = document.getElementById("frame1");
     cd(frame);
    -

    You can pass a CSS selector that matches the iframe:

    +

    Вы можете передать CSS селектор для определенного iframe:

    -
    cd("#frame1");
    +
    cd("#frame1");
    -

    You can pass the iframe's global window object:

    +

    Вы можете передать глобальный объект Window для определенного iframe:

    -
    var frame = document.getElementById("frame1");
    +
    var frame = document.getElementById("frame1");
     cd(frame.contentWindow);
     
    -

    To switch the context back to the top-level window, call cd() with no arguments:

    +

    Для переключения контекста видимости обратно к окну верхнего уровня, введите cd() без аргументов:

    -
    cd();
    +
    cd();
    -

    For example, suppose we have a document that embeds an iframe:

    +

    Предположим у нас есть документ, который содержит iframe:

    -
    <!DOCTYPE html>
    +
    <!DOCTYPE html>
     <html>
       <head>
         <meta charset="UTF-8">
    @@ -599,9 +601,9 @@ cd(frame.contentWindow);
       </body>
     </html>
    -

    The iframe defines a new function:

    +

    В этом iframe определена новая функция:

    -
    <!DOCTYPE html>
    +
    <!DOCTYPE html>
     <html>
       <head>
         <meta charset="UTF-8">
    @@ -615,13 +617,13 @@ cd(frame.contentWindow);
       </body>
     </html>
    -

    You can switch context to the iframe like this:

    +

    Вы можете переключиться на контекст iframe например так:

    -
    cd("#frame1");
    +
    cd("#frame1");
    -

    Now you'll see that the global window's document is the iframe:

    +

    Сейчас Вы сможете видеть, что глобальный объект Window это теперь наш iframe:

    -

    And you can call the function defined in the iframe:

    +

    и сможете выполнить вызов функции, определенной в этом iframe:

    -- cgit v1.2.3-54-g00ecf