2014-01-18 13:53:15 +00:00
|
|
|
= player page.asciicast, page.playback_options
|
2013-12-14 13:54:01 +00:00
|
|
|
p.powered
|
|
|
|
' Powered by
|
|
|
|
a href=root_url target="_top" asciinema
|
2013-06-12 19:52:15 +00:00
|
|
|
|
|
|
|
javascript:
|
2013-06-12 19:33:30 +00:00
|
|
|
$(function() {
|
|
|
|
var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
|
|
|
|
if (typeof target != "undefined" && window !== window.parent) {
|
2014-06-24 18:34:34 +00:00
|
|
|
var w = $('.asciinema-player').width();
|
2013-12-14 13:54:01 +00:00
|
|
|
var h = $(document).height();
|
2014-01-18 13:53:15 +00:00
|
|
|
target.postMessage(['asciicast:size', { id: #{page.asciicast_id}, width: w, height: h }], '*');
|
2013-06-12 19:33:30 +00:00
|
|
|
}
|
2013-10-12 11:24:48 +00:00
|
|
|
|
|
|
|
function onMessage(e) {
|
|
|
|
var event = e.data[0];
|
|
|
|
if (event == 'asciicast:play') {
|
|
|
|
$('.start-prompt').click();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener("message", onMessage, false);
|
2013-06-12 19:33:30 +00:00
|
|
|
});
|