misc/plugin/xmlrpc/xmlrpc.rb in tdiary-4.0.2.20140201 vs misc/plugin/xmlrpc/xmlrpc.rb in tdiary-4.0.3
- old
+ new
@@ -42,11 +42,11 @@
diary = tdiary[time] || tdiary.instance_variable_get(:@io).diary_factory(time, '', '', @conf.style)
title,body = content.split(/\n/,2)
index = diary.add_section(title, body)
src = diary.to_src
-
+
@cgi.params.delete 'date'
@cgi.params['old'] = [postid]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@@ -76,11 +76,11 @@
tdiary = ::TDiary::TDiaryDay::new( @cgi, "day.rhtml", @conf )
year, month, day, index = postid.scan(/(\d{4})(\d\d)(\d\d)(\d\d)/)[0]
index = index.to_i
time = Time::local( year, month, day ) + 12*60*60
diary = tdiary[time]
-
+
src = ''
i = 0
diary.each_section {|sec|
i += 1
if i==index
@@ -88,11 +88,11 @@
sec.subtitle = subtitle
sec.body = (body || '').sub(/[\n\r]+\Z/, '') + "\n\n"
end
src << sec.to_src
}
-
+
@cgi.params.delete 'date'
@cgi.params['old'] = [postid[0,8]]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@@ -121,14 +121,14 @@
index = index.to_i
@cgi.params['date'] = [postid[0,8]]
tdiary = ::TDiary::TDiaryDay::new( @cgi, "day.rhtml", @conf )
time = Time::local( year, month, day ) + 12*60*60
diary = tdiary[time]
-
+
diary.delete_section(index)
src = diary.to_src
-
+
@cgi.params.delete 'date'
@cgi.params['old'] = [postid[0,8]]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@@ -214,14 +214,14 @@
year, month, day = postid.scan(/(\d{4})(\d\d)(\d\d)/)[0]
@cgi.params['date'] = [postid]
tdiary = ::TDiary::TDiaryDay::new( @cgi, "day.rhtml", @conf )
time = Time::local( year, month, day ) + 12*60*60
diary = tdiary[time] || tdiary.instance_variable_get(:@io).diary_factory(time, '', '', @conf.style)
-
+
index = diary.add_section(content['title'], content['description'])
src = diary.to_src
-
+
@cgi.params.delete 'date'
@cgi.params['old'] = [postid]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@@ -248,22 +248,22 @@
tdiary = ::TDiary::TDiaryDay::new( @cgi, "day.rhtml", @conf )
year, month, day, index = postid.scan(/(\d{4})(\d\d)(\d\d)(\d\d)/)[0]
index = index.to_i
time = Time::local( year, month, day ) + 12*60*60
diary = tdiary[time]
-
+
src = ''
i = 0
diary.each_section {|sec|
i += 1
if i==index
sec.subtitle = content['title']
sec.body = content['description'] || ''.sub(/[\n\r]+\Z/, '') + "\n\n"
end
src << sec.to_src
}
-
+
@cgi.params.delete 'date'
@cgi.params['old'] = [postid[0,8]]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@@ -476,11 +476,11 @@
index = index.to_i
time = Time::local( year, month, day ) + 12*60*60
diary = tdiary[time]
@cgi.params.delete 'date'
-
+
src = ''
i = 0
diary.each_section {|sec|
i += 1
if i==index
@@ -492,10 +492,10 @@
}
sec.categories = cats
end
src << sec.to_src
}
-
+
@cgi.params['old'] = [postid[0,8]]
@cgi.params['hide'] = diary.visible? ? [] : ['true']
@cgi.params['title'] = [diary.title]
@cgi.params['year'] = [postid[0..3]]
@cgi.params['month'] = [postid[4..5]]