From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- .../api/htmldialogelement/close_event/index.html | 110 --------------- .../web/api/htmldialogelement/close_event/index.md | 110 +++++++++++++++ files/fr/web/api/htmldialogelement/index.html | 148 --------------------- files/fr/web/api/htmldialogelement/index.md | 148 +++++++++++++++++++++ 4 files changed, 258 insertions(+), 258 deletions(-) delete mode 100644 files/fr/web/api/htmldialogelement/close_event/index.html create mode 100644 files/fr/web/api/htmldialogelement/close_event/index.md delete mode 100644 files/fr/web/api/htmldialogelement/index.html create mode 100644 files/fr/web/api/htmldialogelement/index.md (limited to 'files/fr/web/api/htmldialogelement') diff --git a/files/fr/web/api/htmldialogelement/close_event/index.html b/files/fr/web/api/htmldialogelement/close_event/index.html deleted file mode 100644 index e2a81f2a09..0000000000 --- a/files/fr/web/api/htmldialogelement/close_event/index.html +++ /dev/null @@ -1,110 +0,0 @@ ---- -title: 'HTMLDialogElement: close event' -slug: Web/API/HTMLDialogElement/close_event -tags: - - API - - DOM HTML - - Evènement - - HTMLDialogElement - - Reference - - close - - fermeture -translation_of: Web/API/HTMLDialogElement/close_event ---- -

{{ APIRef() }}

- -

L'événement close est déclenché sur un objet {{domxref ("HTMLDialogElement")}} lorsque la boîte de dialogue qu'il représente a été fermée.

- - - - - - - - - - - - - - - - - - - - -
BouillonnantNon
AnnulableNon
Interface{{domxref("Event")}}
Propriété du gestionnaire d'événements{{domxref ("GlobalEventHandlers/onclose", "onclose")}}
- -

Exemples

- -

Exemple concret

- -

HTML

- -
<dialog class="example-dialog">
-  <button class="close" type="reset">Close</button>
-</dialog>
-
-<button class="open-dialog">Open dialog</button>
-
-<div class="result"></div>
- - - -

JS

- -
const result = document.querySelector('.result')
-
-const dialog = document.querySelector('.example-dialog')
-dialog.addEventListener('close', (event) => {
-  result.textContent = 'dialog was closed'
-})
-
-const openDialog = document.querySelector('.open-dialog')
-openDialog.addEventListener('click', () => {
-  if (typeof dialog.showModal === 'function') {
-    dialog.showModal()
-    result.textContent = ''
-  } else {
-    result.textContent = 'The dialog API is not supported by this browser'
-  }
-})
-
-const closeButton = document.querySelector('.close')
-closeButton.addEventListener('click', () => {
-  dialog.close()
-})
-
- -

Résultat

- -

{{ EmbedLiveSample('Exemple_concret', '100%', '100px') }}

- -

Spécifications

- - - - - - - - - - - - -
SpécificationÉtat
{{ SpecName('HTML WHATWG', 'indices.html#event-close', 'close') }}{{Spec2('HTML WHATWG')}}
- -

Compatibilité des navigateurs

- -

{{Compat("api.HTMLDialogElement.close_event")}}

- -

Voir également

- - diff --git a/files/fr/web/api/htmldialogelement/close_event/index.md b/files/fr/web/api/htmldialogelement/close_event/index.md new file mode 100644 index 0000000000..e2a81f2a09 --- /dev/null +++ b/files/fr/web/api/htmldialogelement/close_event/index.md @@ -0,0 +1,110 @@ +--- +title: 'HTMLDialogElement: close event' +slug: Web/API/HTMLDialogElement/close_event +tags: + - API + - DOM HTML + - Evènement + - HTMLDialogElement + - Reference + - close + - fermeture +translation_of: Web/API/HTMLDialogElement/close_event +--- +

{{ APIRef() }}

+ +

L'événement close est déclenché sur un objet {{domxref ("HTMLDialogElement")}} lorsque la boîte de dialogue qu'il représente a été fermée.

+ + + + + + + + + + + + + + + + + + + + +
BouillonnantNon
AnnulableNon
Interface{{domxref("Event")}}
Propriété du gestionnaire d'événements{{domxref ("GlobalEventHandlers/onclose", "onclose")}}
+ +

Exemples

+ +

Exemple concret

+ +

HTML

+ +
<dialog class="example-dialog">
+  <button class="close" type="reset">Close</button>
+</dialog>
+
+<button class="open-dialog">Open dialog</button>
+
+<div class="result"></div>
+ + + +

JS

