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_link_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
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 19 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
11 12 13 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 11 def twitter_bootstrap_javascript_url(host = DEFAULT_HOST, = {}) twitter_bootstrap_url(:js, host, ) end |
#twitter_bootstrap_stylesheet_link_tag(host, options = {}, html_options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 33 def twitter_bootstrap_stylesheet_link_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
15 16 17 |
# File 'lib/twitter-bootstrap-rails-cdn.rb', line 15 def twitter_bootstrap_stylesheet_url(host = DEFAULT_HOST, = {}) twitter_bootstrap_url(:css, host, ) end |