standardize all javascript blocks in English docs

This commit is contained in:
Zeke Sikelianos 2016-07-25 18:39:25 -07:00
parent dd9935a9d7
commit 06a354a2eb
37 changed files with 567 additions and 445 deletions

View file

@ -8,10 +8,10 @@ title is `Electron`:
```javascript
// In the renderer process.
const {desktopCapturer} = require('electron');
const {desktopCapturer} = require('electron')
desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => {
if (error) throw error;
if (error) throw error
for (let i = 0; i < sources.length; ++i) {
if (sources[i].name === 'Electron') {
navigator.webkitGetUserMedia({
@ -26,18 +26,18 @@ desktopCapturer.getSources({types: ['window', 'screen']}, (error, sources) => {
maxHeight: 720
}
}
}, handleStream, handleError);
return;
}, handleStream, handleError)
return
}
}
});
})
function handleStream(stream) {
document.querySelector('video').src = URL.createObjectURL(stream);
document.querySelector('video').src = URL.createObjectURL(stream)
}
function handleError(e) {
console.log(e);
console.log(e)
}
```