module Octopress::Social::GooglePlus

Constants

DEFAULTS
HEIGHT

Attributes

config[RW]
url[RW]

Public Instance Methods

count(type) click to toggle source
# File lib/octopress-social/google-plus.rb, line 59
def count(type)
  if config["#{type}_count"]
    %Q{data-annotation="bubble"}
  else
    %Q{data-annotation="none"}
  end
end
gplus_follow_button(*args) click to toggle source
# File lib/octopress-social/google-plus.rb, line 47
def gplus_follow_button(*args)
  %Q{<div class="g-follow" #{count('follow')} #{height} data-href="//plus.google.com/u/0/#{config['userid']}" data-rel="author"></div>}
end
gplus_one_button(site, item) click to toggle source
# File lib/octopress-social/google-plus.rb, line 39
def gplus_one_button(site, item)
  %Q{<div class="g-plusone" data-href="#{Social.full_url(site, item)}" #{count('share')} #{width} #{size}></div>}
end
gplus_script_tag(site, item) click to toggle source
# File lib/octopress-social/google-plus.rb, line 87
def gplus_script_tag(site, item)
  %Q{
    <script type="text/javascript">
      #{Octopress::Social::GooglePlus.lang(item)}
      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/platform.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>
  }
end
gplus_share_button(site, item) click to toggle source
# File lib/octopress-social/google-plus.rb, line 43
def gplus_share_button(site, item)
  %Q{<div class="g-plus" data-action="share" data-href="#{Social.full_url(site, item)}" #{count('share')} #{width} #{size}></div>}
end
height() click to toggle source
# File lib/octopress-social/google-plus.rb, line 75
def height
  %Q{data-height="#{HEIGHT[config['size']]}"}
end
lang(item) click to toggle source
# File lib/octopress-social/google-plus.rb, line 79
def lang(item)
  if item['lang']
    "window.___gcfg = {lang: '#{item['lang']}'};"
  else
    ''
  end
end
size() click to toggle source
# File lib/octopress-social/google-plus.rb, line 71
def size
  %Q{data-size="#{config['size']}"}
end
width() click to toggle source
# File lib/octopress-social/google-plus.rb, line 67
def width
  %Q{data-width="#{config['width']}"}
end