tdiary-contrib 4.0.5.1 → 4.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -1
- data/Gemfile.lock +14 -14
- data/lib/tdiary/contrib/version.rb +1 -1
- data/plugin/bigpresen.rb +11 -11
- data/plugin/ja/yo_update.rb +2 -2
- data/plugin/rating.rb +30 -30
- data/plugin/yo_update.rb +28 -9
- data/util/image-gallery/misc/plugin/recent_image.rb +6 -97
- data/util/image-gallery/misc/plugin/view_exif.rb +55 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 405cd097929d2ebb15d36cf9c8dcd4fe8febacda
|
4
|
+
data.tar.gz: b8970c2874a69145ef16384c8e831ed0cc7de9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42f28c48e85063137b70a21b069ae36be86f6b1daa55ea8d6f64ceb03f6559aaff1f473a056c58169a173a8d781c747e86841725e7f3020ae1c3fef84d45c6e0
|
7
|
+
data.tar.gz: 68ab7a4e1eef86197e9415bc803f3d15f4132110277c07e3af74752d3eabe1644d23636c5713b553df17437a20a73c1cbb68b9f4f256dd4c55e21e5105a19fe2
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -5,24 +5,24 @@ GEM
|
|
5
5
|
docile (1.1.5)
|
6
6
|
multi_json (1.10.1)
|
7
7
|
rake (10.3.2)
|
8
|
-
rspec (3.
|
9
|
-
rspec-core (~> 3.
|
10
|
-
rspec-expectations (~> 3.
|
11
|
-
rspec-mocks (~> 3.
|
12
|
-
rspec-core (3.
|
13
|
-
rspec-support (~> 3.
|
14
|
-
rspec-expectations (3.
|
8
|
+
rspec (3.1.0)
|
9
|
+
rspec-core (~> 3.1.0)
|
10
|
+
rspec-expectations (~> 3.1.0)
|
11
|
+
rspec-mocks (~> 3.1.0)
|
12
|
+
rspec-core (3.1.6)
|
13
|
+
rspec-support (~> 3.1.0)
|
14
|
+
rspec-expectations (3.1.2)
|
15
15
|
diff-lcs (>= 1.2.0, < 2.0)
|
16
|
-
rspec-support (~> 3.
|
17
|
-
rspec-mocks (3.
|
18
|
-
rspec-support (~> 3.
|
19
|
-
rspec-support (3.
|
20
|
-
simplecov (0.9.
|
16
|
+
rspec-support (~> 3.1.0)
|
17
|
+
rspec-mocks (3.1.3)
|
18
|
+
rspec-support (~> 3.1.0)
|
19
|
+
rspec-support (3.1.2)
|
20
|
+
simplecov (0.9.1)
|
21
21
|
docile (~> 1.1.0)
|
22
|
-
multi_json
|
22
|
+
multi_json (~> 1.0)
|
23
23
|
simplecov-html (~> 0.8.0)
|
24
24
|
simplecov-html (0.8.0)
|
25
|
-
tdiary (4.0.
|
25
|
+
tdiary (4.0.5.1)
|
26
26
|
bundler (~> 1.3)
|
27
27
|
thor (~> 0.18)
|
28
28
|
thor (0.19.1)
|
data/plugin/bigpresen.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# bigpresen.rb $Revision: 1.03 $
|
2
2
|
#
|
3
|
-
# bigpresen :
|
3
|
+
# bigpresen : クリックで進行する「高橋メソッド」風巨大文字プレゼンテーションを挿入
|
4
4
|
#
|
5
|
-
#
|
6
|
-
# str :
|
7
|
-
# "|"
|
8
|
-
# width :
|
9
|
-
# height :
|
5
|
+
# パラメタ :
|
6
|
+
# str : 本文。"|"はスライドの区切り、"/"はスライド内の改行となる。
|
7
|
+
# "|"と"|"を表示する場合には、前に"\"をつけてエスケープ。
|
8
|
+
# width : スライドの幅。ピクセルで指定。(デフォルト : 480)
|
9
|
+
# height : スライドの高さ。ピクセルで指定。(デフォルト : 320)
|
10
10
|
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
# JavaScript
|
11
|
+
# 日記本文に、<%= bigpresen 'str','width','height' %> の形式で記述します。
|
12
|
+
# 文字のサイズは、表示テキストとスライドのサイズに合うよう自動的に調整されます。
|
13
|
+
# JavaScriptとDHTMLを用いて動かすので、閲覧環境によっては表示されないこともあります。
|
14
14
|
#
|
15
15
|
# Copyright (c) 2006 Maripo Goda
|
16
16
|
# mailto:madin@madin.jp
|
@@ -54,7 +54,7 @@ function #{scriptID} () {
|
|
54
54
|
else {
|
55
55
|
t#{scriptID} = 0;
|
56
56
|
with (document.getElementById("#{scriptID}")) {
|
57
|
-
innerHTML = "
|
57
|
+
innerHTML = "《REPLAY》";
|
58
58
|
style.fontSize = '100%';
|
59
59
|
style.top = '50%';
|
60
60
|
}
|
@@ -78,7 +78,7 @@ function countLength (str)
|
|
78
78
|
<noscript><p>JavaScript Required.</p></noscript>
|
79
79
|
<div class="bigpresen" style="text-align:center; position:relative; width:#{width}px; height:#{height}px; background:#fff;border:ridge 4px #ccc;" onclick="#{scriptID}()">
|
80
80
|
|
81
|
-
<span id="#{scriptID}" style="width:100%; position:absolute; top:50%; left:0; line-height:100%; color:black; font-family:'
|
81
|
+
<span id="#{scriptID}" style="width:100%; position:absolute; top:50%; left:0; line-height:100%; color:black; font-family:'MS Pゴシック', sans-serif;">《START》</span>
|
82
82
|
|
83
83
|
</div>
|
84
84
|
|
data/plugin/ja/yo_update.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
-
# yo_update.rb - Japanese
|
3
|
+
# yo_update.rb - Japanese resource
|
4
4
|
#
|
5
5
|
# Copyright (C) 2014, zunda <zundan at gmail.com>
|
6
6
|
#
|
@@ -34,7 +34,7 @@ def yo_update_conf_html(conf, n_subscribers, test_result)
|
|
34
34
|
%Q|<li><label for="yo_update.#{action}"><input id="yo_update.#{action}" name="yo_update.#{action}" value="t" type="checkbox"#{checked}>#{action_label[action]}</label>|
|
35
35
|
}.join("\n\t")}
|
36
36
|
</ul>
|
37
|
-
<p>Yo を<input name="yo_update.test" value="" size="10"
|
37
|
+
<p>Yo を<input name="yo_update.test" value="" size="10">にリンク<input name="yo_update.link" value="#{yo_update_url}" size="40">(不要なら空白)をつけて送ってみる#{test_result}</p>
|
38
38
|
<h3 class="subtitle">現在の受信者数</h3>
|
39
39
|
<p>#{h n_subscribers}</p>
|
40
40
|
<h3 class="subtitle">Yoボタン</h3>
|
data/plugin/rating.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# $Revision:0.1$
|
2
|
-
# rating.rb:
|
2
|
+
# rating.rb: 複数軸による記事評価とグラフ表示
|
3
3
|
# for tDiary
|
4
4
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# '
|
8
|
-
#
|
9
|
-
#
|
5
|
+
# 使い方
|
6
|
+
# そのまま plugin ディレクトリに置きます。
|
7
|
+
# '設定' -> 'rating.rb Configuration' で、評価軸や
|
8
|
+
# 表示内容を設定。
|
9
|
+
# くわしくは
|
10
10
|
# http://www.maripo.jp/diary/?date=20071019
|
11
11
|
#
|
12
12
|
# Copyright (c) 2007 Mariko/Maripo GODA <god@maripo.jp>
|
@@ -51,21 +51,21 @@ add_conf_proc('rating', 'rating.rb Configuration') do
|
|
51
51
|
|
52
52
|
form_string += <<HTML
|
53
53
|
<p>
|
54
|
-
|
54
|
+
フィードバックフォームの設定をします。軸はいくつでも作成することができます。
|
55
55
|
</p>
|
56
56
|
<p>
|
57
|
-
<a href="http://www.maripo.jp/"
|
57
|
+
<a href="http://www.maripo.jp/">作者</a>の <a href="http://www.maripo.jp/diary/?date=20071019">blog</a> に追加情報が書いてあるかもしれません。
|
58
58
|
</p>
|
59
|
-
<h3
|
59
|
+
<h3>設定方法</h3>
|
60
60
|
<ul>
|
61
|
-
<li
|
62
|
-
<li
|
63
|
-
<li
|
64
|
-
<li
|
65
|
-
<li
|
66
|
-
<li
|
61
|
+
<li>順 … 表示される順番です。小さいほうから順に並びます。番号が飛んでもOK。</li>
|
62
|
+
<li>表示 … いらない軸はチェックを外してしまってください。
|
63
|
+
<li>軸の名前 … (例) "この記事は参考になりましたか"</li>
|
64
|
+
<li>最低ラベル … 例 "まったく参考にならない"</li>
|
65
|
+
<li>最高ラベル … 例 "とても参考になった"</li>
|
66
|
+
<li>選択肢数 … 例 : 1~5の5段階なら "5"</li>
|
67
67
|
</p>
|
68
|
-
<h3
|
68
|
+
<h3>設定内容</h3>
|
69
69
|
<form>
|
70
70
|
<table>
|
71
71
|
HTML
|
@@ -74,13 +74,13 @@ HTML
|
|
74
74
|
rating_config.each { |axis_config|
|
75
75
|
form_string += <<HTML
|
76
76
|
<tr>
|
77
|
-
<td
|
77
|
+
<td>順:<input type="text" size="2" name="order#{index}" value="#{axis_config.order}"></td>
|
78
78
|
<td>
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
軸の名前:<input type="text" size="16" name="label#{index}" value="#{axis_config.label}">
|
80
|
+
最低ラベル:<input type="text" size="10" name="label_min#{index}" value="#{axis_config.label_min}">
|
81
|
+
最高ラベル:<input type="text" size="10" name="label_max#{index}" value="#{axis_config.label_max}">
|
82
|
+
選択肢数:<input type="text" size="4" name="range#{index}" value="#{axis_config.range.to_s}">
|
83
|
+
表示:<input type="checkbox" name="display#{index}" value="#{axis_config.label_max}" #{axis_config.check_label}>
|
84
84
|
</td>
|
85
85
|
</tr>
|
86
86
|
HTML
|
@@ -88,12 +88,12 @@ HTML
|
|
88
88
|
}
|
89
89
|
form_string += <<HTML
|
90
90
|
<tr>
|
91
|
-
<td
|
91
|
+
<td>追加</td>
|
92
92
|
<td>
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
軸の名前:<input type="text" size="16" name="label_new">
|
94
|
+
最低ラベル:<input type="text" size="10" name="label_min_new">
|
95
|
+
最高ラベル:<input type="text" size="10" name="label_max_new">
|
96
|
+
選択肢数:<input type="text" size="4" name="range_new">
|
97
97
|
</td>
|
98
98
|
</tr>
|
99
99
|
</table>
|
@@ -125,7 +125,7 @@ add_body_leave_proc do |date|
|
|
125
125
|
onclick="with(this.parentNode.style){if(overflow=='hidden'){overflow='visible';}else{overflow='hidden';}}"
|
126
126
|
style="cursor:hand;"
|
127
127
|
class="ratingGraphOpener">
|
128
|
-
[
|
128
|
+
[分布をみる]
|
129
129
|
</div>
|
130
130
|
<div class="ratingGraphContent">
|
131
131
|
HTML
|
@@ -153,7 +153,7 @@ HTML
|
|
153
153
|
class="ratingGraphRank">' + (current_rank + 1).to_s + '</div><div
|
154
154
|
class="ratingGraphBar" style="width:' +
|
155
155
|
todays_eval.get_graph_length(axis_config.id, current_rank).to_s +
|
156
|
-
'px"></div><span class="ratingGraphValue"> (' + todays_eval.get_value(axis_config.id, current_rank).to_s + '
|
156
|
+
'px"></div><span class="ratingGraphValue"> (' + todays_eval.get_value(axis_config.id, current_rank).to_s + '票)</span></div>')
|
157
157
|
current_rank += 1
|
158
158
|
end
|
159
159
|
graph_string += '</div>' #end "graphBox"
|
@@ -170,7 +170,7 @@ todays_eval.get_graph_length(axis_config.id, current_rank).to_s +
|
|
170
170
|
<div style="clear:both;height:0px;"></div>
|
171
171
|
HTML
|
172
172
|
form_string += '<input type="hidden" name="date" value="' + date.strftime('%Y%m%d') + '">'
|
173
|
-
form_string += '<input type="submit" value="
|
173
|
+
form_string += '<input type="submit" value="評価する"></div></form>'+"\n"
|
174
174
|
(form_string + graph_string)
|
175
175
|
|
176
176
|
end
|
data/plugin/yo_update.rb
CHANGED
@@ -18,6 +18,18 @@ YO_UPDATE_TIMEOUT = 10
|
|
18
18
|
|
19
19
|
class YoUpdateError < StandardError; end
|
20
20
|
|
21
|
+
def yo_update_url(date = nil, frag = nil) # date: Time frag: e.g. 'p01'
|
22
|
+
url = @conf.index.dup
|
23
|
+
url[0, 0] = base_url unless %r|^https?://|i =~ url
|
24
|
+
url.gsub!( %r|/\./|, '/' )
|
25
|
+
if date
|
26
|
+
ymd = date.strftime('%Y%m%d')
|
27
|
+
anc = frag ? "#{ymd}##{frag}" : ymd
|
28
|
+
url += anchor(anc)
|
29
|
+
end
|
30
|
+
url
|
31
|
+
end
|
32
|
+
|
21
33
|
def yo_update_api_key
|
22
34
|
r = @conf['yo_update.api_key']
|
23
35
|
if not r or r.empty?
|
@@ -48,18 +60,21 @@ def yo_update_access_api(req)
|
|
48
60
|
end
|
49
61
|
end
|
50
62
|
|
51
|
-
def yo_update_send_yo(username = nil)
|
63
|
+
def yo_update_send_yo(username = nil, url = '')
|
52
64
|
api_key = yo_update_api_key
|
53
65
|
unless api_key
|
54
66
|
raise YoUpdateError, "Yo API Key is not set"
|
55
67
|
end
|
68
|
+
data = {'api_token' => api_key}
|
69
|
+
data['link'] = url unless url.empty?
|
56
70
|
unless username
|
57
71
|
req = Net::HTTP::Post.new(URI("http://api.justyo.co/yoall/"))
|
58
|
-
req.set_form_data(
|
72
|
+
req.set_form_data(data)
|
59
73
|
expected = '{}'
|
60
74
|
else
|
61
75
|
req = Net::HTTP::Post.new(URI("http://api.justyo.co/yo/"))
|
62
|
-
|
76
|
+
data['username'] = username
|
77
|
+
req.set_form_data(data)
|
63
78
|
expected = '{"result": "OK"}'
|
64
79
|
end
|
65
80
|
res = yo_update_access_api(req)
|
@@ -70,10 +85,10 @@ def yo_update_send_yo(username = nil)
|
|
70
85
|
return data
|
71
86
|
end
|
72
87
|
|
73
|
-
def yo_update_send_yo_or_log(username = nil)
|
88
|
+
def yo_update_send_yo_or_log(username = nil, url = '')
|
74
89
|
return unless yo_update_api_key
|
75
90
|
begin
|
76
|
-
yo_update_send_yo(username)
|
91
|
+
yo_update_send_yo(username, url)
|
77
92
|
rescue YoUpdateError => e
|
78
93
|
@logger.error "yo_update.rb: #{e.message}"
|
79
94
|
end
|
@@ -131,7 +146,7 @@ unless defined? yo_update_conf_html # maybe defined in a language resource
|
|
131
146
|
%Q|<li><label for="yo_update.#{action}"><input id="yo_update.#{action}" name="yo_update.#{action}" value="t" type="checkbox"#{checked}>#{action_label[action]}</label>|
|
132
147
|
}.join("\n\t")}
|
133
148
|
</ul>
|
134
|
-
<p>Test sending Yo! to <input name="yo_update.test" value="" size="10">#{test_result}</p>
|
149
|
+
<p>Test sending Yo! to <input name="yo_update.test" value="" size="10"> with optional link <input name="yo_update.link" value="#{yo_update_url}" size="40">#{test_result}</p>
|
135
150
|
<h3 class="subtitle">Current Subscribers</h3>
|
136
151
|
<p>#{h n_subscribers}</p>
|
137
152
|
<h3 class="subtitle">Yo button</h3>
|
@@ -156,9 +171,10 @@ add_conf_proc('yo_update', yo_update_conf_label) do
|
|
156
171
|
@conf['yo_update.send_on_update'] = (@cgi.params['yo_update.send_on_update'][0] == 't')
|
157
172
|
@conf['yo_update.send_on_comment'] = (@cgi.params['yo_update.send_on_comment'][0] == 't')
|
158
173
|
test_username = @cgi.params['yo_update.test'][0]
|
174
|
+
test_link = @cgi.params['yo_update.link'][0]
|
159
175
|
if test_username and not test_username.empty?
|
160
176
|
begin
|
161
|
-
result = yo_update_send_yo(test_username)
|
177
|
+
result = yo_update_send_yo(test_username, test_link)
|
162
178
|
rescue YoUpdateError => e
|
163
179
|
result = e.message
|
164
180
|
end
|
@@ -178,9 +194,12 @@ end
|
|
178
194
|
|
179
195
|
add_update_proc do
|
180
196
|
if @mode == 'append' and @conf['yo_update.send_on_update']
|
181
|
-
|
197
|
+
url = yo_update_url(@date) # link to the date
|
198
|
+
yo_update_send_yo_or_log(nil, url)
|
182
199
|
elsif @mode == 'comment' and @comment and @comment.visible? and @conf['yo_update.send_on_comment']
|
183
|
-
|
200
|
+
frag = "c%02d" % @diaries[@date.strftime("%Y%m%d")].count_comments(true)
|
201
|
+
url = yo_update_url(@date, frag)
|
202
|
+
yo_update_send_yo_or_log(nil, url)
|
184
203
|
end
|
185
204
|
end
|
186
205
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# recent_image.rb $Revision: 2.0.
|
1
|
+
# recent_image.rb $Revision: 2.0.5 $
|
2
2
|
#
|
3
3
|
# Copyright (c) 2005-2013 N.KASHIJUKU <n-kashi[at]whi.m-net.ne.jp>
|
4
4
|
# You can redistribute it and/or modify it under GPL2.
|
@@ -72,65 +72,13 @@ def get_filehash_rcimg(target)
|
|
72
72
|
end
|
73
73
|
|
74
74
|
|
75
|
-
def image_info_rcimg(
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
f = File.open(filename.untaint, "rb")
|
81
|
-
return image_type, image_height, image_width if f == nil
|
82
|
-
|
83
|
-
sig = f.read( 24 )
|
84
|
-
if /\A\x89PNG\x0D\x0A\x1A\x0A(....)IHDR(........)/on =~ sig
|
85
|
-
image_type = 'png'
|
86
|
-
image_width, image_height = $2.unpack( 'NN' )
|
87
|
-
|
88
|
-
elsif /\AGIF8[79]a(....)/on =~ sig
|
89
|
-
image_type = 'gif'
|
90
|
-
image_width, image_height = $1.unpack( 'vv' )
|
91
|
-
|
92
|
-
elsif /\A\xFF\xD8/on =~ sig
|
93
|
-
image_type = 'jpg'
|
94
|
-
data = $'
|
95
|
-
|
96
|
-
until data.empty?
|
97
|
-
if RUBY_VERSION >= '1.9.0'
|
98
|
-
break if data[0].unpack("C").first != 0xFF
|
99
|
-
break if data[1].unpack("C").first == 0xD9
|
100
|
-
else
|
101
|
-
break if data[0] != 0xFF
|
102
|
-
break if data[1] == 0xD9
|
103
|
-
end
|
104
|
-
|
105
|
-
data_size = data[2,2].unpack( 'n' ).first + 2
|
106
|
-
datax = data[1]
|
107
|
-
datax_s = [0xc0, 0xc1, 0xc2, 0xc3, 0xc5, 0xc6, 0xc7, 0xc9, 0xca, 0xcb, 0xcd, 0xce, 0xcf]
|
108
|
-
if RUBY_VERSION >= '1.9.0'
|
109
|
-
datax = data[1].unpack("C").first
|
110
|
-
datax_s = [0xc0]
|
111
|
-
end
|
112
|
-
|
113
|
-
if datax_s.index(datax) != nil
|
114
|
-
image_height, image_width = data[5,4].unpack('nn')
|
115
|
-
break
|
116
|
-
else
|
117
|
-
if data.size < data_size
|
118
|
-
f.seek(data_size - data.size, File::IO::SEEK_CUR)
|
119
|
-
data = ''
|
120
|
-
else
|
121
|
-
data = data[data_size .. -1]
|
122
|
-
end
|
123
|
-
data << f.read( 128 ) if data.size <= 4
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
127
|
-
|
128
|
-
f.close
|
129
|
-
return image_type, image_height, image_width
|
75
|
+
def image_info_rcimg( f )
|
76
|
+
require 'fastimage'
|
77
|
+
info = FastImage.new( f )
|
78
|
+
[info.type.to_s.sub( /jpeg/, 'jpg' ), info.size].flatten
|
130
79
|
end
|
131
80
|
|
132
81
|
|
133
|
-
|
134
82
|
# Make sorted keys of @recent_image_hash
|
135
83
|
def keysort_rcimg
|
136
84
|
sortproc = Proc.new {|a, b|
|
@@ -203,7 +151,7 @@ def search_img_rcimg(date, body, subtitle, f_imghash)
|
|
203
151
|
f_name = f_imghash[%Q[#{date}_#{num}]] # and pick up params. -> image[0]=number, image[1]=title
|
204
152
|
next if f_name == nil
|
205
153
|
begin
|
206
|
-
type,
|
154
|
+
type, width, height = image_info_rcimg(%Q[#{@recent_image_dir}/#{f_name.delete("s")}].untaint)
|
207
155
|
image = ImageData.new
|
208
156
|
image.url = f_name
|
209
157
|
image.file = f_name.delete("s")
|
@@ -308,45 +256,6 @@ def count_image(name_filter = nil, title_filter = nil)
|
|
308
256
|
end
|
309
257
|
|
310
258
|
|
311
|
-
# PLUGIN body
|
312
|
-
# view_exif() ... input EXIF datas of images in your diary.
|
313
|
-
#
|
314
|
-
def view_exif(id = 0, exifparam ="")
|
315
|
-
init_rcimg if @recent_image_hash == nil or @recent_image_hash.length == 0
|
316
|
-
begin
|
317
|
-
require 'exifparser'
|
318
|
-
|
319
|
-
@image_date_exif ||= @date.strftime("%Y%m%d")
|
320
|
-
@exifparser = ExifParser.new(%Q[#{@image_dir}/#{@recent_image_hash[@image_date_exif+"_"+id.to_s].file}].untaint)
|
321
|
-
|
322
|
-
if exifparam == "" # return a formatted string.
|
323
|
-
model = @exifparser['Model'].to_s
|
324
|
-
focallength = @exifparser['FocalLength'].to_s
|
325
|
-
fnumber = @exifparser['FNumber'].to_s
|
326
|
-
exposuretime = @exifparser['ExposureTime'].to_s
|
327
|
-
isospeedratings = @exifparser['ISOSpeedRatings'].to_s
|
328
|
-
exposurebiasvalue = @exifparser['ExposureBiasValue'].to_s
|
329
|
-
if @exifparser.tag?('LensParameters')
|
330
|
-
lensname = "("+ @exifparser['LensParameters'].to_s + ")"
|
331
|
-
else
|
332
|
-
lensname = ""
|
333
|
-
end
|
334
|
-
return %Q[<div class="exifdatastr"><p>#{model}, #{focallength}, #{fnumber}, #{exposuretime}, ISO#{isospeedratings}, #{exposurebiasvalue}EV #{lensname}</p></div>]
|
335
|
-
else # return the requested value.
|
336
|
-
return @exifparser[exifparam.untaint].to_s
|
337
|
-
end
|
338
|
-
|
339
|
-
rescue
|
340
|
-
exp = ($!).to_s + "<br>"
|
341
|
-
($!).backtrace.each do |btinfo|
|
342
|
-
exp += btinfo
|
343
|
-
exp += "<br>"
|
344
|
-
end
|
345
|
-
return exp
|
346
|
-
end
|
347
|
-
end
|
348
|
-
|
349
|
-
|
350
259
|
# Callback Functions
|
351
260
|
|
352
261
|
# this is for view_exif().
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# view_exif.rb $Revision: 1.0.0 $
|
2
|
+
#
|
3
|
+
# Copyright (c) 2013 N.KASHIJUKU <n-kashi[at]whi.m-net.ne.jp>
|
4
|
+
# You can redistribute it and/or modify it under GPL2.
|
5
|
+
#
|
6
|
+
# http://www1.whi.m-net.ne.jp/n-kashi/recent_image.htm
|
7
|
+
#
|
8
|
+
# !caution! view_exif.rb needs recent_image.rb
|
9
|
+
#
|
10
|
+
require 'exifparser'
|
11
|
+
|
12
|
+
# PLUGIN body
|
13
|
+
# view_exif() ... input EXIF datas of images in your diary.
|
14
|
+
#
|
15
|
+
def view_exif(id = 0, exifparam ="")
|
16
|
+
init_rcimg if @recent_image_hash == nil or @recent_image_hash.length == 0
|
17
|
+
|
18
|
+
begin
|
19
|
+
@image_date_exif ||= @date.strftime("%Y%m%d")
|
20
|
+
@exifparser = ExifParser.new(%Q[#{@image_dir}/#{@recent_image_hash[@image_date_exif+"_"+id.to_s].file}].untaint)
|
21
|
+
|
22
|
+
if exifparam == "" # return a formatted string.
|
23
|
+
model = @exifparser['Model'].to_s
|
24
|
+
focallength = @exifparser['FocalLength'].to_s
|
25
|
+
fnumber = @exifparser['FNumber'].to_s
|
26
|
+
exposuretime = @exifparser['ExposureTime'].to_s
|
27
|
+
isospeedratings = @exifparser['ISOSpeedRatings'].to_s
|
28
|
+
exposurebiasvalue = @exifparser['ExposureBiasValue'].to_s
|
29
|
+
if @exifparser.tag?('LensParameters')
|
30
|
+
lensname = "("+ @exifparser['LensParameters'].to_s + ")"
|
31
|
+
else
|
32
|
+
lensname = ""
|
33
|
+
end
|
34
|
+
return %Q[<div class="exifdatastr"><p>#{model}, #{focallength}, #{fnumber}, #{exposuretime}, ISO#{isospeedratings}, #{exposurebiasvalue}EV #{lensname}</p></div>]
|
35
|
+
else # return the requested value.
|
36
|
+
return @exifparser[exifparam.untaint].to_s
|
37
|
+
end
|
38
|
+
|
39
|
+
rescue
|
40
|
+
exp = ($!).to_s + "<br>"
|
41
|
+
($!).backtrace.each do |btinfo|
|
42
|
+
exp += btinfo
|
43
|
+
exp += "<br>"
|
44
|
+
end
|
45
|
+
return exp
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
# Callback Functions
|
51
|
+
|
52
|
+
add_body_enter_proc(Proc.new do |date|
|
53
|
+
@image_date_exif = date.strftime("%Y%m%d")
|
54
|
+
""
|
55
|
+
end)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdiary-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tDiary contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tdiary
|
@@ -402,6 +402,7 @@ files:
|
|
402
402
|
- util/image-gallery/js/SmoothGallery/scripts/mootools-1.2.1-core-yc.js
|
403
403
|
- util/image-gallery/js/SmoothGallery/scripts/resizer.php
|
404
404
|
- util/image-gallery/misc/plugin/recent_image.rb
|
405
|
+
- util/image-gallery/misc/plugin/view_exif.rb
|
405
406
|
- util/image-gallery/skel/gallery.rhtml
|
406
407
|
- util/image-gallery/skel/gallery.rhtml.euc-jp
|
407
408
|
- util/image-gallery/tdiary.conf.igsample
|