Sha256: 5d9010385eda4ea047a8f8d3daa70d5b17c3c4fade373b597a8784ebee82bd26
Contents?: true
Size: 960 Bytes
Versions: 10
Compression:
Stored size: 960 Bytes
Contents
# Thanks to https://github.com/simonwhitaker/github-fork-ribbon-css require 'rack/dev-mark/theme/base' module Rack module DevMark module Theme class GithubForkRibbon < Base def initialize(options = {}) @options = options end def insert_into(html) position = @options[:position] || 'left' color = @options[:color] || 'red' fixed = @options[:fixed] ? ' fixed' : '' s = <<-EOS #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.css"} <!--[if lt IE 9]> #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.ie.css"} <![endif]--> <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> EOS html.sub %r{(<body[^>]*>)}i, "\\1#{s.strip}" end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems