Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improve visualization of links to youtube videos

  • Loading branch information...
commit b167e0ffc6f92be972affa0c592487c79580c515 1 parent 814c0b7
@rrrene authored
View
3  app/assets/javascripts/links.js.coffee
@@ -28,6 +28,7 @@ OUT.links =
if matched
video_id = matched[1]
insert_link_here.html youtube_thumb_template.replace(/%{video_id}/g, video_id)
+ content_item.addClass "content-item-link-with-thumb"
$('a[data-convert-into="youtube_embed_player"]').live "click", (event) ->
video_id = $(this).data("video-id")
@@ -35,5 +36,7 @@ OUT.links =
false
$ ->
+ OUT.registerCreatedHandler "link", OUT.links.thumbnailizeVideoLinks
+ OUT.registerUpdatedHandler "link", OUT.links.thumbnailizeVideoLinks
OUT.links.thumbnailizeVideoLinks()
OUT.contentItems.highlightQueryIn(".content-items .content-item-link .content-item-body")
View
26 app/assets/stylesheets/application/links.css.sass
@@ -23,11 +23,27 @@
.content-item-link
.content-item-body
- small.href
- a
- color: #aaa
- &:hover
- text-decoration: none
+ .text,
+ .thumb
+ margin-top: 10px
+ .text
+ h2
+ line-height: 16px
+ small.href
+ a
+ color: #aaa
+ &:hover
+ text-decoration: none
+
+.content-item-link-with-thumb
+ .content-item-body
+ .text
+ float: left
+ width: 75%
+ .thumb
+ float: left
+ img
+ margin-right: 10px
form.link-edit
.controls
View
12 app/views/links/_show.html.haml
@@ -1,11 +1,11 @@
= render :partial => "content_items/timestamp", :locals => {:resource => resource}
-%h2= link_to inline_user_text(resource.title.presence || resource.href_without_protocol), resource.href, {:rel => :external, :class => :external, :target => '_blank'}
-%small.href= link_to resource.href, resource.href, {:rel => :external, :class => :external}
-
.thumb
-.clearboth
+.text
+ %h2= link_to inline_user_text(resource.title.presence || resource.href_without_protocol), resource.href, {:rel => :external, :class => :external, :target => '_blank'}
+ %small.href= link_to resource.href, resource.href, {:rel => :external, :class => :external}
+ - if resource.text.present?
+ %p= user_text resource.text
-- if resource.text.present?
- %p= user_text resource.text
Please sign in to comment.
Something went wrong with that request. Please try again.