From d527d47d926b8ff165c47b8be7b95ce6c9265209 Mon Sep 17 00:00:00 2001 From: Alexey Pyltsyn Date: Sat, 20 Mar 2021 13:22:35 +0300 Subject: Unify Russian translation for callback word (#226) * Unify Russian translation for callback word * Apply suggestions from code review Co-authored-by: Sasha Sushko * Fixes Co-authored-by: Sasha Sushko --- files/ru/web/api/windoworworkerglobalscope/setinterval/index.html | 2 +- files/ru/web/api/windoworworkerglobalscope/settimeout/index.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'files/ru/web/api/windoworworkerglobalscope') diff --git a/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html b/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html index 71e437f891..aa4ba76d3a 100644 --- a/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html +++ b/files/ru/web/api/windoworworkerglobalscope/setinterval/index.html @@ -253,7 +253,7 @@ Vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. Proin ac an

View this demo in action. See also: clearInterval().

-

Аргументы функции обратного вызова

+

Аргументы колбэк-функции

As previously discussed, Internet Explorer versions 9 and below do not support the passing of arguments to the callback function in either setTimeout() or setInterval(). The following IE-specific code demonstrates a method for overcoming this limitation.  To use, simply add the following code to the top of your script.

diff --git a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html b/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html index 8fb8144b50..8c115986b0 100644 --- a/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html +++ b/files/ru/web/api/windoworworkerglobalscope/settimeout/index.html @@ -25,7 +25,7 @@ original_slug: Web/API/WindowTimers/setTimeout
  • delay  {{optional_inline}} -  задержка в миллисекундах (тысячных долях секунды), после которой будет выполнен вызов функции. Реальная задержка может быть больше; см. {{anch("Notes")}} ниже.
  • -

    Необходимо принять во внимание, что передача дополнительных параметров функции в первом варианте не работает в Internet Explorer 9 и ниже. Для использования этого функционала в таких браузерах, необходимо использовать код для совместимости (см. раздел Аргументы функции обратного вызова).

    +

    Необходимо принять во внимание, что передача дополнительных параметров функции в первом варианте не работает в Internet Explorer 9 и ниже. Для использования этого функционала в таких браузерах, необходимо использовать код для совместимости (см. раздел Аргументы колбэк-функции).

    Important: Prior to Gecko 13 {{ geckoRelease("13.0") }}, Gecko passed an extra parameter to the callback routine, indicating the "actual lateness" of the timeout in milliseconds. This non-standard parameter is no longer passed.
    @@ -62,7 +62,7 @@ function clearAlert() {

    Смотрите также пример clearTimeout().

    -

    Аргументы функции обратного вызова

    +

    Аргументы колбэк-функции

    Если вам нужно передать аргумент в вашу callback функцию, но нужно, чтобы это работало в Internet Explorer 9 и ниже, который не поддерживает передачу дополнительных параметров (ни с setTimeout() или setInterval()), то вы можете прописать специальный код для совместимости с IE, вставив этот код в начало ваших скриптов, который включит функцию передачи стандартных параметров HTML5 в Internet Explorer для обоих таймеров.

    @@ -162,7 +162,7 @@ setTimeout(myArray.myMethod, 1500, "1"); // prints "undefined" after 1.5 seconds setTimeout.call(myArray, myArray.myMethod, 2000); // error: "NS_ERROR_XPC_BAD_OP_ON_WN_PROTO: Illegal operation on WrappedNative prototype object" setTimeout.call(myArray, myArray.myMethod, 2500, 2); // same error -

    Как видите, нет способов передать объект this в функцию обратного вызова..

    +

    Как видите, нет способов передать объект this в колбэк-функцию..

    Возможное решение

    @@ -186,7 +186,7 @@ window.setInterval = function (vCallback, nDelay /*, argumentToPass1, argumentTo   } : vCallback, nDelay); }; -
    Note: These two replacements will also enable the HTML5 standard passage of arbitrary arguments to the callback functions of timers in IE. So they can be used as polyfills also. See the Callback arguments paragraph.
    +
    Note: These two replacements will also enable the HTML5 standard passage of arbitrary arguments to the callback functions of timers in IE. So they can be used as polyfills also. See the Callback arguments paragraph.

    Новая тестируемая особенность:

    -- cgit v1.2.3-54-g00ecf