tdiary 4.1.3 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +24 -25
- data/js/amazon.js +5 -35
- data/js/amazon_bitly.js +43 -0
- data/lib/tdiary/admin.rb +0 -8
- data/lib/tdiary/configuration.rb +5 -5
- data/lib/tdiary/core_ext.rb +5 -3
- data/lib/tdiary/dispatcher/index_main.rb +10 -16
- data/lib/tdiary/dispatcher/update_main.rb +8 -18
- data/lib/tdiary/filter/spam.rb +2 -2
- data/lib/tdiary/plugin/00default.rb +13 -37
- data/lib/tdiary/plugin/en/00default.rb +30 -32
- data/lib/tdiary/plugin/en/05referer.rb +4 -4
- data/lib/tdiary/plugin/ja/00default.rb +28 -31
- data/lib/tdiary/plugin/ja/05referer.rb +4 -4
- data/lib/tdiary/version.rb +1 -1
- data/lib/tdiary/view.rb +0 -4
- data/misc/plugin/amazon.rb +4 -2
- data/misc/plugin/amazon/amazonimg.rb +1 -1
- data/misc/plugin/category.rb +12 -20
- data/misc/plugin/category_autocomplete.rb +1 -1
- data/misc/plugin/comment_emoji_autocomplete.rb +1 -2
- data/misc/plugin/edit_today.rb +5 -9
- data/misc/plugin/en/pb-show.rb +2 -2
- data/misc/plugin/en/tb-show.rb +4 -4
- data/misc/plugin/hide-mail-field.rb +2 -2
- data/misc/plugin/image.rb +1 -3
- data/misc/plugin/ja/pb-show.rb +2 -2
- data/misc/plugin/ja/tb-show.rb +4 -4
- data/misc/plugin/my-ex.rb +0 -4
- data/misc/plugin/my-sequel.rb +10 -10
- data/misc/plugin/pb-show.rb +0 -6
- data/misc/plugin/ping.rb +1 -1
- data/misc/plugin/random_google.rb +12 -12
- data/misc/plugin/recent_rss.rb +3 -2
- data/misc/plugin/speed_comment.rb +1 -1
- data/misc/plugin/tb-show.rb +0 -6
- data/misc/plugin/weather.rb +3 -7
- data/spec/acceptance/save_conf_dnsbl_spec.rb +2 -2
- data/spec/core/core_ext_spec.rb +7 -0
- data/spec/plugin/plugin_helper.rb +3 -9
- metadata +4 -14
- data/views/i.category.rhtml +0 -6
- data/views/i.conf.rhtml +0 -14
- data/views/i.day.rhtml +0 -28
- data/views/i.diary.rhtml +0 -17
- data/views/i.footer.rhtml +0 -2
- data/views/i.header.rhtml +0 -3
- data/views/i.latest.rhtml +0 -24
- data/views/i.month.rhtml +0 -39
- data/views/i.search.rhtml +0 -5
- data/views/i.update.rhtml +0 -40
- data/views/i.update.rhtml.en +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e91db326489ae1530ad483470a8124f6835a38
|
4
|
+
data.tar.gz: e42ec452449cccfc8e42fc467b9de52e9e13b419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeac59a8654d182474b91d2acca85b7802d27082985e24331b19cde681b11faec7d838bb7ae0b6886aa9e05118ee3f2a1b0f4c69ac2bf539bc17042d1123b74e
|
7
|
+
data.tar.gz: cd1454d727a9f1a1a077ffdfc612e814c03d54765ca52730fff253e2b6bb0da5ff15ee7cbbb2b87014704db0d2942485740bc3f2d1f0d992ea7f948cce3332ed
|
data/Gemfile.lock
CHANGED
@@ -2,9 +2,9 @@ GEM
|
|
2
2
|
remote: https://rubygems.org/
|
3
3
|
specs:
|
4
4
|
addressable (2.3.8)
|
5
|
-
byebug (
|
5
|
+
byebug (5.0.0)
|
6
6
|
columnize (= 0.9.0)
|
7
|
-
capybara (2.
|
7
|
+
capybara (2.5.0)
|
8
8
|
mime-types (>= 1.16)
|
9
9
|
nokogiri (>= 1.3.3)
|
10
10
|
rack (>= 1.0.0)
|
@@ -28,15 +28,15 @@ GEM
|
|
28
28
|
docile (1.1.5)
|
29
29
|
domain_name (0.5.24)
|
30
30
|
unf (>= 0.0.5, < 1.0.0)
|
31
|
-
execjs (2.
|
31
|
+
execjs (2.6.0)
|
32
32
|
fastimage (1.7.0)
|
33
33
|
addressable (~> 2.3, >= 2.3.5)
|
34
|
-
ffi (1.9.
|
34
|
+
ffi (1.9.10)
|
35
35
|
gemoji (2.1.0)
|
36
36
|
hikidoc (0.1.0)
|
37
37
|
http-cookie (1.0.2)
|
38
38
|
domain_name (~> 0.5)
|
39
|
-
jasmine (2.3.
|
39
|
+
jasmine (2.3.1)
|
40
40
|
jasmine-core (~> 2.3)
|
41
41
|
phantomjs
|
42
42
|
rack (>= 1.2.1)
|
@@ -44,25 +44,25 @@ GEM
|
|
44
44
|
jasmine-core (2.3.4)
|
45
45
|
launchy (2.4.3)
|
46
46
|
addressable (~> 2.3)
|
47
|
-
libv8 (3.16.14.
|
47
|
+
libv8 (3.16.14.11)
|
48
48
|
mail (2.6.3)
|
49
49
|
mime-types (>= 1.16, < 3)
|
50
50
|
method_source (0.8.2)
|
51
|
-
mime-types (2.6.
|
51
|
+
mime-types (2.6.2)
|
52
52
|
mini_portile (0.6.2)
|
53
|
-
multi_json (1.11.
|
53
|
+
multi_json (1.11.2)
|
54
54
|
netrc (0.10.3)
|
55
55
|
nokogiri (1.6.6.2)
|
56
56
|
mini_portile (~> 0.6.0)
|
57
57
|
phantomjs (1.9.8.0)
|
58
58
|
pit (0.0.7)
|
59
|
-
power_assert (0.2.
|
60
|
-
pry (0.10.
|
59
|
+
power_assert (0.2.4)
|
60
|
+
pry (0.10.2)
|
61
61
|
coderay (~> 1.1.0)
|
62
62
|
method_source (~> 0.8.1)
|
63
63
|
slop (~> 3.4)
|
64
|
-
pry-byebug (3.
|
65
|
-
byebug (~>
|
64
|
+
pry-byebug (3.2.0)
|
65
|
+
byebug (~> 5.0)
|
66
66
|
pry (~> 0.10)
|
67
67
|
rack (1.6.4)
|
68
68
|
rack-test (0.6.3)
|
@@ -71,8 +71,8 @@ GEM
|
|
71
71
|
rack (>= 1.0)
|
72
72
|
rack-test (>= 0.5)
|
73
73
|
rake (10.4.2)
|
74
|
-
redcarpet (3.3.
|
75
|
-
ref (
|
74
|
+
redcarpet (3.3.3)
|
75
|
+
ref (2.0.0)
|
76
76
|
rest-client (1.8.0)
|
77
77
|
http-cookie (>= 1.0.2, < 2.0)
|
78
78
|
mime-types (>= 1.16, < 3.0)
|
@@ -81,40 +81,40 @@ GEM
|
|
81
81
|
rspec-core (~> 3.3.0)
|
82
82
|
rspec-expectations (~> 3.3.0)
|
83
83
|
rspec-mocks (~> 3.3.0)
|
84
|
-
rspec-core (3.3.
|
84
|
+
rspec-core (3.3.2)
|
85
85
|
rspec-support (~> 3.3.0)
|
86
|
-
rspec-expectations (3.3.
|
86
|
+
rspec-expectations (3.3.1)
|
87
87
|
diff-lcs (>= 1.2.0, < 2.0)
|
88
88
|
rspec-support (~> 3.3.0)
|
89
|
-
rspec-mocks (3.3.
|
89
|
+
rspec-mocks (3.3.2)
|
90
90
|
diff-lcs (>= 1.2.0, < 2.0)
|
91
91
|
rspec-support (~> 3.3.0)
|
92
92
|
rspec-support (3.3.0)
|
93
93
|
rubyzip (1.1.7)
|
94
|
-
selenium-webdriver (2.
|
94
|
+
selenium-webdriver (2.47.1)
|
95
95
|
childprocess (~> 0.5)
|
96
96
|
multi_json (~> 1.0)
|
97
97
|
rubyzip (~> 1.0)
|
98
98
|
websocket (~> 1.0)
|
99
|
-
sequel (4.
|
99
|
+
sequel (4.26.0)
|
100
100
|
simplecov (0.9.2)
|
101
101
|
docile (~> 1.1.0)
|
102
102
|
multi_json (~> 1.0)
|
103
103
|
simplecov-html (~> 0.9.0)
|
104
104
|
simplecov-html (0.9.0)
|
105
105
|
slop (3.6.0)
|
106
|
-
sprockets (3.
|
107
|
-
rack (
|
106
|
+
sprockets (3.3.5)
|
107
|
+
rack (> 1, < 3)
|
108
108
|
sqlite3 (1.3.10)
|
109
109
|
term-ansicolor (1.3.2)
|
110
110
|
tins (~> 1.0)
|
111
|
-
test-unit (3.1.
|
111
|
+
test-unit (3.1.4)
|
112
112
|
power_assert
|
113
113
|
therubyracer (0.12.2)
|
114
114
|
libv8 (~> 3.16.14.0)
|
115
115
|
ref
|
116
116
|
thor (0.19.1)
|
117
|
-
tins (1.
|
117
|
+
tins (1.6.0)
|
118
118
|
unf (0.1.4)
|
119
119
|
unf_ext
|
120
120
|
unf_ext (0.0.7.1)
|
@@ -136,7 +136,6 @@ DEPENDENCIES
|
|
136
136
|
launchy
|
137
137
|
mail
|
138
138
|
pit
|
139
|
-
pry
|
140
139
|
pry-byebug
|
141
140
|
rack
|
142
141
|
racksh
|
@@ -152,4 +151,4 @@ DEPENDENCIES
|
|
152
151
|
therubyracer
|
153
152
|
|
154
153
|
BUNDLED WITH
|
155
|
-
1.10.
|
154
|
+
1.10.6
|
data/js/amazon.js
CHANGED
@@ -1,43 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
* amazon.js :
|
2
|
+
* amazon.js :
|
3
|
+
* * remove height / width infomation of images
|
3
4
|
*
|
4
|
-
* Copyright (C)
|
5
|
+
* Copyright (C) 2015 by TADA Tadashi <t@tdtds.jp>
|
5
6
|
* You can distribute it under GPL2 or any later version.
|
6
7
|
*/
|
7
8
|
|
8
9
|
$(function(){
|
9
|
-
|
10
|
-
|
11
|
-
var api = 'http://api.bit.ly/v3/shorten'
|
12
|
-
+ '?format=json'
|
13
|
-
+ '&longUrl=' + encodeURIComponent(url)
|
14
|
-
+ '&login=' + $tDiary.plugin.bitly.login
|
15
|
-
+ '&apiKey=' + $tDiary.plugin.bitly.apiKey;
|
16
|
-
|
17
|
-
$.ajax({
|
18
|
-
type: 'GET',
|
19
|
-
url: api,
|
20
|
-
dataType: 'jsonp',
|
21
|
-
success: function(data){
|
22
|
-
if (data['data']){
|
23
|
-
link.attr('href',data['data']['url']);
|
24
|
-
}
|
25
|
-
else{
|
26
|
-
//console.warn('fail to short: ' + link.attr('href'));
|
27
|
-
}
|
28
|
-
}
|
29
|
-
});
|
10
|
+
if($(window).width() <= 360) {
|
11
|
+
$('img.amazon').attr('height', null).attr('width', null);
|
30
12
|
}
|
31
|
-
|
32
|
-
$(window).bind('scroll', function(event){
|
33
|
-
var bottom = $(window).height() + $(window).scrollTop();
|
34
|
-
//console.warn('window.bottom: ' + bottom);
|
35
|
-
$('a[href*="://www.amazon.co.jp/"]').each(function(){
|
36
|
-
var a = $(this);
|
37
|
-
if (bottom > a.offset().top){
|
38
|
-
//console.warn('appear!: ' + a.text());
|
39
|
-
shorten(a);
|
40
|
-
}
|
41
|
-
});
|
42
|
-
});
|
43
13
|
});
|
data/js/amazon_bitly.js
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
/*
|
2
|
+
* amazon_bitly.js : replace amazon URL using bit.ly (amzn.to).
|
3
|
+
*
|
4
|
+
* Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp>
|
5
|
+
* You can distribute it under GPL2 or any later version.
|
6
|
+
*/
|
7
|
+
|
8
|
+
$(function(){
|
9
|
+
function shorten(link){
|
10
|
+
var url = link.attr('href');
|
11
|
+
var api = 'http://api.bit.ly/v3/shorten'
|
12
|
+
+ '?format=json'
|
13
|
+
+ '&longUrl=' + encodeURIComponent(url)
|
14
|
+
+ '&login=' + $tDiary.plugin.bitly.login
|
15
|
+
+ '&apiKey=' + $tDiary.plugin.bitly.apiKey;
|
16
|
+
|
17
|
+
$.ajax({
|
18
|
+
type: 'GET',
|
19
|
+
url: api,
|
20
|
+
dataType: 'jsonp',
|
21
|
+
success: function(data){
|
22
|
+
if (data['data']){
|
23
|
+
link.attr('href',data['data']['url']);
|
24
|
+
}
|
25
|
+
else{
|
26
|
+
//console.warn('fail to short: ' + link.attr('href'));
|
27
|
+
}
|
28
|
+
}
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
$(window).bind('scroll', function(event){
|
33
|
+
var bottom = $(window).height() + $(window).scrollTop();
|
34
|
+
//console.warn('window.bottom: ' + bottom);
|
35
|
+
$('a[href*="://www.amazon.co.jp/"]').each(function(){
|
36
|
+
var a = $(this);
|
37
|
+
if (bottom > a.offset().top){
|
38
|
+
//console.warn('appear!: ' + a.text());
|
39
|
+
shorten(a);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
});
|
data/lib/tdiary/admin.rb
CHANGED
@@ -73,10 +73,6 @@ module TDiary
|
|
73
73
|
|
74
74
|
@title = @cgi.params['title'][0]
|
75
75
|
@body = @cgi.params['body'][0]
|
76
|
-
if @cgi.mobile_agent?
|
77
|
-
@title.force_encoding(@conf.mobile_encoding)
|
78
|
-
@body.force_encoding(@conf.mobile_encoding)
|
79
|
-
end
|
80
76
|
@title = @conf.to_native( @title )
|
81
77
|
@body = @conf.to_native( @body )
|
82
78
|
@old_date = @cgi.params['old'][0]
|
@@ -113,10 +109,6 @@ module TDiary
|
|
113
109
|
def initialize( cgi, rhtml, conf )
|
114
110
|
@title = cgi.params['title'][0]
|
115
111
|
@body = cgi.params['body'][0]
|
116
|
-
if cgi.mobile_agent?
|
117
|
-
@title.force_encoding(conf.mobile_encoding)
|
118
|
-
@body.force_encoding(conf.mobile_encoding)
|
119
|
-
end
|
120
112
|
@title = conf.to_native( @title )
|
121
113
|
@body = conf.to_native( @body )
|
122
114
|
@hide = cgi.params['hide'][0] == 'true' ? true : false
|
data/lib/tdiary/configuration.rb
CHANGED
@@ -40,14 +40,14 @@ module TDiary
|
|
40
40
|
@options2.delete( key )
|
41
41
|
end
|
42
42
|
|
43
|
-
# backword compatibility,
|
43
|
+
# backword compatibility, returns NOT mobile phone always
|
44
44
|
def mobile_agent?
|
45
|
-
|
45
|
+
false
|
46
46
|
end
|
47
47
|
|
48
|
-
# backword compatibility,
|
48
|
+
# backword compatibility, returns NOT smartphone always
|
49
49
|
def smartphone?
|
50
|
-
|
50
|
+
false
|
51
51
|
end
|
52
52
|
alias iphone? smartphone?
|
53
53
|
|
@@ -138,7 +138,7 @@ module TDiary
|
|
138
138
|
@secure = true unless @secure
|
139
139
|
@options = {}
|
140
140
|
|
141
|
-
eval( File::open( 'tdiary.conf' ) {|f| f.read }.untaint,
|
141
|
+
eval( File::open( 'tdiary.conf' ) {|f| f.read }.untaint, nil, "(tdiary.conf)", 1 )
|
142
142
|
|
143
143
|
# language setup
|
144
144
|
@lang = 'ja' unless @lang
|
data/lib/tdiary/core_ext.rb
CHANGED
@@ -4,12 +4,14 @@ require 'gemoji'
|
|
4
4
|
|
5
5
|
module TDiary
|
6
6
|
module RequestExtension
|
7
|
+
# backword compatibility, returns NOT mobile phone always
|
7
8
|
def mobile_agent?
|
8
|
-
|
9
|
+
false
|
9
10
|
end
|
10
11
|
|
12
|
+
# backword compatibility, returns NOT smartphone always
|
11
13
|
def smartphone?
|
12
|
-
|
14
|
+
false
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
@@ -43,7 +45,7 @@ class String
|
|
43
45
|
if emoji_alias == 'plus1' or emoji_alias == '+1'
|
44
46
|
emoji_url % (['plus1']*3)
|
45
47
|
elsif emoji = Emoji.find_by_alias(emoji_alias)
|
46
|
-
emoji_url % ([emoji.name]*3)
|
48
|
+
emoji_url % ([CGI.escape(emoji.name)]*3)
|
47
49
|
else
|
48
50
|
match
|
49
51
|
end
|
@@ -34,24 +34,18 @@ module TDiary
|
|
34
34
|
head['Cache-Control'] = 'no-cache'
|
35
35
|
return TDiary::Response.new( '', 200, head )
|
36
36
|
else
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
37
|
+
require 'digest/md5'
|
38
|
+
body = tdiary.eval_rhtml
|
39
|
+
head['ETag'] = %Q["#{Digest::MD5.hexdigest( body )}"]
|
40
|
+
if ENV['HTTP_IF_NONE_MATCH'] == head['ETag'] and request.get? then
|
41
|
+
head['status'] = CGI::HTTP_STATUS['NOT_MODIFIED']
|
41
42
|
else
|
42
|
-
|
43
|
-
|
44
|
-
head['ETag'] = %Q["#{Digest::MD5.hexdigest( body )}"]
|
45
|
-
if ENV['HTTP_IF_NONE_MATCH'] == head['ETag'] and request.get? then
|
46
|
-
head['status'] = CGI::HTTP_STATUS['NOT_MODIFIED']
|
47
|
-
else
|
48
|
-
head['charset'] = conf.encoding
|
49
|
-
head['Content-Length'] = body.bytesize.to_s
|
50
|
-
end
|
51
|
-
head['Pragma'] = 'no-cache'
|
52
|
-
head['Cache-Control'] = 'no-cache'
|
53
|
-
head['X-Frame-Options'] = conf.x_frame_options if conf.x_frame_options
|
43
|
+
head['charset'] = conf.encoding
|
44
|
+
head['Content-Length'] = body.bytesize.to_s
|
54
45
|
end
|
46
|
+
head['Pragma'] = 'no-cache'
|
47
|
+
head['Cache-Control'] = 'no-cache'
|
48
|
+
head['X-Frame-Options'] = conf.x_frame_options if conf.x_frame_options
|
55
49
|
head['cookie'] = tdiary.cookies if tdiary.cookies.size > 0
|
56
50
|
TDiary::Response.new( body, ::TDiary::Dispatcher.extract_status_for_legacy_tdiary( head ), head )
|
57
51
|
end
|
@@ -19,24 +19,14 @@ module TDiary
|
|
19
19
|
@tdiary = create_tdiary
|
20
20
|
begin
|
21
21
|
head = {}; body = ''
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
else
|
31
|
-
body = tdiary.eval_rhtml
|
32
|
-
head = {
|
33
|
-
'Content-Type' => 'text/html',
|
34
|
-
'charset' => conf.encoding,
|
35
|
-
'Content-Length' => body.bytesize.to_s,
|
36
|
-
'Vary' => 'User-Agent',
|
37
|
-
'X-Frame-Options' => 'SAMEORIGIN'
|
38
|
-
}
|
39
|
-
end
|
22
|
+
body = tdiary.eval_rhtml
|
23
|
+
head = {
|
24
|
+
'Content-Type' => 'text/html',
|
25
|
+
'charset' => conf.encoding,
|
26
|
+
'Content-Length' => body.bytesize.to_s,
|
27
|
+
'Vary' => 'User-Agent',
|
28
|
+
'X-Frame-Options' => 'SAMEORIGIN'
|
29
|
+
}
|
40
30
|
body = ( request.head? ? '' : body )
|
41
31
|
TDiary::Response.new( body, 200, head )
|
42
32
|
rescue TDiary::ForceRedirect
|
data/lib/tdiary/filter/spam.rb
CHANGED
@@ -165,13 +165,13 @@ module TDiary
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def lookup(domain, dnsbl, iplookup = false)
|
168
|
-
timeout(5) do
|
168
|
+
Timeout::timeout(5) do
|
169
169
|
domain = IPSocket::getaddress( domain ).split(/\./).reverse.join(".") if iplookup
|
170
170
|
address = Resolv.getaddress( "#{domain}.#{dnsbl}" )
|
171
171
|
debug("lookup:#{domain}.#{dnsbl} address:#{address}: spam host.")
|
172
172
|
return true
|
173
173
|
end
|
174
|
-
rescue
|
174
|
+
rescue Timeout::Error, Resolv::ResolvTimeout
|
175
175
|
debug("lookup:#{domain}.#{dnsbl}: safe host.")
|
176
176
|
return false
|
177
177
|
rescue Resolv::ResolvError, Exception
|
@@ -206,6 +206,7 @@ add_header_proc do
|
|
206
206
|
<<-HEADER
|
207
207
|
<meta http-equiv="Content-Type" content="text/html; charset=#{h charset}">
|
208
208
|
<meta name="generator" content="tDiary #{h TDIARY_VERSION}">
|
209
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
209
210
|
#{last_modified_header}
|
210
211
|
#{content_script_type}
|
211
212
|
#{author_name_tag}
|
@@ -217,14 +218,13 @@ add_header_proc do
|
|
217
218
|
#{jquery_tag.chomp}
|
218
219
|
#{script_tag.chomp}
|
219
220
|
#{css_tag.chomp}
|
220
|
-
#{smartphone_tag.chomp}
|
221
221
|
#{title_tag.chomp}
|
222
222
|
#{robot_control.chomp}
|
223
223
|
HEADER
|
224
224
|
end
|
225
225
|
|
226
226
|
def calc_links
|
227
|
-
if /day|edit/ =~ @mode
|
227
|
+
if /day|edit/ =~ @mode then
|
228
228
|
today = @date.strftime('%Y%m%d')
|
229
229
|
days = []
|
230
230
|
yms = []
|
@@ -261,11 +261,7 @@ def calc_links
|
|
261
261
|
end
|
262
262
|
|
263
263
|
def charset
|
264
|
-
|
265
|
-
@conf.mobile_encoding
|
266
|
-
else
|
267
|
-
@conf.encoding
|
268
|
-
end
|
264
|
+
@conf.encoding
|
269
265
|
end
|
270
266
|
|
271
267
|
def last_modified_header
|
@@ -423,21 +419,6 @@ def css_tag
|
|
423
419
|
CSS
|
424
420
|
end
|
425
421
|
|
426
|
-
def smartphone_tag
|
427
|
-
if @cgi.smartphone? then
|
428
|
-
<<-CSS
|
429
|
-
<meta name = "viewport" content = "width = device-width">
|
430
|
-
<style type="text/css"><!--
|
431
|
-
form.comment textarea {
|
432
|
-
width: 80%;
|
433
|
-
}
|
434
|
-
--></style>
|
435
|
-
CSS
|
436
|
-
else
|
437
|
-
''
|
438
|
-
end
|
439
|
-
end
|
440
|
-
|
441
422
|
def robot_control
|
442
423
|
if /^form|edit|preview|showcomment$/ =~ @mode then
|
443
424
|
'<meta name="robots" content="noindex,nofollow">'
|
@@ -468,7 +449,7 @@ add_title_proc do |date, title|
|
|
468
449
|
end
|
469
450
|
|
470
451
|
def nyear_link( date, title )
|
471
|
-
if @conf.show_nyear and @mode != 'nyear'
|
452
|
+
if @conf.show_nyear and @mode != 'nyear' then
|
472
453
|
m = date.strftime( '%m' )
|
473
454
|
d = date.strftime( '%d' )
|
474
455
|
years = @years.find_all {|year, months| months.include? m}
|
@@ -525,20 +506,15 @@ end
|
|
525
506
|
def subtitle_link( date, index, subtitle )
|
526
507
|
r = ''
|
527
508
|
|
528
|
-
if
|
529
|
-
r <<
|
530
|
-
r << %Q
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
r << %Q[name="p#{'%02d' % index}" ] if @anchor_name
|
535
|
-
param = "#{date.strftime( '%Y%m%d' )}#p#{'%02d' % index}"
|
536
|
-
titleattr = (not subtitle or subtitle.empty?) ? '' : %Q[ title="#{remove_tag( apply_plugin( subtitle )).gsub( /"/, """ )}"]
|
537
|
-
r << %Q[href="#{h @conf.index}#{anchor param}"#{titleattr}>#{@conf.section_anchor}</a> ]
|
538
|
-
end
|
539
|
-
|
540
|
-
r << %Q[(#{h @author}) ] if @multi_user and @author and subtitle
|
509
|
+
if date then
|
510
|
+
r << "<a "
|
511
|
+
r << %Q[name="p#{'%02d' % index}" ] if @anchor_name
|
512
|
+
param = "#{date.strftime( '%Y%m%d' )}#p#{'%02d' % index}"
|
513
|
+
titleattr = (not subtitle or subtitle.empty?) ? '' : %Q[ title="#{remove_tag( apply_plugin( subtitle )).gsub( /"/, """ )}"]
|
514
|
+
r << %Q[href="#{h @conf.index}#{anchor param}"#{titleattr}>#{@conf.section_anchor}</a> ]
|
541
515
|
end
|
516
|
+
|
517
|
+
r << %Q[(#{h @author}) ] if @multi_user and @author and subtitle
|
542
518
|
r << make_category_link( subtitle )
|
543
519
|
end
|
544
520
|
|
@@ -843,7 +819,7 @@ def conf_theme_list
|
|
843
819
|
<input name="css" size="30" value="#{h @conf.css}">
|
844
820
|
</p>
|
845
821
|
<p><img id="theme_thumbnail" src="http://www.tdiary.org/theme.image/#{img}.jpg" alt="#{@theme_thumbnail_label}"></p>
|
846
|
-
#{@theme_location_comment
|
822
|
+
#{@theme_location_comment}
|
847
823
|
HTML
|
848
824
|
end
|
849
825
|
|