+ +
const result = document.querySelector('.result')
+
+const dialog = document.querySelector('.example-dialog')
+dialog.addEventListener('close', (event) => {
+  result.textContent = 'dialog was closed'
+})
+
+const openDialog = document.querySelector('.open-dialog')
+openDialog.addEventListener('click', () => {
+  if (typeof dialog.showModal === 'function') {
+    dialog.showModal()
+    result.textContent = ''
+  } else {
+    result.textContent = 'The dialog API is not supported by this browser'
+  }
+})
+
+const closeButton = document.querySelector('.close')
+closeButton.addEventListener('click', () => {
+  dialog.close()
+})
+
+ +

Résultat

+ +

{{ EmbedLiveSample('Exemple_concret', '100%', '100px') }}

+ +

Spécifications

+ + + + + + + + + + + + +
SpécificationÉtat
{{ SpecName('HTML WHATWG', 'indices.html#event-close', 'close') }}{{Spec2('HTML WHATWG')}}
+ +

Compatibilité des navigateurs

+ +

{{Compat("api.HTMLDialogElement.close_event")}}

+ +

Voir également

+ + diff --git a/files/fr/web/api/htmldialogelement/index.html b/files/fr/web/api/htmldialogelement/index.html deleted file mode 100644 index 15d1449571..0000000000 --- a/files/fr/web/api/htmldialogelement/index.html +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: HTMLDialogElement -slug: Web/API/HTMLDialogElement -tags: - - API - - Experimental - - HTML DOM - - HTMLDialogElement - - Interface - - NeedsTranslation - - Reference - - TopicStub -translation_of: Web/API/HTMLDialogElement ---- -
{{APIRef("HTML DOM")}}{{SeeCompatTable}}
- -

The HTMLDialogElement interface provides methods to manipulate {{HTMLElement("dialog")}} elements. It inherits properties and methods from the {{domxref("HTMLElement")}} interface.

- -

{{InheritanceDiagram(600, 120)}}

- -

Properties

- -

Inherits properties from its parent, {{domxref("HTMLElement")}}.

- -
-
{{domxref("HTMLDialogElement.open")}}
-
A {{domxref("Boolean")}} reflecting the {{htmlattrxref("open", "dialog")}} HTML attribute, indicating whether the dialog is available for interaction.
-
{{domxref("HTMLDialogElement.returnValue")}}
-
A {{domxref("DOMString")}} that sets or returns the return value for the dialog.
-
- -

Methods

- -

Inherits methods from its parent, {{domxref("HTMLElement")}}.

- -
-
{{domxref("HTMLDialogElement.close()")}}
-
Closes the dialog. An optional {{domxref("DOMString")}} may be passed as an argument, updating the returnValue of the the dialog.
-
{{domxref("HTMLDialogElement.show()")}}
-
Displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog.
-
{{domxref("HTMLDialogElement.showModal()")}}
-
Displays the dialog as a modal, over the top of any other dialogs that might be present. Interaction outside the dialog is blocked.
-
- -

Events

- -
-
{{domxref("HTMLDialogElement/close_event", "close")}}
-
Fired when the dialog is closed.
- Also available via the {{domxref("GlobalEventHandlers/onclose", "onclose")}} property.
-
- -

Examples

- -

The following example shows a simple button that, when clicked, opens a {{htmlelement("dialog")}} containing a form via the {{domxref("HTMLDialogElement.showModal()")}} function. From there you can click the Cancel button to close the dialog (via the {{domxref("HTMLDialogElement.close()")}} function), or submit the form via the submit button.

- -
  <!-- Simple pop-up dialog box, containing a form -->
-  <dialog id="favDialog">
-    <form method="dialog">
-      <section>
-        <p><label for="favAnimal">Favorite animal:</label>
-        <select id="favAnimal" name="favAnimal">
-          <option></option>
-          <option>Brine shrimp</option>
-          <option>Red panda</option>
-          <option>Spider monkey</option>
-        </select></p>
-      </section>
-      <menu>
-        <button id="cancel" type="reset">Cancel</button>
-        <button type="submit">Confirm</button>
-      </menu>
-    </form>
-  </dialog>
-
-  <menu>
-    <button id="updateDetails">Update details</button>
-  </menu>
-
-  <script>
-    (function() {
-      var updateButton = document.getElementById('updateDetails');
-      var cancelButton = document.getElementById('cancel');
-      var dialog = document.getElementById('favDialog');
-      dialog.returnValue = 'favAnimal';
-
-      function openCheck(dialog) {
-        if(dialog.open) {
-          console.log('Dialog open');
-        } else {
-          console.log('Dialog closed');
-        }
-      }
-
-      // Update button opens a modal dialog
-      updateButton.addEventListener('click', function() {
-        dialog.showModal();
-        openCheck(dialog);
-      });
-
-      // Form cancel button closes the dialog box
-      cancelButton.addEventListener('click', function() {
-        dialog.close('animalNotChosen');
-        openCheck(dialog);
-      });
-
-    })();
-  </script>
- -
-

Note : You can find this example on GitHub as htmldialogelement-basic (see it live also).

