lib/papermill/papermill_helper.rb in papermill-0.6.0 vs lib/papermill/papermill_helper.rb in papermill-0.6.1

- old
+ new

@@ -8,22 +8,19 @@ # If you changed the location of papermill.js, you'll need to set :root_folder (defaults to "javascripts") def papermill_javascript_tag(options = {}) html = [] root_folder = options[:path] || "javascripts" if options[:with_jquery] || options[:with_jqueryui] - html << %{<script src="http://www.google.com/jsapi"></script>} - html << %{<script type="text/javascript">} - html << %{google.load("jquery", "1");} if options[:with_jquery] - html << %{google.load("jqueryui", "1");} if options[:with_jquery] || options[:with_jqueryui_only] - html << %{jQuery.noConflict();} if options[:with_jquery] == "no_conflict" - html << %{</script>} + html << %{<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"</script>} if options[:with_jquery] + html << %{<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"</script>} if options[:with_jquery] || options[:with_jqueryui_only] + html << %{<script type="text/javascript">jQuery.noConflict();</script>} if options[:with_jquery] == "no_conflict" end html << %{<script src="http://swfupload.googlecode.com/svn/swfupload/tags/swfupload_v2.2.0_core/swfupload.js"></script>} - html << %{<script type="text/javascript">\n//<![CDATA[} + html << %{<script type="text/javascript">} ["SWFUPLOAD_PENDING", "SWFUPLOAD_LOADING", "SWFUPLOAD_ERROR"].each do |js_constant| html << %{var #{js_constant} = "#{I18n.t(js_constant, :scope => "papermill")}";} end - html << %{//]]>\n</script>} + html << %{</script>} html << javascript_include_tag("/#{root_folder}/papermill", :cache => "swfupload-papermill") unless @content_for_papermill_inline_js.blank? html << '<script type="text/javascript">jQuery(document).ready(function() {' html << @content_for_papermill_inline_js html << '});</script>' \ No newline at end of file