forked from External/greenlight
wait for moderator with action cable
This commit is contained in:
@ -1,21 +1,35 @@
|
||||
(function() {
|
||||
var waitForModerator = function(url) {
|
||||
$.get(url + "/wait", function(html) {
|
||||
$(".center-panel-wrapper").html(html);
|
||||
});
|
||||
if (!Meeting.getInstance().getWaitingForMod()) {
|
||||
Meeting.getInstance().setWaitingForMod(true);
|
||||
if (Meeting.getInstance().getModJoined()) {
|
||||
loopJoin();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var init = function() {
|
||||
|
||||
$('.meeting-join').click (function (event) {
|
||||
var url = $('.meeting-url').val();
|
||||
var name = $('.meeting-user-name').val();
|
||||
$.ajax({
|
||||
url : url + "/join?name=" + name,
|
||||
dataType : "json",
|
||||
type : 'GET',
|
||||
success : function(data) {
|
||||
Meeting.getInstance().setURL(url);
|
||||
Meeting.getInstance().setName(name);
|
||||
var jqxhr = Meeting.getInstance().getjoinMeetingURL();
|
||||
|
||||
jqxhr.done(function(data) {
|
||||
if (data.messageKey === 'wait_for_moderator') {
|
||||
waitForModerator(url);
|
||||
} else {
|
||||
$(location).attr("href", data.response.join_url);
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
},
|
||||
complete : function(xhr, status) {
|
||||
}
|
||||
});
|
||||
jqxhr.fail(function(xhr, status, error) {
|
||||
console.info("meeting join failed");
|
||||
});
|
||||
});
|
||||
|
||||
$('.meeting-url-copy').click (function (e) {
|
||||
|
Reference in New Issue
Block a user