Class: Rack::DevMark::Theme::GithubForkRibbon
- Defined in:
- lib/rack/dev-mark/theme/github_fork_ribbon.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GithubForkRibbon
constructor
A new instance of GithubForkRibbon.
- #insert_into(html) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ GithubForkRibbon
Returns a new instance of GithubForkRibbon.
8 9 10 |
# File 'lib/rack/dev-mark/theme/github_fork_ribbon.rb', line 8 def initialize( = {}) = end |
Instance Method Details
#insert_into(html) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rack/dev-mark/theme/github_fork_ribbon.rb', line 12 def insert_into(html) position = [:position] || 'left' color = [:color] || 'red' fixed = [:fixed] ? ' fixed' : '' s = "\#{stylesheet_link_tag \"github-fork-ribbon-css/gh-fork-ribbon.css\"}\n<!--[if lt IE 9]>\n\#{stylesheet_link_tag \"github-fork-ribbon-css/gh-fork-ribbon.ie.css\"}\n<![endif]-->\n<div class=\"github-fork-ribbon-wrapper \#{position}\#{fixed}\" onClick=\"this.style.display='none'\" title=\"\#{revision}\"><div class=\"github-fork-ribbon \#{color}\"><span class=\"github-fork-ribbon-text\">\#{env}</span></div></div>\n EOS\n html.sub %r{(<body[^>]*>)}i, \"\\\\1\#{s.strip}\"\nend\n" |