|
|
@ -35,7 +35,7 @@ $.ajax({ |
|
|
|
|
|
|
|
|
|
|
|
// Default ajax setup
|
|
|
|
// Default ajax setup
|
|
|
|
$.ajaxSetup({ |
|
|
|
$.ajaxSetup({ |
|
|
|
url: rootUrl + 'jsapi', |
|
|
|
url: rootUrl + 'api', |
|
|
|
type: 'POST', |
|
|
|
type: 'POST', |
|
|
|
dataType: 'json', |
|
|
|
dataType: 'json', |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
@ -46,7 +46,6 @@ $.ajaxSetup({ |
|
|
|
// Handle lang switch
|
|
|
|
// Handle lang switch
|
|
|
|
$('#switch_lang').change(function(){ |
|
|
|
$('#switch_lang').change(function(){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'switch_lang', |
|
|
|
action: 'switch_lang', |
|
|
@ -98,7 +97,6 @@ function addNotifiedEmail(email){ |
|
|
|
function removeNotifiedEmail(email){ |
|
|
|
function removeNotifiedEmail(email){ |
|
|
|
var id = escapeJqSelector(email.replace(/['"]/, '_').replace('\\\'', '\'')); |
|
|
|
var id = escapeJqSelector(email.replace(/['"]/, '_').replace('\\\'', '\'')); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'email_notification', |
|
|
|
action: 'email_notification', |
|
|
@ -527,7 +525,6 @@ function initVroom(room) { |
|
|
|
// Get our role and other room settings from the server
|
|
|
|
// Get our role and other room settings from the server
|
|
|
|
function getRoomInfo(){ |
|
|
|
function getRoomInfo(){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'get_room_info', |
|
|
|
action: 'get_room_info', |
|
|
@ -593,7 +590,6 @@ function initVroom(room) { |
|
|
|
// Get the role of a peer
|
|
|
|
// Get the role of a peer
|
|
|
|
function getPeerRole(id){ |
|
|
|
function getPeerRole(id){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'get_peer_role', |
|
|
|
action: 'get_peer_role', |
|
|
@ -958,7 +954,6 @@ function initVroom(room) { |
|
|
|
function promotePeer(id){ |
|
|
|
function promotePeer(id){ |
|
|
|
if (peers[id] && peers[id].role != 'owner'){ |
|
|
|
if (peers[id] && peers[id].role != 'owner'){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'promote_peer', |
|
|
|
action: 'promote_peer', |
|
|
@ -1062,7 +1057,6 @@ function initVroom(room) { |
|
|
|
function wipeRoomData(){ |
|
|
|
function wipeRoomData(){ |
|
|
|
if (etherpad.enabled){ |
|
|
|
if (etherpad.enabled){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'wipe_data', |
|
|
|
action: 'wipe_data', |
|
|
@ -1450,7 +1444,6 @@ function initVroom(room) { |
|
|
|
wipeChatHistory(); |
|
|
|
wipeChatHistory(); |
|
|
|
if (etherpad.enabled){ |
|
|
|
if (etherpad.enabled){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'get_pad_session', |
|
|
|
action: 'get_pad_session', |
|
|
@ -1510,7 +1503,6 @@ function initVroom(room) { |
|
|
|
// we send it. Not that I like sending this kind of data to the server
|
|
|
|
// we send it. Not that I like sending this kind of data to the server
|
|
|
|
// but it's needed for email notifications
|
|
|
|
// but it's needed for email notifications
|
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'join', |
|
|
|
action: 'join', |
|
|
@ -1611,7 +1603,6 @@ function initVroom(room) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'invite_email', |
|
|
|
action: 'invite_email', |
|
|
@ -1709,7 +1700,6 @@ function initVroom(room) { |
|
|
|
$('#lockButton').change(function() { |
|
|
|
$('#lockButton').change(function() { |
|
|
|
var action = ($(this).is(":checked")) ? 'lock_room' : 'unlock_room'; |
|
|
|
var action = ($(this).is(":checked")) ? 'lock_room' : 'unlock_room'; |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: action, |
|
|
|
action: action, |
|
|
@ -1745,7 +1735,6 @@ function initVroom(room) { |
|
|
|
$('#askForNameButton').change(function() { |
|
|
|
$('#askForNameButton').change(function() { |
|
|
|
var set = ($(this).is(":checked")) ? 'on':'off'; |
|
|
|
var set = ($(this).is(":checked")) ? 'on':'off'; |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'set_ask_for_name', |
|
|
|
action: 'set_ask_for_name', |
|
|
@ -1909,7 +1898,6 @@ function initVroom(room) { |
|
|
|
event.preventDefault(); |
|
|
|
event.preventDefault(); |
|
|
|
var pass = $('#authPass').val(); |
|
|
|
var pass = $('#authPass').val(); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'authenticate', |
|
|
|
action: 'authenticate', |
|
|
@ -1949,7 +1937,6 @@ function initVroom(room) { |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'set_join_password', |
|
|
|
action: 'set_join_password', |
|
|
@ -1986,7 +1973,6 @@ function initVroom(room) { |
|
|
|
if (pass == pass2 && pass != ''){ |
|
|
|
if (pass == pass2 && pass != ''){ |
|
|
|
$('#setJoinPassButton').addClass('disabled'); |
|
|
|
$('#setJoinPassButton').addClass('disabled'); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'set_join_password', |
|
|
|
action: 'set_join_password', |
|
|
@ -2032,7 +2018,6 @@ function initVroom(room) { |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'set_owner_password', |
|
|
|
action: 'set_owner_password', |
|
|
@ -2067,7 +2052,6 @@ function initVroom(room) { |
|
|
|
if (pass == pass2 && pass != ''){ |
|
|
|
if (pass == pass2 && pass != ''){ |
|
|
|
$('#setOwnerPassButton').addClass('disabled'); |
|
|
|
$('#setOwnerPassButton').addClass('disabled'); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'set_owner_password', |
|
|
|
action: 'set_owner_password', |
|
|
@ -2116,7 +2100,6 @@ function initVroom(room) { |
|
|
|
$('#newEmailNotificationForm').submit(function(event){ |
|
|
|
$('#newEmailNotificationForm').submit(function(event){ |
|
|
|
event.preventDefault(); |
|
|
|
event.preventDefault(); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'email_notification', |
|
|
|
action: 'email_notification', |
|
|
@ -2306,7 +2289,6 @@ function initVroom(room) { |
|
|
|
webrtc.sendToAll('terminate_room', {}); |
|
|
|
webrtc.sendToAll('terminate_room', {}); |
|
|
|
wipeRoomData(); |
|
|
|
wipeRoomData(); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'delete_room', |
|
|
|
action: 'delete_room', |
|
|
@ -2351,7 +2333,6 @@ function initVroom(room) { |
|
|
|
// Used to detect inactive rooms
|
|
|
|
// Used to detect inactive rooms
|
|
|
|
setInterval(function(){ |
|
|
|
setInterval(function(){ |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
|
|
|
|
data: { |
|
|
|
data: { |
|
|
|
req: JSON.stringify({ |
|
|
|
req: JSON.stringify({ |
|
|
|
action: 'ping', |
|
|
|
action: 'ping', |
|
|
|