Fix Codacy warnings

Run standardjs across all js files, fix all other issues by hand
This commit is contained in:
Sean DuBois
2019-02-05 14:21:11 -08:00
parent 88b495c7f5
commit d9ba0533f5
8 changed files with 16 additions and 22 deletions

View File

@@ -18,41 +18,39 @@ window.createDataChannel = name => {
log(`${fullName}: has opened`)
dc.onmessage = e => log(`${fullName}: '${e.data}'`)
let ul = document.getElementById("ul-open");
let li = document.createElement('li');
let ul = document.getElementById('ul-open')
let li = document.createElement('li')
li.appendChild(document.createTextNode(`${fullName}: `))
let btnSend = document.createElement("BUTTON")
btnSend.appendChild(document.createTextNode("Send message"))
let btnSend = document.createElement('BUTTON')
btnSend.appendChild(document.createTextNode('Send message'))
btnSend.onclick = () => {
let message = document.getElementById('message').value
if (message === '') {
return alert('Message must not be empty')
}
dc.send(message)
}
li.appendChild(btnSend)
let btnClose = document.createElement("BUTTON")
btnClose.appendChild(document.createTextNode("Close"))
let btnClose = document.createElement('BUTTON')
btnClose.appendChild(document.createTextNode('Close'))
btnClose.onclick = () => {
dc.close()
ul.removeChild(li)
}
li.appendChild(btnClose)
dc.onclose = () => {
log(`${fullName}: closed.`)
ul.removeChild(li)
}
ul.appendChild(li);
ul.appendChild(li)
}
}
let sendChannel = window.createDataChannel('foo')
pc.oniceconnectionstatechange = e => log(`ICE state: ${pc.iceConnectionState}`)
pc.onicecandidate = event => {
if (event.candidate === null) {
@@ -63,7 +61,6 @@ pc.onicecandidate = event => {
pc.onnegotiationneeded = e =>
pc.createOffer().then(d => pc.setLocalDescription(d)).catch(log)
window.startSession = () => {
let sd = document.getElementById('remoteSessionDescription').value
if (sd === '') {