lib/scribd-carrierwave.rb in scribd-carrierwave-0.0.9 vs lib/scribd-carrierwave.rb in scribd-carrierwave-0.1.0
- old
+ new
@@ -56,10 +56,12 @@
<script type="text/javascript" src="http://www.scribd.com/javascripts/scribd_api.js"></script>
<div id="embedded_flash#{id}">#{options.delete(:alt)}</div>
<script type="text/javascript">
var scribd_doc = scribd.Document.getDoc(#{ipaper_id}, '#{ipaper_access_key}');
scribd_doc.addParam( 'jsapi_version', 2 );
- scribd_doc.addParam("hide_disabled_buttons", true)
+ #{options.map do |k,v|
+ "scribd_doc.addParam('#{k.to_s}', #{v.is_a?(String) ? "'#{v.to_s}'" : v.to_s})"
+ end.join('\n')}
scribd_doc.write("embedded_flash#{id}");
</script>
END
end