mirror of
https://github.com/jech/galene.git
synced 2024-11-10 02:35:58 +01:00
Add missing semicolons.
This commit is contained in:
parent
89695c3713
commit
f595da8fa9
1 changed files with 23 additions and 23 deletions
|
@ -48,7 +48,7 @@ function Connection(id, pc) {
|
||||||
|
|
||||||
Connection.prototype.setInterval = function(f, t) {
|
Connection.prototype.setInterval = function(f, t) {
|
||||||
this.timers.push(setInterval(f, t));
|
this.timers.push(setInterval(f, t));
|
||||||
}
|
};
|
||||||
|
|
||||||
Connection.prototype.close = function(sendit) {
|
Connection.prototype.close = function(sendit) {
|
||||||
while(this.timers.length > 0)
|
while(this.timers.length > 0)
|
||||||
|
@ -68,7 +68,7 @@ Connection.prototype.close = function(sendit) {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
function setUserPass(username, password) {
|
function setUserPass(username, password) {
|
||||||
window.sessionStorage.setItem(
|
window.sessionStorage.setItem(
|
||||||
|
@ -124,27 +124,27 @@ function setConnected(connected) {
|
||||||
document.getElementById('presenterbox').onchange = function(e) {
|
document.getElementById('presenterbox').onchange = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setLocalMedia(this.checked);
|
setLocalMedia(this.checked);
|
||||||
}
|
};
|
||||||
|
|
||||||
document.getElementById('audioselect').onchange = function(e) {
|
document.getElementById('audioselect').onchange = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setLocalMedia(document.getElementById('presenterbox').checked);
|
setLocalMedia(document.getElementById('presenterbox').checked);
|
||||||
}
|
};
|
||||||
|
|
||||||
document.getElementById('videoselect').onchange = function(e) {
|
document.getElementById('videoselect').onchange = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setLocalMedia(document.getElementById('presenterbox').checked);
|
setLocalMedia(document.getElementById('presenterbox').checked);
|
||||||
}
|
};
|
||||||
|
|
||||||
document.getElementById('sharebox').onchange = function(e) {
|
document.getElementById('sharebox').onchange = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setShareMedia(this.checked);
|
setShareMedia(this.checked);
|
||||||
}
|
};
|
||||||
|
|
||||||
document.getElementById('requestbox').onchange = function(e) {
|
document.getElementById('requestbox').onchange = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
sendRequest(this.checked);
|
sendRequest(this.checked);
|
||||||
}
|
};
|
||||||
|
|
||||||
async function updateStats(conn, sender) {
|
async function updateStats(conn, sender) {
|
||||||
let stats;
|
let stats;
|
||||||
|
@ -165,7 +165,7 @@ async function updateStats(conn, sender) {
|
||||||
delete(stats.rate);
|
delete(stats.rate);
|
||||||
delete(stats.timestamp);
|
delete(stats.timestamp);
|
||||||
delete(stats.bytesSent);
|
delete(stats.bytesSent);
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let r of report.values()) {
|
for(let r of report.values()) {
|
||||||
|
@ -283,7 +283,7 @@ async function setLocalMedia(setup) {
|
||||||
if(localMediaId) {
|
if(localMediaId) {
|
||||||
up[localMediaId].close(true);
|
up[localMediaId].close(true);
|
||||||
delete(up[localMediaId]);
|
delete(up[localMediaId]);
|
||||||
delMedia(localMediaId)
|
delMedia(localMediaId);
|
||||||
localMediaId = null;
|
localMediaId = null;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -358,7 +358,7 @@ async function setShareMedia(setup) {
|
||||||
t.onended = e => {
|
t.onended = e => {
|
||||||
document.getElementById('sharebox').checked = false;
|
document.getElementById('sharebox').checked = false;
|
||||||
setShareMedia(false);
|
setShareMedia(false);
|
||||||
}
|
};
|
||||||
c.setInterval(() => {
|
c.setInterval(() => {
|
||||||
updateStats(c, sender);
|
updateStats(c, sender);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
@ -408,7 +408,7 @@ function setMedia(id) {
|
||||||
label = document.createElement('div');
|
label = document.createElement('div');
|
||||||
label.id = 'label-' + id;
|
label.id = 'label-' + id;
|
||||||
label.classList.add('label');
|
label.classList.add('label');
|
||||||
div.appendChild(label)
|
div.appendChild(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
media.srcObject = c.stream;
|
media.srcObject = c.stream;
|
||||||
|
@ -580,19 +580,19 @@ async function gotOffer(id, offer) {
|
||||||
id: id,
|
id: id,
|
||||||
candidate: e.candidate,
|
candidate: e.candidate,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
c.pc.ontrack = function(e) {
|
c.pc.ontrack = function(e) {
|
||||||
c.stream = e.streams[0];
|
c.stream = e.streams[0];
|
||||||
setMedia(id);
|
setMedia(id);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
await c.pc.setRemoteDescription(offer);
|
await c.pc.setRemoteDescription(offer);
|
||||||
await addIceCandidates(c);
|
await addIceCandidates(c);
|
||||||
let answer = await c.pc.createAnswer();
|
let answer = await c.pc.createAnswer();
|
||||||
if(!answer)
|
if(!answer)
|
||||||
throw new Error("Didn't create answer")
|
throw new Error("Didn't create answer");
|
||||||
await c.pc.setLocalDescription(answer);
|
await c.pc.setLocalDescription(answer);
|
||||||
send({
|
send({
|
||||||
type: 'answer',
|
type: 'answer',
|
||||||
|
@ -654,11 +654,11 @@ async function gotICE(id, candidate) {
|
||||||
if(conn.pc.remoteDescription)
|
if(conn.pc.remoteDescription)
|
||||||
await conn.pc.addIceCandidate(candidate).catch(console.warn);
|
await conn.pc.addIceCandidate(candidate).catch(console.warn);
|
||||||
else
|
else
|
||||||
conn.iceCandidates.push(candidate)
|
conn.iceCandidates.push(candidate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addIceCandidates(conn) {
|
async function addIceCandidates(conn) {
|
||||||
let promises = []
|
let promises = [];
|
||||||
conn.iceCandidates.forEach(c => {
|
conn.iceCandidates.forEach(c => {
|
||||||
promises.push(conn.pc.addIceCandidate(c).catch(console.warn));
|
promises.push(conn.pc.addIceCandidate(c).catch(console.warn));
|
||||||
});
|
});
|
||||||
|
@ -669,7 +669,7 @@ async function addIceCandidates(conn) {
|
||||||
function send(m) {
|
function send(m) {
|
||||||
if(!m)
|
if(!m)
|
||||||
throw(new Error('Sending null message'));
|
throw(new Error('Sending null message'));
|
||||||
return socket.send(JSON.stringify(m))
|
return socket.send(JSON.stringify(m));
|
||||||
}
|
}
|
||||||
|
|
||||||
let users = {};
|
let users = {};
|
||||||
|
@ -933,7 +933,7 @@ document.getElementById('input').onkeypress = function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleInput();
|
handleInput();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
function chatResizer(e) {
|
function chatResizer(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
@ -978,7 +978,7 @@ async function newUpStream() {
|
||||||
iceServers: iceServers,
|
iceServers: iceServers,
|
||||||
});
|
});
|
||||||
if(!pc)
|
if(!pc)
|
||||||
throw new Error("Couldn't create peer connection")
|
throw new Error("Couldn't create peer connection");
|
||||||
up[id] = new Connection(id, pc);
|
up[id] = new Connection(id, pc);
|
||||||
|
|
||||||
pc.onnegotiationneeded = e => negotiate(id);
|
pc.onnegotiationneeded = e => negotiate(id);
|
||||||
|
@ -990,7 +990,7 @@ async function newUpStream() {
|
||||||
id: id,
|
id: id,
|
||||||
candidate: e.candidate,
|
candidate: e.candidate,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
pc.ontrack = console.error;
|
pc.ontrack = console.error;
|
||||||
|
|
||||||
|
@ -1069,18 +1069,18 @@ document.getElementById('userform').onsubmit = async function(e) {
|
||||||
let password = document.getElementById('password').value;
|
let password = document.getElementById('password').value;
|
||||||
setUserPass(username, password);
|
setUserPass(username, password);
|
||||||
await doConnect();
|
await doConnect();
|
||||||
}
|
};
|
||||||
|
|
||||||
document.getElementById('disconnectbutton').onclick = function(e) {
|
document.getElementById('disconnectbutton').onclick = function(e) {
|
||||||
socket.close();
|
socket.close();
|
||||||
}
|
};
|
||||||
|
|
||||||
function start() {
|
function start() {
|
||||||
group = decodeURIComponent(location.pathname.replace(/^\/[a-z]*\//, ''));
|
group = decodeURIComponent(location.pathname.replace(/^\/[a-z]*\//, ''));
|
||||||
let title = group.charAt(0).toUpperCase() + group.slice(1);
|
let title = group.charAt(0).toUpperCase() + group.slice(1);
|
||||||
if(group !== '') {
|
if(group !== '') {
|
||||||
document.title = title;
|
document.title = title;
|
||||||
document.getElementById('title').textContent = title
|
document.getElementById('title').textContent = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
myid = randomid();
|
myid = randomid();
|
||||||
|
|
Loading…
Reference in a new issue