lib/jquery-rails-cdn.rb in jquery-rails-cdn-yjchen-0.3.2 vs lib/jquery-rails-cdn.rb in jquery-rails-cdn-yjchen-0.3.3

- old
+ new

@@ -20,39 +20,39 @@ :jquery => "//code.jquery.com/ui/#{JQUERY_UI_VERSION}/jquery-ui.min.js", :yandex => "//yandex.st/jquery-ui/#{JQUERY_UI_VERSION}/jquery-ui.min.js" }, } - def jquery_url(name, options = {}) + def jquery_url(name) return CDNS[:jquery][name] end - def jquery_ui_url(name, options = {}) + def jquery_ui_url(name) return CDNS[:jquery_ui][name] end def jquery_include_tag(name, options = {}) jquery = 'jquery' - jquery = jquery + '.min' if options[:compressed] + jquery = jquery + '.min' if options.delete(:compressed) - if OFFLINE and !options[:force] - return javascript_include_tag(jquery) + if OFFLINE and !options.delete(:force) + return javascript_include_tag(jquery, options) else - [ javascript_include_tag(jquery_url(name, options)), - javascript_tag("window.jQuery || document.write(unescape('#{javascript_include_tag(jquery).gsub('<','%3C')}'))") + [ javascript_include_tag(jquery_url(name), options), + javascript_tag("window.jQuery || document.write(unescape('#{javascript_include_tag(jquery, options).gsub('<','%3C')}'))") ].join("\n").html_safe end end def jquery_ui_include_tag(name, options = {}) jqueryui = 'jquery-ui' - jqueryui = jqueryui + '.min' if options[:compressed] + jqueryui = jqueryui + '.min' if options.delete(:compressed) - if OFFLINE and !options[:force] - return javascript_include_tag(jqueryui) + if OFFLINE and !options.delete(:force) + return javascript_include_tag(jqueryui, options) else - [ javascript_include_tag(jquery_ui_url(name, options)), - javascript_tag("window.jQuery.ui || document.write(unescape('#{javascript_include_tag(jqueryui).gsub('<','%3C')}'))") + [ javascript_include_tag(jquery_ui_url(name), options), + javascript_tag("window.jQuery.ui || document.write(unescape('#{javascript_include_tag(jqueryui, options).gsub('<','%3C')}'))") ].join("\n").html_safe end end end