Module: FlexLayout::ViewHelper
- Defined in:
- lib/flexlayout/view_helper.rb
Instance Method Summary collapse
- #flexie_script ⇒ Object
-
#html5_script(folder = nil) ⇒ Object
Le HTML5 shim, for IE6-8 support of HTML elements if :local option, the option must point to the relative asset folder!.
- #ie_script_tag(version, operator = :lt, &block) ⇒ Object
- #script_src_tag(src) ⇒ Object
Instance Method Details
#flexie_script ⇒ Object
8 9 10 11 12 13 |
# File 'lib/flexlayout/view_helper.rb', line 8 def flexie_script # content = capture(script_tag "flexie.min.js") ie_script_tag 8, :lte do script_src_tag "flexie.min.js" end end |
#html5_script(folder = nil) ⇒ Object
Le HTML5 shim, for IE6-8 support of HTML elements if :local option, the option must point to the relative asset folder!
17 18 19 20 21 |
# File 'lib/flexlayout/view_helper.rb', line 17 def html5_script folder = nil ie_script_tag 8, :lte do script_src_tag folder ? File.join(folder, "html5.min.js") : "http://html5shim.googlecode.com/svn/trunk/html5.js" end end |
#ie_script_tag(version, operator = :lt, &block) ⇒ Object
3 4 5 6 |
# File 'lib/flexlayout/view_helper.rb', line 3 def ie_script_tag version, operator = :lt, &block raise ArgumentError, "must take a block" unless block_given? raw("<!--[if #{operator} IE #{version}]>#{capture(&block)}<![endif]-->").html_safe end |
#script_src_tag(src) ⇒ Object
23 24 25 |
# File 'lib/flexlayout/view_helper.rb', line 23 def script_src_tag src raw("<script src=\"#{src}\" type=\"text/javascript\">").html_safe end |