Sha256: 9f629eccfc21ff4087e984225bffe31b3e67120f853b1a53a2a9262668654e45

Contents?: true

Size: 1.2 KB

Versions: 41

Compression:

Stored size: 1.2 KB

Contents

# -*- coding: utf-8 -*-
#
# select_style.rb: a plugin for selecting styles
# Distributed under the GPL
#
# [CAUTION] You need to insert a line to tdiary.conf after "load_cgi_conf"
#    @style = @options2['style'] if @options2['style']
#

# styles
def saveconf_style
	if @mode == 'saveconf' then
		@conf['style'] = @cgi.params['style'][0]
	end
end

if @mode =~ /^(conf|saveconf)$/ then
	@conf_style_list = []
	Dir::glob( "#{::TDiary::PATH}/tdiary/{style/,}*_style.rb" ) do |style_file|
		style = File::basename( style_file ).sub( /_style\.rb$/, '' )
		@conf_style_list << style
	end
end

add_conf_proc( 'style', 'スタイル' ) do
	saveconf_style

	r = <<-HTML
	<h3 class="subtitle">スタイルの指定</h3>
	<p>スタイル (日記の文法) を指定します。</p>
	<p>
	<select name="style">
	HTML
	@conf_style_list.each do |style|
		r << %Q|<option value="#{style}"#{if (style == @conf['style']) or (!@conf['style'] && style == 'tdiary') then " selected" end}>#{style}</option>|
	end
	r << <<-HTML
	</select>
	</p>
	<p>スタイルについての詳細は<a href="http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?%A5%B9%A5%BF%A5%A4%A5%EB">スタイル - tDiary の記法</a>をごらんください。</p>
	HTML
end

Version data entries

41 entries across 35 versions & 2 rubygems

Version Path
tdiary-contrib-5.3.0 plugin/select_style.rb
tdiary-contrib-5.2.4 plugin/select_style.rb
tdiary-contrib-5.2.3 plugin/select_style.rb
tdiary-contrib-5.2.2 plugin/select_style.rb
tdiary-contrib-5.2.1 plugin/select_style.rb
tdiary-contrib-5.2.0 plugin/select_style.rb
tdiary-contrib-5.1.7 plugin/select_style.rb
tdiary-contrib-5.1.6 plugin/select_style.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/select_style.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/bundler/gems/tdiary-contrib-d1e41204db13/plugin/select_style.rb
tdiary-contrib-5.1.5 plugin/select_style.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/tdiary-contrib-5.1.4/plugin/select_style.rb
tdiary-contrib-5.1.4 plugin/select_style.rb
tdiary-contrib-5.1.3 plugin/select_style.rb
tdiary-contrib-5.1.2 plugin/select_style.rb
tdiary-contrib-5.1.1 plugin/select_style.rb
tdiary-contrib-5.1.0 plugin/select_style.rb
tdiary-contrib-5.0.13 plugin/select_style.rb
tdiary-contrib-5.0.12 plugin/select_style.rb
tdiary-contrib-5.0.11 plugin/select_style.rb