# encoding: utf-8 module PapermillHelper # Sets all the javascript needed for papermill. # If you already loaded jQuery and JQueryUI, call papermill_javascript_tag # If you don't use jQuery or use some other library, call papermill_javascript_tag(:with_jquery => "no_conflict") # If you want to rely on this helper to load jQuery/jQueryUI and use it, call papermill_javascript_tag(:with_jquery => true) # If you loaded jQuery and need to load only jQueryUI, call papermill_javascript_tag(:with_jqueryui_only => true) def papermill_javascript_tag(options = {}) html = [] if options[:with_jquery] || options[:with_jqueryui_only] html << %{} if options[:with_jquery] html << %{} if options[:with_jquery] || options[:with_jqueryui_only] html << %{} if options[:with_jquery].to_s == "no_conflict" end html << %{} html << javascript_include_tag("/papermill/papermill", "/papermill/swfupload") unless @content_for_papermill_inline_js.blank? html << '' end html.join("\n") end # Sets the css tags needed for papermill. def papermill_stylesheet_tag(options = {}) html = [] html << stylesheet_link_tag("/papermill/papermill") unless @content_for_papermill_inline_css.blank? html << %{} end html.join("\n") end end