From a617ec8afec43949849163167daaf51a60d2b298 Mon Sep 17 00:00:00 2001 From: MDN Date: Sun, 13 Feb 2022 00:57:20 +0000 Subject: [CRON] sync translated content --- files/zh-cn/_redirects.txt | 4 ++ files/zh-cn/_wikihistory.json | 50 +++++++------- .../api/window/gamepadconnected_event/index.html | 65 ++++++++++++++++++ .../api/element/fullscreenchange_event/index.html | 79 ++++++++++++++++++++++ .../api/element/fullscreenerror_event/index.html | 65 ++++++++++++++++++ .../web/api/element/onfullscreenchange/index.html | 78 --------------------- .../web/api/element/onfullscreenerror/index.html | 64 ------------------ .../window/gamepaddisconnected_event/index.html | 52 ++++++++++++++ .../web/api/window/ongamepadconnected/index.html | 64 ------------------ .../api/window/ongamepaddisconnected/index.html | 51 -------------- 10 files changed, 290 insertions(+), 282 deletions(-) create mode 100644 files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html create mode 100644 files/zh-cn/web/api/element/fullscreenchange_event/index.html create mode 100644 files/zh-cn/web/api/element/fullscreenerror_event/index.html delete mode 100644 files/zh-cn/web/api/element/onfullscreenchange/index.html delete mode 100644 files/zh-cn/web/api/element/onfullscreenerror/index.html create mode 100644 files/zh-cn/web/api/window/gamepaddisconnected_event/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepadconnected/index.html delete mode 100644 files/zh-cn/web/api/window/ongamepaddisconnected/index.html (limited to 'files/zh-cn') diff --git a/files/zh-cn/_redirects.txt b/files/zh-cn/_redirects.txt index 84dfe0d381..b1214b6ed1 100644 --- a/files/zh-cn/_redirects.txt +++ b/files/zh-cn/_redirects.txt @@ -1315,6 +1315,8 @@ /zh-CN/docs/Web/API/Element/onbeforescriptexecute /zh-CN/docs/Web/API/Document/onbeforescriptexecute /zh-CN/docs/Web/API/Element/oncopy /zh-CN/docs/Web/API/HTMLElement/oncopy /zh-CN/docs/Web/API/Element/oncut /zh-CN/docs/Web/API/HTMLElement/oncut +/zh-CN/docs/Web/API/Element/onfullscreenchange /zh-CN/docs/Web/API/Element/fullscreenchange_event +/zh-CN/docs/Web/API/Element/onfullscreenerror /zh-CN/docs/Web/API/Element/fullscreenerror_event /zh-CN/docs/Web/API/Element/onpaste /zh-CN/docs/Web/API/HTMLElement/onpaste /zh-CN/docs/Web/API/Element/removeAttributre /zh-CN/docs/Web/API/Element/removeAttribute /zh-CN/docs/Web/API/Event/CustomEvent /zh-CN/docs/Web/API/CustomEvent @@ -1590,6 +1592,8 @@ /zh-CN/docs/Web/API/Window/minimize /zh-CN/docs/conflicting/Web/API/Window /zh-CN/docs/Web/API/Window/mozAnimationStartTIme /zh-CN/docs/Web/API/Animation/startTime /zh-CN/docs/Web/API/Window/onbeforeunload /zh-CN/docs/Web/API/WindowEventHandlers/onbeforeunload +/zh-CN/docs/Web/API/Window/ongamepadconnected /zh-CN/docs/conflicting/Web/API/Window/gamepadconnected_event +/zh-CN/docs/Web/API/Window/ongamepaddisconnected /zh-CN/docs/Web/API/Window/gamepaddisconnected_event /zh-CN/docs/Web/API/Window/onhashchange /zh-CN/docs/Web/API/WindowEventHandlers/onhashchange /zh-CN/docs/Web/API/Window/onpopstate /zh-CN/docs/Web/API/WindowEventHandlers/onpopstate /zh-CN/docs/Web/API/Window/onresize /zh-CN/docs/Web/API/GlobalEventHandlers/onresize diff --git a/files/zh-cn/_wikihistory.json b/files/zh-cn/_wikihistory.json index 4589deb197..6de70e3d52 100644 --- a/files/zh-cn/_wikihistory.json +++ b/files/zh-cn/_wikihistory.json @@ -12143,6 +12143,19 @@ "liuhe" ] }, + "Web/API/Element/fullscreenchange_event": { + "modified": "2019-03-18T21:19:43.587Z", + "contributors": [ + "Wyatt" + ] + }, + "Web/API/Element/fullscreenerror_event": { + "modified": "2020-10-15T22:21:46.027Z", + "contributors": [ + "kjyzly", + "LinChengDior" + ] + }, "Web/API/Element/getAttribute": { "modified": "2019-04-29T04:23:55.908Z", "contributors": [ @@ -12432,19 +12445,6 @@ "ziyunfei" ] }, - "Web/API/Element/onfullscreenchange": { - "modified": "2019-03-18T21:19:43.587Z", - "contributors": [ - "Wyatt" - ] - }, - "Web/API/Element/onfullscreenerror": { - "modified": "2020-10-15T22:21:46.027Z", - "contributors": [ - "kjyzly", - "LinChengDior" - ] - }, "Web/API/Element/openOrClosedShadowRoot": { "modified": "2020-10-15T22:35:17.746Z", "contributors": [ @@ -22901,6 +22901,12 @@ "libin2866" ] }, + "Web/API/Window/gamepaddisconnected_event": { + "modified": "2020-10-15T22:23:08.406Z", + "contributors": [ + "AWhiteMouse" + ] + }, "Web/API/Window/getComputedStyle": { "modified": "2020-10-15T21:29:18.864Z", "contributors": [ @@ -23160,18 +23166,6 @@ "PengyaoZhang" ] }, - "Web/API/Window/ongamepadconnected": { - "modified": "2020-10-15T22:22:28.465Z", - "contributors": [ - "VoidRain" - ] - }, - "Web/API/Window/ongamepaddisconnected": { - "modified": "2020-10-15T22:23:08.406Z", - "contributors": [ - "AWhiteMouse" - ] - }, "Web/API/Window/online_event": { "modified": "2019-04-18T11:22:47.220Z", "contributors": [ @@ -47272,6 +47266,12 @@ "ziyunfei" ] }, + "conflicting/Web/API/Window/gamepadconnected_event": { + "modified": "2020-10-15T22:22:28.465Z", + "contributors": [ + "VoidRain" + ] + }, "conflicting/Web/API/Window/localStorage": { "modified": "2019-03-23T22:25:01.381Z", "contributors": [ diff --git a/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html b/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html new file mode 100644 index 0000000000..8ec4daf1f5 --- /dev/null +++ b/files/zh-cn/conflicting/web/api/window/gamepadconnected_event/index.html @@ -0,0 +1,65 @@ +--- +title: Window.ongamepadconnected +slug: conflicting/Web/API/Window/gamepadconnected_event +tags: + - API + - Event Handler + - Experimental + - Gamepad API + - Property + - Reference + - Window + - gamepadconnected + - ongamepadconnected + - 手柄 + - 游戏 +translation_of: Web/API/Window/ongamepadconnected +original_slug: Web/API/Window/ongamepadconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

{{domxref("Window")}} 接口的 ongamepadconnected 属性是一个事件处理程序,它将在游戏手柄连接时运行 (即当 {{event('gamepadconnected')}} 事件触发时)。

+ +

此方法响应的对象类型是 {{domxref("GamepadEvent")}}.

+ +

语法

+ +
window.ongamepadconnected = function() { ... };
+
+ +

示例

+ +
window.ongamepadconnected = function(event) {
+  // 手柄上所有的可用按键和手柄控制元件上各轴向数值都能在此获取
+  event.gamepad;
+};
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}Initial definition
+ +

浏览器兼容性

+ + + +

{{Compat("api.Window.ongamepadconnected")}}

+ +

相关知识

+ + diff --git a/files/zh-cn/web/api/element/fullscreenchange_event/index.html b/files/zh-cn/web/api/element/fullscreenchange_event/index.html new file mode 100644 index 0000000000..7da05dd65b --- /dev/null +++ b/files/zh-cn/web/api/element/fullscreenchange_event/index.html @@ -0,0 +1,79 @@ +--- +title: Element.onfullscreenchange +slug: Web/API/Element/fullscreenchange_event +translation_of: Web/API/Element/onfullscreenchange +original_slug: Web/API/Element/onfullscreenchange +--- +
元素接口的 onfullscreenchange 属性是在元素过渡到或过渡到全屏模式时触发的全屏更改事件的事件处理程序。
+ +

语法

+ +
targetDocument.onfullscreenchange = fullscreenChangeHandler;
+
+ +

+ +

当事件处理程序处于 fullscreenchange 模式的时候, 表明游戏元素被改变了或者是退出了全屏模式

+ +

Example

+ +

本示例建立一个fullscreenchange 处理程序, handleFullscreenChange ()。此函数通过检查 event.target 的值来确定调用它的元素, 然后将文档的fullscreenElement 值与元素进行比较, 以查看它们是否为同一节点。

+ +

这给了我们一个值, 即 isFullscreen, 我们将其传递到一个名为 adjustMyControls() 的函数, 我们想象它是一个函数, 可以对应用的用户界面进行调整, 以便在全屏模式下而不是在窗口。

+ +
function toggleFullscreen() {
+  let elem = document.querySelector("video");
+
+  elem.onfullscreenchange = handleFullscreenChange;
+  if (!document.fullscreenElement) {
+    elem.requestFullscreen().then({}).catch(err => {
+      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
+    });
+  } else {
+    document.exitFullscreen();
+  }
+}
+
+function handleFullscreenChange(event) {
+  let elem = event.target;
+  let isFullscreen = document.fullscreenElement === elem;
+
+  adjustMyControls(isFullscreen);
+}
+
+ +

 

+ +

程序规范

+ + + + + + + + + + + + + + +
规范表达式程序状态解释
Fullscreen API
+ The definition of 'Document.fullscreenElement' in that specification.
Living Standard初始化定义
+ +

浏览器适配

+ +

请切换至英文版本查看浏览器适配统计表

+ +

此页上的兼容性表是由结构化数据生成的。如果您想提供数据, 请查看 https://github.com/mdn/browser-compat-data 并向我们发送 pull request

+ +

其他

+ + diff --git a/files/zh-cn/web/api/element/fullscreenerror_event/index.html b/files/zh-cn/web/api/element/fullscreenerror_event/index.html new file mode 100644 index 0000000000..502df3c680 --- /dev/null +++ b/files/zh-cn/web/api/element/fullscreenerror_event/index.html @@ -0,0 +1,65 @@ +--- +title: Element.onfullscreenerror +slug: Web/API/Element/fullscreenerror_event +translation_of: Web/API/Element/onfullscreenerror +original_slug: Web/API/Element/onfullscreenerror +--- +
{{ApiRef("Fullscreen API")}}
+ +

{{domxref("Element")}} 接口的 onfullscreenerror 属性是在{{domxref("Element")}} 过渡到或退出全屏模式发生错误后处理事件{{event("fullscreenerror")}}的事件处理程序。

+ +

语法

+ +
targetElement.onfullscreenerror = fullscreenErrorHandler;
+
+ +

+ +

一个处理事件{{event("fullscreenerror")}}的事件处理程序.

+ +

示例

+ +

本示例尝试不从用户发起的事件(如点击事件{{event("click")}}或键盘事件{{event("keypress")}})处理程序来触发全屏,由于全屏模式只允许由用户主动输入触发,因此该操作会发生错误,从而导致{{domxref("Element")}}会触发{{event("fullscreenerror")}}事件传递给错误处理程序

+ +
let elem = document.querySelector("video")}}
+
+elem.onfullscreenerror = function ( event ) {
+  displayWarning("Unable to switch into full-screen mode.");
+};
+
+//....
+
+elem.requestFullscreen();
+ +

