improve SoundCloud embed
This commit is contained in:
parent
24db78a734
commit
989ed8e787
@ -320,20 +320,12 @@ Linkify =
|
|||||||
,
|
,
|
||||||
key: 'SoundCloud'
|
key: 'SoundCloud'
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
||||||
style: 'height: auto; width: 500px; display: inline-block;'
|
style: 'border: 0; width: 500px; height: 400px;'
|
||||||
el: (a) ->
|
el: (a) ->
|
||||||
div = $.el 'div',
|
$.el 'iframe',
|
||||||
className: "soundcloud"
|
src: "//w.soundcloud.com/player/?visual=true&show_comments=false&url=https%3A%2F%2Fsoundcloud.com%2F#{encodeURIComponent a.dataset.uid}"
|
||||||
name: "soundcloud"
|
|
||||||
$.ajax(
|
|
||||||
"//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{a.dataset.uid}"
|
|
||||||
onloadend: ->
|
|
||||||
div.innerHTML = '<iframe width="500" height="400" scrolling="no" frameborder="no"></iframe>'
|
|
||||||
div.firstChild.src = JSON.parse(@responseText).html.match(/\bsrc="([^"]+)"/)[1]
|
|
||||||
false)
|
|
||||||
div
|
|
||||||
title:
|
title:
|
||||||
api: (uid) -> "//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{uid}"
|
api: (uid) -> "//soundcloud.com/oembed?format=json&url=https%3A%2F%2Fsoundcloud.com%2F#{encodeURIComponent uid}"
|
||||||
text: (_) -> _.title
|
text: (_) -> _.title
|
||||||
,
|
,
|
||||||
key: 'StrawPoll'
|
key: 'StrawPoll'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user