# # 00default.rb: default plugins # $Revision: 1.4 $ # # # make navigation buttons # def navi result = %Q[

\n] result << navi_user result << navi_admin result << %Q[

] end def navi_user result = '' result << %Q[トップ\n] unless @index_page.empty? result << %Q[<前日\n] if /^(day|comment)$/ =~ @mode result << %Q[翌日>\n] if /^(day|comment)$/ =~ @mode result << %Q[最新\n] unless @mode == 'latest' result end def navi_admin result = %Q[更新\n] result << %Q[設定\n] if /^(latest|month|day|comment|conf)$/ !~ @mode result end # # make calendar # def calendar result = %Q[

\n] @years.keys.sort.each do |year| result << %Q[#{year}|] @years[year.to_s].sort.each do |month| m = "#{year}#{month}" result << %Q[#{month}|] end result << "
\n" end result << "

" end # # insert file. only enable unless @secure. # def insert( file ) begin File::readlines( file ).join rescue %Q[

#$! (#{$!.type})
cannot read #{file}.

] end end # # define DOCTYPE # def doctype %Q[] end # # default HTML header # add_header_proc do <<-HEADER #{author_name_tag} #{author_mail_tag} #{index_page_tag} #{css_tag.chomp} #{title_tag.chomp} HEADER end def author_name_tag if @author_name then %Q[] else '' end end def author_mail_tag if @author_mail then %Q[] else '' end end def index_page_tag if @index_page and @index_page.size > 0 then %Q[] else '' end end def theme_url; 'theme'; end def css_tag if @theme and @theme.length > 0 then css = "#{theme_url}/#{@theme}.css" else css = @css end <<-CSS CSS end def title_tag r = "#{@html_title}" case @mode when 'day', 'comment' r << "(#{@date.strftime( '%Y-%m-%d' )})" if @date when 'month' r << "(#{@date.strftime( '%Y-%m' )})" if @date when 'form' r << '(更新)' when 'append', 'replace' r << '(更新完了)' when 'showcomment' r << '(変更完了)' when 'conf' r << '(設定)' when 'saveconf' r << '(設定完了)' end r << '' end # # make anchor string # def anchor( s ) if /^(\d+)#?([pc]\d*)?$/ =~ s then if $2 then "?date=#$1##$2" else "?date=#$1" end else "" end end # # make anchor tag in my diary # def my( a, str ) %Q[#{str}] end # # referer of today # def referer_of_today_short( diary, limit ) return '' if not diary or diary.count_referers == 0 result = %Q[

#{referer_today} | ] diary.each_referer( limit ) do |count,ref| result << %Q[#{count} | ] end result + '

' end def referer_of_today_long( diary, limit ) return '' if not diary or diary.count_referers == 0 result = %Q[

#{referer_today}

\n] result << %Q[
' end # # labels # def comment_today; '本日のツッコミ'; end def comment_total( total ); "(全#{total}件)"; end def comment_new; 'ツッコミを入れる'; end def comment_description; 'ツッコミ・コメントがあればどうぞ! E-mailアドレスは公開されません。'; end def comment_description_short; 'ツッコミ!!'; end def comment_name_label; 'お名前'; end def comment_name_label_short; '名前'; end def comment_mail_label; 'E-mail'; end def comment_mail_label_short; 'Mail'; end def comment_body_label; 'コメント'; end def comment_body_label_short; '本文'; end def comment_submit_label; '投稿'; end def comment_submit_label_short; '投稿'; end def comment_date( time ); time.strftime( "(#{@date_format} %H:%M)" ); end def referer_today; '本日のリンク元'; end def submit_command if @mode == 'form' then 'append' else 'replace' end end def submit_label if @mode == 'form' then '追加' else '登録' end end