@@ -339,6 +339,10 @@
|
||||
|
||||
.debate-show, .proposal-show, .investment-project-show {
|
||||
|
||||
p {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.social-share-full .social-share-button {
|
||||
display:inline;
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
module EmbedVideosHelper
|
||||
|
||||
def embedded_video_code
|
||||
link = @proposal.video_url
|
||||
link = @proposal.video_url
|
||||
if link.match(/vimeo.*/)
|
||||
server = "Vimeo"
|
||||
elsif link.match(/youtu*.*/)
|
||||
server = "YouTube"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if server == "Vimeo"
|
||||
regExp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
|
||||
src = "https://player.vimeo.com/video/"
|
||||
elsif server == "YouTube"
|
||||
regExp = /youtu.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
|
||||
src = "https://www.youtube.com/embed/"
|
||||
regExp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
|
||||
src = "https://www.youtube.com/embed/"
|
||||
end
|
||||
|
||||
if regExp
|
||||
|
||||
if regExp
|
||||
match = link.match(regExp)
|
||||
end
|
||||
|
||||
if match and match[2]
|
||||
'<iframe src="' + src + match[2] + '" frameborder="0" allowfullscreen></iframe>'
|
||||
else
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user