Initial commit

This commit is contained in:
Senad Uka
2020-05-31 22:38:19 +02:00
commit 858fafc3c5
1280 changed files with 65918 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# TODO: Need to unsubscribe as project changes
$(document).on "turbolinks:load", ->
# Only connect if a project-id meta tag is present
return unless meta = document.querySelector("meta[name=project-id]")
# Get the id of the project to subscribe to
projectId = meta.getAttribute("content")
App.projects = App.cable.subscriptions.create { channel: "ProjectsChannel", id: projectId },
connected: ->
# Called when the subscription is ready for use on the server
disconnected: ->
# Called when the subscription has been terminated by the server
received: (data) ->
switch data.event
when "video_status_update" then @showVideoStatusUpdate(data.content)
when "download_status_update" then @showDownloadStatusUpdate(data.content)
when "conference_recording_ready" then @showDownloadStatusUpdate(data.content)
showVideoStatusUpdate: (content) ->
$("[data-ujs-target='video-analysis-msg']").replaceWith content
showDownloadStatusUpdate: (content) ->
$(".flash-message").html content