forked from External/greenlight
		
	Merge pull request #122 from zach-chai/past_meetings_from_recordings
past meetings from recordings
This commit is contained in:
		@@ -17,7 +17,8 @@
 | 
				
			|||||||
# Previous Meetings class
 | 
					# Previous Meetings class
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class @PreviousMeetings
 | 
					class @PreviousMeetings
 | 
				
			||||||
  @init: (type)->
 | 
					  @init: (type) ->
 | 
				
			||||||
 | 
					    $('.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) ->
 | 
				
			||||||
      name = $(this).text()
 | 
					      name = $(this).text()
 | 
				
			||||||
      $('input.meeting-name').val(name).trigger('input')
 | 
					      $('input.meeting-name').val(name).trigger('input')
 | 
				
			||||||
@@ -31,3 +32,21 @@ class @PreviousMeetings
 | 
				
			|||||||
        $('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>')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      $('.center-panel-wrapper .previously-joined-wrapper').removeClass('hidden')
 | 
					      $('.center-panel-wrapper .previously-joined-wrapper').removeClass('hidden')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @add: (names) ->
 | 
				
			||||||
 | 
					    meetings = $('ul.previously-joined > li').toArray().map( (li) ->
 | 
				
			||||||
 | 
					      return li.innerText
 | 
				
			||||||
 | 
					    )
 | 
				
			||||||
 | 
					    index = meetings.indexOf('')
 | 
				
			||||||
 | 
					    if index > 1
 | 
				
			||||||
 | 
					      meetings.splice(index, 1)
 | 
				
			||||||
 | 
					    if Array.isArray(names)
 | 
				
			||||||
 | 
					      names = names.filter( (value) ->
 | 
				
			||||||
 | 
					        return $.inArray(value, meetings) == -1
 | 
				
			||||||
 | 
					      )
 | 
				
			||||||
 | 
					      for m in names
 | 
				
			||||||
 | 
					        if $('ul.previously-joined').length > 4
 | 
				
			||||||
 | 
					          return
 | 
				
			||||||
 | 
					        $('ul.previously-joined').append('<li><a class="fill-meeting-name">'+m+'</a></li>')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      $('.center-panel-wrapper .previously-joined-wrapper').removeClass('hidden')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -202,6 +202,13 @@ class @Recordings
 | 
				
			|||||||
      table_api.rows.add(data.recordings)
 | 
					      table_api.rows.add(data.recordings)
 | 
				
			||||||
      @draw()
 | 
					      @draw()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      recording_names = data.recordings.map (r) ->
 | 
				
			||||||
 | 
					        return r.name
 | 
				
			||||||
 | 
					      output = {}
 | 
				
			||||||
 | 
					      for key in [0...recording_names.length]
 | 
				
			||||||
 | 
					        output[recording_names[key]] = recording_names[key]
 | 
				
			||||||
 | 
					      PreviousMeetings.add(value for key, value of output)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # setup click handlers for the action buttons
 | 
					  # setup click handlers for the action buttons
 | 
				
			||||||
  setupActionHandlers: ->
 | 
					  setupActionHandlers: ->
 | 
				
			||||||
    table_api = this.table.api()
 | 
					    table_api = this.table.api()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user