Module: TwitterBootstrap::Rails::Cdn::ActionViewExtensions
- Defined in:
- lib/twitter-bootstrap-rails-cdn.rb
Constant Summary collapse
- OFFLINE =
( Rails.env.development? or Rails.env.test? )
- DEFAULT_HOST =
:netdna
- BOOTSTRAP_VERSIONS =
[ '3.0.0', '2.3.2' ]
Instance Method Summary collapse
- #twitter_bootstrap_javascript_include_tag(host, options = {}, html_options = {}) ⇒ Object
- #twitter_bootstrap_javascript_url(host = DEFAULT_HOST, options = {}) ⇒ Object
- #twitter_bootstrap_stylesheet_include_tag(host, options = {}, html_options = {}) ⇒ Object
- #twitter_bootstrap_stylesheet_url(host = DEFAULT_HOST, options = {}) ⇒ Object
Instance Method Details
#twitter_bootstrap_javascript_include_tag(host, options = {}, html_options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 17 def twitter_bootstrap_javascript_include_tag(host, = {}, = {}) local = twitter_bootstrap_javascript_url(:local, ) if OFFLINE and ![:force] javascript_include_tag(local, ) else [ javascript_include_tag(twitter_bootstrap_javascript_url(host, ), ), javascript_tag("typeof $().modal == 'function' "+ "|| document.write(unescape('#{javascript_include_tag(local, ).gsub('<','%3C')}'))") ].join("\n").html_safe end end |
#twitter_bootstrap_javascript_url(host = DEFAULT_HOST, options = {}) ⇒ Object
9 10 11 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 9 def twitter_bootstrap_javascript_url(host = DEFAULT_HOST, = {}) twitter_bootstrap_url(:js, host, ) end |
#twitter_bootstrap_stylesheet_include_tag(host, options = {}, html_options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 31 def twitter_bootstrap_stylesheet_include_tag(host, = {}, = {}) local = twitter_bootstrap_stylesheet_url(:local, ) if OFFLINE and ![:force] stylesheet_link_tag(local, ) else stylesheet_link_tag(twitter_bootstrap_stylesheet_url(host, ), ) end end |
#twitter_bootstrap_stylesheet_url(host = DEFAULT_HOST, options = {}) ⇒ Object
13 14 15 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 13 def twitter_bootstrap_stylesheet_url(host = DEFAULT_HOST, = {}) twitter_bootstrap_url(:css, host, ) end |