asciinema.org/app/helpers/asciicasts_helper.rb

19 lines
362 B
Ruby
Raw Normal View History

2011-11-23 21:30:09 +00:00
module AsciicastsHelper
2011-11-27 12:54:10 +00:00
2012-03-03 17:38:11 +00:00
def player_script(asciicast)
return <<EOS.html_safe
<script>
2012-02-07 09:42:57 +00:00
$(function() {
window.player = new AsciiIo.PlayerView({
el: $('.player'),
2012-03-03 17:38:11 +00:00
cols: #{asciicast.terminal_columns},
lines: #{asciicast.terminal_lines},
model: new AsciiIo.Asciicast({ id: #{asciicast.id} })
2012-02-07 09:42:57 +00:00
});
});
</script>
EOS
2011-11-27 12:54:10 +00:00
end
2011-11-23 21:30:09 +00:00
end