|
|
|
@ -14,4 +14,20 @@ javascript:
|
|
|
|
|
var h = Math.max(document.body.scrollHeight, document.body.offsetHeight);
|
|
|
|
|
target.postMessage(['asciicast:size', { width: w, height: h }], '*');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onMessage(e) {
|
|
|
|
|
if (e.data == 'asciicast:play' || e.data[0] == 'asciicast:play') {
|
|
|
|
|
player.play();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// reveal.js support
|
|
|
|
|
|
|
|
|
|
if (e.data == 'slide:start') {
|
|
|
|
|
player.play();
|
|
|
|
|
} else if (e.data == 'slide:stop') {
|
|
|
|
|
player.pause();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
window.addEventListener("message", onMessage, false);
|
|
|
|
|
});
|
|
|
|
|