Sha256: 4d25c1e5f3c69d4ad93b42d8a931ad15c90a97735fca11d57070607499cee345

Contents?: true

Size: 986 Bytes

Versions: 11

Compression:

Stored size: 986 Bytes

Contents

# hb_footer4sec_js.rb $Revision 1.0 $
#
# Copyright (c) 2008 SHIBATA Hiroshi <h-sbt@nifty.com>
# You can redistribute it and/or modify it under GPL2.
#

def permalink( date, index, escape = true )
	ymd = date.strftime( "%Y%m%d" )
	uri = @conf.index.dup
	uri.sub!( %r|\A(?!https?://)|i, @conf.base_url )
	uri.gsub!( %r|/\.(?=/)|, "" ) # /././ -> /
	link = uri + anchor( "#{ymd}p%02d" % index )
	link.sub!( "#", "%23" ) if escape
	link
end

add_section_leave_proc do |date, index|
	if @mode == 'day' and not bot? and not @conf.mobile_agent? then
		<<-SCRIPT
		<script type= "text/javascript"><!--
		var hatena_bookmark_anywhere_limit = 10;
		var hatena_bookmark_anywhere_style = true;
		var hatena_bookmark_anywhere_collapse = true;
		var hatena_bookmark_anywhere_url = "#{permalink(date, index)}";
		//--></script>
		<script src="#{@conf.base_url}hatena-bookmark-anywhere.js" type="text/javascript" charset="utf-8"></script>
		<div id="hatena_bookmark_anywhere"></div>
		SCRIPT
	end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tdiary-contrib-4.1.3 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.1.2 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.1.1 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.1.0 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.0.5.1 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.0.4 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.0.3 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.0.2.1 plugin/hb_footer4sec_js.rb
tdiary-contrib-4.0.2 plugin/hb_footer4sec_js.rb
tdiary-contrib-3.2.2.20130614 plugin/hb_footer4sec_js.rb
tdiary-contrib-3.2.2.20130518 plugin/hb_footer4sec_js.rb