Module: Jaap3::Addthis::Helper
- Defined in:
- lib/addthis.rb
Instance Method Summary collapse
- #addthis_bookmark_button(*args) ⇒ Object (also: #addthis_share_button)
- #addthis_email_button(*args) ⇒ Object
- #addthis_feed_button(url, *args) ⇒ Object
Instance Method Details
#addthis_bookmark_button(*args) ⇒ Object Also known as:
24 25 26 27 28 29 30 |
# File 'lib/addthis.rb', line 24 def (*args) url, = (args) [:button_html] = yield if block_given? = BOOKMARK_BUTTON_DEFAULTS.merge() s = %Q{<a href="http://www.addthis.com/bookmark.php?v=20" onmouseover="#{addthis_open("", url, [:page_title])}" onmouseout="addthis_close()" onclick="return addthis_sendto()" title="#{[:title]}">} addthis_tag(s, ) end |
#addthis_email_button(*args) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/addthis.rb', line 33 def (*args) url, = (args) [:button_html] = yield if block_given? = EMAIL_BUTTON_DEFAULTS.merge() s = %Q{<a href="http://www.addthis.com/bookmark.php" onclick="#{addthis_open("email", url, [:page_title])}" title="#{[:title]}">} addthis_tag(s, ) end |
#addthis_feed_button(url, *args) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/addthis.rb', line 41 def (url, *args) = FEED_BUTTON_DEFAULTS.merge((args)) [:button_html] = yield if block_given? s = %Q{<a href="http://www.addthis.com/feed.php?pub=#{[:publisher]}&h1=#{url.gsub(/[^a-zA-Z0-9_\.\-]/n) {|c| sprintf('%%%02x', c[0]) }}&t1=" onclick="#{addthis_open("feed", url)}" title="#{[:title]}" target="_blank">} addthis_tag(s, ) end |