规范

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}Initial definition.
+ +

浏览器兼容性

+ + + +

{{Compat("api.Element.onfullscreenerror")}}

+ +

其他

+ + diff --git a/files/zh-cn/web/api/element/onfullscreenchange/index.html b/files/zh-cn/web/api/element/onfullscreenchange/index.html deleted file mode 100644 index 2a2b2416cf..0000000000 --- a/files/zh-cn/web/api/element/onfullscreenchange/index.html +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Element.onfullscreenchange -slug: Web/API/Element/onfullscreenchange -translation_of: Web/API/Element/onfullscreenchange ---- -
元素接口的 onfullscreenchange 属性是在元素过渡到或过渡到全屏模式时触发的全屏更改事件的事件处理程序。
- -

语法

- -
targetDocument.onfullscreenchange = fullscreenChangeHandler;
-
- -

- -

当事件处理程序处于 fullscreenchange 模式的时候, 表明游戏元素被改变了或者是退出了全屏模式

- -

Example

- -

本示例建立一个fullscreenchange 处理程序, handleFullscreenChange ()。此函数通过检查 event.target 的值来确定调用它的元素, 然后将文档的fullscreenElement 值与元素进行比较, 以查看它们是否为同一节点。

- -

这给了我们一个值, 即 isFullscreen, 我们将其传递到一个名为 adjustMyControls() 的函数, 我们想象它是一个函数, 可以对应用的用户界面进行调整, 以便在全屏模式下而不是在窗口。

