diff --git a/app/views/asciicasts/_embed.html.slim b/app/views/asciicasts/_embed.html.slim new file mode 100644 index 0000000..13d3c41 --- /dev/null +++ b/app/views/asciicasts/_embed.html.slim @@ -0,0 +1,27 @@ +.modal.fade id="embed-modal" tabindex="-1" role="dialog" + .modal-dialog.embed-modal + .modal-content + .modal-header + button type="button" class="close" data-dismiss="modal" + span × + h4.modal-title id="myModalLabel" Embed this asciicast + .modal-body + h2 Image link + p Use snippets below to display a screenshot linking to this asciicast. Useful in places where scripts are not allowed (e.g. in a project's README file). + p + span HTML: + br + input[type="text" value=page.embed_html_link data-behavior="auto-select" readonly] + p + span Markdown: + br + input[type="text" value=page.embed_markdown_link data-behavior="auto-select" readonly] + + h2 Player + + p If you're embedding on your own page or on a site which permits script tags, + you can use the full player widget: + p + input[type="text" value=page.embed_script data-behavior="auto-select" readonly] + p Paste the above script tag where you want the player to be displayed on your page. + p See the #{link_to 'embedding docs', docs_path(:embedding)} for additional options. diff --git a/app/views/asciicasts/show.html.slim b/app/views/asciicasts/show.html.slim index d2f9bb3..8825f6f 100644 --- a/app/views/asciicasts/show.html.slim +++ b/app/views/asciicasts/show.html.slim @@ -3,6 +3,8 @@ = render 'discovery_tags', page: page .asciicast-page + = render 'embed', page: page + section.cinema .container = player page.asciicast, page.playback_options @@ -76,31 +78,3 @@ .other-asciicasts h2 More by #{page.author_link} = render 'previews', asciicasts: page.other_asciicasts_by_author, per_row: 3 - - .modal.fade id="embed-modal" tabindex="-1" role="dialog" - .modal-dialog.embed-modal - .modal-content - .modal-header - button type="button" class="close" data-dismiss="modal" - span × - h4.modal-title id="myModalLabel" Embed this asciicast - .modal-body - h2 Image link - p Use snippets below to display a screenshot linking to this asciicast. Useful in places where scripts are not allowed (e.g. in a project's README file). - p - span HTML: - br - input[type="text" value=page.embed_html_link data-behavior="auto-select" readonly] - p - span Markdown: - br - input[type="text" value=page.embed_markdown_link data-behavior="auto-select" readonly] - - h2 Player - - p If you're embedding on your own page or on a site which permits script tags, - you can use the full player widget: - p - input[type="text" value=page.embed_script data-behavior="auto-select" readonly] - p Paste the above script tag where you want the player to be displayed on your page. - p See the #{link_to 'embedding docs', docs_path(:embedding)} for additional options.