forked from External/greenlight
cleanup meetings
This commit is contained in:
parent
68d3e8da5a
commit
c9f0dead12
|
@ -13,6 +13,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var init = function() {
|
var init = function() {
|
||||||
|
Meeting.clear();
|
||||||
|
|
||||||
$('.center-panel-wrapper').on ('click', '.meeting-join', function (event) {
|
$('.center-panel-wrapper').on ('click', '.meeting-join', function (event) {
|
||||||
var name = $('.meeting-user-name').val();
|
var name = $('.meeting-user-name').val();
|
||||||
|
@ -69,16 +70,17 @@
|
||||||
|
|
||||||
$('.generate-link').click (function (e) {
|
$('.generate-link').click (function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
var newId = Math.trunc(Math.random() * 1000000000);
|
||||||
|
$(".page-wrapper.meetings").data('id', newId);
|
||||||
var link = window.location.protocol +
|
var link = window.location.protocol +
|
||||||
'//' +
|
'//' +
|
||||||
window.location.hostname +
|
window.location.hostname +
|
||||||
'/meetings/' +
|
'/meetings/' +
|
||||||
Math.trunc(Math.random() * 1000000000);
|
newId;
|
||||||
|
|
||||||
$('.meeting-url').val(link);
|
$('.meeting-url').val(link);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (meetingId = $('.meeting-url').data('meetingId')) {
|
if (meetingId = $(".page-wrapper.meetings").data('id')) {
|
||||||
var link = window.location.protocol +
|
var link = window.location.protocol +
|
||||||
'//' +
|
'//' +
|
||||||
window.location.hostname +
|
window.location.hostname +
|
||||||
|
|
|
@ -9,18 +9,25 @@ class @Meeting
|
||||||
@getInstance: ->
|
@getInstance: ->
|
||||||
if _meetingInstance
|
if _meetingInstance
|
||||||
return _meetingInstance
|
return _meetingInstance
|
||||||
id = $(".page-wrapper.rooms").data('room')
|
id = $(".page-wrapper").data('id')
|
||||||
url = @buildURL()
|
url = @buildURL(id)
|
||||||
name = $('.meeting-user-name').val()
|
name = $('.meeting-user-name').val()
|
||||||
_meetingInstance = new Meeting(id, url, name)
|
_meetingInstance = new Meeting(id, url, name)
|
||||||
return _meetingInstance
|
return _meetingInstance
|
||||||
|
|
||||||
@buildURL: ->
|
@clear: ->
|
||||||
|
_meetingInstance = null
|
||||||
|
|
||||||
|
@buildURL: (id) ->
|
||||||
|
if (resource = location.pathname.split('/')[1]) != 'rooms'
|
||||||
|
resource = 'meetings'
|
||||||
return location.protocol +
|
return location.protocol +
|
||||||
'//' +
|
'//' +
|
||||||
location.hostname +
|
location.hostname +
|
||||||
'/rooms/' +
|
'/' +
|
||||||
$('.rooms').data('room')
|
resource +
|
||||||
|
'/' +
|
||||||
|
id;
|
||||||
|
|
||||||
# Sends the end meeting request
|
# Sends the end meeting request
|
||||||
# Returns a response object
|
# Returns a response object
|
||||||
|
|
|
@ -50,7 +50,7 @@ class @Recordings
|
||||||
str = ''
|
str = ''
|
||||||
if row.published
|
if row.published
|
||||||
for d in data
|
for d in data
|
||||||
str += '<a href="'+d.url+'">'+d.type+'</a> '
|
str += '<a href="'+d.url+'">'+d.type_i18n+'</a> '
|
||||||
return str
|
return str
|
||||||
return data
|
return data
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
json.partial! 'bbb', messageKey: @messageKey, message: @message, status: @status
|
json.partial! 'bbb', messageKey: @messageKey, message: @message, status: @status
|
||||||
unless @response.blank?
|
json.is_owner current_user == @user
|
||||||
json.is_owner current_user == @user
|
json.recordings do
|
||||||
json.recordings do
|
|
||||||
json.array!(@response) do |recording|
|
json.array!(@response) do |recording|
|
||||||
json.id recording[:recordID]
|
json.id recording[:recordID]
|
||||||
json.name recording[:name]
|
json.name recording[:name]
|
||||||
|
@ -15,7 +14,8 @@ unless @response.blank?
|
||||||
end
|
end
|
||||||
json.playbacks do
|
json.playbacks do
|
||||||
json.array!(recording[:playbacks]) do |playback|
|
json.array!(recording[:playbacks]) do |playback|
|
||||||
json.type t(playback[:type]) # translates the playback type
|
json.type playback[:type]
|
||||||
|
json.type_i18n t(playback[:type]) # translates the playback type
|
||||||
json.url playback[:url]
|
json.url playback[:url]
|
||||||
json.previews do
|
json.previews do
|
||||||
json.array!(playback[:previews]) do |preview|
|
json.array!(playback[:previews]) do |preview|
|
||||||
|
@ -25,5 +25,4 @@ unless @response.blank?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="page-wrapper meetings">
|
<div class="page-wrapper meetings" data-id="<%= @meeting_id %>">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
<%= render 'shared/title', title: t('start_new_session') %>
|
<%= render 'shared/title', title: t('start_new_session') %>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<% page_title= t('greet_guest', name: @user.username) %>
|
<% page_title= t('greet_guest', name: @user.username) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="page-wrapper rooms" data-room="<%= @user.encrypted_id %>">
|
<div class="page-wrapper rooms" data-id="<%= @user.encrypted_id %>">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
<%= render 'shared/title', title: page_title %>
|
<%= render 'shared/title', title: page_title %>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<div <%= "hidden" if hidden %> class="meeting-url-wrapper">
|
<div <%= "hidden" if hidden %> class="meeting-url-wrapper">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" readonly="readonly" class="form-control meeting-url" data-meeting-id="<%= @meeting_id %>" data-path="<%= @user.room_url if @user %>"/>
|
<input type="text" readonly="readonly" class="form-control meeting-url"/>
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button type="button" class="btn btn-default meeting-url-copy">
|
<button type="button" class="btn btn-default meeting-url-copy">
|
||||||
<i class="fa fa-paperclip" aria-hidden="true"></i>
|
<i class="fa fa-paperclip" aria-hidden="true"></i>
|
||||||
|
|
Loading…
Reference in New Issue