Sha256: dbc8da92dab6f40789a06c568ade4ad0e33741af87734ed54aaa24471d26313b

Contents?: true

Size: 1008 Bytes

Versions: 1

Compression:

Stored size: 1008 Bytes

Contents

class Main
  module JqueryHelpers
    def jquery(path='/js/jquery.js', version='1.4.3')
      if settings.production?
        # Grab Google CDN's jQuery; fallback to local if necessary
        url = "http://ajax.googleapis.com/ajax/libs/jquery/#{version}/jquery.min.js"
        "<script type='text/javascript' src=\"#{url}\"></script>"+
        "<script>!window.jQuery && document.write('<script src=\"#{path}\"><\\/script>')</script>"
      else
        "<script type='text/javascript' src='#{path}'></script>"
      end
    end

    def jquery_ui(path='/js/jqueryui.js', version='1.8.5')
      if settings.production?
        url = "http://ajax.googleapis.com/ajax/libs/jqueryui/#{version}/jquery-ui.min.js"
        "<script type='text/javascript' src=\"#{url}\"></script>"+
        "<script>!window.jQuery.ui && document.write('<script src=\"#{path}\"><\\/script>')</script>"
      else
        "<script type='text/javascript' src='#{path}'></script>"
      end
    end
  end

  helpers JqueryHelpers
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aura-0.0.1.pre10 app/helpers/jquery_helpers.rb