tdiary-blogkit 5.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,92 @@
1
+ # blog-style.rb: customize to blog like labels. $Revision: 1.11 $
2
+ #
3
+ # Copyright (c) 2011 TADA Tadashi <t@tdtds.jp>
4
+ # Distributed under the GPL
5
+ #
6
+ # THIS PLUGIN IS ALMOST MADE BY LANGUAGE RESOURCE. SEE ja OR en DIRECTORY.
7
+ #
8
+
9
+ def blogkit?
10
+ true
11
+ end
12
+ add_js_setting( '$tDiary.blogkit', "true" )
13
+
14
+ #
15
+ # title
16
+ #
17
+ alias title_tag_ title_tag
18
+ def title_tag
19
+ case @mode
20
+ when 'day'
21
+ diary = @diaries[@date.strftime('%Y%m%d')]
22
+ if diary
23
+ title = %Q|#{Style::BaseDiary.method_defined?(:stripped_title) ? diary.stripped_title : diary.title}|
24
+ return "<title>#{h @html_title} - #{h title}</title>"
25
+ else
26
+ return title_tag_
27
+ end
28
+ when 'month'
29
+ list = @years.keys.collect {|y| @years[y].collect {|m| "#{y}#{m}"}}.flatten.push( nil ).unshift( nil )
30
+ index = list.index( @date.strftime("%Y%m") )
31
+ return "<title>#{h @html_title} - #{'%05d' % index}</title>"
32
+ else
33
+ return title_tag_
34
+ end
35
+ end
36
+
37
+ #
38
+ # without anchor in subtitle
39
+ #
40
+ def subtitle_link( date, index, subtitle )
41
+ r = ''
42
+ if subtitle
43
+ if respond_to?( :category_anchor ) then
44
+ r << subtitle.sub( /^(\[([^\[]+?)\])+/ ) do
45
+ $&.gsub( /\[(.*?)\]/ ) do
46
+ $1.split( /,/ ).collect do |c|
47
+ category_anchor( "#{c}" )
48
+ end.join
49
+ end
50
+ end
51
+ else
52
+ r << subtitle
53
+ end
54
+ end
55
+ r
56
+ end
57
+
58
+ #
59
+ # disable section specify in sending TrackBack
60
+ #
61
+ @conf['tb.no_section'] = true
62
+
63
+ #
64
+ # hide date fields on form
65
+ #
66
+ def blog_style_date_field
67
+ if /^(form|edit|preview|showcomment)$/ =~ @mode then
68
+ <<-HTML
69
+ <style type="text/css"><!--
70
+ form.update span.year,
71
+ form.update span.month,
72
+ form.update span.day,
73
+ form.update span.edit {
74
+ display: none;
75
+ }
76
+ --></style>
77
+ HTML
78
+ else
79
+ ''
80
+ end
81
+ end
82
+
83
+ add_header_proc do
84
+ blog_style_date_field
85
+ end
86
+
87
+ # Local Variables:
88
+ # mode: ruby
89
+ # indent-tabs-mode: t
90
+ # tab-width: 3
91
+ # ruby-indent-level: 3
92
+ # End:
@@ -0,0 +1,24 @@
1
+ # blog-category.rb $Revision: 1.4 $
2
+ #
3
+ # resource file for blog-category.rb
4
+ #
5
+ # Copyright (c) 2003 Junichiro KITA <kita@kitaj.no-ip.com>
6
+ # Distributed under the GPL
7
+ #
8
+
9
+ @blog_category_conf_label = 'Categorize BlogKit'
10
+ @blog_category_desc_label = <<HTML
11
+ <h3 class="subtitle">Initialization of category index</h3>
12
+ <p>The category feature of the BlogKit won't work until you initialize category index. Push the button bellow and tDiary initialize category index for you. It takes time if you have so many articles.</p>
13
+ <p>When you add or update an article, category index is automatically updated, so initialization is needed once.</p>
14
+ <p>If you remove @cache_path/blog_category accidentally or there's something wrong with category feature, try to re-initialize category index.</p>
15
+ <input type="hidden" name="blog_category_initialize" value="true">
16
+ HTML
17
+
18
+ # Local Variables:
19
+ # mode: ruby
20
+ # indent-tabs-mode: t
21
+ # tab-width: 3
22
+ # ruby-indent-level: 3
23
+ # End:
24
+ # vim: ts=3
@@ -0,0 +1,108 @@
1
+ # blog-style.rb: English recource of BlogKit. $Revision: 1.2 $
2
+ #
3
+ # Copyright (c) 2002 TADA Tadashi <sho@spc.gr.jp>
4
+ # Distributed under the GPL
5
+ #
6
+ def no_diary
7
+ "Article ##{@date.strftime( '%Y%m%d' )} does not exist."
8
+ end
9
+
10
+ def comment_today
11
+ 'Comments'
12
+ end
13
+
14
+ def comment_total( total )
15
+ "(#{total})"
16
+ end
17
+
18
+ def comment_new
19
+ 'Post a comment'
20
+ end
21
+
22
+ def comment_description_default
23
+ 'Post a comment please. Your Email address will not show in this page.'
24
+ end
25
+
26
+ def comment_description_short
27
+ 'Post a comment'
28
+ end
29
+
30
+ def comment_name_label
31
+ 'Name'
32
+ end
33
+
34
+ def comment_name_label_short
35
+ 'Name'
36
+ end
37
+
38
+ def comment_mail_label
39
+ 'Email Address'
40
+ end
41
+
42
+ def comment_mail_label_short
43
+ 'Email'
44
+ end
45
+
46
+ def comment_body_label
47
+ 'Comments'
48
+ end
49
+
50
+ def comment_body_label_short
51
+ 'Comments'
52
+ end
53
+
54
+ def comment_submit_label
55
+ 'Post'
56
+ end
57
+
58
+ def comment_submit_label_short
59
+ 'Post'
60
+ end
61
+
62
+ def comment_date( time )
63
+ format = @options['blog.date_format'] || 'on %B %d, %Y %H:%M'
64
+ time.strftime( format )
65
+ end
66
+
67
+ def referer_today
68
+ "Today's Link"
69
+ end
70
+
71
+ def navi_index
72
+ 'Index'
73
+ end
74
+
75
+ def navi_latest
76
+ 'Main'
77
+ end
78
+
79
+ def navi_update
80
+ "Update"
81
+ end
82
+
83
+ def navi_edit
84
+ "Edit"
85
+ end
86
+
87
+ def navi_preference
88
+ "Preference"
89
+ end
90
+
91
+ def navi_prev_ndays
92
+ "Prev #{@conf.latest_limit} entries"
93
+ end
94
+
95
+ def navi_next_ndays
96
+ "Next #{@conf.latest_limit} entries"
97
+ end
98
+
99
+ def label_hidden_diary
100
+ 'This article is now HIDDEN.'
101
+ end
102
+
103
+ # Local Variables:
104
+ # mode: ruby
105
+ # indent-tabs-mode: t
106
+ # tab-width: 3
107
+ # ruby-indent-level: 3
108
+ # End:
@@ -0,0 +1,18 @@
1
+ # whatsnew-list.rb English resources
2
+
3
+ if /conf/ =~ @mode then
4
+ @whatsnew_list_label_rdf_out = 'Generate feed(RSS) file'
5
+ @whatsnew_list_label_rdf_out_notice = 'Generate RDF into index.rdf when updating your diary. index.rdf have to be writable via web server process.'
6
+ @whatsnew_list_label_rdf_out_yes = 'ON'
7
+ @whatsnew_list_label_rdf_out_no = 'OFF'
8
+ @whatsnew_list_msg_access = ': Access denied. Confirm permission.'
9
+ end
10
+
11
+ @whatsnew_list_edit_label = "A little modify (don't update feed)"
12
+
13
+ # Local Variables:
14
+ # mode: ruby
15
+ # indent-tabs-mode: t
16
+ # tab-width: 3
17
+ # ruby-indent-level: 3
18
+ # End:
@@ -0,0 +1,25 @@
1
+ # -*- coding: utf-8 -*-
2
+ # blog-category.rb $Revision: 1.4 $
3
+ #
4
+ # resource file for blog-category.rb
5
+ #
6
+ # Copyright (c) 2003 Junichiro KITA <kita@kitaj.no-ip.com>
7
+ # Distributed under the GPL
8
+ #
9
+
10
+ @blog_category_conf_label = 'BlogKitカテゴリ'
11
+ @blog_category_desc_label = <<HTML
12
+ <h3 class="subtitle">カテゴリイデックスの初期化</h3>
13
+ <p>BlogKitのカテゴリ機能はカテゴリインデックスを初期化しないと使用できません。下のOKボタンを押すとカテゴリインデックスの初期化を実行します。記事の量が多い場合は多少時間がかかるかもしれません。</p>
14
+ <p>記事を追加したり更新した時は,自動的にカテゴリ情報がインデックスに追加されますので、初期化は一度で結構です。</p>
15
+ <p>キャッシュディレクトリにあるblog_categoryというファイルを消してしまったり、カテゴリの情報がおかしくなってしまった場合は、再度カテゴリインデックスを初期化してください。</p>
16
+ <input type="hidden" name="blog_category_initialize" value="true">
17
+ HTML
18
+
19
+ # Local Variables:
20
+ # mode: ruby
21
+ # indent-tabs-mode: t
22
+ # tab-width: 3
23
+ # ruby-indent-level: 3
24
+ # End:
25
+ # vim: ts=3
@@ -0,0 +1,108 @@
1
+ # blog-style.rb: Japanese resource of BlogKit. $Revision: 1.2 $
2
+ #
3
+ # Copyright (c) 2003 TADA Tadashi <sho@spc.gr.jp>
4
+ # Distributed under the GPL
5
+ #
6
+ def no_diary
7
+ "記事番号##{@date.strftime( '%Y%m%d' )}は存在しません。"
8
+ end
9
+
10
+ def comment_today
11
+ 'コメント'
12
+ end
13
+
14
+ def comment_total( total )
15
+ "(#{total})"
16
+ end
17
+
18
+ def comment_new
19
+ 'コメントを投稿する'
20
+ end
21
+
22
+ def comment_description_default
23
+ 'コメントを投稿してください。E-mailアドレスは公開されません。'
24
+ end
25
+
26
+ def comment_description_short
27
+ 'コメントを投稿する'
28
+ end
29
+
30
+ def comment_name_label
31
+ '名前'
32
+ end
33
+
34
+ def comment_name_label_short
35
+ '名前'
36
+ end
37
+
38
+ def comment_mail_label
39
+ 'E-mail'
40
+ end
41
+
42
+ def comment_mail_label_short
43
+ 'E-mail'
44
+ end
45
+
46
+ def comment_body_label
47
+ 'コメント'
48
+ end
49
+
50
+ def comment_body_label_short
51
+ 'コメント'
52
+ end
53
+
54
+ def comment_submit_label
55
+ '投稿'
56
+ end
57
+
58
+ def comment_submit_label_short
59
+ '投稿'
60
+ end
61
+
62
+ def comment_date( time )
63
+ format = @options['blog.date_format'] || '(%Y-%m-%d %H:%M)'
64
+ time.strftime( format )
65
+ end
66
+
67
+ def referer_today
68
+ "本日のリンク元"
69
+ end
70
+
71
+ def navi_index
72
+ 'トップ'
73
+ end
74
+
75
+ def navi_latest
76
+ '最新'
77
+ end
78
+
79
+ def navi_update
80
+ "更新"
81
+ end
82
+
83
+ def navi_edit
84
+ "編集"
85
+ end
86
+
87
+ def navi_preference
88
+ "設定"
89
+ end
90
+
91
+ def navi_prev_ndays
92
+ "前#{@conf.latest_limit}件"
93
+ end
94
+
95
+ def navi_next_ndays
96
+ "次#{@conf.latest_limit}件"
97
+ end
98
+
99
+ def label_hidden_diary
100
+ 'この記事は現在、隠されています。'
101
+ end
102
+
103
+ # Local Variables:
104
+ # mode: ruby
105
+ # indent-tabs-mode: t
106
+ # tab-width: 3
107
+ # ruby-indent-level: 3
108
+ # End:
@@ -0,0 +1,18 @@
1
+ # whatsnew-list.rb Japanese resources
2
+
3
+ if /conf/ =~ @mode then
4
+ @whatsnew_list_label_rdf_out = 'フィード(RSS)ファイルの生成'
5
+ @whatsnew_list_label_rdf_out_notice = '更新があるたびに、日記のトップページにindex.rdfというファイルを生成します。index.rdfにはWebサーバが書き込める権限が必要です。'
6
+ @whatsnew_list_label_rdf_out_yes = '生成する'
7
+ @whatsnew_list_label_rdf_out_no = '生成しない'
8
+ @whatsnew_list_msg_access = 'に書き込めません。パーミッションを確認してください。'
9
+ end
10
+
11
+ @whatsnew_list_edit_label = 'ちょっとした修正(フィードを更新しない)'
12
+
13
+ # Local Variables:
14
+ # mode: ruby
15
+ # indent-tabs-mode: t
16
+ # tab-width: 3
17
+ # ruby-indent-level: 3
18
+ # End:
data/plugin/lm.rb ADDED
@@ -0,0 +1,42 @@
1
+ # lm.rb: show last-modified before/after article body. $Revision: 1.4 $
2
+ #
3
+ # This plugin run only copy to plugin directory.
4
+ # You can customize in tdiary.conf:
5
+ # @options['lm.bottom']: show below the article (default: false )
6
+ # @options['lm.style']: date format (default: 'Last Update: %Y-%m-%d %H:%M:%S')
7
+ #
8
+ # notice:
9
+ # After a comment posting, this value will change without your
10
+ # modify of the article. This is a specification of tDiary.
11
+ #
12
+ # Copyright (c) 2002 TADA Tadashi <sho@spc.gr.jp>
13
+ # Distributed under the GPL
14
+ #
15
+ def lm( date, leave = false )
16
+ return '' if feed?
17
+
18
+ bottom = @options['lm.bottom'] || false
19
+ style = @options['lm.style'] || 'Last Update: %Y-%m-%d %H:%M:%S'
20
+ diary = @diaries[date.strftime( '%Y%m%d' )]
21
+ if diary and !(leave ^ bottom) then
22
+ %Q|<div class="lm"><span class="lm">#{diary.last_modified.strftime( style )}</span></div>|
23
+ else
24
+ ''
25
+ end
26
+ end
27
+
28
+ add_body_enter_proc do |date|
29
+ lm( date, false )
30
+ end
31
+
32
+ add_body_leave_proc do |date|
33
+ lm( date, true )
34
+ end
35
+
36
+
37
+ # Local Variables:
38
+ # mode: ruby
39
+ # indent-tabs-mode: t
40
+ # tab-width: 3
41
+ # ruby-indent-level: 3
42
+ # End: