From 26ec2dcaea4a334ac3a8683d6ed5be83ea57fd5b Mon Sep 17 00:00:00 2001
From: Michael Wilson
Date: Wed, 27 Nov 2024 15:38:11 -0800
Subject: [PATCH 1/2] Move remaining examples to explainer, and modernize and
fix errors in examples
---
explainer.md | 35 +++++++++++++++++++++++++++++++----
index.html | 38 +++-----------------------------------
2 files changed, 34 insertions(+), 39 deletions(-)
diff --git a/explainer.md b/explainer.md
index 48abf97..11d5b58 100644
--- a/explainer.md
+++ b/explainer.md
@@ -62,6 +62,30 @@ function listInputsAndOutputs( midiAccess ) {
}
```
+### Adding inputs and outputs to a
- This type is used to represent all the currently available MIDI input
- ports. This enables:
+ This type is used to represent all the currently available [=MIDI input
+ ports=].
-
// to tell how many entries there are:
- let numberOfMIDIInputs = inputs.size;
-
- // add each of the ports to a <select> box
- inputs.forEach( function( port, key ) {
- let opt = document.createElement("option");
- opt.text = port.name;
- document.getElementById("inputportselector").add(opt);
- });
-
- // or you could express in ECMAScript 6 as:
- for (let input of inputs.values()) {
- let opt = document.createElement("option");
- opt.text = input.name;
- document.getElementById("inputportselector").add(opt);
- }
@@ -486,24 +470,8 @@
This type is used to represent all the currently available [=MIDI
- output ports=]. This enables:
+ output ports=].
-
// to tell how many entries there are:
- let numberOfMIDIOutputs = outputs.size;
-
- // add each of the ports to a <select> box
- outputs.forEach( function( port, key ) {
- let opt = document.createElement("option");
- opt.text = port.name;
- document.getElementById("outputportselector").add(opt);
- });
-
- // or you could express in ECMAScript 6 as:
- for (let output of outputs.values()) {
- let opt = document.createElement("option");
- opt.text = output.name;
- document.getElementById("outputportselector").add(opt);
- }
From 887aaa39808d997b3b5f8c1ae22390cff583f4ce Mon Sep 17 00:00:00 2001
From: Michael Wilson
Date: Wed, 27 Nov 2024 15:41:31 -0800
Subject: [PATCH 2/2] Update text
---
explainer.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/explainer.md b/explainer.md
index 11d5b58..8fba1de 100644
--- a/explainer.md
+++ b/explainer.md
@@ -62,7 +62,7 @@ function listInputsAndOutputs( midiAccess ) {
}
```
-### Adding inputs and outputs to a box
+### Adding inputs and outputs to select boxes
```js
// to tell how many entries there are: