You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/app/helpers/asciicasts_helper.rb

19 lines
362 B
Ruby

module AsciicastsHelper
def player_script(asciicast)
return <<EOS.html_safe
<script>
$(function() {
window.player = new AsciiIo.PlayerView({
el: $('.player'),
cols: #{asciicast.terminal_columns},
lines: #{asciicast.terminal_lines},
model: new AsciiIo.Asciicast({ id: #{asciicast.id} })
});
});
</script>
EOS
end
end