Sha256: 0cbccc4c1f25128a780104bc82912f8cfd96256b69d5185ed4445e8abacfbce4

Contents?: true

Size: 1.07 KB

Versions: 20

Compression:

Stored size: 1.07 KB

Contents

# edit_today.rb : add link to edit after title of each days.
#
# Copyright (C) 2007 by NOB <nob@harunaru.com>
# You can redistribute it and/or modify it under GPL2.
#

def edit_today_init
	@conf['edit_today.caption'] ||= @edit_today_caption
end

add_title_proc do |date,title|
	edit_today_link( date, title )
end

def edit_today_link( date, title )
	unless /^(day|preview)$/ =~ @mode
		edit_today_init
		caption = @conf['edit_today.caption']
		unless @cgi.mobile_agent?
			r = <<-HTML
			#{title}\n<span class="edit-today">
			<a href="#{@update}?edit=true;#{date.strftime( 'year=%Y;month=%m;day=%d' )}" title="#{edit_today_edit_label( date )}" rel="nofollow">#{caption}</a>
			</span>
			HTML
		else
			title
		end
	else
		title
	end
end

def edit_today_saveconf
	if @mode == 'saveconf' then
		@conf['edit_today.caption'] = @cgi.params['edit_today_caption'][0]
	end
end

add_conf_proc( 'edit_today', @edit_today_caption, 'update' ) do
	edit_today_saveconf
	edit_today_init
	edit_today_conf_html
end

# Local Variables:
# mode: ruby
# indent-tabs-mode: t
# tab-width: 3
# ruby-indent-level: 3
# End:

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
tdiary-4.0.4 misc/plugin/edit_today.rb
tdiary-4.0.3 misc/plugin/edit_today.rb
tdiary-4.0.2.20140201 misc/plugin/edit_today.rb
tdiary-4.0.2 misc/plugin/edit_today.rb
tdiary-4.0.1.20131102 misc/plugin/edit_today.rb
tdiary-4.0.1.20130929 misc/plugin/edit_today.rb
tdiary-4.0.1.20130903 misc/plugin/edit_today.rb
tdiary-4.0.1 misc/plugin/edit_today.rb
tdiary-4.0.0.20130826 misc/plugin/edit_today.rb
tdiary-4.0.0 misc/plugin/edit_today.rb
tdiary-3.2.2.20130727 misc/plugin/edit_today.rb
tdiary-3.2.2.20130722 misc/plugin/edit_today.rb
tdiary-3.2.2.20130720 misc/plugin/edit_today.rb
tdiary-3.2.2.20130617 misc/plugin/edit_today.rb
tdiary-3.2.2.20130614 misc/plugin/edit_today.rb
tdiary-3.2.2.20130604 misc/plugin/edit_today.rb
tdiary-3.2.2.20130527 misc/plugin/edit_today.rb
tdiary-3.2.2.20130518 misc/plugin/edit_today.rb
tdiary-3.2.2.20130508 misc/plugin/edit_today.rb
tdiary-3.2.2.20130507 misc/plugin/edit_today.rb