Remove old screenshot code

docker-smtp
Marcin Kulik 7 years ago
parent 747767da15
commit e8b0d85be8

@ -1,12 +0,0 @@
//= require player
body.screenshot
background-color: transparent
padding: 0
margin: 0
.control-bar
display: none
.asciinema-player-wrapper
text-align: left

@ -38,16 +38,6 @@ module AsciicastsHelper
content_tag('asciinema-player', '', opts)
end
def screenshot_javascript_tag
js = assets.find_asset('embed.js').to_s
content_tag(:script, js.html_safe)
end
def screenshot_stylesheet_tag
css = translate_asset_paths(assets.find_asset('screenshot.css').to_s)
content_tag(:style, css.html_safe)
end
def embed_script(asciicast)
src = asciicast_url(asciicast, format: :js)
id = "asciicast-#{asciicast.to_param}"
@ -69,13 +59,6 @@ module AsciicastsHelper
private
def translate_asset_paths(css)
css.gsub(/['"]\/assets\/(.+?)(-\w{64})?\.(.+?)['"]/) { |m|
path = assets.find_asset("#{$1}.#{$3}").pathname
"'#{path}'"
}
end
def base64_poster(asciicast)
'data:application/json;base64,' + Base64.encode64(JSON.generate(asciicast.snapshot, ascii_only: true))
end

@ -1,9 +0,0 @@
doctype html
html[lang="en"]
head
meta[charset="utf-8"]
= screenshot_javascript_tag
= screenshot_stylesheet_tag
= content_for(:head)
body.screenshot
= yield

@ -5,4 +5,4 @@ Rails.application.config.assets.version = '1.0'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w( player.css asciinema-player.js embed.css embed.js widget.js screenshot.css )
Rails.application.config.assets.precompile += %w( player.css asciinema-player.js embed.css embed.js widget.js )

Loading…
Cancel
Save