- -
function toggleFullscreen() {
-  let elem = document.querySelector("video");
-
-  elem.onfullscreenchange = handleFullscreenChange;
-  if (!document.fullscreenElement) {
-    elem.requestFullscreen().then({}).catch(err => {
-      alert(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`);
-    });
-  } else {
-    document.exitFullscreen();
-  }
-}
-
-function handleFullscreenChange(event) {
-  let elem = event.target;
-  let isFullscreen = document.fullscreenElement === elem;
-
-  adjustMyControls(isFullscreen);
-}
-
- -

 

- -

程序规范

- - - - - - - - - - - - - - -
规范表达式程序状态解释
Fullscreen API
- The definition of 'Document.fullscreenElement' in that specification.
Living Standard初始化定义
- -

浏览器适配

- -

请切换至英文版本查看浏览器适配统计表

- -

此页上的兼容性表是由结构化数据生成的。如果您想提供数据, 请查看 https://github.com/mdn/browser-compat-data 并向我们发送 pull request

- -

其他

- - diff --git a/files/zh-cn/web/api/element/onfullscreenerror/index.html b/files/zh-cn/web/api/element/onfullscreenerror/index.html deleted file mode 100644 index de9e5353c4..0000000000 --- a/files/zh-cn/web/api/element/onfullscreenerror/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Element.onfullscreenerror -slug: Web/API/Element/onfullscreenerror -translation_of: Web/API/Element/onfullscreenerror ---- -
{{ApiRef("Fullscreen API")}}
- -

{{domxref("Element")}} 接口的 onfullscreenerror 属性是在{{domxref("Element")}} 过渡到或退出全屏模式发生错误后处理事件{{event("fullscreenerror")}}的事件处理程序。

- -

语法

- -
targetElement.onfullscreenerror = fullscreenErrorHandler;
-
- -

- -

一个处理事件{{event("fullscreenerror")}}的事件处理程序.

- -

示例

- -

本示例尝试不从用户发起的事件(如点击事件{{event("click")}}或键盘事件{{event("keypress")}})处理程序来触发全屏,由于全屏模式只允许由用户主动输入触发,因此该操作会发生错误,从而导致{{domxref("Element")}}会触发{{event("fullscreenerror")}}事件传递给错误处理程序

- -
let elem = document.querySelector("video")}}
-
-elem.onfullscreenerror = function ( event ) {
-  displayWarning("Unable to switch into full-screen mode.");
-};
-
-//....
-
-elem.requestFullscreen();
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName("Fullscreen", "#dom-element-onfullscreenerror", "onfullscreenerror")}}{{Spec2("HTML WHATWG")}}Initial definition.
- -

浏览器兼容性

- - - -

{{Compat("api.Element.onfullscreenerror")}}

- -

其他

- - diff --git a/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html new file mode 100644 index 0000000000..48ef7f7e79 --- /dev/null +++ b/files/zh-cn/web/api/window/gamepaddisconnected_event/index.html @@ -0,0 +1,52 @@ +--- +title: Window.ongamepaddisconnected +slug: Web/API/Window/gamepaddisconnected_event +translation_of: Web/API/Window/ongamepaddisconnected +original_slug: Web/API/Window/ongamepaddisconnected +--- +
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
+ +

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

+ +

The event object is of type {{domxref("GamepadEvent")}}.

+ +

解析

+ +
window.ongamepaddisconnected = function() { ... };
+
+ +

示例

+ +
window.ongamepaddisconnected = function() {
+  // A gamepad has been disconnected
+};
+ +

Specifications

+ + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.Window.ongamepaddisconnected")}}

+ +

See also

+ + diff --git a/files/zh-cn/web/api/window/ongamepadconnected/index.html b/files/zh-cn/web/api/window/ongamepadconnected/index.html deleted file mode 100644 index 809fd1f1c7..0000000000 --- a/files/zh-cn/web/api/window/ongamepadconnected/index.html +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: Window.ongamepadconnected -slug: Web/API/Window/ongamepadconnected -tags: - - API - - Event Handler - - Experimental - - Gamepad API - - Property - - Reference - - Window - - gamepadconnected - - ongamepadconnected - - 手柄 - - 游戏 -translation_of: Web/API/Window/ongamepadconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

{{domxref("Window")}} 接口的 ongamepadconnected 属性是一个事件处理程序,它将在游戏手柄连接时运行 (即当 {{event('gamepadconnected')}} 事件触发时)。

- -

此方法响应的对象类型是 {{domxref("GamepadEvent")}}.

- -

语法

- -
window.ongamepadconnected = function() { ... };
-
- -

示例

- -
window.ongamepadconnected = function(event) {
-  // 手柄上所有的可用按键和手柄控制元件上各轴向数值都能在此获取
-  event.gamepad;
-};
- -

规范

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepadconnected', 'gamepadconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

浏览器兼容性

- - - -

{{Compat("api.Window.ongamepadconnected")}}

- -

相关知识

- - diff --git a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html b/files/zh-cn/web/api/window/ongamepaddisconnected/index.html deleted file mode 100644 index 7712dd6066..0000000000 --- a/files/zh-cn/web/api/window/ongamepaddisconnected/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: Window.ongamepaddisconnected -slug: Web/API/Window/ongamepaddisconnected -translation_of: Web/API/Window/ongamepaddisconnected ---- -
{{DefaultAPISidebar("Gamepad API")}}{{SeeCompatTable}}
- -

The ongamepaddisconnected property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).

- -

The event object is of type {{domxref("GamepadEvent")}}.

- -

解析

- -
window.ongamepaddisconnected = function() { ... };
-
- -

示例

- -
window.ongamepaddisconnected = function() {
-  // A gamepad has been disconnected
-};
- -

Specifications

- - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}}{{Spec2('Gamepad')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("api.Window.ongamepaddisconnected")}}

- -

See also

- - -- cgit v1.2.3-54-g00ecf