diff options
Diffstat (limited to 'files/fr/web/api/notification')
25 files changed, 76 insertions, 73 deletions
diff --git a/files/fr/web/api/notification/actions/index.html b/files/fr/web/api/notification/actions/index.html index 3f484723f7..e65543b120 100644 --- a/files/fr/web/api/notification/actions/index.html +++ b/files/fr/web/api/notification/actions/index.html @@ -13,17 +13,19 @@ translation_of: Web/API/Notification/actions --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <strong><code>actions</code></strong> en lecture seule de l'interface {{domxref ("Notification")}} renvoie la liste des {{domxref ("NotificationAction")}} objets définis à l'aide de l'option <code>actions</code> lors de la création de la notification à l'aide du constructeur {{domxref("Notification.Notification","Notification()")}}.</span> Il s'agit d'une liste des actions définies par l'application que l'utilisateur peut choisir de prendre directement depuis le contexte d'une notification.</p> +<p>La propriété <strong><code>actions</code></strong> en lecture seule de l'interface {{domxref ("Notification")}} renvoie la liste des {{domxref ("NotificationAction")}} objets définis à l'aide de l'option <code>actions</code> lors de la création de la notification à l'aide du constructeur {{domxref("Notification.Notification","Notification()")}}.</p> + +<p>Il s'agit d'une liste des actions définies par l'application que l'utilisateur peut choisir de prendre directement depuis le contexte d'une notification.</p> <div class="blockIndicator note"> <p><strong>Note:</strong> Le périphérique et l'agent utilisateur peuvent ne pouvoir afficher qu'un nombre limité d'actions (en raison, par exemple, d'un espace d'écran limité). Cette limite peut être déduite de {{DOMxRef ("Notification.maxActions")}}.</p> </div> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.actions</pre> +<pre class="syntaxbox"><var>Notification</var>.actions</pre> -<h3 id="Value" name="Value">Valeur</h3> +<h3 id="Value">Valeur</h3> <p>Un tableau en lecture seule d'objets {{domxref ("NotificationAction")}}, chacun décrivant une action unique que l'utilisateur peut choisir dans une notification.</p> diff --git a/files/fr/web/api/notification/badge/index.html b/files/fr/web/api/notification/badge/index.html index 7afe7c725f..319ba58bb9 100644 --- a/files/fr/web/api/notification/badge/index.html +++ b/files/fr/web/api/notification/badge/index.html @@ -12,11 +12,11 @@ translation_of: Web/API/Notification/badge --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <strong><code>badge</code></strong> de l'interface {{domxref ("Notification")}} renvoie l'URL de l'image utilisée pour représenter la notification lorsqu'il n'y a pas assez d'espace pour afficher la notification elle-même.</span></p> +<p>La propriété <strong><code>badge</code></strong> de l'interface {{domxref ("Notification")}} renvoie l'URL de l'image utilisée pour représenter la notification lorsqu'il n'y a pas assez d'espace pour afficher la notification elle-même.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate">const url = Notification.badge</pre> +<pre class="syntaxbox">const url = Notification.badge</pre> <h3 id="Valeur">Valeur</h3> @@ -34,7 +34,7 @@ translation_of: Web/API/Notification/badge <tr> <td>{{SpecName('Web Notifications','#dom-notification-badge','badge')}}</td> <td>{{Spec2('Web Notifications')}}</td> - <td><span class="tlid-translation translation" lang="fr"><span title="">Définition initiale</span></span>.</td> + <td>Définition initiale.</td> </tr> </tbody> </table> diff --git a/files/fr/web/api/notification/body/index.html b/files/fr/web/api/notification/body/index.html index d89bd55769..e19c579157 100644 --- a/files/fr/web/api/notification/body/index.html +++ b/files/fr/web/api/notification/body/index.html @@ -13,11 +13,11 @@ translation_of: Web/API/Notification/body --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <span class="tlid-translation translation" lang="fr">en lecture seule</span> <strong><code>body</code></strong> de l'interface {{domxref ("Notification")}} est la chaîne de caractères qui correspond au corps de la notification, comme définis à l'aide de l'option <code>body</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</span></p> +<p>La propriété en lecture seule <strong><code>body</code></strong> de l'interface {{domxref ("Notification")}} est la chaîne de caractères qui correspond au corps de la notification, comme définis à l'aide de l'option <code>body</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.body +<pre class="syntaxbox"><var>Notification</var>.body </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/close/index.html b/files/fr/web/api/notification/close/index.html index 37f7f929b6..359bf36dda 100644 --- a/files/fr/web/api/notification/close/index.html +++ b/files/fr/web/api/notification/close/index.html @@ -14,7 +14,7 @@ translation_of: Web/API/Notification/close --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p>La méthode <code>close()</code> de l'interface {{domxref("Notification")}} est <span class="tlid-translation translation" lang="fr">utilisée </span>pour fermer / supprimer une notification précédemment affichée.</p> +<p>La méthode <code>close()</code> de l'interface {{domxref("Notification")}} est utilisée pour fermer / supprimer une notification précédemment affichée.</p> <div class="note"> <p><strong>Note:</strong> Cette API ne doit pas être utilisée uniquement pour supprimer la notification de l'écran après un délai fixe, car cette méthode supprimera également la notification de toute barre de notification, empêchant ainsi les utilisateurs d'interagir avec elle après son affichage initial. Une utilisation valable de cette API serait de supprimer une notification qui n'est plus pertinente (par exemple, l'utilisateur a déjà lu la notification sur la page Web dans le cas d'une application de messagerie ou la chanson suivante est déjà en cours de lecture dans une application musicale).</p> @@ -22,7 +22,7 @@ translation_of: Web/API/Notification/close <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate">Notification.close()</pre> +<pre class="syntaxbox">Notification.close()</pre> <h3 id="Paramètres">Paramètres</h3> @@ -36,7 +36,7 @@ translation_of: Web/API/Notification/close <p>Dans l'extrait de code suivant, nous avons une simple fonction qui, lorsqu'elle est appelée, crée un objet <code>options</code>, puis de celui-ci une nouvelle notification. À la fin de la fonction, elle appelle également <code>close()</code> dans une fonction {{domxref ("EventTarget.addEventListener", "addEventListener ()")}} pour supprimer la notification lorsque le contenu pertinent a été lu sur la page Web.</p> -<pre class="brush:js notranslate">function spawnNotification(theBody, theIcon, theTitle) { +<pre class="brush:js">function spawnNotification(theBody, theIcon, theTitle) { const options = { body: theBody, icon: theIcon diff --git a/files/fr/web/api/notification/data/index.html b/files/fr/web/api/notification/data/index.html index e6e29516f2..22b3b01747 100644 --- a/files/fr/web/api/notification/data/index.html +++ b/files/fr/web/api/notification/data/index.html @@ -13,13 +13,13 @@ translation_of: Web/API/Notification/data --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>data</code></strong> de l'interface {{domxref ("Notification")}} renvoie un clone structuré des données de la notification, comme définis à l'aide de l'option <code>data</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification() ")}}.</span></p> +<p>La propriété en lecture seule <strong><code>data</code></strong> de l'interface {{domxref ("Notification")}} renvoie un clone structuré des données de la notification, comme définis à l'aide de l'option <code>data</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification() ")}}.</p> <p>Les données de la notification peuvent être des données arbitraires, sans restriction de format que vous souhaitez associer à la notification.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.data +<pre class="syntaxbox"><var>Notification</var>.data </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/dir/index.html b/files/fr/web/api/notification/dir/index.html index 6e694e6d14..7fed8f84dd 100644 --- a/files/fr/web/api/notification/dir/index.html +++ b/files/fr/web/api/notification/dir/index.html @@ -13,14 +13,14 @@ translation_of: Web/API/Notification/dir --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>dir</code></strong> de l'interface {{domxref ("Notification")}} indique le sens du texte de la notification, définis à l'aide de l'option <code>dir</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</span></p> +<p>La propriété en lecture seule <strong><code>dir</code></strong> de l'interface {{domxref ("Notification")}} indique le sens du texte de la notification, définis à l'aide de l'option <code>dir</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="eval notranslate"><var>Notification</var>.dir +<pre class="eval"><var>Notification</var>.dir </pre> -<h3 id="Value" name="Value">Valeur</h3> +<h3 id="Value">Valeur</h3> <p>Une {{domxref ("DOMString")}} spécifiant la direction du texte. Les valeurs possibles sont:</p> @@ -31,7 +31,7 @@ translation_of: Web/API/Notification/dir </ul> <div class="note"> -<p><strong>Note</strong>: La plupart des navigateurs semblent ignorer les paramètres explicites de ltr et rtl, et utilisent simplement le paramètre à l'échelle du navigateur.</p> +<p><strong>Note :</strong> La plupart des navigateurs semblent ignorer les paramètres explicites de ltr et rtl, et utilisent simplement le paramètre à l'échelle du navigateur.</p> </div> <h2 id="Spécifications">Spécifications</h2> diff --git a/files/fr/web/api/notification/icon/index.html b/files/fr/web/api/notification/icon/index.html index 19eac0702c..8b25811ea0 100644 --- a/files/fr/web/api/notification/icon/index.html +++ b/files/fr/web/api/notification/icon/index.html @@ -17,7 +17,7 @@ translation_of: Web/API/Notification/icon <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.icon +<pre class="syntaxbox"><var>Notification</var>.icon </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/image/index.html b/files/fr/web/api/notification/image/index.html index 0ad86d51a3..fa57345f6e 100644 --- a/files/fr/web/api/notification/image/index.html +++ b/files/fr/web/api/notification/image/index.html @@ -15,11 +15,11 @@ translation_of: Web/API/Notification/image <p>La propriété en lecture seule <code><strong>image</strong></code> de l'interface {{domxref ("Notification")}} contient l'URL d'une image à afficher dans le cadre de la notification, comme définis à l'aide de l'option <code>image</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification"," Notification()")}}.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.image</pre> +<pre class="syntaxbox"><var>Notification</var>.image</pre> -<h3 id="Value" name="Value">Valeur</h3> +<h3 id="Value">Valeur</h3> <p>Une {{domxref("USVString")}}.</p> diff --git a/files/fr/web/api/notification/index.html b/files/fr/web/api/notification/index.html index 207ba16762..f732fae408 100644 --- a/files/fr/web/api/notification/index.html +++ b/files/fr/web/api/notification/index.html @@ -11,7 +11,7 @@ translation_of: Web/API/Notification --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">L'interface Notification de l'<a href="/fr/docs/Web/API/Notifications_API">API Notifications</a> est utilisée pour configurer et afficher les notifications de bureau à l'utilisateur. L'apparence et les fonctionnalités spécifiques de ces notifications varient selon les plates-formes, mais elles permettent généralement de fournir des informations de manière asynchrone à l'utilisateur.</span></p> +<p>L'interface Notification de l'<a href="/fr/docs/Web/API/Notifications_API">API Notifications</a> est utilisée pour configurer et afficher les notifications de bureau à l'utilisateur. L'apparence et les fonctionnalités spécifiques de ces notifications varient selon les plates-formes, mais elles permettent généralement de fournir des informations de manière asynchrone à l'utilisateur.</p> <h2 id="Constructeur">Constructeur</h2> @@ -28,7 +28,7 @@ translation_of: Web/API/Notification <dl> <dt>{{domxref("Notification.permission")}} {{readonlyinline}}</dt> - <dd>Une chaîne représentant l'autorisation actuelle d'afficher les notifications. Les valeurs possibles sont: + <dd><p>Une chaîne représentant l'autorisation actuelle d'afficher les notifications. Les valeurs possibles sont:</p> <ul> <li><code>denied</code> — L'utilisateur refuse d'afficher des notifications.</li> <li><code>granted</code> — L'utilisateur accepte d'afficher des notifications.</li> @@ -36,6 +36,7 @@ translation_of: Web/API/Notification </ul> </dd> <dt>{{domxref("Notification.maxActions")}} {{readonlyinline}}</dt> + <dd>Le nombre maximal d'actions pris en charge par l'appareil et l'agent utilisateur.</dd> </dl> <h3 id="Propriétés_de_linstance">Propriétés de l'instance</h3> @@ -112,11 +113,11 @@ translation_of: Web/API/Notification <p>Supposons ce HTML de base:</p> -<pre class="brush: html notranslate"><button onclick="notifyMe()">Notifie moi !</button></pre> +<pre class="brush: html"><button onclick="notifyMe()">Notifie moi !</button></pre> <p>Il est possible d'envoyer une notification comme suit - nous présentons ici un ensemble de code assez détaillé et complet que vous pourriez utiliser si vous vouliez d'abord vérifier si les notifications sont prises en charge, puis vérifiez si l'autorisation a été accordée pour l'{{glossary("Origin","origine")}} actuelle d'envoyer des notifications, puis demander l'autorisation si nécessaire, avant d'envoyer une notification.</p> -<pre class="brush: js notranslate">function notifyMe() { +<pre class="brush: js">function notifyMe() { // Vérifions si le navigateur prend en charge les notifications if (!('Notification' in window)) { alert('Ce navigateur ne prend pas en charge la notification de bureau') @@ -145,8 +146,8 @@ translation_of: Web/API/Notification <p>Nous ne montrons plus d'exemple en direct sur cette page, car Chrome et Firefox n'autorisent plus les demandes de notification des {{htmlelement ("iframe")}}s d'origine croisée, avec d'autres navigateurs à suivre. Pour voir un exemple en action, consultez notre <a href="https://github.com/mdn/to-do-notifications/tree/gh-pages">exemple de liste de tâches</a> (voir également l'<a href="https://mdn.github.io/to-do-notifications/">application en cours d'exécution</a>.)</p> -<div class="blockIndicator note"> -<p><strong>Note</strong>: dans l'exemple ci-dessus, nous générons des notifications en réponse à un geste de l'utilisateur (en cliquant sur un bouton). Il ne s'agit pas seulement d'une bonne pratique - vous ne devriez pas envoyer de spam aux utilisateurs avec des notifications qu'ils n'acceptent pas - mais les navigateurs suivants interdiront explicitement les notifications non déclenchées en réponse à un geste de l'utilisateur. Firefox le fait déjà depuis la version 72, par exemple.</p> +<div class="note"> +<p><strong>Note :</strong> Dans l'exemple ci-dessus, nous générons des notifications en réponse à un geste de l'utilisateur (en cliquant sur un bouton). Il ne s'agit pas seulement d'une bonne pratique - vous ne devriez pas envoyer de spam aux utilisateurs avec des notifications qu'ils n'acceptent pas - mais les navigateurs suivants interdiront explicitement les notifications non déclenchées en réponse à un geste de l'utilisateur. Firefox le fait déjà depuis la version 72, par exemple.</p> </div> <h2 id="Spécifications">Spécifications</h2> diff --git a/files/fr/web/api/notification/lang/index.html b/files/fr/web/api/notification/lang/index.html index 91134377e5..3a409d72ff 100644 --- a/files/fr/web/api/notification/lang/index.html +++ b/files/fr/web/api/notification/lang/index.html @@ -12,13 +12,13 @@ translation_of: Web/API/Notification/lang --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>lang</code></strong> de l'interface {{domxref ("Notification")}} indique la langue utilisée dans la notification, comme définis à l'aide de l'option <code>lang</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</span></p> +<p>La propriété en lecture seule <strong><code>lang</code></strong> de l'interface {{domxref ("Notification")}} indique la langue utilisée dans la notification, comme définis à l'aide de l'option <code>lang</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()" )}}.</p> <p>La langue elle-même est spécifiée à l'aide d'un {{domxref ("DOMString")}} représentant <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">une balise de langue BCP 47</a>. Consultez la page des <a href="http://www.sitepoint.com/web-foundations/iso-2-letter-language-codes/">codes de langue à 2 lettres ISO</a> de Sitepoint pour une référence simple.</p> <h2 id="Syntaxz">Syntaxz</h2> -<pre class="syntaxbox notranslate"><var>N</var><var>otification</var>.lang +<pre class="syntaxbox"><var>N</var><var>otification</var>.lang </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/maxactions/index.html b/files/fr/web/api/notification/maxactions/index.html index f780fc27a1..df61031657 100644 --- a/files/fr/web/api/notification/maxactions/index.html +++ b/files/fr/web/api/notification/maxactions/index.html @@ -17,7 +17,7 @@ translation_of: Web/API/Notification/maxActions <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.maxActions +<pre class="syntaxbox"><var>Notification</var>.maxActions </pre> <h3 id="Valeur">Valeur</h3> @@ -28,7 +28,7 @@ translation_of: Web/API/Notification/maxActions <p>L'extrait de code suivant enregistre le nombre maximal d'actions prises en charge.</p> -<pre class="brush: js notranslate">const { maxActions } = Notification +<pre class="brush: js">const { maxActions } = Notification console.log(`This device can display at most ${maxActions} actions on each notification.`); </pre> diff --git a/files/fr/web/api/notification/notification/index.html b/files/fr/web/api/notification/notification/index.html index 48578eb688..0e9a988e55 100644 --- a/files/fr/web/api/notification/notification/index.html +++ b/files/fr/web/api/notification/notification/index.html @@ -17,7 +17,7 @@ translation_of: Web/API/Notification/Notification <h2 id="Syntaxe">Syntaxe</h2> -<pre class="brush: js syntaxbox">const <var>myNotification</var> = new Notification(<var>title</var>, <var>options</var>)</pre> +<pre class="brush: js">const <var>myNotification</var> = new Notification(<var>title</var>, <var>options</var>)</pre> <h3 id="Paramètres">Paramètres</h3> @@ -48,7 +48,7 @@ translation_of: Web/API/Notification/Notification <p>Dans notre <a href="https://chrisdavidmills.github.io/emogotchi/">démo Emogotchi</a> (<a href="https://github.com/mdn/emogotchi">voir le code source</a>), nous exécutons une fonction <code>spawnNotification()</code> lorsque nous voulons déclencher une notification. La fonction reçoit des paramètres pour spécifier le corps, l'icône et le titre souhaités, puis elle crée l'objet <code>options</code> nécessaire et déclenche la notification à l'aide du constructeur <code>Notification()</code>.</p> -<pre class="brush: js notranslate">function spawnNotification(body, icon, title) { +<pre class="brush: js">function spawnNotification(body, icon, title) { const options = { body: body, icon: icon diff --git a/files/fr/web/api/notification/onclick/index.html b/files/fr/web/api/notification/onclick/index.html index 209d7c519f..b1561a4fe9 100644 --- a/files/fr/web/api/notification/onclick/index.html +++ b/files/fr/web/api/notification/onclick/index.html @@ -14,7 +14,7 @@ translation_of: Web/API/Notification/onclick <p>La propriété <strong><code>onclick</code></strong>, rattachée à l'interface {{domxref("Notification")}}, définit un gestionnaire d'évènement à déclencher lorsque la notification recçoit un évènement {{event("click")}} (qui se produit lorsqu'un utilisateur clique sur la notification).</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> <pre class="syntaxbox"><em>Notification</em>.onclick = function(event) { ... }; </pre> diff --git a/files/fr/web/api/notification/onclose/index.html b/files/fr/web/api/notification/onclose/index.html index 5d5edbde16..5dddd078f3 100644 --- a/files/fr/web/api/notification/onclose/index.html +++ b/files/fr/web/api/notification/onclose/index.html @@ -13,11 +13,11 @@ translation_of: Web/API/Notification/onclose --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <strong><code>onclose</code></strong> de l'interface {{domxref ("Notification")}} définit un écouteur d'événements pour recevoir les événements {{domxref ("HTMLDialogElement/close_event", "close")}}. Ces événements se produisent lorsqu'une {{domxref ("Notification")}} est fermée.</span></p> +<p>La propriété <strong><code>onclose</code></strong> de l'interface {{domxref ("Notification")}} définit un écouteur d'événements pour recevoir les événements {{domxref ("HTMLDialogElement/close_event", "close")}}. Ces événements se produisent lorsqu'une {{domxref ("Notification")}} est fermée.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.onclose = function(event) { ... } +<pre class="syntaxbox"><var>Notification</var>.onclose = function(event) { ... } Notification.onclose = (event) => { ... } </pre> diff --git a/files/fr/web/api/notification/onerror/index.html b/files/fr/web/api/notification/onerror/index.html index 476e5cb9d7..af9115de5b 100644 --- a/files/fr/web/api/notification/onerror/index.html +++ b/files/fr/web/api/notification/onerror/index.html @@ -13,11 +13,11 @@ translation_of: Web/API/Notification/onerror --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <strong><code>onerror</code></strong> de l'interface {{domxref ("Notification")}} spécifie un écouteur d'événements pour recevoir les événements {{domxref ("HTMLElement/error_event", "error")}}. Ces événements se produisent lorsque quelque chose ce déroule mal avec une {{domxref ("Notification")}}</span> (dans de nombreux cas, une erreur qui empêche l'affichage de la notification.)</p> +<p>La propriété <strong><code>onerror</code></strong> de l'interface {{domxref ("Notification")}} spécifie un écouteur d'événements pour recevoir les événements {{domxref ("HTMLElement/error_event", "error")}}. Ces événements se produisent lorsque quelque chose ce déroule mal avec une {{domxref ("Notification")}} (dans de nombreux cas, une erreur qui empêche l'affichage de la notification.)</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.onerror = function(event) { ... } +<pre class="syntaxbox"><var>Notification</var>.onerror = function(event) { ... } <var>Notification</var>.onerror = (even) => { ... } </pre> diff --git a/files/fr/web/api/notification/onshow/index.html b/files/fr/web/api/notification/onshow/index.html index bdb0953b6f..a0a38caf41 100644 --- a/files/fr/web/api/notification/onshow/index.html +++ b/files/fr/web/api/notification/onshow/index.html @@ -13,11 +13,11 @@ translation_of: Web/API/Notification/onshow --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété <strong><code>onshow</code></strong> de l'interface {{domxref ("Notification")}} définit un écouteur d'événements pour recevoir des événements {{domxref ("Element/show_event", "show")}}. Ces événements se produisent lorsqu'une {{domxref ("Notification")}} est affiché.</span></p> +<p>La propriété <strong><code>onshow</code></strong> de l'interface {{domxref ("Notification")}} définit un écouteur d'événements pour recevoir des événements {{domxref ("Element/show_event", "show")}}. Ces événements se produisent lorsqu'une {{domxref ("Notification")}} est affiché.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.onshow = function() { ... } +<pre class="syntaxbox"><var>Notification</var>.onshow = function() { ... } <var>Notification</var>.onshow = () => { ... } </pre> diff --git a/files/fr/web/api/notification/permission/index.html b/files/fr/web/api/notification/permission/index.html index 55405894aa..603a7cdb3c 100644 --- a/files/fr/web/api/notification/permission/index.html +++ b/files/fr/web/api/notification/permission/index.html @@ -12,13 +12,13 @@ translation_of: Web/API/Notification/permission --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>permission</code></strong> de l'interface {{domxref ("Notification")}} indique l'autorisation actuelle accordée par l'utilisateur à l'origine actuelle pour afficher des notifications.</span></p> +<p>La propriété en lecture seule <strong><code>permission</code></strong> de l'interface {{domxref ("Notification")}} indique l'autorisation actuelle accordée par l'utilisateur à l'origine actuelle pour afficher des notifications.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate">Notification.permission</pre> +<pre class="syntaxbox">Notification.permission</pre> -<h3 id="Return_Value" name="Return_Value">Valeur</h3> +<h3 id="Return_Value">Valeur</h3> <p>Une {{domxref("DOMString")}} représentant l'autorisation actuelle. La valeur peut être:</p> @@ -32,7 +32,7 @@ translation_of: Web/API/Notification/permission <p>L'extrait suivant peut être utilisé si vous souhaitez d'abord vérifier si les notifications sont prises en charge, puis vérifier si l'autorisation a été accordée pour l'origine actuelle pour envoyer des notifications, puis demander l'autorisation si nécessaire, avant d'envoyer une notification.</p> -<pre class="brush: js notranslate">function notifyMe() { +<pre class="brush: js">function notifyMe() { // Let's check if the browser supports notifications if (!('Notification' in window)) { console.log('This browser does not support desktop notification') diff --git a/files/fr/web/api/notification/renotify/index.html b/files/fr/web/api/notification/renotify/index.html index a79c385380..ebd7bb4492 100644 --- a/files/fr/web/api/notification/renotify/index.html +++ b/files/fr/web/api/notification/renotify/index.html @@ -15,11 +15,11 @@ translation_of: Web/API/Notification/renotify --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>renotify</code></strong> de l'interface {{domxref ("Notification")}} spécifie si l'utilisateur doit être notifié après qu'une nouvelle notification remplace l'ancienne, comme spécifié comme définis à l'aide de l'option <code>renotify</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification"," Notification()")}}.</span></p> +<p>La propriété en lecture seule <strong><code>renotify</code></strong> de l'interface {{domxref ("Notification")}} spécifie si l'utilisateur doit être notifié après qu'une nouvelle notification remplace l'ancienne, comme spécifié comme définis à l'aide de l'option <code>renotify</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification"," Notification()")}}.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.renotify +<pre class="syntaxbox"><var>Notification</var>.renotify </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/requestpermission/index.html b/files/fr/web/api/notification/requestpermission/index.html index b5b1222762..e8d71e4a90 100644 --- a/files/fr/web/api/notification/requestpermission/index.html +++ b/files/fr/web/api/notification/requestpermission/index.html @@ -16,11 +16,11 @@ translation_of: Web/API/Notification/requestPermission <p><strong>Note:</strong> Cette fonctionnalité n'est pas disponible dans {{domxref("SharedWorker")}}</p> </div> -<div class="blockIndicator note"> -<p><strong>Note</strong>: Safari utilise toujours la syntaxe de function de rappel (callback ) pour obtenir l'autorisation. Lisez <a href="/fr/docs/Web/API/Notifications_API/Using_the_Notifications_API">Utilisation de l'API Notifications</a> pour un bon exemple de la fonctionnalité de détection et d'exécution du code le cas échéant.</p> +<div class="note"> +<p><strong>Note :</strong> Safari utilise toujours la syntaxe de function de rappel (callback ) pour obtenir l'autorisation. Lisez <a href="/fr/docs/Web/API/Notifications_API/Using_the_Notifications_API">Utilisation de l'API Notifications</a> pour un bon exemple de la fonctionnalité de détection et d'exécution du code le cas échéant.</p> </div> -<p><span class="seoSummary">La méthode <strong><code>requestPermission()</code></strong> de l'interface {{domxref ("Notification")}} demande l'autorisation à l'utilisateur pour l'origine actuelle d'afficher des notifications.</span></p> +<p>La méthode <strong><code>requestPermission()</code></strong> de l'interface {{domxref ("Notification")}} demande l'autorisation à l'utilisateur pour l'origine actuelle d'afficher des notifications.</p> <h2 id="Syntaxe">Syntaxe</h2> @@ -54,11 +54,11 @@ translation_of: Web/API/Notification/requestPermission <p>Supposons ce HTML de base:</p> -<pre class="brush: html notranslate"><button onclick="notifyMe()">Notifie moi !</button></pre> +<pre class="brush: html"><button onclick="notifyMe()">Notifie moi !</button></pre> <p>Il est possible d'envoyer une notification comme suit - nous présentons ici un ensemble de code assez détaillé et complet que vous pourriez utiliser si vous vouliez d'abord vérifier si les notifications sont prises en charge, puis vérifiez si l'autorisation a été accordée pour l'origine actuelle d'envoyer des notifications, puis demander l'autorisation si nécessaire, avant d'envoyer une notification.</p> -<pre class="brush: js notranslate">function notifyMe() { +<pre class="brush: js">function notifyMe() { // Vérifions si le navigateur prend en charge les notifications if (!('Notification' in window)) { alert('Ce navigateur ne prend pas en charge la notification de bureau') @@ -87,8 +87,8 @@ translation_of: Web/API/Notification/requestPermission <p>Nous ne montrons plus d'exemple en direct sur cette page, car Chrome et Firefox n'autorisent plus les demandes de notification des {{htmlelement ("iframe")}}s d'origine croisée, avec d'autres navigateurs à suivre. Pour voir un exemple en action, consultez notre <a href="https://github.com/mdn/to-do-notifications/tree/gh-pages">exemple de liste de tâches</a> (voir également l'<a href="https://mdn.github.io/to-do-notifications/">application en cours d'exécution</a>.)</p> -<div class="blockIndicator note"> -<p><strong>Note</strong>: dans l'exemple ci-dessus, nous générons des notifications en réponse à un geste de l'utilisateur (en cliquant sur un bouton). Il ne s'agit pas seulement d'une bonne pratique - vous ne devriez pas envoyer de spam aux utilisateurs avec des notifications qu'ils n'acceptent pas - mais les navigateurs suivants interdiront explicitement les notifications non déclenchées en réponse à un geste de l'utilisateur. Firefox le fait déjà depuis la version 72, par exemple.</p> +<div class="note"> +<p><strong>Note :</strong> Dans l'exemple ci-dessus, nous générons des notifications en réponse à un geste de l'utilisateur (en cliquant sur un bouton). Il ne s'agit pas seulement d'une bonne pratique - vous ne devriez pas envoyer de spam aux utilisateurs avec des notifications qu'ils n'acceptent pas - mais les navigateurs suivants interdiront explicitement les notifications non déclenchées en réponse à un geste de l'utilisateur. Firefox le fait déjà depuis la version 72, par exemple.</p> </div> <h2 id="Spécifications">Spécifications</h2> diff --git a/files/fr/web/api/notification/requireinteraction/index.html b/files/fr/web/api/notification/requireinteraction/index.html index d598a97269..80eacf5f84 100644 --- a/files/fr/web/api/notification/requireinteraction/index.html +++ b/files/fr/web/api/notification/requireinteraction/index.html @@ -16,11 +16,11 @@ translation_of: Web/API/Notification/requireInteraction <p>La propriété en lecture seule <strong><code>requireInteraction</code></strong> de l'interface {{domxref ("Notification")}} renvoie un {{jsxref ("Boolean")}} indiquant qu'une notification doit rester active jusqu'à ce que l'utilisateur clique dessus ou la rejette, plutôt que de se fermer automatiquement. Ceci peut être défini à l'aide de l'option <code>requireInteraction</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification()")}}.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="brush: js notranslate">Notification.requireInteraction</pre> +<pre class="brush: js">Notification.requireInteraction</pre> -<h3 id="Return_Value" name="Return_Value">Valeur</h3> +<h3 id="Return_Value">Valeur</h3> <p>Un {{jsxref("Boolean")}}.</p> diff --git a/files/fr/web/api/notification/silent/index.html b/files/fr/web/api/notification/silent/index.html index 5452c77398..d97cde7bd4 100644 --- a/files/fr/web/api/notification/silent/index.html +++ b/files/fr/web/api/notification/silent/index.html @@ -15,11 +15,11 @@ translation_of: Web/API/Notification/silent --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>silent</code></strong> de l'interface {{domxref ("Notification")}} spécifie si la notification doit être silencieuse, c'est-à-dire qu'aucun son ou vibration ne doit être émis, quels que soient les paramètres de l'appareil. Ceci est comme définis à l'aide de l'option <code>silent</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()")}}.</span></p> +<p>La propriété en lecture seule <strong><code>silent</code></strong> de l'interface {{domxref ("Notification")}} spécifie si la notification doit être silencieuse, c'est-à-dire qu'aucun son ou vibration ne doit être émis, quels que soient les paramètres de l'appareil. Ceci est comme définis à l'aide de l'option <code>silent</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()")}}.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.silent +<pre class="syntaxbox"><var>Notification</var>.silent </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/tag/index.html b/files/fr/web/api/notification/tag/index.html index 7794c70e61..7c5196d714 100644 --- a/files/fr/web/api/notification/tag/index.html +++ b/files/fr/web/api/notification/tag/index.html @@ -20,7 +20,7 @@ translation_of: Web/API/Notification/tag <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.tag +<pre class="syntaxbox"><var>Notification</var>.tag </pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/timestamp/index.html b/files/fr/web/api/notification/timestamp/index.html index ca54bf330c..8218d858d6 100644 --- a/files/fr/web/api/notification/timestamp/index.html +++ b/files/fr/web/api/notification/timestamp/index.html @@ -14,15 +14,15 @@ translation_of: Web/API/Notification/timestamp --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>timestamp</code></strong> de l'interface {{domxref ("Notification")}} renvoie un {{domxref ("DOMTimeStamp")}}, comme définis à l'aide de l'option <code>timestamp</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()")}}.</span></p> +<p>La propriété en lecture seule <strong><code>timestamp</code></strong> de l'interface {{domxref ("Notification")}} renvoie un {{domxref ("DOMTimeStamp")}}, comme définis à l'aide de l'option <code>timestamp</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()")}}.</p> <p>L'horodatage de la notification peut représenter le moment, en millisecondes depuis 00:00:00 UTC le 1er janvier 1970, de l'événement pour lequel la notification a été créée, ou il peut s'agir d'un horodatage arbitraire que vous souhaitez associer à la notification. Par exemple, un horodatage pour une réunion à venir pourrait être défini dans le futur, tandis qu'un horodatage pour un message manqué pourrait être défini dans le passé.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.timestamp</pre> +<pre class="syntaxbox"><var>Notification</var>.timestamp</pre> -<h3 id="Return_Value" name="Return_Value">Valeur</h3> +<h3 id="Return_Value">Valeur</h3> <p>Un {{domxref("DOMTimeStamp")}}.</p> diff --git a/files/fr/web/api/notification/title/index.html b/files/fr/web/api/notification/title/index.html index 40edbb0790..ba07a05630 100644 --- a/files/fr/web/api/notification/title/index.html +++ b/files/fr/web/api/notification/title/index.html @@ -14,11 +14,11 @@ translation_of: Web/API/Notification/title --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>title</code></strong> de l'interface {{domxref ("Notification")}} indique le titre de la notification, comme définis à l'aide de l'option <code>silent</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()") }} constructeur.</span></p> +<p>La propriété en lecture seule <strong><code>title</code></strong> de l'interface {{domxref ("Notification")}} indique le titre de la notification, comme définis à l'aide de l'option <code>silent</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification()") }} constructeur.</p> <h2 id="Syntaxe">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.title</pre> +<pre class="syntaxbox"><var>Notification</var>.title</pre> <h3 id="Valeur">Valeur</h3> diff --git a/files/fr/web/api/notification/vibrate/index.html b/files/fr/web/api/notification/vibrate/index.html index f9945d7c8a..d9bae90120 100644 --- a/files/fr/web/api/notification/vibrate/index.html +++ b/files/fr/web/api/notification/vibrate/index.html @@ -15,14 +15,14 @@ translation_of: Web/API/Notification/vibrate --- <p>{{APIRef("Web Notifications")}}{{AvailableInWorkers}}{{securecontext_header}}</p> -<p><span class="seoSummary">La propriété en lecture seule <strong><code>vibrate</code></strong> de l'interface {{domxref ("Notification")}} spécifie un modèle de vibration que le matériel de vibration de l'appareil doit émettre lorsque la notification se déclenche. Ceci est comme définis à l'aide de l'option <code>vibrate</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification ()")}}.</span></p> +<p>La propriété en lecture seule <strong><code>vibrate</code></strong> de l'interface {{domxref ("Notification")}} spécifie un modèle de vibration que le matériel de vibration de l'appareil doit émettre lorsque la notification se déclenche. Ceci est comme définis à l'aide de l'option <code>vibrate</code> lors de la création de la notification à l'aide du constructeur {{domxref ("Notification.Notification", "Notification ()")}}.</p> -<h2 id="Syntax" name="Syntax">Syntaxe</h2> +<h2 id="Syntax">Syntaxe</h2> -<pre class="syntaxbox notranslate"><var>Notification</var>.vibrate +<pre class="syntaxbox"><var>Notification</var>.vibrate </pre> -<h3 id="Return_Value" name="Return_Value">Valeur</h3> +<h3 id="Return_Value">Valeur</h3> <p>Un <a href="/fr/docs/Web/Guide/API/Vibration#Vibration_patterns">modèle de vibration</a>, tel que spécifié dans la spécification de l'{{domxref ("Vibration_API", "Api de Vibration")}}.</p> |