-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#htmldialogelement', 'HTMLDialogElement')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.2', 'interactive-elements.html#the-dialog-element', '<dialog>')}}{{Spec2('HTML5.2')}}Initial definition
- -

Browser compatibility

- - - -

{{Compat("api.HTMLDialogElement")}}

- -

See also

- - diff --git a/files/fr/web/api/htmldialogelement/index.md b/files/fr/web/api/htmldialogelement/index.md new file mode 100644 index 0000000000..15d1449571 --- /dev/null +++ b/files/fr/web/api/htmldialogelement/index.md @@ -0,0 +1,148 @@ +--- +title: HTMLDialogElement +slug: Web/API/HTMLDialogElement +tags: + - API + - Experimental + - HTML DOM + - HTMLDialogElement + - Interface + - NeedsTranslation + - Reference + - TopicStub +translation_of: Web/API/HTMLDialogElement +--- +
{{APIRef("HTML DOM")}}{{SeeCompatTable}}
+ +

The HTMLDialogElement interface provides methods to manipulate {{HTMLElement("dialog")}} elements. It inherits properties and methods from the {{domxref("HTMLElement")}} interface.

+ +

{{InheritanceDiagram(600, 120)}}

+ +

Properties

+ +

Inherits properties from its parent, {{domxref("HTMLElement")}}.

+ +
+
{{domxref("HTMLDialogElement.open")}}
+
A {{domxref("Boolean")}} reflecting the {{htmlattrxref("open", "dialog")}} HTML attribute, indicating whether the dialog is available for interaction.
+
{{domxref("HTMLDialogElement.returnValue")}}
+
A {{domxref("DOMString")}} that sets or returns the return value for the dialog.
+
+ +

Methods

+ +

Inherits methods from its parent, {{domxref("HTMLElement")}}.

+ +
+
{{domxref("HTMLDialogElement.close()")}}
+
Closes the dialog. An optional {{domxref("DOMString")}} may be passed as an argument, updating the returnValue of the the dialog.
+
{{domxref("HTMLDialogElement.show()")}}
+
Displays the dialog modelessly, i.e. still allowing interaction with content outside of the dialog.
+
{{domxref("HTMLDialogElement.showModal()")}}
+
Displays the dialog as a modal, over the top of any other dialogs that might be present. Interaction outside the dialog is blocked.
+
+ +

Events

+ +
+
{{domxref("HTMLDialogElement/close_event", "close")}}
+
Fired when the dialog is closed.
+ Also available via the {{domxref("GlobalEventHandlers/onclose", "onclose")}} property.
+
+ +

Examples

+ +

The following example shows a simple button that, when clicked, opens a {{htmlelement("dialog")}} containing a form via the {{domxref("HTMLDialogElement.showModal()")}} function. From there you can click the Cancel button to close the dialog (via the {{domxref("HTMLDialogElement.close()")}} function), or submit the form via the submit button.

+ +
  <!-- Simple pop-up dialog box, containing a form -->
+  <dialog id="favDialog">
+    <form method="dialog">
+      <section>
+        <p><label for="favAnimal">Favorite animal:</label>
+        <select id="favAnimal" name="favAnimal">
+          <option></option>
+          <option>Brine shrimp</option>
+          <option>Red panda</option>
+          <option>Spider monkey</option>
+        </select></p>
+      </section>
+      <menu>
+        <button id="cancel" type="reset">Cancel</button>
+        <button type="submit">Confirm</button>
+      </menu>
+    </form>
+  </dialog>
+
+  <menu>
+    <button id="updateDetails">Update details</button>
+  </menu>
+
+  <script>
+    (function() {
+      var updateButton = document.getElementById('updateDetails');
+      var cancelButton = document.getElementById('cancel');
+      var dialog = document.getElementById('favDialog');
+      dialog.returnValue = 'favAnimal';
+
+      function openCheck(dialog) {
+        if(dialog.open) {
+          console.log('Dialog open');
+        } else {
+          console.log('Dialog closed');
+        }
+      }
+
+      // Update button opens a modal dialog
+      updateButton.addEventListener('click', function() {
+        dialog.showModal();
+        openCheck(dialog);
+      });
+
+      // Form cancel button closes the dialog box
+      cancelButton.addEventListener('click', function() {
+        dialog.close('animalNotChosen');
+        openCheck(dialog);
+      });
+
+    })();
+  </script>
+ +
+

Note : You can find this example on GitHub as htmldialogelement-basic (see it live also).

+
+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', '#htmldialogelement', 'HTMLDialogElement')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.2', 'interactive-elements.html#the-dialog-element', '<dialog>')}}{{Spec2('HTML5.2')}}Initial definition
+ +

Browser compatibility

+ + + +

{{Compat("api.HTMLDialogElement")}}

+ +

See also

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