Bump browserslist from 4.16.3 to 4.16.6
[KisSync.git] / player / custom-embed.coffee
blob8d7e6446ea6c2d6b5f3ed97d536da4098a9d760c
1 CUSTOM_EMBED_WARNING = 'This channel is embedding custom content from %link%.
2     Since this content is not trusted, you must click "Embed" below to allow
3     the content to be embedded.<hr>'
5 window.CustomEmbedPlayer = class CustomEmbedPlayer extends EmbedPlayer
6     constructor: (data) ->
7         if not (this instanceof CustomEmbedPlayer)
8             return new CustomEmbedPlayer(data)
10         @load(data)
12     load: (data) ->
13         if not data.meta.embed?
14             console.error('CustomEmbedPlayer::load(): missing meta.embed')
15             return
17         embedSrc = data.meta.embed.src
18         link = "<a href=\"#{embedSrc}\" target=\"_blank\"><strong>#{embedSrc}</strong></a>"
19         alert = makeAlert('Untrusted Content', CUSTOM_EMBED_WARNING.replace('%link%', link),
20             'alert-warning')
21             .removeClass('col-md-12')
22         $('<button/>').addClass('btn btn-default')
23             .text('Embed')
24             .click(=>
25                 super(data)
26             )
27             .appendTo(alert.find('.alert'))
28         removeOld(alert)