|
|
@ -1015,13 +1015,6 @@ function initVroom(room) { |
|
|
|
chatIndex++; |
|
|
|
chatIndex++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Wipe the history
|
|
|
|
|
|
|
|
function wipeChatHistory(){ |
|
|
|
|
|
|
|
$('#chatHistory').html(''); |
|
|
|
|
|
|
|
chatHistory = {}; |
|
|
|
|
|
|
|
chatIndex = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update the displayName of the peer
|
|
|
|
// Update the displayName of the peer
|
|
|
|
// and its screen if any
|
|
|
|
// and its screen if any
|
|
|
|
function updateDisplayName(id){ |
|
|
|
function updateDisplayName(id){ |
|
|
@ -1170,35 +1163,6 @@ function initVroom(room) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Wipe data
|
|
|
|
|
|
|
|
function wipeRoomData(){ |
|
|
|
|
|
|
|
if (etherpad.enabled){ |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
req: JSON.stringify({ |
|
|
|
|
|
|
|
action: 'wipe_data', |
|
|
|
|
|
|
|
param: { |
|
|
|
|
|
|
|
room: roomName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async: false, |
|
|
|
|
|
|
|
error: function(data){ |
|
|
|
|
|
|
|
showApiError(data); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
success: function(data){ |
|
|
|
|
|
|
|
if ($('#etherpadContainer').html() != ''){ |
|
|
|
|
|
|
|
loadEtherpadIframe(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
webrtc.sendToAll('wipe_data', {}); |
|
|
|
|
|
|
|
wipeChatHistory(); |
|
|
|
|
|
|
|
$('#wipeModal').modal('hide'); |
|
|
|
|
|
|
|
$.notify(locale.DATA_WIPED, 'info'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// An owner is muting/unmuting someone
|
|
|
|
// An owner is muting/unmuting someone
|
|
|
|
webrtc.on('owner_toggle_mute', function(data){ |
|
|
|
webrtc.on('owner_toggle_mute', function(data){ |
|
|
|
// Ignore this if the remote peer isn't the owner of the room
|
|
|
|
// Ignore this if the remote peer isn't the owner of the room
|
|
|
@ -1469,37 +1433,6 @@ function initVroom(room) { |
|
|
|
getPeerRole(data.id); |
|
|
|
getPeerRole(data.id); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// An owner has wiped data
|
|
|
|
|
|
|
|
webrtc.on('wipe_data', function(data){ |
|
|
|
|
|
|
|
if (data.roomType == 'screen' || peers[data.id].role != 'owner'){ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
wipeChatHistory(); |
|
|
|
|
|
|
|
if (etherpad.enabled){ |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
req: JSON.stringify({ |
|
|
|
|
|
|
|
action: 'get_pad_session', |
|
|
|
|
|
|
|
param: { |
|
|
|
|
|
|
|
room: roomName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
error: function(data){ |
|
|
|
|
|
|
|
showApiError(data); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
success: function(data){ |
|
|
|
|
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'success'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
loadEtherpadIframe(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var who = (peers[data.id].hasName) ? peers[data.id].displayName : locale.A_ROOM_ADMIN; |
|
|
|
|
|
|
|
$.notify(sprintf(locale.ROOM_DATA_WIPED_BY_s, stringEscape(who)), 'info'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Handle the readyToCall event: join the room
|
|
|
|
// Handle the readyToCall event: join the room
|
|
|
|
// Or prompt for a name first
|
|
|
|
// Or prompt for a name first
|
|
|
|
webrtc.once('readyToCall', function () { |
|
|
|
webrtc.once('readyToCall', function () { |
|
|
@ -1987,51 +1920,6 @@ function initVroom(room) { |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Remove the active class on the help button
|
|
|
|
|
|
|
|
$('#helpModal').on('hide.bs.modal',function(){ |
|
|
|
|
|
|
|
$('#helpButton').removeClass('active'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Display the wipe data modal
|
|
|
|
|
|
|
|
$('#wipeDataButton').click(function(){ |
|
|
|
|
|
|
|
$('#wipeModal').modal('show'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// Really wipe data
|
|
|
|
|
|
|
|
$('#confirmWipeButton').click(function(){ |
|
|
|
|
|
|
|
wipeRoomData(); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Display terminate room modal
|
|
|
|
|
|
|
|
$('#terminateRoomButton').click(function(){ |
|
|
|
|
|
|
|
$('#terminateModal').modal('show'); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
// Really terminate the room now
|
|
|
|
|
|
|
|
$('#confirmTerminateButton').click(function(){ |
|
|
|
|
|
|
|
// Ask all the peers to quit now
|
|
|
|
|
|
|
|
webrtc.sendToAll('terminate_room', {}); |
|
|
|
|
|
|
|
wipeRoomData(); |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
req: JSON.stringify({ |
|
|
|
|
|
|
|
action: 'delete_room', |
|
|
|
|
|
|
|
param: { |
|
|
|
|
|
|
|
room: roomName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async: false, |
|
|
|
|
|
|
|
error: function(data){ |
|
|
|
|
|
|
|
showApiError(data); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
success: function(data){ |
|
|
|
|
|
|
|
if (data.msg && data.msg != ''){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'info'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
hangupCall; |
|
|
|
|
|
|
|
window.location.assign(rootUrl + 'goodbye/' + roomName); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (etherpad.enabled){ |
|
|
|
if (etherpad.enabled){ |
|
|
|
$('.btn-etherpad').click(function(){ |
|
|
|
$('.btn-etherpad').click(function(){ |
|
|
|