Sha256: 489796e9af1aa042b97947f97e976159ff81c093c0e1d69e2e34b1d47145ef84

Contents?: true

Size: 1.07 KB

Versions: 51

Compression:

Stored size: 1.07 KB

Contents

#
# twitter_badge.rb: insert 'Follow me' badge of Twitter.
#
# Copyright (C) 2010 TADA Tadashi <t@tdtds.jp>
# You can redistribute it and/or modify it under GPL2.
#

def twitter_badge( account, opt = {} )
	return '' unless account
	@twitter_badge_setting = {
		:account => account,
		:label => (opt[:label] || 'follow-me'),
		:color => (opt[:color] || '#35ccff'),
		:side => (opt[:side] || 'right')[0,1],
		:top => (opt[:top] || 136).to_i,
		:delay => (opt[:delay] || 5).to_i * 1000,
	}
	'' # do nothing in this method.
end

add_footer_proc do
	if @twitter_badge_setting then
		t = @twitter_badge_setting
		<<-TEXT
		<!-- Twitter follow badge by go2web20 -->
		<script src="http://www.go2web20.net/twitterfollowbadge/1.0/badge.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript"><!--
		tfb.account = '#{t[:account]}';
		tfb.label = '#{t[:label]}';
		tfb.color = '#{t[:color]}';
		tfb.side = '#{t[:side]}';
		tfb.top = #{t[:top]};
		setTimeout( tfb.showbadge, #{t[:delay]} );
		//-->
		</script>
		<!-- end of Twitter follow badge -->
		TEXT
	else
		''
	end
end

Version data entries

51 entries across 45 versions & 2 rubygems

Version Path
tdiary-contrib-5.3.0 plugin/twitter_badge.rb
tdiary-contrib-5.2.4 plugin/twitter_badge.rb
tdiary-contrib-5.2.3 plugin/twitter_badge.rb
tdiary-contrib-5.2.2 plugin/twitter_badge.rb
tdiary-contrib-5.2.1 plugin/twitter_badge.rb
tdiary-contrib-5.2.0 plugin/twitter_badge.rb
tdiary-contrib-5.1.7 plugin/twitter_badge.rb
tdiary-contrib-5.1.6 plugin/twitter_badge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/twitter_badge.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/bundler/gems/tdiary-contrib-d1e41204db13/plugin/twitter_badge.rb
tdiary-contrib-5.1.5 plugin/twitter_badge.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/twitter_badge.rb
tdiary-contrib-5.1.4 plugin/twitter_badge.rb
tdiary-contrib-5.1.3 plugin/twitter_badge.rb
tdiary-contrib-5.1.2 plugin/twitter_badge.rb
tdiary-contrib-5.1.1 plugin/twitter_badge.rb
tdiary-contrib-5.1.0 plugin/twitter_badge.rb
tdiary-contrib-5.0.13 plugin/twitter_badge.rb
tdiary-contrib-5.0.12 plugin/twitter_badge.rb
tdiary-contrib-5.0.11 plugin/twitter_badge.rb