diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 270005f88..d897a2a28 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -339,6 +339,10 @@ .debate-show, .proposal-show, .investment-project-show { + p { + word-wrap: break-word; + } + .social-share-full .social-share-button { display:inline; } diff --git a/app/helpers/embed_videos_helper.rb b/app/helpers/embed_videos_helper.rb index b53aeef21..b48799bf5 100644 --- a/app/helpers/embed_videos_helper.rb +++ b/app/helpers/embed_videos_helper.rb @@ -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] '' - else + else '' end - end + end end \ No newline at end of file