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

@ -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