|
|
@ -41,6 +41,17 @@ $.ajaxSetup({ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Parse and display an error when an API call failed
|
|
|
|
|
|
|
|
function showApiError(data){ |
|
|
|
|
|
|
|
data = data.responseJSON; |
|
|
|
|
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Handle lang switch
|
|
|
|
// Handle lang switch
|
|
|
|
$('#switch_lang').change(function(){ |
|
|
|
$('#switch_lang').change(function(){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
@ -53,13 +64,7 @@ $('#switch_lang').change(function(){ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
window.location.reload(); |
|
|
|
window.location.reload(); |
|
|
@ -308,13 +313,7 @@ $('#configureRoomForm').submit(function(e){ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
$('#ownerPass,#ownerPassConfirm,#joinPass,#joinPassConfirm').val(''); |
|
|
|
$('#ownerPass,#ownerPassConfirm,#joinPass,#joinPassConfirm').val(''); |
|
|
@ -342,9 +341,6 @@ function initIndex(){ |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
type: 'POST', |
|
|
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'create_room', |
|
|
|
action: 'create_room', |
|
|
@ -478,13 +474,7 @@ function initAdmin(){ |
|
|
|
})
|
|
|
|
})
|
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
roomList = data.rooms; |
|
|
|
roomList = data.rooms; |
|
|
@ -507,7 +497,7 @@ function initAdmin(){ |
|
|
|
}, |
|
|
|
}, |
|
|
|
async: false, |
|
|
|
async: false, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
showApiError(data); |
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
// Reset the list of email displayed, so first remove evry input field but the last one
|
|
|
|
// Reset the list of email displayed, so first remove evry input field but the last one
|
|
|
@ -563,13 +553,7 @@ function initAdmin(){ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
$.notify(data.msg, 'success'); |
|
|
|
$.notify(data.msg, 'success'); |
|
|
@ -652,13 +636,7 @@ function initVroom(room) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async: false, |
|
|
|
async: false, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
// Notify others if our role changed
|
|
|
|
// Notify others if our role changed
|
|
|
@ -719,13 +697,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
if (peers[id]){ |
|
|
|
if (peers[id]){ |
|
|
@ -1081,13 +1053,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
webrtc.sendToAll('owner_promoted', {peer: id}); |
|
|
|
webrtc.sendToAll('owner_promoted', {peer: id}); |
|
|
@ -1185,13 +1151,7 @@ function initVroom(room) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async: false, |
|
|
|
async: false, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
if ($('#etherpadContainer').html() != ''){ |
|
|
|
if ($('#etherpadContainer').html() != ''){ |
|
|
@ -1499,13 +1459,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
if (data.msg){ |
|
|
|
if (data.msg){ |
|
|
@ -1560,13 +1514,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
if (data.msg){ |
|
|
|
if (data.msg){ |
|
|
@ -1672,13 +1620,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
$('#recipient').val(''); |
|
|
|
$('#recipient').val(''); |
|
|
@ -1868,13 +1810,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
$('#authPass').val(''); |
|
|
|
$('#authPass').val(''); |
|
|
@ -2050,13 +1986,7 @@ function initVroom(room) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async: false, |
|
|
|
async: false, |
|
|
|
error: function(data){ |
|
|
|
error: function(data){ |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data){ |
|
|
|
success: function(data){ |
|
|
|
if (data.msg && data.msg != ''){ |
|
|
|
if (data.msg && data.msg != ''){ |
|
|
@ -2071,7 +2001,7 @@ function initVroom(room) { |
|
|
|
if (etherpad.enabled){ |
|
|
|
if (etherpad.enabled){ |
|
|
|
$('#etherpadButton').change(function(){ |
|
|
|
$('#etherpadButton').change(function(){ |
|
|
|
var action = ($(this).is(':checked')) ? 'show':'hide'; |
|
|
|
var action = ($(this).is(':checked')) ? 'show':'hide'; |
|
|
|
if (action == 'show'){ |
|
|
|
if (action === 'show'){ |
|
|
|
// If not already loaded, load etherpad in the iFrame
|
|
|
|
// If not already loaded, load etherpad in the iFrame
|
|
|
|
if ($('#etherpadContainer').html() == ''){ |
|
|
|
if ($('#etherpadContainer').html() == ''){ |
|
|
|
loadEtherpadIframe(); |
|
|
|
loadEtherpadIframe(); |
|
|
@ -2099,13 +2029,7 @@ function initVroom(room) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
error: function(data) { |
|
|
|
error: function(data) { |
|
|
|
data = data.responseJSON; |
|
|
|
showApiError(data); |
|
|
|
if (data.msg){ |
|
|
|
|
|
|
|
$.notify(data.msg, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
$.notify(locale.ERROR_OCCURRED, 'error'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
success: function(data) { |
|
|
|
success: function(data) { |
|
|
|
if (data.msg && data.msg != ''){ |
|
|
|
if (data.msg && data.msg != ''){ |
|
|
|