# add_bookmark.rb $Revision 1.3 $ # # Copyright (c) 2005 SHIBATA Hiroshi # You can redistribute it and/or modify it under GPL2. require 'uri' def bookmark_init @conf['add.bookmark.delicious'] ||= '' @conf['add.bookmark.hatena'] ||= '' @conf['add.bookmark.livedoor'] ||= '' @conf['add.bookmark.buzzurl'] ||= '' end add_subtitle_proc do |date, index, subtitle| bookmark_init caption = %Q|#{subtitle} | section_url = @conf.base_url + anchor(date.strftime('%Y%m%d')) + '#p' + ('%02d' % index) if @conf['add.bookmark.delicious'] == 't' then escaped_url = CGI.escape(section_url) caption += %Q|| caption += %Q|#{@caption_delicious}| caption += %Q| | end if @conf['add.bookmark.hatena'] == 't' then caption += %Q|| caption += %Q|#{@caption_hatena}| caption += %Q| | end if @conf['add.bookmark.livedoor'] == 't' then caption += %Q|| caption += %Q|#{@caption_livedoor}| caption += %Q| | end if @conf['add.bookmark.buzzurl'] == 't' then caption += %Q|| caption += %Q|#{@caption_buzzurl}| caption += %Q| | end <<-HTML #{caption} HTML end add_conf_proc( 'add_bookmark', @add_bookmark_label ) do add_bookmark_conf_proc end def add_bookmark_conf_proc bookmark_init saveconf_add_bookmark bookmark_categories = [ 'add.bookmark.delicious', 'add.bookmark.hatena', 'add.bookmark.livedoor', 'add.bookmark.buzzurl' ] r = '' r << %Q|

#{@add_bookmark_label}

#{@add_bookmark_desc}

| end if @mode == 'saveconf' def saveconf_add_bookmark @conf['add.bookmark.delicious'] = @cgi.params['add.bookmark.delicious'][0] @conf['add.bookmark.hatena'] = @cgi.params['add.bookmark.hatena'][0] @conf['add.bookmark.livedoor'] = @cgi.params['add.bookmark.livedoor'][0] @conf['add.bookmark.buzzurl'] = @cgi.params['add.bookmark.buzzurl'][0] end end