From af9727e99358a22b5665675a450d93e93f80376a Mon Sep 17 00:00:00 2001 From: skyclouds2001 <95597335+skyclouds2001@users.noreply.github.com> Date: Thu, 19 Sep 2024 02:43:40 +0800 Subject: [PATCH] update --- .../api/notification/notification/index.md | 50 +++++++++---------- .../requestpermission_static/index.md | 2 +- .../using_the_notifications_api/index.md | 2 +- .../shownotification/index.md | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/files/zh-cn/web/api/notification/notification/index.md b/files/zh-cn/web/api/notification/notification/index.md index 797bcc0fc12f21..04e6d1b38f0b6d 100644 --- a/files/zh-cn/web/api/notification/notification/index.md +++ b/files/zh-cn/web/api/notification/notification/index.md @@ -2,7 +2,7 @@ title: Notification:Notification() 构造函数 slug: Web/API/Notification/Notification l10n: - sourceCommit: e011d5695b264ced5a3f4bb822ca7904e23b7e83 + sourceCommit: 09ad551d5fecae5872328ece2871fdf02b115b6e --- {{APIRef("Web Notifications")}}{{securecontext_header}} {{AvailableInWorkers}} @@ -27,30 +27,6 @@ new Notification(title, options) - : 一个包含要应用于通知的任何自定义设置的选项对象。可能的选项有: - - `dir` {{optional_inline}} - - : 显示通知的方向。它默认为 `auto`,即只采用浏览器的语言设置行为,但你可以通过设置 `ltr` 和 `rtl` 的值来覆盖该行为(尽管大多数浏览器似乎忽略这些设置)。 - - `lang` {{optional_inline}} - - : 指定通知的语言,根据 {{RFC(5646, "识别语言的标签(也被称为 BCP47)")}}使用表示语言标签的字符串指定。请参阅 Sitepoint [ISO 2 字母语言代码](https://www.sitepoint.com/iso-2-letter-language-codes/)页面以获取简单参考。 - - `badge` {{optional_inline}} - - : 一个包含图像 URL 的字符串,用于在没有足够空间显示通知本身时表示通知。 - - `body` {{optional_inline}} - - : 一个表示通知正文的字符串,显示在标题下方,默认值是一个空字符串。 - - `tag` {{optional_inline}} - - : 一个表示通知的识别标签的字符串,默认值是一个空字符串。 - - `icon` {{optional_inline}} - - : 一个包含要在通知中显示的图标的 URL 的字符串。 - - `image` {{optional_inline}} - - : 一个包含要在通知中显示的图像的 URL 的字符串。 - - `data` {{optional_inline}} - - : 任意你想要与通知关联的数据。它可以是任何数据类型。默认值为 `null`。 - - `vibrate` {{optional_inline}} - - : 设备振动硬件随通知一起发出的[振动模式](/zh-CN/docs/Web/API/Vibration_API#振动模式)。当该值被指定时,`silent` 参数不得设置为 `true`。 - - `timestamp` {{optional_inline}} - - : 一个表示通知创建或适用的时间(过去、现在或将来)的数字。 - - `renotify` {{optional_inline}} - - : 一个布尔值,指定在新通知替换旧通知后是否应通知用户。默认值为 `false`,这意味着他们不会收到通知。如果该值被指定为 `true`,那么必须同时设置 `tag` 参数。 - - `requireInteraction` {{optional_inline}} - - : 指示通知应保持活动状态,直到用户单击或关闭它,而不是自动关闭。默认值为 `false`。 - `actions` {{optional_inline}} - : 要在通知中显示的一系列操作的数组,默认为一个空数组。数组中的每个元素都是一个具有以下成员的对象: @@ -64,8 +40,32 @@ new Notification(title, options) 使用 {{domxref("ServiceWorkerGlobalScope.notificationclick_event", "notificationclick")}} 事件中的 `event.action` 构建适当的响应。 + - `badge` {{optional_inline}} + - : 一个包含图像 URL 的字符串,用于在没有足够空间显示通知本身时表示通知。 + - `body` {{optional_inline}} + - : 一个表示通知正文的字符串,显示在标题下方,默认值是一个空字符串。 + - `data` {{optional_inline}} + - : 任意你想要与通知关联的数据。它可以是任何数据类型。默认值为 `null`。 + - `dir` {{optional_inline}} + - : 显示通知的方向。它默认为 `auto`,即只采用浏览器的语言设置行为,但你可以通过设置 `ltr` 和 `rtl` 的值来覆盖该行为(尽管大多数浏览器似乎忽略这些设置)。 + - `icon` {{optional_inline}} + - : 一个包含要在通知中显示的图标的 URL 的字符串。 + - `image` {{optional_inline}} + - : 一个包含要在通知中显示的图像的 URL 的字符串。 + - `lang` {{optional_inline}} + - : 指定通知的语言,根据 {{RFC(5646, "识别语言的标签(也被称为 BCP47)")}}使用表示语言标签的字符串指定。请参阅 Sitepoint [ISO 2 字母语言代码](https://www.sitepoint.com/iso-2-letter-language-codes/)页面以获取简单参考。 + - `renotify` {{optional_inline}} + - : 一个布尔值,指定在新通知替换旧通知后是否应通知用户。默认值为 `false`,这意味着他们不会收到通知。如果该值被指定为 `true`,那么必须同时设置 `tag` 参数。 + - `requireInteraction` {{optional_inline}} + - : 指示通知应保持活动状态,直到用户单击或关闭它,而不是自动关闭。默认值为 `false`。 - `silent` {{optional_inline}} - : 一个布尔值,指定通知是否静音(不发出声音或振动),无论设备设置如何。默认值 `null` 表示使用设备默认值。如果被设置为 `true`,那么不能同时存在 `vibrate` 参数。 + - `tag` {{optional_inline}} + - : 一个表示通知的识别标签的字符串,默认值是一个空字符串。 + - `timestamp` {{optional_inline}} + - : 一个表示通知创建或适用的时间(过去、现在或将来)的数字。 + - `vibrate` {{optional_inline}} + - : 设备振动硬件随通知一起发出的[振动模式](/zh-CN/docs/Web/API/Vibration_API#振动模式)。当该值被指定时,`silent` 参数不得设置为 `true`。 ### 返回值 diff --git a/files/zh-cn/web/api/notification/requestpermission_static/index.md b/files/zh-cn/web/api/notification/requestpermission_static/index.md index df6a84c72aed7e..02666845736a66 100644 --- a/files/zh-cn/web/api/notification/requestpermission_static/index.md +++ b/files/zh-cn/web/api/notification/requestpermission_static/index.md @@ -2,7 +2,7 @@ title: Notification:requestPermission() 静态方法 slug: Web/API/Notification/requestPermission_static l10n: - sourceCommit: 1d32183ba01cac6355135962686935e092f0251b + sourceCommit: 09ad551d5fecae5872328ece2871fdf02b115b6e --- {{APIRef("Web Notifications")}}{{securecontext_header}} diff --git a/files/zh-cn/web/api/notifications_api/using_the_notifications_api/index.md b/files/zh-cn/web/api/notifications_api/using_the_notifications_api/index.md index e76dbaf579a562..13f722e0479767 100644 --- a/files/zh-cn/web/api/notifications_api/using_the_notifications_api/index.md +++ b/files/zh-cn/web/api/notifications_api/using_the_notifications_api/index.md @@ -2,7 +2,7 @@ title: 使用 Notifications API slug: Web/API/Notifications_API/Using_the_Notifications_API l10n: - sourceCommit: aa8fa82a902746b0bd97839180fc2b5397088140 + sourceCommit: 83ec73ac6fec9cae23c54b729e6481f50a0a45e7 --- {{DefaultAPISidebar("Web Notifications")}}{{securecontext_header}} diff --git a/files/zh-cn/web/api/serviceworkerregistration/shownotification/index.md b/files/zh-cn/web/api/serviceworkerregistration/shownotification/index.md index 01cd0673306bb5..a1dddd164256eb 100644 --- a/files/zh-cn/web/api/serviceworkerregistration/shownotification/index.md +++ b/files/zh-cn/web/api/serviceworkerregistration/shownotification/index.md @@ -2,7 +2,7 @@ title: ServiceWorkerRegistration:showNotification() 方法 slug: Web/API/ServiceWorkerRegistration/showNotification l10n: - sourceCommit: 4de6f76bbfd76229db78ffb7d52cf6b4cb9f31f8 + sourceCommit: 09ad551d5fecae5872328ece2871fdf02b115b6e --- {{APIRef("Web Notifications")}}{{SecureContext_Header}} {{AvailableInWorkers}}