tdiary-contrib 4.0.4 → 4.0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Gemfile +2 -8
- data/Gemfile.lock +17 -21
- data/README.en.md +1 -1
- data/filter/commentsize.rb +1 -1
- data/filter/iplookup.rb +55 -55
- data/filter/plugin/commentsize.rb +1 -1
- data/filter/plugin/en/spambayes.rb +1 -1
- data/filter/plugin/iplookup.rb +39 -39
- data/filter/plugin/ja/antirefspam.rb +1 -1
- data/filter/plugin/ja/spambayes.rb +1 -1
- data/filter/plugin/spambayes.rb +1 -1
- data/filter/spambayes.rb +1 -1
- data/js/flickr.js +1 -1
- data/lib/bayes.rb +1 -1
- data/lib/bayes/convert.rb +1 -1
- data/lib/tdiary/contrib/version.rb +1 -1
- data/lib/wgs2tky.rb +93 -93
- data/plugin/appstore.rb +6 -6
- data/plugin/bigpresen.rb +3 -3
- data/plugin/bitly.rb +1 -1
- data/plugin/brow_si.rb +1 -1
- data/plugin/category_similar.rb +1 -1
- data/plugin/category_to_tagcloud.rb +2 -2
- data/plugin/coderay.rb +1 -1
- data/plugin/datepicker.rb +1 -1
- data/plugin/flickr.rb +2 -2
- data/plugin/git-register.rb +7 -7
- data/plugin/goo_gl.rb +7 -7
- data/plugin/google_map.rb +6 -6
- data/plugin/google_webmaster.rb +4 -4
- data/plugin/hb_footer.rb +5 -5
- data/plugin/hb_footer4sec.rb +5 -5
- data/plugin/hide_sidebar_iphone.rb +1 -1
- data/plugin/iddy.rb +1 -1
- data/plugin/image_ex.rb +17 -17
- data/plugin/image_gps.rb +3 -3
- data/plugin/inline_wiki.rb +6 -6
- data/plugin/instagr.rb +8 -8
- data/plugin/instagram.rb +1 -1
- data/plugin/ja/yo_update.rb +51 -0
- data/plugin/jquery_ui_theme.rb +8 -8
- data/plugin/jroku.rb +1 -1
- data/plugin/jyear.rb +2 -2
- data/plugin/makerss_category.rb +4 -4
- data/plugin/makerss_comment.rb +4 -4
- data/plugin/microsummary.rb +2 -2
- data/plugin/nhk_program_info.rb +2 -2
- data/plugin/picasa.rb +2 -2
- data/plugin/playstore.rb +3 -3
- data/plugin/rating.rb +10 -10
- data/plugin/recent_estraier.rb +7 -7
- data/plugin/search-bing.rb +1 -1
- data/plugin/search-google-custom.rb +1 -1
- data/plugin/search-yahoo-websearch.rb +8 -8
- data/plugin/search-yahoo.rb +1 -1
- data/plugin/section_footer2.rb +1 -1
- data/plugin/show_and_hide.rb +20 -20
- data/plugin/socialbutton.rb +2 -2
- data/plugin/tdiarytimes.rb +16 -16
- data/plugin/tdiarytimes2.rb +10 -10
- data/plugin/tdiarytimes_textstyle.rb +3 -3
- data/plugin/twitter_anywhere.rb +51 -51
- data/plugin/twitter_summary_card.rb +1 -1
- data/plugin/vote.rb +4 -4
- data/plugin/yahoo_kousei.rb +2 -2
- data/plugin/yo_update.rb +214 -0
- data/plugin/zenback.rb +2 -2
- data/spec/apple_webclip_spec.rb +6 -6
- data/util/estraier-search/estraier-register.rb +2 -2
- data/util/image-gallery/image-gallery.rb +8 -8
- data/util/image-gallery/misc/plugin/recent_image.rb +4 -4
- data/util/posttdiary/posttdiary-ex.rb +7 -7
- data/util/rast-search/rast-register.rb +1 -1
- metadata +4 -2
data/plugin/appstore.rb
CHANGED
@@ -16,24 +16,24 @@ end
|
|
16
16
|
|
17
17
|
def appstore_detail(url)
|
18
18
|
appstore_dom = ''
|
19
|
-
|
19
|
+
|
20
20
|
begin
|
21
21
|
appstore_dom = appstore_common(url, {:detail => true})
|
22
|
-
|
22
|
+
|
23
23
|
rescue
|
24
24
|
appstore_dom = "<b>Error. message=#{$!.message}.</b>"
|
25
|
-
|
25
|
+
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
end
|
29
29
|
|
30
30
|
def appstore_common(url, params)
|
31
31
|
return %Q|<a href="url">#{url}</a>| if feed?
|
32
|
-
|
32
|
+
|
33
33
|
appstore_uri = URI::parse(url)
|
34
34
|
id = appstore_uri.path.split('/').last.gsub('id', '')
|
35
35
|
raise StandardError.new("AppStore ID: not found from #{url}..") if id.nil? || id == ''
|
36
|
-
|
36
|
+
|
37
37
|
return %Q|<a class="appstore" data-appstoreid="#{id}" href="#{url}"></a>|
|
38
38
|
end
|
39
39
|
|
data/plugin/bigpresen.rb
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
# ʸ���Υ������ϡ�ɽ���ƥ����Ȥȥ��饤�ɤΥ������˹礦�褦��ưŪ��Ĵ������ޤ���
|
13
13
|
# JavaScript��DHTML���Ѥ���ư�����Τǡ������Ķ��ˤ�äƤ�ɽ������ʤ����Ȥ⤢��ޤ���
|
14
14
|
#
|
15
|
-
# Copyright (c) 2006 Maripo Goda
|
15
|
+
# Copyright (c) 2006 Maripo Goda
|
16
16
|
# mailto:madin@madin.jp
|
17
17
|
# Document URL http://www.madin.jp/works/plugin.html
|
18
18
|
# You can redistribute it and/or modify it under GPL2.
|
@@ -44,7 +44,7 @@ function #{scriptID} () {
|
|
44
44
|
maxPx = Math.min(maxPx, w#{scriptID} * 2 * 0.9 / countLength(msgArr[t]));
|
45
45
|
}
|
46
46
|
maxPx = Math.min(maxPx, Math.floor(h#{scriptID} * 0.8 / msgArr.length));
|
47
|
-
with (document.getElementById("#{scriptID}")) {
|
47
|
+
with (document.getElementById("#{scriptID}")) {
|
48
48
|
innerHTML = msg#{scriptID}[t#{scriptID}];
|
49
49
|
style.fontSize = maxPx+"px";
|
50
50
|
style.top = ((h#{scriptID}-(maxPx * msgArr.length)) / 2) + "px";
|
@@ -61,7 +61,7 @@ function #{scriptID} () {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
|
64
|
-
function countLength (str)
|
64
|
+
function countLength (str)
|
65
65
|
{
|
66
66
|
len = 0;
|
67
67
|
for (i = 0; i < str.length; i++) {
|
data/plugin/bitly.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# (because bitly returns nil sometime.)
|
6
6
|
#
|
7
7
|
# required some options below:
|
8
|
-
# @options['biyly.login'] : your login ID of bit.ly.
|
8
|
+
# @options['biyly.login'] : your login ID of bit.ly.
|
9
9
|
# @options['biyly.key'] : your API key of biy.ly.
|
10
10
|
#
|
11
11
|
# Copyright (C) 2010, TADA Tadashi <t@tdtds.jp>
|
data/plugin/brow_si.rb
CHANGED
data/plugin/category_similar.rb
CHANGED
@@ -21,7 +21,7 @@ def category_similar(categories, max_item)
|
|
21
21
|
items << %Q|<a href="#{h @index}#{anchor "#{ymd}#p#{'%02d' % idx}"}" title="#{h excerpt}">#{t}#p#{'%02d' % idx}</a> #{apply_plugin(title)}|
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
unless items.empty?
|
26
26
|
'<div class="section">' +
|
27
27
|
"<h3 class='category-similar'>#{category_similar_label}</h3>" +
|
@@ -149,13 +149,13 @@ if category_enable?
|
|
149
149
|
now_year = Time.now.year
|
150
150
|
now_month = Time.now.month
|
151
151
|
r = Hash.new
|
152
|
-
|
152
|
+
|
153
153
|
months = [
|
154
154
|
['01'],['01','02'],['01','02','03'],['02','03','04'],['03','04','05'],
|
155
155
|
['04','05','06'],['05','06','07'],['06','07','08'],['07','08','09'],
|
156
156
|
['08','09','10'],['09','10','11'],['10','11','12']
|
157
157
|
][now_month - 1]
|
158
|
-
|
158
|
+
|
159
159
|
r[now_year.to_s] = months
|
160
160
|
case now_month
|
161
161
|
when 1
|
data/plugin/coderay.rb
CHANGED
data/plugin/datepicker.rb
CHANGED
data/plugin/flickr.rb
CHANGED
@@ -96,7 +96,7 @@ def flickr_open(method, photo_id)
|
|
96
96
|
Dir::mkdir(cache_dir) unless File::directory?(cache_dir)
|
97
97
|
|
98
98
|
file = "#{cache_dir}/#{photo_id}.#{method}"
|
99
|
-
|
99
|
+
if !File.exist?(file) || File.size(file) == 0
|
100
100
|
req = Flickr::Request.new(@conf['flickr.apikey'])
|
101
101
|
req['method'] = method
|
102
102
|
req['photo_id'] = photo_id
|
@@ -106,7 +106,7 @@ def flickr_open(method, photo_id)
|
|
106
106
|
fout.puts req.open
|
107
107
|
}
|
108
108
|
end
|
109
|
-
rescue TimeoutError => e
|
109
|
+
rescue TimeoutError, OpenSSL::OpenSSLError => e
|
110
110
|
File.delete(file)
|
111
111
|
raise e
|
112
112
|
end
|
data/plugin/git-register.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# You can redistribute it and/or modify it under GPL2.
|
7
7
|
#
|
8
8
|
# tDiaryのデータを日別でGitに登録するプラグインです
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# 1. プラグインディレクトリ(例: plugin)にgit-register.rbを設置。
|
11
11
|
# 2. プラグインディレクトリにja/git-register.rb、en/git-register.rbを設置。
|
12
12
|
# 3. tdiary.confにリポジトリを指定(リポジトリの場所を/var/git-respoと仮定)
|
@@ -113,16 +113,16 @@ module ::TDiary
|
|
113
113
|
|
114
114
|
# commit
|
115
115
|
require 'shellwords'
|
116
|
-
|
117
|
-
msg = "#{ENV['REMOTE_ADDR']} - #{ENV['REMOTE_HOST']}"
|
118
|
-
|
116
|
+
|
117
|
+
msg = "#{ENV['REMOTE_ADDR']} - #{ENV['REMOTE_HOST']}"
|
118
|
+
|
119
119
|
Dir.chdir("#{@repository_dir}") do
|
120
120
|
td2_file2 = @date.strftime("%Y%m/%Y%m%d.td2")
|
121
121
|
system("git add -- #{Shellwords.shellescape(td2_file2)}".untaint)
|
122
122
|
system("git commit -q -m \"#{msg}\" -- #{Shellwords.shellescape(td2_file2)}".untaint)
|
123
123
|
end
|
124
124
|
end
|
125
|
-
|
125
|
+
|
126
126
|
protected
|
127
127
|
|
128
128
|
def mode; 'day'; end
|
@@ -199,9 +199,9 @@ else
|
|
199
199
|
conf.show_nyear = false
|
200
200
|
def conf.bot?; true; end
|
201
201
|
|
202
|
-
repository_dir = @conf['git.repository_dir']
|
202
|
+
repository_dir = @conf['git.repository_dir']
|
203
203
|
diary = @diaries[@date.strftime('%Y%m%d')]
|
204
|
-
|
204
|
+
|
205
205
|
TDiary::GitRegister.new(repository_dir, diary).execute
|
206
206
|
end
|
207
207
|
|
data/plugin/goo_gl.rb
CHANGED
@@ -12,18 +12,18 @@ require 'net/https'
|
|
12
12
|
|
13
13
|
def goo_gl( long_url )
|
14
14
|
return nil if !long_url or long_url.empty?
|
15
|
-
|
15
|
+
|
16
16
|
# on memory
|
17
17
|
@goo_gl_cache ||= {} # cached only on memory
|
18
18
|
return @goo_gl_cache[long_url] if @goo_gl_cache[long_url]
|
19
|
-
|
19
|
+
|
20
20
|
# proxy
|
21
21
|
px_host, px_port = (@conf['proxy'] || '').split( /:/ )
|
22
22
|
px_port = 80 if px_host and !px_port
|
23
|
-
|
23
|
+
|
24
24
|
# params
|
25
25
|
params = {'longUrl' => long_url}.to_json
|
26
|
-
|
26
|
+
|
27
27
|
https = nil
|
28
28
|
begin
|
29
29
|
https = Net::HTTP::Proxy(px_host, px_port).new('www.googleapis.com', 443)
|
@@ -32,11 +32,11 @@ def goo_gl( long_url )
|
|
32
32
|
@goo_gl_cache[long_url] = JSON::parse(body)["id"] if res.code == '200'
|
33
33
|
rescue Exception => e
|
34
34
|
# do nothing..
|
35
|
-
|
35
|
+
|
36
36
|
ensure
|
37
37
|
https.finish if https && https.started?
|
38
|
-
|
38
|
+
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
return @goo_gl_cache[long_url]
|
42
42
|
end
|
data/plugin/google_map.rb
CHANGED
@@ -27,7 +27,7 @@ def google_map_common(params)
|
|
27
27
|
return %Q|<a href="#{url}">#{url}</a>|
|
28
28
|
end
|
29
29
|
return 'not support this environment.' if @conf.mobile_agent?
|
30
|
-
|
30
|
+
|
31
31
|
params[:zoom] ||= 10
|
32
32
|
params[:html] ||= nil
|
33
33
|
params[:title] ||= nil
|
@@ -36,7 +36,7 @@ def google_map_common(params)
|
|
36
36
|
params[:address] ||= nil
|
37
37
|
params[:type] ||= :ROADMAP
|
38
38
|
params[:overview]||= false
|
39
|
-
|
39
|
+
|
40
40
|
dom_id = "#{@date.strftime("%Y%m")}_#{@gmap_count}"
|
41
41
|
params.merge!(:id => dom_id)
|
42
42
|
params.merge!(:width => 240, :height => 180) if @conf.iphone?
|
@@ -96,7 +96,7 @@ def google_map_script(hash)
|
|
96
96
|
if hash[:title]
|
97
97
|
str << %Q| var marker = new google.maps.Marker({\n|
|
98
98
|
str << %Q| position: new google.maps.LatLng(#{hash[:lat]}, #{hash[:lon]}),\n|
|
99
|
-
str << %Q| map: gMap,\n|
|
99
|
+
str << %Q| map: gMap,\n|
|
100
100
|
str << %Q| title: '#{hash[:title]}'\n|
|
101
101
|
str << %Q| });\n|
|
102
102
|
# set InfoWindow
|
@@ -109,7 +109,7 @@ def google_map_script(hash)
|
|
109
109
|
end # :html
|
110
110
|
end # :title
|
111
111
|
str << %Q|});\n|
|
112
|
-
|
112
|
+
|
113
113
|
str
|
114
114
|
end
|
115
115
|
|
@@ -137,7 +137,7 @@ def google_geomap_script(hash)
|
|
137
137
|
if hash[:title]
|
138
138
|
str << %Q| var marker = new google.maps.Marker({\n|
|
139
139
|
str << %Q| position: geoLat,\n|
|
140
|
-
str << %Q| map: gMap,\n|
|
140
|
+
str << %Q| map: gMap,\n|
|
141
141
|
str << %Q| title: '#{hash[:title]}'\n|
|
142
142
|
str << %Q| });\n|
|
143
143
|
# set InfoWindow
|
@@ -155,7 +155,7 @@ def google_geomap_script(hash)
|
|
155
155
|
str << %Q| });\n|
|
156
156
|
str << %Q| }\n|
|
157
157
|
str << %Q|});\n|
|
158
|
-
|
158
|
+
|
159
159
|
str
|
160
160
|
end
|
161
161
|
|
data/plugin/google_webmaster.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
# google-webmaster.rb - embed a meta tag to let Google Webmaster tool know your verification code.
|
3
|
-
#
|
2
|
+
# google-webmaster.rb - embed a meta tag to let Google Webmaster tool know your verification code.
|
3
|
+
#
|
4
4
|
# Copyright (C) 2012, Tatsuya Sato <satoryu.1981@gmail.com>
|
5
5
|
# You can redistribute it and/or modify it under GPL2.
|
6
6
|
#
|
7
7
|
|
8
8
|
add_header_proc do
|
9
|
-
"<meta name=\"google-site-verification\" content=\"#{h @conf['google_webmaster.verification']}\" />"
|
9
|
+
"<meta name=\"google-site-verification\" content=\"#{h @conf['google_webmaster.verification']}\" />"
|
10
10
|
end
|
11
11
|
|
12
12
|
add_conf_proc('Google Webmaster', 'Google ウェブマスターツール', 'etc') do
|
13
|
-
if @mode == 'saveconf'
|
13
|
+
if @mode == 'saveconf'
|
14
14
|
@conf['google_webmaster.verification'] = @cgi.params['google_webmaster.verification'][0]
|
15
15
|
end
|
16
16
|
<<-HTML
|
data/plugin/hb_footer.rb
CHANGED
@@ -35,7 +35,7 @@ add_body_leave_proc(Proc.new do |date|
|
|
35
35
|
end
|
36
36
|
end)
|
37
37
|
|
38
|
-
# rss-recent.rb: RSS recent plugin
|
38
|
+
# rss-recent.rb: RSS recent plugin
|
39
39
|
#
|
40
40
|
# rss_recnet: show recnet list from RSS
|
41
41
|
# parameters (default):
|
@@ -72,11 +72,11 @@ def hb_footer(url, max = 5, cache_time = 3600, \
|
|
72
72
|
cache_file = "#{@cache_path}/rss-recent.#{CGI.escape(url)}"
|
73
73
|
|
74
74
|
hb_footer_cache_rss(url, cache_file, cache_time.to_i)
|
75
|
-
|
75
|
+
|
76
76
|
return '' unless test(?r, cache_file)
|
77
77
|
|
78
78
|
rv = template_head
|
79
|
-
|
79
|
+
|
80
80
|
i = 0
|
81
81
|
hb_footer_read_from_cache(cache_file).each do |title, url, time, content, description|
|
82
82
|
break if i >= max
|
@@ -111,14 +111,14 @@ def hb_footer_cache_rss(url, cache_file, cache_time)
|
|
111
111
|
require 'rss/2.0'
|
112
112
|
require 'rss/dublincore'
|
113
113
|
require 'rss/content'
|
114
|
-
|
114
|
+
|
115
115
|
begin
|
116
116
|
uri = URI.parse(url)
|
117
117
|
|
118
118
|
raise URI::InvalidURIError if uri.scheme != "http"
|
119
119
|
|
120
120
|
rss_source = hb_footer_fetch_rss(uri, cached_time)
|
121
|
-
|
121
|
+
|
122
122
|
raise InvalidResourceError if rss_source.nil?
|
123
123
|
|
124
124
|
# parse RSS
|
data/plugin/hb_footer4sec.rb
CHANGED
@@ -24,7 +24,7 @@ add_section_leave_proc do |date, index|
|
|
24
24
|
hb_footer4sec(rss_url, 50, cache_time, template_head, template_list, template_foot)
|
25
25
|
end
|
26
26
|
|
27
|
-
# rss-recent.rb: RSS recent plugin
|
27
|
+
# rss-recent.rb: RSS recent plugin
|
28
28
|
#
|
29
29
|
# rss_recnet: show recnet list from RSS
|
30
30
|
# parameters (default):
|
@@ -61,11 +61,11 @@ def hb_footer4sec(url, max = 5, cache_time = 3600, \
|
|
61
61
|
cache_file = "#{@cache_path}/rss-recent.#{CGI.escape(url)}"
|
62
62
|
|
63
63
|
hb_footer4sec_cache_rss(url, cache_file, cache_time.to_i)
|
64
|
-
|
64
|
+
|
65
65
|
return '' unless test(?r, cache_file)
|
66
66
|
|
67
67
|
rv = template_head
|
68
|
-
|
68
|
+
|
69
69
|
i = 0
|
70
70
|
hb_footer4sec_read_from_cache(cache_file).each do |title, url, time, content, description|
|
71
71
|
break if i >= max
|
@@ -100,14 +100,14 @@ def hb_footer4sec_cache_rss(url, cache_file, cache_time)
|
|
100
100
|
require 'rss/2.0'
|
101
101
|
require 'rss/dublincore'
|
102
102
|
require 'rss/content'
|
103
|
-
|
103
|
+
|
104
104
|
begin
|
105
105
|
uri = URI.parse(url)
|
106
106
|
|
107
107
|
raise URI::InvalidURIError if uri.scheme != "http"
|
108
108
|
|
109
109
|
rss_source = hb_footer4sec_fetch_rss(uri, cached_time)
|
110
|
-
|
110
|
+
|
111
111
|
raise InvalidResourceError if rss_source.nil?
|
112
112
|
|
113
113
|
# parse RSS
|
data/plugin/iddy.rb
CHANGED
@@ -47,7 +47,7 @@ def iddy( id )
|
|
47
47
|
nameroma = user.to_a( 'nameroma' )[0]
|
48
48
|
mail = user.to_a( 'mail' )[0]
|
49
49
|
submail = user.to_a( 'submail' )[0]
|
50
|
-
|
50
|
+
|
51
51
|
html = '<div class="iddy">'
|
52
52
|
html << %Q|<a href="#{profileurl.text}">|
|
53
53
|
html << %Q|<span class="iddy-image"><img src="#{imageurl.text}" alt="image" width="96" height="96"></span>| if imageurl
|
data/plugin/image_ex.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# image_plugin_ex.rb
|
2
2
|
# version 0.3
|
3
3
|
# -pv-
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# 名称:
|
6
6
|
# 絵日記Plugin機能追加版
|
7
7
|
#
|
@@ -89,7 +89,7 @@ if @conf.smartphone?
|
|
89
89
|
end
|
90
90
|
|
91
91
|
|
92
|
-
add_body_enter_proc(Proc.new do |date|
|
92
|
+
add_body_enter_proc(Proc.new do |date|
|
93
93
|
@image_date = date.strftime("%Y%m%d")
|
94
94
|
@image_year = date.strftime("%Y")
|
95
95
|
""
|
@@ -110,10 +110,10 @@ def image( id, alt = "image", id2 = nil, width = nil, place="none" )
|
|
110
110
|
|
111
111
|
image_dir.untaint
|
112
112
|
Dir.mkdir(image_dir) unless File.directory?(image_dir)
|
113
|
-
|
113
|
+
|
114
114
|
list = imageList(@image_date, image_dir).untaint
|
115
115
|
slist = imageList(@image_date, image_dir, "s").untaint
|
116
|
-
|
116
|
+
|
117
117
|
if width
|
118
118
|
width_tag = %Q[width="#{h width}"]
|
119
119
|
else
|
@@ -194,7 +194,7 @@ add_form_proc do |date|
|
|
194
194
|
def resize_image(orig, new, width, height, imageex_convertedwidth, imageex_convertedheight, orig_type, new_type)
|
195
195
|
imageex_convertpath = @options && @options['image_ex.convertpath'] || "convert"
|
196
196
|
imageex_convertpath
|
197
|
-
|
197
|
+
|
198
198
|
if width > height
|
199
199
|
imageex_convertedsize = %Q[#{imageex_convertedwidth}x#{imageex_convertedheight}]
|
200
200
|
imageex_convertedsize
|
@@ -217,16 +217,16 @@ add_form_proc do |date|
|
|
217
217
|
giftopnm = @options && @options['image_ex.giftopnmpath'] || "giftopnm"
|
218
218
|
tifftopnm = @options && @options['image_ex.tifftopnmpath'] || "tifftopnm"
|
219
219
|
bmptopnm = @options && @options['image_ex.bmptopnmpath'] || "bmptopnm"
|
220
|
-
|
220
|
+
|
221
221
|
downtype = orig_type.downcase
|
222
222
|
topnm = eval("#{downtype}topnm")
|
223
|
-
|
223
|
+
|
224
224
|
if new_type == "jpg"
|
225
225
|
pnmto = pnmtojpeg
|
226
226
|
elsif new_type == "png"
|
227
227
|
pnmto = pnmtopng
|
228
228
|
end
|
229
|
-
|
229
|
+
|
230
230
|
if width > height
|
231
231
|
imageex_convertedsize ="#{imageex_convertedwidth}"
|
232
232
|
else
|
@@ -252,7 +252,7 @@ add_form_proc do |date|
|
|
252
252
|
}
|
253
253
|
return image_path
|
254
254
|
end
|
255
|
-
|
255
|
+
|
256
256
|
if @cgi.params['plugin_image_add'][0] && @cgi.params['plugin_image_file'][0].original_filename != ''
|
257
257
|
image_dir = @cgi.params['plugin_image_dir'][0].read.untaint
|
258
258
|
image_filename = ''
|
@@ -271,7 +271,7 @@ add_form_proc do |date|
|
|
271
271
|
f.print @cgi.params['plugin_image_file'][0].read
|
272
272
|
}
|
273
273
|
end
|
274
|
-
|
274
|
+
|
275
275
|
if imageex_useresize == 1 or imageex_useresize == 2
|
276
276
|
open(image_file,"rb") do |fh|
|
277
277
|
img = ImageSize.new(fh.read)
|
@@ -291,7 +291,7 @@ add_form_proc do |date|
|
|
291
291
|
elsif imageex_converttype == 1
|
292
292
|
new_type = "png"
|
293
293
|
end
|
294
|
-
|
294
|
+
|
295
295
|
if width
|
296
296
|
if width > imageex_thresholdsize or height > imageex_thresholdsize
|
297
297
|
small_image_file = %Q[#{image_dir}s#{image_date}_#{image_name.length.to_s}.#{new_type}]
|
@@ -367,10 +367,10 @@ add_form_proc do |date|
|
|
367
367
|
n_image = imageList(@date.strftime("%Y%m%d"), image_dir).length
|
368
368
|
list = imageList(@date.strftime("%Y%m%d"), image_dir)
|
369
369
|
slist = imageList(@date.strftime("%Y%m%d"), image_dir, "s")
|
370
|
-
|
370
|
+
|
371
371
|
pretable=""
|
372
372
|
posttable=""
|
373
|
-
|
373
|
+
|
374
374
|
if n_image > 0
|
375
375
|
pretable<< %Q[<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">]
|
376
376
|
posttable << %Q[</TR></TABLE>]
|
@@ -386,7 +386,7 @@ add_form_proc do |date|
|
|
386
386
|
image_plugin_tag1 = "<%="
|
387
387
|
image_plugin_tag2 = "%>"
|
388
388
|
end
|
389
|
-
|
389
|
+
|
390
390
|
r = ''
|
391
391
|
r << %Q[
|
392
392
|
<script type="text/javascript">
|
@@ -416,14 +416,14 @@ add_form_proc do |date|
|
|
416
416
|
alt_tag = %Q[alt="#{h list[id.to_i]}"]
|
417
417
|
thumbnail_tag = %Q[<form class="update" method="post" enctype="multipart/form-data" action="#{h @update}">#{csrf_protection}<input type="hidden" name="plugin_image_name" value="#{date.strftime( '%Y%m%d' )}_#{h id}"><input type="hidden" name="plugin_image_dir" value="#{h image_dir}"><input type="hidden" name="plugin_image_thumbnail" value="true"><input type="hidden" name="date" value="#{date.strftime( '%Y%m%d' )}"><input type="file" name="plugin_image_file"><input type="submit" name="plugin" value="サムネイル"></form>] if imageex_useresize == 0
|
418
418
|
end
|
419
|
-
|
419
|
+
|
420
420
|
ptag = "#{image_plugin_tag1}image #{id}, '画像の説明'#{image_plugin_tag2}"
|
421
|
-
|
421
|
+
|
422
422
|
i<< %Q[<td><table border="1" cellpadding="1" cellspacing="1"><tr><td style="text-align:center"><input type="button" onclick="ins("#{ptag}")" value="本文に追加"></td></tr><tr><td style="text-align:center">#{image_plugin_tag1}image #{h id},'title#{h id}'#{image_plugin_tag2}</td></tr><tr><td width="#{@imageex_thumbnailsize * 1.5}" height="#{@imageex_thumbnailsize * 1.3}" style="text-align:center">
|
423
423
|
<img class="form" #{src_tag} #{alt_tag} height="#{@imageex_thumbnailsize}" ></tr><tr><td>#{thumbnail_tag}<form class="update" method="post" action="#{h @update}">#{csrf_protection}<input type="hidden" name="plugin_image_del" value="true"><input type="hidden" name="date" value="#{date.strftime( '%Y%m%d' )}"><input type="hidden" name="plugin_image_id" value="#{h id}"><input type="submit" name="plugin" value="画像を削除"><input type="hidden" name="plugin_image_dir" value="#{h image_dir}"></form>
|
424
424
|
</tr></table></td>] if slist[id.to_i] || list[id.to_i]
|
425
425
|
nt += 1 if slist[id.to_i] || list[id.to_i]
|
426
|
-
|
426
|
+
|
427
427
|
if nt > 0 and nt%2 == 0
|
428
428
|
i<< %Q[</TR></TABLE><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD>]
|
429
429
|
end
|