= 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').outerWidth(); var h = $('.player').outerHeight(); target.postMessage(['asciicast:size', { id: #{@asciicast.id}, width: w, height: h }], '*'); } function onMessage(e) { var event = e.data[0]; if (event == 'asciicast:play') { $('.start-prompt').click(); } } window.addEventListener("message", onMessage, false); });