Fix sending of size message from an iframe

private-asciicasts
Marcin Kulik 9 years ago
parent ae95697a9a
commit dd23c87e09

@ -18,7 +18,7 @@ class BareAsciicastPagePresenter
end
def asciicast_id
asciicast.id
asciicast.to_param
end
end

@ -9,7 +9,7 @@ javascript:
if (typeof target != "undefined" && window !== window.parent) {
var w = $('.asciinema-player').width();
var h = $(document).height();
target.postMessage(['asciicast:size', { id: #{page.asciicast_id}, width: w, height: h }], '*');
target.postMessage(['asciicast:size', { id: '#{page.asciicast_id}', width: w, height: h }], '*');
}
function onMessage(e) {

@ -5,12 +5,12 @@ p
Some pilots get picked and become television programs. Some don't, become
nothing. She starred in one of the ones that became nothing.
script[type="text/javascript" src=asciicast_url(@asciicast, format: 'js') id="asciicast-#{@asciicast.id}" async data-speed="2"]
script[type="text/javascript" src=asciicast_url(@asciicast, format: 'js') id="asciicast-#{@asciicast.to_param}" async data-speed="2"]
p
' And now again. There should be an embedded player below this paragraph.
script[type="text/javascript" src=asciicast_url(@asciicast, format: 'js') id="asciicast-#{@asciicast.id}" async data-speed="2"]
script[type="text/javascript" src=asciicast_url(@asciicast, format: 'js') id="asciicast-#{@asciicast.to_param}" async data-speed="2"]
p
' This is at the bottom of the page, below all players.

@ -25,7 +25,7 @@ describe BareAsciicastPagePresenter do
describe '#asciicast_id' do
subject { presenter.asciicast_id }
it { should eq(123) }
it { should eq('123') }
end
end

Loading…
Cancel
Save