asciinema.org/app/views/api/asciicasts/show.html.slim

27 lines
858 B
Plaintext
Raw Normal View History

= player page.asciicast, page.playback_options
p.powered
' Powered by
a href=root_url target="_top" asciinema
2013-06-12 19:52:15 +00:00
javascript:
2016-10-01 18:09:32 +00:00
var player = document.getElementById('player');
player.addEventListener('attached', function() {
var target = parent.postMessage ? parent : (parent.document.postMessage ? parent.document : undefined);
if (typeof target != "undefined" && window !== window.parent) {
2016-10-01 18:09:32 +00:00
var w = player.getElementsByClassName('asciinema-player')[0].offsetWidth;
var h = Math.max(document.body.scrollHeight, document.body.offsetHeight);
target.postMessage(['asciicast:size', { width: w, height: h }], '*');
}
function onMessage(e) {
var event = e.data[0];
if (event == 'asciicast:play') {
2016-10-01 18:09:32 +00:00
// player.play(); // TODO
}
}
window.addEventListener("message", onMessage, false);
});