module SocialIcons::ViewHelpers
Public Instance Methods
facebook_like_button(opts = {})
click to toggle source
# File lib/social_icons/view_helpers.rb, line 30 def facebook_like_button(opts = {}) url = opts[:link] out = '<iframe src="http://www.facebook.com/plugins/like.php?href=' + url + '&layout=standard&show_faces=true&width=272&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:272px; height:80px;" allowTransparency="true"></iframe>' out end
print_social_icons(opts = {})
click to toggle source
# File lib/social_icons/view_helpers.rb, line 11 def print_social_icons(opts = {}) link = "http://" + request.env["HTTP_HOST"] + request.request_uri default_opts = {:size => 48, :link => link, :title => "", :icon_set => "default"} opts = default_opts.merge(opts) opts[:icon_path] = "social_icons/#{opts[:icon_set]}/#{opts[:size]}" out = "" out << "<div class=\"social_icons_container\">" out << "<div class=\"facebook_like_button\">#{facebook_like_button(opts)}</div>" out << "<div class=\"social_icons\">" out << "<span class=\"social_icon_twitter\">#{social_icon_twitter(opts)}</span>" out << "<span class=\"social_icon_facebook\">#{social_icon_facebook(opts)}</span>" out << "<span class=\"social_icon_delicious\">#{social_icon_delicious(opts)}</span>" out << "<span class=\"social_icon_digg\">#{social_icon_digg(opts)}</span>" out << "<span class=\"social_icon_reddit\">#{social_icon_reddit(opts)}</span>" out << "</div>" out << "</div>" out end
social_icon_delicious(opts)
click to toggle source
<a href=“delicious.com/save?url= urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>” onclick=“window.open('delicious.com/save?v=5&noui&jump=close&url= urlencode(the_permalink()); ?>&title=<?php urlencode(the_title()); ?>', 'delicious', 'toolbar=no,width=550,height=550'); return false;” title=“Bookmark this post on del.icio.us”> </a>
social_icon_digg(opts)
click to toggle source
<a title=“Digg this post” href=“digg.com/submit?phase=2&url=http%3A%2F%2Fwww.weddingbee.com%2F2009%2F03%2F11%2Fadd-share-icons-for-social-media%2F” rel=“nofollow” target=“_blank”><img alt=“Digg this post” src=“” style=“border: medium none ;”></a>
# File lib/social_icons/view_helpers.rb, line 63 def social_icon_digg(opts) icon_label = t("social_icons.digg") default_opts = {:title => "", :desc => "", :link => ""} opts = default_opts.merge(opts) out = '<a title="' + icon_label + '" href="http://digg.com/submit?phase=2&url=' + opts[:link] + '&title=' + opts[:title] + '" rel="nofollow" target="_blank">' + image_tag("#{opts[:icon_path]}/digg.png", :alt => icon_label, :title => icon_label) + '</a>' end
social_icon_facebook(opts = {})
click to toggle source
<a name=“fb_share” type=“button_count” share_url=“google.com” href=“Share