forked from External/greenlight
make previous meetings per room instead of global
This commit is contained in:
parent
47464d35b2
commit
7b52e2ef61
@ -192,6 +192,7 @@
|
|||||||
|
|
||||||
var initRooms = function() {
|
var initRooms = function() {
|
||||||
displayRoomURL();
|
displayRoomURL();
|
||||||
|
var roomAdmin = $('.page-wrapper.rooms').data('admin-id');
|
||||||
|
|
||||||
$('.center-panel-wrapper').on('input', '.meeting-name', function (event, msg) {
|
$('.center-panel-wrapper').on('input', '.meeting-name', function (event, msg) {
|
||||||
var newId = $(this).val();
|
var newId = $(this).val();
|
||||||
@ -206,7 +207,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if ($(".page-wrapper.rooms").data('main-room')) {
|
if ($(".page-wrapper.rooms").data('main-room')) {
|
||||||
PreviousMeetings.init('joinedRooms');
|
PreviousMeetings.init('joinedRooms-'+roomAdmin);
|
||||||
|
|
||||||
if ($('input.meeting-name').val() !== '') {
|
if ($('input.meeting-name').val() !== '') {
|
||||||
$('input.meeting-name').trigger('input');
|
$('input.meeting-name').trigger('input');
|
||||||
|
@ -72,7 +72,7 @@ class @Meeting
|
|||||||
if @type == 'meetings'
|
if @type == 'meetings'
|
||||||
key = 'joinedMeetings'
|
key = 'joinedMeetings'
|
||||||
else if @type == 'rooms'
|
else if @type == 'rooms'
|
||||||
key = 'joinedRooms'
|
key = 'joinedRooms-'+@adminId
|
||||||
|
|
||||||
# update previously joined meetings/rooms on client
|
# update previously joined meetings/rooms on client
|
||||||
try
|
try
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
class @PreviousMeetings
|
class @PreviousMeetings
|
||||||
MAX_MEETINGS = 5
|
MAX_MEETINGS = 5
|
||||||
|
|
||||||
|
# initializes and populates previous meetings list with entries from localStorage
|
||||||
@init: (type) ->
|
@init: (type) ->
|
||||||
$('.center-panel-wrapper').off 'click', '.fill-meeting-name'
|
$('.center-panel-wrapper').off 'click', '.fill-meeting-name'
|
||||||
$('.center-panel-wrapper').on 'click', '.fill-meeting-name', (event, msg) ->
|
$('.center-panel-wrapper').on 'click', '.fill-meeting-name', (event, msg) ->
|
||||||
@ -29,15 +30,10 @@ class @PreviousMeetings
|
|||||||
joinedMeetings = localStorage.getItem(type)
|
joinedMeetings = localStorage.getItem(type)
|
||||||
if joinedMeetings && joinedMeetings.length > 0
|
if joinedMeetings && joinedMeetings.length > 0
|
||||||
joinedMeetings = joinedMeetings.split(',')
|
joinedMeetings = joinedMeetings.split(',')
|
||||||
|
PreviousMeetings.append(joinedMeetings.reverse())
|
||||||
|
|
||||||
for m in joinedMeetings by -1
|
# adds to previous meetings list if its unique
|
||||||
if $('ul.previously-joined > li').length > MAX_MEETINGS
|
@uniqueAdd: (names) ->
|
||||||
break
|
|
||||||
$('ul.previously-joined').append('<li><a class="fill-meeting-name">'+m+'</a></li>')
|
|
||||||
|
|
||||||
$('.center-panel-wrapper .previously-joined-wrapper').removeClass('hidden')
|
|
||||||
|
|
||||||
@add: (names) ->
|
|
||||||
meetings = $('ul.previously-joined > li').toArray().map( (li) ->
|
meetings = $('ul.previously-joined > li').toArray().map( (li) ->
|
||||||
return li.innerText
|
return li.innerText
|
||||||
)
|
)
|
||||||
@ -48,7 +44,10 @@ class @PreviousMeetings
|
|||||||
names = names.filter( (value) ->
|
names = names.filter( (value) ->
|
||||||
return $.inArray(value, meetings) == -1
|
return $.inArray(value, meetings) == -1
|
||||||
)
|
)
|
||||||
for m in names
|
PreviousMeetings.append(names)
|
||||||
|
|
||||||
|
@append: (meeting_names) ->
|
||||||
|
for m in meeting_names
|
||||||
if $('ul.previously-joined > li').length > MAX_MEETINGS
|
if $('ul.previously-joined > li').length > MAX_MEETINGS
|
||||||
break
|
break
|
||||||
$('ul.previously-joined').append('<li><a class="fill-meeting-name">'+m+'</a></li>')
|
$('ul.previously-joined').append('<li><a class="fill-meeting-name">'+m+'</a></li>')
|
||||||
|
@ -216,7 +216,7 @@ class @Recordings
|
|||||||
output = {}
|
output = {}
|
||||||
for key in [0...recording_names.length]
|
for key in [0...recording_names.length]
|
||||||
output[recording_names[key]] = recording_names[key]
|
output[recording_names[key]] = recording_names[key]
|
||||||
PreviousMeetings.add(value for key, value of output)
|
PreviousMeetings.uniqueAdd(value for key, value of output)
|
||||||
|
|
||||||
|
|
||||||
# setup click handlers for the action buttons
|
# setup click handlers for the action buttons
|
||||||
|
Loading…
x
Reference in New Issue
Block a user