lib/scribd_fu.rb in scribd_fu-2.0.9 vs lib/scribd_fu.rb in scribd_fu-2.0.10

- old
+ new

@@ -1,8 +1,8 @@ module ScribdFu - ConfigPath = "#{RAILS_ROOT}/config/scribd_fu.yml".freeze + ConfigPath = "#{::Rails.root.to_s}/config/scribd_fu.yml".freeze # A list of content types supported by iPaper. ContentTypes = [ 'application/pdf', 'application/msword', @@ -34,11 +34,11 @@ CLOUD_FRONT = /^http:\/\/[A-Za-z0-9]*.cloudfront.net/ # Available parameters for the JS API # http://www.scribd.com/publisher/api/api?method_name=Javascript+API Available_JS_Params = [ :height, :width, :page, :my_user_id, :search_query, - :jsapi_version, :disable_related_docs, :mode, :auto_size ] + :jsapi_version, :disable_related_docs, :mode, :auto_size, :hide_disabled_buttons, :hide_full_screen_button] class ScribdFuError < StandardError #:nodoc: end class ScribdFuUploadError < ScribdFuError #:nodoc: @@ -245,10 +245,16 @@ # Check and collect any Javascript params that might have been passed in def js_params(options) opt = [] options.each_pair do |k, v| - opt << "scribd_doc.addParam('#{k}', '#{v}');" if Available_JS_Params.include?(k) + if Available_JS_Params.include?(k) + if v == true || v == false + opt << "scribd_doc.addParam('#{k}', #{v});" + else + opt << "scribd_doc.addParam('#{k}', '#{v}');" + end + end end opt.compact.join("\n") end