Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment out ellipsis in code blocks #18496

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions files/en-us/web/api/stylepropertymapreadonly/foreach/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ provided function once for each element of {{domxref('StylePropertyMapReadOnly')

```js
// Arrow function
forEach((currentValue) => { /* ... */ } )
forEach((currentValue, index) => { /* ... */ } )
forEach((currentValue, index, array) => { /* ... */ } )
forEach((currentValue) => { /* */ } )
forEach((currentValue, index) => { /* */ } )
forEach((currentValue, index, array) => { /* */ } )

// Callback function
forEach(callbackFn)
forEach(callbackFn, thisArg)

// Inline callback function
forEach(function(currentValue) { /* ... */ })
forEach(function(currentValue, index) { /* ... */ })
forEach(function(currentValue, index, array){ /* ... */ })
forEach(function(currentValue, index, array) { /* ... */ }, thisArg)
forEach(function(currentValue) { /* */ })
forEach(function(currentValue, index) { /* */ })
forEach(function(currentValue, index, array){ /* */ })
forEach(function(currentValue, index, array) { /* */ }, thisArg)
```

### Parameters
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/stylesheet/disabled/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ A boolean.
## Examples

```js
// If the stylesheet is disabled...
// If the stylesheet is disabled
if (stylesheet.disabled) {
// ... apply styles in-line.
// Apply styles in-line
}
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/stylesheetlist/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const allCSS = [...document.styleSheets]
.map(rule => rule.cssText)
.join('');
} catch (e) {
console.log('Access to stylesheet %s is denied. Ignoring...', styleSheet.href);
console.log('Access to stylesheet %s is denied. Ignoring', styleSheet.href);
}
})
.filter(Boolean)
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/subtlecrypto/derivebits/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async function deriveSharedSecret(privateKey, publicKey) {
sharedSecretValue.addEventListener("animationend", () => {
sharedSecretValue.classList.remove("fade-in");
});
sharedSecretValue.textContent = `${buffer}...[${sharedSecret.byteLength} bytes total]`;
sharedSecretValue.textContent = `${buffer}[${sharedSecret.byteLength} bytes total]`;
}

// Generate 2 ECDH key pairs: one for Alice and one for Bob
Expand Down Expand Up @@ -197,7 +197,7 @@ async function getDerivedBits() {
derivedBitsValue.addEventListener("animationend", () => {
derivedBitsValue.classList.remove("fade-in");
});
derivedBitsValue.textContent = `${buffer}...[${derivedBits.byteLength} bytes total]`;
derivedBitsValue.textContent = `${buffer}[${derivedBits.byteLength} bytes total]`;
}

const deriveBitsButton = document.querySelector(".pbkdf2 .derive-bits-button");
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/touch/radiusx/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This example illustrates using the {{domxref("Touch")}} interface's {{domxref("T
The following simple code snippet, registers a single handler for the {{domxref("Document/touchstart_event", "touchstart")}}, {{event("touchmove")}} and {{event("touchend")}} events. When the `src` element is touched, the element's width and height will be calculate based on the touch point's `radiusX` and `radiusY` values and the element will then be rotated using the touch point's `rotationAngle`.

```html
<div id="src"> ... </div>
<div id="src"> </div>
```

```js
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/visualviewport/resize_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ You can use the `resize` event in an [`addEventListener`](/en-US/docs/Web/API/Ev

```js
visualViewport.addEventListener('resize', function() {
/* ... */
// …
});
```

Or use the `onresize` event handler property:

```js
visualViewport.onresize = function() {
/* ... */
// …
};
```

Expand Down
4 changes: 2 additions & 2 deletions files/en-us/web/api/visualviewport/scroll_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ You can use the `scroll` event in an [`addEventListener`](/en-US/docs/Web/API/Ev

```js
visualViewport.addEventListener('scroll', function() {
/* ... */
// …
});
```

Or use the `onscroll` event handler property:

```js
visualViewport.onscroll = function() {
/* ... */
// …
};
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function drawVRScene() {
// WebVR: Request the next frame of the animation
vrSceneFrame = vrDisplay.requestAnimationFrame(drawVRScene);

// ...
//
}
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrdisplay/getframedata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function drawVRScene() {
// draw the view for each eye
}

// ...
//

// WebVR: Indicate that we are ready to present the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrdisplay/getpose/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if(navigator.getVRDisplays) {
// Return the current VRPose object for the display
const pose = vrDisplay.getPose();

// ...
//

}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function drawVRScene() {
// draw the view for each eye
}

// ...
//

// WebVR: Indicate that we are ready to present the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrdisplay/submitframe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function drawVRScene() {
// draw the view for each eye
}

// ...
//

// WebVR: Indicate that we are ready to present the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrframedata/timestamp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function drawVRScene() {
// and do something with it
framedata.timestamp

// ...
//

// WebVR: Indicates that we are ready to present the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/web/api/vrlayerinit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if(navigator.getVRDisplays) {
// Here it returns an array of VRLayerInit objects
layers = vrDisplay.getLayers();

// ...
//
});
});
}
Expand All @@ -64,8 +64,8 @@ if(navigator.getVRDisplays) {

```
{
leftBounds : [ ... ],
rightBounds: [ ... ],
leftBounds : [ /* … */ ],
rightBounds: [ /* … */ ],
source: canvasReference
}
```
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrpose/angularacceleration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function drawVRScene() {
const aaz = angAcc[2];

// render the scene
// ...
//

// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrpose/angularvelocity/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function drawVRScene() {
const avz = angVel[2];

// render the scene
// ...

// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrpose/linearacceleration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function drawVRScene() {
const laz = linAcc[2];

// render the scene
// ...
//

// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/vrpose/linearvelocity/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function drawVRScene() {
const lvz = linVel[2];

// render the scene
// ...
//

// WebVR: submit the rendered frame to the VR display
vrDisplay.submitFrame();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,15 +342,15 @@ const endGame = function() {

if (aliceHeight <= .333){
// Alice got smaller!
// ...
//

} else if (aliceHeight >= .666) {
// Alice got bigger!
// ...
//

} else {
// Alice didn't change significantly
// ...
//

}
}
Expand All @@ -368,11 +368,11 @@ CSS Animations and Transitions have their own event listeners, and these are als
Here we set the callbacks for the cake, bottle, and Alice to fire the `endGame` function:

```js
// When the cake or bottle runs out...
// When the cake or bottle runs out
nommingCake.onfinish = endGame;
drinking.onfinish = endGame;

// ...or Alice reaches the end of her animation
// Alice reaches the end of her animation
aliceChange.onfinish = endGame;
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ We can now use `setupSample()` like so:
setupSample()
.then((sample) => {
// sample is our buffered file
// ...
//
});
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ And the `click` event listener starts like so:
playButton.addEventListener('click', function() {
if (this.dataset.playing === 'false') {
srcNode = playSourceNode(audioCtx, sample);
// ...
}
// …
}, false);
```

Expand All @@ -115,8 +114,7 @@ filterButton.addEventListener('click', function() {
if (this.dataset.filteron === 'false') {
srcNode.disconnect(audioCtx.destination);
srcNode.connect(iirfilter).connect(audioCtx.destination);
// ...
}
// …
}, false);
```

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/web_authentication_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ navigator.credentials.create(createCredentialDefaultArgs)
console.log("NEW CREDENTIAL", cred);

// normally the credential IDs available for an account would come from a server
// but we can just copy them from above...
// but we can just copy them from above
const idList = [{
id: cred.rawId,
transports: ["usb", "nfc", "ble"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The HTML and CSS for the app is really trivial. We have a title, instructions pa
<h1>Speech color changer</h1>
<p>Tap/click then say a color to change the background color of the app.</p>
<div>
<p class="output"><em>...diagnostic messages</em></p>
<p class="output"><em>diagnostic messages</em></p>
</div>
```

Expand All @@ -68,7 +68,7 @@ const SpeechRecognitionEvent = window.SpeechRecognitionEvent || webkitSpeechReco
The next part of our code defines the grammar we want our app to recognize. The following variable is defined to hold our grammar:

```js
const colors = [ 'aqua' , 'azure' , 'beige', 'bisque', 'black', 'blue', 'brown', 'chocolate', 'coral', /* ... */ ];
const colors = [ 'aqua' , 'azure' , 'beige', 'bisque', 'black', 'blue', 'brown', 'chocolate', 'coral', /* */ ];
const grammar = '#JSGF V1.0; grammar colors; public <color> = ' + colors.join(' | ') + ' ;'
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ For slightly more controlled error handling and backwards compatibility, it is a

```js
if (window.Worker) {

// ...

// …
}
```

Expand Down Expand Up @@ -606,9 +604,7 @@ There is not an "official" way to embed the code of a worker within a web page,
<script type="text/javascript">
// This script WILL be parsed by JS engines because its MIME type is text/javascript.

// In the past...:
// blob builder existed
// ...but now we use Blob...:
// In the past blob builder existed, but now we use Blob
const blob = new Blob(Array.prototype.map.call(document.querySelectorAll('script[type=\'text\/js-worker\']'), function (oScript) { return oScript.textContent; }),{type: 'text/javascript'});

// Creating a new document.worker property containing all our "text/js-worker" scripts.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ None ({{jsxref("undefined")}}).
var query = gl.createQuery();
gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);

// ...
//
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,12 @@ None ({{jsxref("undefined")}}).
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
// …

// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...

// …
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ points to vertex array data.
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
// …

// calls to bindBuffer or vertexAttribPointer
// which will be "recorded" in the VAO
// ...

// …
```

## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ None ({{jsxref("undefined")}}).
```js
var query = gl.createQuery();

// ...
//

gl.deleteQuery(query);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ None ({{jsxref("undefined")}}).
```js
var sampler = gl.createSampler();

// ...
//

gl.deleteSampler(sampler);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ objects are not available in WebGL 1.
```js
var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);

// ...
//

gl.deleteSync(sync);
```
Expand Down