cleanup meetings

This commit is contained in:
Zachary Chai
2016-11-15 12:09:51 -05:00
parent 68d3e8da5a
commit c9f0dead12
7 changed files with 41 additions and 33 deletions

View File

@ -13,6 +13,7 @@
};
var init = function() {
Meeting.clear();
$('.center-panel-wrapper').on ('click', '.meeting-join', function (event) {
var name = $('.meeting-user-name').val();
@ -69,16 +70,17 @@
$('.generate-link').click (function (e) {
e.preventDefault();
var newId = Math.trunc(Math.random() * 1000000000);
$(".page-wrapper.meetings").data('id', newId);
var link = window.location.protocol +
'//' +
window.location.hostname +
'/meetings/' +
Math.trunc(Math.random() * 1000000000);
newId;
$('.meeting-url').val(link);
});
if (meetingId = $('.meeting-url').data('meetingId')) {
if (meetingId = $(".page-wrapper.meetings").data('id')) {
var link = window.location.protocol +
'//' +
window.location.hostname +

View File

@ -9,18 +9,25 @@ class @Meeting
@getInstance: ->
if _meetingInstance
return _meetingInstance
id = $(".page-wrapper.rooms").data('room')
url = @buildURL()
id = $(".page-wrapper").data('id')
url = @buildURL(id)
name = $('.meeting-user-name').val()
_meetingInstance = new Meeting(id, url, name)
return _meetingInstance
@buildURL: ->
@clear: ->
_meetingInstance = null
@buildURL: (id) ->
if (resource = location.pathname.split('/')[1]) != 'rooms'
resource = 'meetings'
return location.protocol +
'//' +
location.hostname +
'/rooms/' +
$('.rooms').data('room')
'/' +
resource +
'/' +
id;
# Sends the end meeting request
# Returns a response object

View File

@ -50,7 +50,7 @@ class @Recordings
str = ''
if row.published
for d in data
str += '<a href="'+d.url+'">'+d.type+'</a> '
str += '<a href="'+d.url+'">'+d.type_i18n+'</a> '
return str
return data
},