commit
a0e84709d4
@ -0,0 +1,2 @@
|
||||
//= require application
|
||||
//= require player
|
@ -0,0 +1,4 @@
|
||||
//= require player
|
||||
|
||||
body.iframe
|
||||
background-color: transparent
|
@ -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 +0,0 @@
|
||||
<%= player @asciicast %>
|
@ -0,0 +1,11 @@
|
||||
= player @asciicast
|
||||
|
||||
javascript:
|
||||
$(function() {
|
||||
var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
|
||||
if (typeof target != "undefined" && window !== window.parent) {
|
||||
var w = $('.player').css('width');
|
||||
var h = $('.player').css('height');
|
||||
target.postMessage(['asciicast:size', { id: #{@asciicast.id}, width: w, height: h }], '*');
|
||||
}
|
||||
});
|
@ -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'
|
@ -0,0 +1,36 @@
|
||||
// ascii.io - embeddable player
|
||||
|
||||
(function() {
|
||||
function receiveSize(e) {
|
||||
if (e.origin === document.location.protocol + "//<%= request.host %>") {
|
||||
var event = e.data[0];
|
||||
var data = e.data[1];
|
||||
if (event == 'asciicast:size' && data.id == <%= @asciicast.id %>) {
|
||||
var player = document.getElementById("asciicast-iframe-<%= @asciicast.id %>");
|
||||
if (player) {
|
||||
player.style.width = data.width;
|
||||
player.style.height = data.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function insertAfter(referenceNode, newNode) {
|
||||
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
||||
}
|
||||
|
||||
var scriptTag = document.getElementById("asciicast-<%= @asciicast.id %>");
|
||||
|
||||
if (scriptTag) {
|
||||
window.addEventListener("message", receiveSize, false);
|
||||
var container = document.createElement('div');
|
||||
container.className = 'asciicast';
|
||||
container.style.display = 'block';
|
||||
container.style.float = 'none';
|
||||
container.style.overflow = 'hidden';
|
||||
container.style.padding = '0';
|
||||
insertAfter(scriptTag, container);
|
||||
var containerWidth = container.offsetWidth;
|
||||
container.innerHTML = '<iframe src="http://<%= request.host_with_port %>/a/<%= @asciicast.id %>/raw?container_width=' + containerWidth + '" name="asciicast-iframe-<%= @asciicast.id %>" id="asciicast-iframe-<%= @asciicast.id %>" width="600" height="300" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" style="display: block; float: none; visibility: hidden;" onload="this.style.visibility=\'visible\';"></iframe>';
|
||||
}
|
||||
})();
|
@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title><%= page_title %></title>
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
||||
<![endif]-->
|
||||
|
||||
<%= stylesheet_link_tag "player", :media => "all" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= javascript_include_tag "player" %>
|
||||
|
||||
<script>
|
||||
window.unpackWorkerPath = '<%= javascript_path "unpack_worker" %>';
|
||||
window.mainWorkerPath = '<%= javascript_path "main_worker" %>';
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
doctype html
|
||||
html[lang="en"]
|
||||
head
|
||||
meta[charset="utf-8"]
|
||||
title = page_title
|
||||
= stylesheet_link_tag 'embed', :media => 'all'
|
||||
= javascript_include_tag 'embed'
|
||||
script
|
||||
| window.unpackWorkerPath = '#{javascript_path "unpack_worker"}';
|
||||
window.mainWorkerPath = '#{javascript_path "main_worker"}';
|
||||
body.iframe
|
||||
= yield
|
Loading…
Reference in New Issue