finish meeting class

This commit is contained in:
Zachary Chai
2016-11-10 17:05:43 -05:00
parent ef06c4133b
commit 1d879993d5
5 changed files with 93 additions and 73 deletions

View File

@ -4,67 +4,14 @@ $.ajaxSetup({
}
});
var getEncryptedId = function() {
return $(".page-wrapper.rooms").data('room');
}
var PUBLISHED_CLASSES = ['fa-eye-slash', 'fa-eye']
var getPublishClass = function(published) {
return PUBLISHED_CLASSES[+published];
}
var meetingInstance = null;
class Meeting {
constructor(url, name) {
this.url = url;
this.name = name;
}
static getInstance() {
if (meetingInstance) {
return meetingInstance;
}
var url = $('.meeting-url').val();
var name = $('.meeting-user-name').val();
meetingInstance = new Meeting(url, name);
return meetingInstance;
}
getjoinMeetingURL() {
return $.get(this.url + "/join?name=" + this.name, function() {
});
};
endMeeting() {
return $.ajax({
url: this.url + "/end",
type: 'DELETE'
});
}
setURL(url) {
this.url = url;
}
setName(name) {
this.name = name;
}
setModJoined(modJoined) {
this.modJoined = modJoined;
}
getModJoined() {
return this.modJoined;
}
setWaitingForMod(wMod) {
this.waitingForMod = wMod;
}
getWaitingForMod() {
return this.waitingForMod;
}
}
var loopJoin = function() {
var jqxhr = Meeting.getInstance().getjoinMeetingURL();
var jqxhr = Meeting.getInstance().getJoinMeetingResponse();
jqxhr.done(function(data) {
if (data.messageKey === 'wait_for_moderator') {
setTimeout(loopJoin, 5000);
@ -92,11 +39,6 @@ var showAlert = function(html, timeout_delay) {
}
}
var displayMeetingURL = function() {
meetingURL = $('.meeting-url');
var link = window.location.protocol +
'//' +
window.location.hostname +
meetingURL.data('path');
meetingURL.val(link);
var displayRoomURL = function() {
$('.meeting-url').val(Meeting.getInstance().getURL());
}