Display embed link on the asciicast's page

openid
Marcin Kulik 11 years ago
parent 20cf58e89b
commit feec862f99

@ -15,4 +15,8 @@
$(function() {
$('abbr.timeago').timeago();
$("input[data-behavior=auto-select]").click(function() {
this.select();
});
});

@ -96,3 +96,8 @@ div.presentation
.other-asciicasts
margin-top: 70px
.extras
.embed-script
width: 100%
margin: 5px 0

@ -99,6 +99,10 @@ class AsciicastDecorator < ApplicationDecorator
end
end
def embed_script
%(<script type="text/javascript" src="#{h.asciicast_url(model, :format => :js)}" id="asciicast-#{id}" async></script>)
end
private
def prepare_lines(lines, width, height)

@ -1,7 +0,0 @@
<h1>Share</h1>
<ul class="delimited">
<li>
Twitter
</li>
</ul>

@ -0,0 +1,6 @@
h1 Share
ul.delimited
li
' Embed on your page
input[type="text" class="embed-script" value=@asciicast.embed_script data-behavior="auto-select" readonly]

@ -1,25 +0,0 @@
<section id="presentation" class="feature">
<div class="asciicast-wrapper">
<%= player @asciicast %>
</div>
</section>
<section class="supplimental">
<div class="wrapper">
<div class="main">
<h1><%= @asciicast.title %></h1>
<div class="description">
<%= @asciicast.description %>
</div>
<%= render :partial => 'other_by_user' %>
</div>
<div class="extras">
<%= render :partial => 'author' %>
<%= render :partial => 'actions' %>
<%= render :partial => 'info' %>
</div>
</div>
</section>

@ -0,0 +1,15 @@
section#presentation.feature
.asciicast-wrapper
= player @asciicast
section.supplimental
.wrapper
.main
h1 = @asciicast.title
.description = @asciicast.description
= render :partial => 'other_by_user'
.extras
= render :partial => 'author'
= render :partial => 'actions'
= render :partial => 'info'
= render :partial => 'share'
Loading…
Cancel
Save