tdiary-contrib 4.1.3 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +21 -22
  3. data/js/hide_sidebar_smartphone.js +14 -0
  4. data/js/image_ex.js +11 -9
  5. data/lib/tdiary/contrib/version.rb +1 -1
  6. data/plugin/add_bookmark.rb +27 -31
  7. data/plugin/cocomment.rb +1 -1
  8. data/plugin/comment_pushbullet.rb +2 -1
  9. data/plugin/datepicker.rb +1 -1
  10. data/plugin/everytrail.rb +0 -5
  11. data/plugin/flickr.rb +4 -11
  12. data/plugin/google_adsense.rb +1 -1
  13. data/plugin/google_map.rb +1 -3
  14. data/plugin/hb_footer4sec_js.rb +1 -1
  15. data/plugin/hide_sidebar_smartphone.rb +6 -0
  16. data/plugin/image_ex.rb +1 -4
  17. data/plugin/image_gps.rb +7 -14
  18. data/plugin/jquery_ui_theme.rb +1 -1
  19. data/plugin/latlonglab_route.rb +1 -1
  20. data/plugin/livedoor_weather.rb +2 -2
  21. data/plugin/navi_day.rb +2 -2
  22. data/plugin/nicovideo.rb +3 -3
  23. data/plugin/picasa.rb +1 -8
  24. data/plugin/section_footer.rb +23 -25
  25. data/plugin/section_footer2.rb +1 -1
  26. data/plugin/select-style.rb +2 -2
  27. data/plugin/select_style.rb +2 -2
  28. data/plugin/tatsu_zine.rb +2 -2
  29. data/plugin/tdiarygraph_flashstyle.rb +1 -5
  30. data/plugin/tdiarytimes_flashstyle.rb +1 -5
  31. data/plugin/tdiarytimes_textstyle.rb +0 -7
  32. data/plugin/twitter_anywhere.rb +1 -3
  33. data/plugin/ustream.rb +1 -1
  34. data/plugin/vimeo.rb +1 -1
  35. data/plugin/yahoo_map.rb +4 -8
  36. data/plugin/youtube.rb +1 -8
  37. data/spec/spec_helper.rb +5 -11
  38. data/spec/youtube_spec.rb +0 -2
  39. data/util/estraier-search/estraier-search.rb +8 -14
  40. data/util/image-gallery/README.ja +2 -2
  41. data/util/rast-search/rast-search.rb +8 -14
  42. metadata +5 -4
  43. data/plugin/hide_sidebar_iphone.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dad562683f3ef04d5be651c704d813ae64c34aae
4
- data.tar.gz: 17a8e5702e650f9e613fbcb964bc5205bbb11f0e
3
+ metadata.gz: b0261647cb0391bb468ccc2df77df87cf5b6cf65
4
+ data.tar.gz: 6b51bbbe6917310a9027da41d4a04dbd122bf15a
5
5
  SHA512:
6
- metadata.gz: 177f717e43f0448a05f5e923288e915f7e65e029422bbd12a16b7293b38e723a5223c80ad970d818fc1c043ca701582781b85617db3f0f6f3b5043a0c5f4925a
7
- data.tar.gz: be994ffdfa8e0976b04730cc84858ab6542b50bc50369899c09f48d14c6f96ce601b8c5b139e24895006473231a3fa38653a216372fb0d5d6c262a9cbed72eaf
6
+ metadata.gz: da4972ac0fadf204dc2f4f1da359a16ae57ae32762acf35e46eba06a3495f7c3d376b341d43d52a46a6d066811e10aeea6bc8c3e4f86441d0ff8ac7215468892
7
+ data.tar.gz: 9b5e50c6d5ca78ad1d19948f0b17af6f981e774c11b70e7e5fc7ed5dbcc85d4163a3bd826efb75ab58cdf798d755b800617e5bf36a2dc9ca5456271f215ea670
@@ -1,7 +1,7 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- addressable (2.3.7)
4
+ addressable (2.3.8)
5
5
  coderay (1.1.0)
6
6
  crack (0.4.2)
7
7
  safe_yaml (~> 1.0.0)
@@ -9,10 +9,9 @@ GEM
9
9
  docile (1.1.5)
10
10
  json (1.8.3)
11
11
  method_source (0.8.2)
12
- mime-types (2.6.1)
13
- multi_json (1.10.1)
12
+ mime-types (2.6.2)
14
13
  netrc (0.10.3)
15
- pry (0.10.1)
14
+ pry (0.10.2)
16
15
  coderay (~> 1.1.0)
17
16
  method_source (~> 0.8.1)
18
17
  slop (~> 3.4)
@@ -20,34 +19,34 @@ GEM
20
19
  rest-client (1.7.3)
21
20
  mime-types (>= 1.16, < 3.0)
22
21
  netrc (~> 0.7)
23
- rspec (3.2.0)
24
- rspec-core (~> 3.2.0)
25
- rspec-expectations (~> 3.2.0)
26
- rspec-mocks (~> 3.2.0)
27
- rspec-core (3.2.0)
28
- rspec-support (~> 3.2.0)
29
- rspec-expectations (3.2.0)
22
+ rspec (3.3.0)
23
+ rspec-core (~> 3.3.0)
24
+ rspec-expectations (~> 3.3.0)
25
+ rspec-mocks (~> 3.3.0)
26
+ rspec-core (3.3.2)
27
+ rspec-support (~> 3.3.0)
28
+ rspec-expectations (3.3.1)
30
29
  diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.2.0)
32
- rspec-mocks (3.2.0)
30
+ rspec-support (~> 3.3.0)
31
+ rspec-mocks (3.3.2)
33
32
  diff-lcs (>= 1.2.0, < 2.0)
34
- rspec-support (~> 3.2.0)
35
- rspec-support (3.2.1)
33
+ rspec-support (~> 3.3.0)
34
+ rspec-support (3.3.0)
36
35
  ruby-pushbullet (0.1.3)
37
36
  json
38
37
  rest-client (~> 1.7.2)
39
38
  safe_yaml (1.0.4)
40
- simplecov (0.9.1)
39
+ simplecov (0.10.0)
41
40
  docile (~> 1.1.0)
42
- multi_json (~> 1.0)
43
- simplecov-html (~> 0.8.0)
44
- simplecov-html (0.8.0)
41
+ json (~> 1.8)
42
+ simplecov-html (~> 0.10.0)
43
+ simplecov-html (0.10.0)
45
44
  slop (3.6.0)
46
- tdiary (4.1.1)
45
+ tdiary (4.1.3)
47
46
  bundler (~> 1.3)
48
47
  thor (~> 0.18)
49
48
  thor (0.19.1)
50
- webmock (1.20.4)
49
+ webmock (1.21.0)
51
50
  addressable (>= 2.3.6)
52
51
  crack (>= 0.3.2)
53
52
 
@@ -64,4 +63,4 @@ DEPENDENCIES
64
63
  webmock
65
64
 
66
65
  BUNDLED WITH
67
- 1.10.3
66
+ 1.10.6
@@ -0,0 +1,14 @@
1
+ /*
2
+ * hide_sidebar_smartphone.js
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
+ if($(window).width() <= 360) {
10
+ $('div.sidebar').hide();
11
+ $('div.main').attr('width', '100%').attr('float', 'none');
12
+ }
13
+ });
14
+
@@ -62,18 +62,20 @@ $(function() {
62
62
  }
63
63
  }
64
64
 
65
- $(document).ready(function() {
66
- $("img.image-ex").bind("load", function() {
67
- resizeImage(this);
65
+ $(window).width() <= 360) {
66
+ $(document).ready(function() {
67
+ $("img.image-ex").bind("load", function() {
68
+ resizeImage(this);
69
+ });
68
70
  });
69
- });
70
71
 
71
- // for when images have been cached
72
- $(window).bind("load", function() {
73
- $("img.image-ex").each(function() {
74
- resizeImage(this);
72
+ // for when images have been cached
73
+ $(window).bind("load", function() {
74
+ $("img.image-ex").each(function() {
75
+ resizeImage(this);
76
+ });
75
77
  });
76
- });
78
+ }
77
79
  });
78
80
 
79
81
  // vim: set ts=3 sw=3 noexpandtab :
@@ -1,5 +1,5 @@
1
1
  module TDiary
2
2
  class Contrib
3
- VERSION = "4.1.3"
3
+ VERSION = "4.2.0"
4
4
  end
5
5
  end
@@ -15,37 +15,33 @@ end
15
15
  add_subtitle_proc do |date, index, subtitle|
16
16
  bookmark_init
17
17
 
18
- if @conf.mobile_agent? then
19
- caption = %Q|#{subtitle}|
20
- else
21
- caption = %Q|#{subtitle} |
22
-
23
- section_url = @conf.base_url + anchor(date.strftime('%Y%m%d')) + '#p' + ('%02d' % index)
24
-
25
- if @conf['add.bookmark.delicious'] == 't' then
26
- escaped_url = URI.escape(section_url, /[^-.!~*'()\w]/n)
27
- caption += %Q|<a href="http://delicious.com/save?url=#{escaped_url}" onclick="window.open('http://delicious.com/save?v=5;noui;jump=close;url=#{escaped_url};title='+encodeURIComponent(document.title), 'delicious', 'toolbar=no,width=550,height=550'); return false">|
28
- caption += %Q|<img src="http://static.delicious.com/img/delicious.small.gif" width="10" height="10" style="border: 0 none;vertical-align: middle;" alt="#{@caption_delicious}">|
29
- caption += %Q|</a> |
30
- end
31
-
32
- if @conf['add.bookmark.hatena'] == 't' then
33
- caption += %Q|<a href="http://b.hatena.ne.jp/append?#{h(section_url)}">|
34
- caption += %Q|<img src="http://b.hatena.ne.jp/images/append.gif" width="16" height="12" style="border: 0 none;vertical-align: middle;" alt="#{@caption_hatena}" title="#{@caption_hatena}">|
35
- caption += %Q|</a> |
36
- end
37
-
38
- if @conf['add.bookmark.livedoor'] == 't' then
39
- caption += %Q|<a href="http://clip.livedoor.com/redirect?link=#{h(section_url)}" class="ldclip-redirect">|
40
- caption += %Q|<img src="http://parts.blog.livedoor.jp/img/cmn/clip_16_16_w.gif" width="16" height="16" style="border: 0 none;vertical-align: middle;" alt="#{@caption_livedoor}" title="#{@caption_livedoor}">|
41
- caption += %Q|</a> |
42
- end
43
-
44
- if @conf['add.bookmark.buzzurl'] == 't' then
45
- caption += %Q|<a href="http://buzzurl.jp/entry/#{h(section_url)}">|
46
- caption += %Q|<img src="http://buzzurl.jp/static/image/api/icon/add_icon_mini_10.gif" width="16" height="12" style="border: 0 none;vertical-align: middle;" title="#{@caption_buzzurl}" alt="#{@caption_buzzurl}" class="icon">|
47
- caption += %Q|</a> |
48
- end
18
+ caption = %Q|#{subtitle} |
19
+
20
+ section_url = @conf.base_url + anchor(date.strftime('%Y%m%d')) + '#p' + ('%02d' % index)
21
+
22
+ if @conf['add.bookmark.delicious'] == 't' then
23
+ escaped_url = URI.escape(section_url, /[^-.!~*'()\w]/n)
24
+ caption += %Q|<a href="http://delicious.com/save?url=#{escaped_url}" onclick="window.open('http://delicious.com/save?v=5;noui;jump=close;url=#{escaped_url};title='+encodeURIComponent(document.title), 'delicious', 'toolbar=no,width=550,height=550'); return false">|
25
+ caption += %Q|<img src="http://static.delicious.com/img/delicious.small.gif" width="10" height="10" style="border: 0 none;vertical-align: middle;" alt="#{@caption_delicious}">|
26
+ caption += %Q|</a> |
27
+ end
28
+
29
+ if @conf['add.bookmark.hatena'] == 't' then
30
+ caption += %Q|<a href="http://b.hatena.ne.jp/append?#{h(section_url)}">|
31
+ caption += %Q|<img src="http://b.hatena.ne.jp/images/append.gif" width="16" height="12" style="border: 0 none;vertical-align: middle;" alt="#{@caption_hatena}" title="#{@caption_hatena}">|
32
+ caption += %Q|</a> |
33
+ end
34
+
35
+ if @conf['add.bookmark.livedoor'] == 't' then
36
+ caption += %Q|<a href="http://clip.livedoor.com/redirect?link=#{h(section_url)}" class="ldclip-redirect">|
37
+ caption += %Q|<img src="http://parts.blog.livedoor.jp/img/cmn/clip_16_16_w.gif" width="16" height="16" style="border: 0 none;vertical-align: middle;" alt="#{@caption_livedoor}" title="#{@caption_livedoor}">|
38
+ caption += %Q|</a> |
39
+ end
40
+
41
+ if @conf['add.bookmark.buzzurl'] == 't' then
42
+ caption += %Q|<a href="http://buzzurl.jp/entry/#{h(section_url)}">|
43
+ caption += %Q|<img src="http://buzzurl.jp/static/image/api/icon/add_icon_mini_10.gif" width="16" height="12" style="border: 0 none;vertical-align: middle;" title="#{@caption_buzzurl}" alt="#{@caption_buzzurl}" class="icon">|
44
+ caption += %Q|</a> |
49
45
  end
50
46
 
51
47
  <<-HTML
@@ -4,7 +4,7 @@
4
4
  # You can redistribute it and/or modify it under GPL2.
5
5
  #
6
6
 
7
- if @mode == 'day' and not bot? and not @conf.mobile_agent? then
7
+ if @mode == 'day' and not bot?
8
8
  add_body_enter_proc do |date|
9
9
  <<-SCRIPT
10
10
  <script type="text/javascript">
@@ -33,9 +33,10 @@ def comment_pushbullet
33
33
  serial = @diaries[@date.strftime('%Y%m%d')].count_comments(true)
34
34
  title = %Q|#{@date.strftime(header)}-#{serial} #{@comment.name}|
35
35
  body = @comment.body.sub( /[\r\n]+\Z/, '' )
36
+ link = @conf.base_url + anchor(@date.strftime('%Y%m%d')) + '#c' + "%02d"%serial
36
37
 
37
38
  Pushbullet.api_token = @conf['comment_pushbullet.access_token']
38
- Pushbullet::Contact.me.push_note(title, body)
39
+ Pushbullet::Contact.me.push_link(title,link,body)
39
40
  end
40
41
 
41
42
  add_update_proc do
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # not support
11
11
  #
12
- return if feed? || @conf.mobile_agent?
12
+ return if feed?
13
13
 
14
14
  if /\A(?:form|preview|append|edit|update)\z/ =~ @mode
15
15
  enable_js('//ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js')
@@ -9,9 +9,6 @@ def everytrail_adjust_size( size )
9
9
  s = size.collect {|i| i.to_i }
10
10
  s[0] = 400 if s[0] == 0
11
11
  s[1] = 300 if s[1] == 0
12
- if @conf.iphone? then
13
- s = [300, 300 * s[1] / s[0]]
14
- end
15
12
  s
16
13
  end
17
14
 
@@ -28,8 +25,6 @@ def everytrail_flash( trip_id, label = nil, size = [400, 300] )
28
25
  end
29
26
 
30
27
  def everytrail_widget( trip_id, latitude = nil, longtitude = nil, label = nil, size = [400, 300] )
31
- return '' if @conf.iphone?
32
-
33
28
  size = everytrail_adjust_size( size )
34
29
  lat_param = latitude ? "&amp;startLat=#{latitude}" : ''
35
30
  lon_param = longtitude ? "&amp;startLon=#{longtitude}" : ''
@@ -38,22 +38,15 @@ def flickr(photo_id, size = nil, place = 'flickr')
38
38
  return '[ERROR] flickr.rb: API Key is not specified.'
39
39
  end
40
40
  size ||= @conf['flickr.default_size']
41
- size = 'small' if @conf.smartphone?
42
41
  photo = flickr_photo_info(photo_id.to_s, size)
43
42
  unless photo
44
43
  return '[ERROR] flickr.rb: failed to get photo.'
45
44
  end
46
45
 
47
- if @conf.mobile_agent?
48
- body = %Q|<a href="#{photo[:src]}" class="flickr">#{photo[:title]}</a>|
49
- else
50
- body = %Q|<a href="#{photo[:page]}" class="flickr"><img title="#{photo[:title]}" alt="#{photo[:title]}" src="#{photo[:src]}" class="#{place}"|
51
- unless @conf.smartphone?
52
- body << %Q| width="#{photo[:width]}"| if photo[:width]
53
- body << %Q| height="#{photo[:height]}"| if photo[:height]
54
- end
55
- body << %Q|></a>|
56
- end
46
+ body = %Q|<a href="#{photo[:page]}" class="flickr"><img title="#{photo[:title]}" alt="#{photo[:title]}" src="#{photo[:src]}" class="#{place}"|
47
+ body << %Q| width="#{photo[:width]}"| if photo[:width]
48
+ body << %Q| height="#{photo[:height]}"| if photo[:height]
49
+ body << %Q|></a>|
57
50
 
58
51
  body
59
52
  end
@@ -74,7 +74,7 @@ def google_adsense_init( layout )
74
74
  end
75
75
 
76
76
  add_section_leave_proc do |date,index|
77
- if @mode == 'day' and !@conf.iphone? and index == 1 and @conf['google_adsense.slot'] then
77
+ if @mode == 'day' and index == 1 and @conf['google_adsense.slot'] then
78
78
  %Q|<div class="google-adsense">#{google_adsense( 0, @conf['google_adsense.slot'] )}</div>|
79
79
  else
80
80
  ''
@@ -47,11 +47,9 @@ def google_map_common(params)
47
47
  return %Q|<a href="#{url}">#{url}</a>| if url
48
48
 
49
49
  end
50
- return 'not support this environment.' if @conf.mobile_agent?
51
50
 
52
51
  dom_id = "#{@gmap_date.strftime("%Y%m%d")}_#{@gmap_count}"
53
52
  params.merge!(:id => dom_id)
54
- params.merge!(:width => 240, :height => 180) if @conf.iphone?
55
53
  @gmap_data << params
56
54
  @gmap_count += 1
57
55
 
@@ -60,7 +58,7 @@ end
60
58
 
61
59
  add_header_proc do
62
60
  if /\A(?:latest|day|month|nyear|preview)\z/ =~ @mode
63
- %Q|<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=#{!@conf.smartphone?.nil?}"></script>\n|
61
+ %Q|<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>\n|
64
62
  end
65
63
  end
66
64
 
@@ -15,7 +15,7 @@ def permalink( date, index, escape = true )
15
15
  end
16
16
 
17
17
  add_section_leave_proc do |date, index|
18
- if @mode == 'day' and not bot? and not @conf.mobile_agent? then
18
+ if @mode == 'day' and not bot?
19
19
  <<-SCRIPT
20
20
  <script type= "text/javascript"><!--
21
21
  var hatena_bookmark_anywhere_limit = 10;
@@ -0,0 +1,6 @@
1
+ # hide_sidebar_smartphone.rb
2
+ #
3
+ # Copyright (C) 2011 by TADA Tadashi <t@tdtds.jp>
4
+ # You can distribute it under GPL2 or any later version.
5
+ #
6
+ enable_js( 'hide_sidebar_smartphone.js' )
@@ -84,10 +84,7 @@
84
84
  @imageex_thumbnailsize = @options && @options['image_ex.previewsize'] || 120
85
85
  @imageex_yearlydir = @options && @options['image_ex.yearlydir'] || 0
86
86
 
87
- if @conf.smartphone?
88
- enable_js("image_ex.js")
89
- end
90
-
87
+ enable_js("image_ex.js")
91
88
 
92
89
  add_body_enter_proc(Proc.new do |date|
93
90
  @image_date = date.strftime("%Y%m%d")
@@ -92,7 +92,7 @@ def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
92
92
  detail += "#{exif[e].to_s}"+sep if exif.tag?(e)
93
93
  }
94
94
  unless lat.nil?
95
- unless (google_maps_api_key == '' || @conf.smartphone?)
95
+ unless google_maps_api_key == ''
96
96
  map_img = %Q["http://maps.googleapis.com/maps/api/staticmap?format=gif&amp;]
97
97
  map_img += %Q[center=#{lat},#{lon}&amp;zoom=14&amp;size=200x200&amp;markers=#{lat},#{lon}&amp;]
98
98
  map_img += %Q[key=#{google_maps_api_key}&amp;sensor=false"]
@@ -111,21 +111,14 @@ def image( id, alt = 'image', thumbnail = nil, size = nil, place = 'photo' )
111
111
 
112
112
  url = ''
113
113
 
114
- if @conf.mobile_agent?
115
- url += %Q[<a href=#{google}/maps/m?q=#{lat},#{lon}>] unless lat.nil?
116
- url += thumbnail ? img_t : img
117
- url += %Q[</a>] unless lat.nil?
118
- else
119
- url += %Q[<div class="photo_detail">]
120
- url += %Q[<a href="#{@image_url}/#{image}">]
121
- url += thumbnail ? img_t : img
122
- url += %Q[</a>]
123
- url += %Q[#{detail}] if detail
124
- url += %Q[</div>]
125
- end
114
+ url += %Q[<div class="photo_detail">]
115
+ url += %Q[<a href="#{@image_url}/#{image}">]
116
+ url += thumbnail ? img_t : img
117
+ url += %Q[</a>]
118
+ url += %Q[#{detail}] if detail
119
+ url += %Q[</div>]
126
120
 
127
121
  url
128
-
129
122
  end
130
123
  add_header_proc do
131
124
  if @mode !~ /conf$/ and not bot? then
@@ -9,7 +9,7 @@
9
9
  #
10
10
  # not support
11
11
  #
12
- return if feed? || @conf.mobile_agent?
12
+ return if feed?
13
13
 
14
14
  add_header_proc do
15
15
  if /\A(?:form|preview|append|edit|update)\z/ =~ @mode
@@ -8,7 +8,7 @@
8
8
 
9
9
  def route( id, w = 480, h = 480 )
10
10
 
11
- if feed? or @conf.mobile_agent?
11
+ if feed?
12
12
  return %Q|<p><a href="http://latlonglab.yahoo.co.jp/route/watch?id=#{id}">Link to LatLongLab Route</a></p>|
13
13
  end
14
14
 
@@ -97,7 +97,7 @@ def lwws_to_html(date)
97
97
 
98
98
  result = ""
99
99
  result << %Q|<div class="lwws">|
100
- if @conf['lwws.icon.disp'] != "t" or @conf.mobile_agent? then
100
+ if @conf['lwws.icon.disp'] != "t" then
101
101
  result << %Q|<a href="#{h(detail_url)}">#{telop}</a>|
102
102
  else
103
103
  result << %Q|<a href="#{h(detail_url)}"><img src="#{url}" border="0" alt="#{title}" title="#{title}" width=#{width} height="#{height}"></a>|
@@ -158,7 +158,7 @@ def lwws_conf_proc
158
158
  end
159
159
 
160
160
  add_body_enter_proc do |date|
161
- unless @conf.mobile_agent? or @conf.iphone? or feed? or bot?
161
+ unless feed? or bot?
162
162
  lwws_to_html(date)
163
163
  end
164
164
  end
@@ -46,9 +46,9 @@ end
46
46
  alias :calc_links_navi_day_backup :calc_links
47
47
 
48
48
  def calc_links
49
- if not (@conf.secure and @conf.mobile_agent?) and \
49
+ if not @conf.secure and \
50
50
  (/day|edit/ =~ @mode or \
51
- (@conf.mobile_agent? and /latest|month|nyear/ =~ @mode)) then
51
+ /latest|month|nyear/ =~ @mode) then
52
52
  if /(latest|month|nyear)/ === @mode
53
53
  today = @diaries.keys.sort[-1]
54
54
  else
@@ -54,7 +54,7 @@ def nicovideo_inline( video_id, elem, label = nil, link = nil )
54
54
  i[:thumb] = elem['thumbnail_url']
55
55
  i[:title] = label || elem['title']
56
56
  i[:desc] = elem['description']
57
- i[:comment] = @conf.mobile_agent? ? '' : elem['last_res_body']
57
+ i[:comment] = elem['last_res_body']
58
58
  i[:date] = elem['first_retrieve']
59
59
  i[:length] = elem['length']
60
60
  i[:view] = elem['view_counter']
@@ -74,7 +74,7 @@ def nicovideo_iframe( video_id )
74
74
  end
75
75
 
76
76
  def nicovideo_player( video_id, size = [544,384] )
77
- if feed? or @conf.mobile_agent? or @conf.iphone? then
77
+ if feed?
78
78
  nicovideo( video_id )
79
79
  else
80
80
  q = ''
@@ -94,7 +94,7 @@ def nicovideo( video_id, label = nil, link = nil )
94
94
  thumb.gsub!( /"INLINE_PLAYER"/, %Q|"#" onclick="return nicovideoPlayer( '#{video_id}' );"| )
95
95
  r << thumb
96
96
  r << '</div>'
97
- if feed? or @conf.mobile_agent? or @conf.iphone? then
97
+ if feed?
98
98
  r.gsub!( /<a(?:[ \t\n\r][^>]*)?>/, '' )
99
99
  r.gsub!( %r{</a[ \t\n\r]*>}, '' )
100
100
  else
@@ -19,14 +19,7 @@
19
19
  #
20
20
 
21
21
  def picasa( src, alt = "photo", place = 'photo' )
22
- src.sub!( %r|/s\d+/|, "/s200/" ) if @conf.iphone?
23
-
24
- if @cgi.mobile_agent?
25
- body = %Q|<a href="#{src}">#{alt}</a>|
26
- else
27
- body = %Q|<img title="#{alt}" alt="#{alt}" src="#{src}" class="#{place} picasa">|
28
- end
29
- body
22
+ %Q|<img title="#{alt}" alt="#{alt}" src="#{src}" class="#{place} picasa">|
30
23
  end
31
24
 
32
25
  def picasa_left( src, alt = "photo" )
@@ -53,40 +53,38 @@ end
53
53
  add_section_leave_proc do |date, index|
54
54
  r = '<div class="tags">'
55
55
 
56
- unless @conf.mobile_agent? then
57
- # カテゴリタグの追加
58
- if @category_to_tag_list and not @category_to_tag_list.empty? then
59
- r << "Tags: "
60
- @category_to_tag_list.each do |tag, blog|
61
- if blog
62
- r << %Q|<a href="#{@index}?blogcategory=#{h tag}">#{tag}</a> |
63
- else
64
- r << category_anchor( "#{tag}" ).sub( /^\[/, '' ).sub( /\]$/, '' ) << ' '
65
- end
56
+ # カテゴリタグの追加
57
+ if @category_to_tag_list and not @category_to_tag_list.empty? then
58
+ r << "Tags: "
59
+ @category_to_tag_list.each do |tag, blog|
60
+ if blog
61
+ r << %Q|<a href="#{@index}?blogcategory=#{h tag}">#{tag}</a> |
62
+ else
63
+ r << category_anchor( "#{tag}" ).sub( /^\[/, '' ).sub( /\]$/, '' ) << ' '
66
64
  end
67
65
  end
66
+ end
68
67
 
69
- # 「このエントリの Delicious history (JSON)」
70
- r << add_delicious_json(date, index)
68
+ # 「このエントリの Delicious history (JSON)」
69
+ r << add_delicious_json(date, index)
71
70
 
72
- # 「このエントリを含む Delicious (画像API)」
73
- # r << add_delicious(date, index)
71
+ # 「このエントリを含む Delicious (画像API)」
72
+ # r << add_delicious(date, index)
74
73
 
75
- # 「このエントリを含むはてなブックーク」
76
- r << add_hatenabm(date, index)
74
+ # 「このエントリを含むはてなブックーク」
75
+ r << add_hatenabm(date, index)
77
76
 
78
- # 「このエントリを含む livedoor クリップ」
79
- r << add_ldclip(date, index)
77
+ # 「このエントリを含む livedoor クリップ」
78
+ r << add_ldclip(date, index)
80
79
 
81
- # 「このエントリを含む Buzzurl」
82
- r << add_buzzurl(date, index)
80
+ # 「このエントリを含む Buzzurl」
81
+ r << add_buzzurl(date, index)
83
82
 
84
- # 「このエントリを含む Yahoo!ブックマーク」
85
- r << add_yahoobm(date, index)
83
+ # 「このエントリを含む Yahoo!ブックマーク」
84
+ r << add_yahoobm(date, index)
86
85
 
87
- # Permalinkの追加
88
- r << add_permalink(date, index)
89
- end
86
+ # Permalinkの追加
87
+ r << add_permalink(date, index)
90
88
 
91
89
  r << "</div>\n"
92
90
  end
@@ -99,7 +99,7 @@ def subtitle_link( date, index, subtitle )
99
99
  end
100
100
 
101
101
  add_section_leave_proc do |date, index|
102
- unless @conf.mobile_agent? or @conf.iphone? or feed? or bot?
102
+ unless feed? or bot?
103
103
  r = '<div class="tags">'
104
104
  # add category_tag
105
105
  if @category_to_tag_list and not @category_to_tag_list.empty? then
@@ -35,7 +35,7 @@ add_conf_proc( 'style', 'スタイル', 'update' ) do
35
35
 
36
36
  r = <<-HTML
37
37
  <h3 class="subtitle">スタイルの指定</h3>
38
- #{"<p>スタイル (日記の文法) を指定します。</p>" unless @conf.mobile_agent?}
38
+ <p>スタイル (日記の文法) を指定します。</p>
39
39
  <p>
40
40
  <select name="style">
41
41
  HTML
@@ -51,6 +51,6 @@ add_conf_proc( 'style', 'スタイル', 'update' ) do
51
51
  r << <<-HTML
52
52
  </select>
53
53
  </p>
54
- #{"<p>スタイルについての詳細は<a href=\"http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?%A5%B9%A5%BF%A5%A4%A5%EB\">スタイル - tDiary の記法</a>をごらんください。</p>" unless @conf.mobile_agent?}
54
+ <p>スタイルについての詳細は<a href="http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?%A5%B9%A5%BF%A5%A4%A5%EB">スタイル - tDiary の記法</a>をごらんください。</p>
55
55
  HTML
56
56
  end
@@ -27,7 +27,7 @@ add_conf_proc( 'style', 'スタイル' ) do
27
27
 
28
28
  r = <<-HTML
29
29
  <h3 class="subtitle">スタイルの指定</h3>
30
- #{"<p>スタイル (日記の文法) を指定します。</p>" unless @conf.mobile_agent?}
30
+ <p>スタイル (日記の文法) を指定します。</p>
31
31
  <p>
32
32
  <select name="style">
33
33
  HTML
@@ -37,6 +37,6 @@ add_conf_proc( 'style', 'スタイル' ) do
37
37
  r << <<-HTML
38
38
  </select>
39
39
  </p>
40
- #{"<p>スタイルについての詳細は<a href=\"http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?%A5%B9%A5%BF%A5%A4%A5%EB\">スタイル - tDiary の記法</a>をごらんください。</p>" unless @conf.mobile_agent?}
40
+ <p>スタイルについての詳細は<a href="http://tdiary-users.sourceforge.jp/cgi-bin/wiki.cgi?%A5%B9%A5%BF%A5%A4%A5%EB">スタイル - tDiary の記法</a>をごらんください。</p>
41
41
  HTML
42
42
  end
@@ -69,13 +69,13 @@ if __FILE__ == $0
69
69
  def test_tatsu_zine
70
70
  expect = <<-EOS
71
71
  <a class="amazon-detail" href="http://tatsu-zine.com/books/winrubybuild"><span class="amazon-detail">
72
- <img class="amazon-detail left" src="http://tatsu-zine.com/images/books/1/cover_s.jpg"
72
+ <img class="amazon-detail left" src="http://tatsu-zine.com/images/books/1/cover_l.jpg"
73
73
  height="150" width="100"
74
74
  alt="Ruby環境構築講座 Windows編">
75
75
  <span class="amazon-detail-desc">
76
76
  <span class="amazon-title">Ruby環境構築講座 Windows編</span><br>
77
77
  <span class="amazon-author">arton</span><br>
78
- <span class="amazon-price">1,000円(税込)</span>
78
+ <span class="amazon-price">1036</span>
79
79
  </span><br style="clear: left">
80
80
  </span></a>
81
81
  EOS
@@ -265,11 +265,7 @@ end
265
265
 
266
266
 
267
267
  def tdiarygraph_flashstyle_preview
268
- unless @conf.mobile_agent?
269
- <<-r
270
- <p>#{if @conf['tdiarygraph_f.preview'] == "1" then "#{tdiarygraph_flashstyle}" else "プレビュー表示を有効にすると、ここに Flash が表示されます。" end}</p>
271
- r
272
- end
268
+ %Q|<p>#{if @conf['tdiarygraph_f.preview'] == "1" then "#{tdiarygraph_flashstyle}" else "プレビュー表示を有効にすると、ここに Flash が表示されます。" end}</p>|
273
269
  end
274
270
 
275
271
 
@@ -240,11 +240,7 @@ end
240
240
 
241
241
 
242
242
  def tdiarytimes_flashstyle_preview
243
- unless @conf.mobile_agent?
244
- <<-r
245
- <p>#{if @conf['tdiarytimes_f.preview'] == "1" then "#{tdiarytimes_flashstyle}" else "プレビュー表示を有効にすると、ここに Flash が表示されます。" end}</p>
246
- r
247
- end
243
+ %Q|<p>#{if @conf['tdiarytimes_f.preview'] == "1" then "#{tdiarytimes_flashstyle}" else "プレビュー表示を有効にすると、ここに Flash が表示されます。" end}</p>|
248
244
  end
249
245
 
250
246
  def tdiarytimes_flashstyle_templete( filename="tdiarytimes234x30.swf", argvs="", width="234", height="30" )
@@ -212,13 +212,6 @@ end
212
212
  # --------------------------------------------------------------------
213
213
 
214
214
  def tdiarytimes_textstyle(init_text = nil, entr_text = nil, init_color = nil, entr_color = nil, fade_color = nil, init_css = nil, entr_css = nil, title_text = nil, fade_time = nil)
215
-
216
-
217
- # モバイル端末、テキストブラウザ、CSS非対応ブラウザ、検索ボットなどには結果を出力しない
218
-
219
- unless @cgi.mobile_agent? || @cgi.user_agent =~ %r[(#{tdiarytimes_textstyle_ignore_user_agent})]i
220
-
221
-
222
215
  r = ""
223
216
 
224
217
 
@@ -158,9 +158,7 @@ add_conf_proc( 'twitter_anywhere', 'Twitter Anywhere' ) do
158
158
  end
159
159
 
160
160
  def support_anywhere?
161
- return false if @conf.mobile_agent? || feed?
162
- return true
163
-
161
+ return !feed?
164
162
  end
165
163
 
166
164
  def ready_anywhere?
@@ -11,7 +11,7 @@ def ustream( id, type = :recorded )
11
11
  end
12
12
 
13
13
  # insert recorded video
14
- if @conf.mobile_agent? or @conf.iphone? or feed? then
14
+ if feed? then
15
15
  return %Q|<a href="http://www.ustream.tv/recorded/#{id}">Link to Ustream ##{id}</a></p><p>|
16
16
  end
17
17
 
@@ -6,7 +6,7 @@
6
6
  #
7
7
 
8
8
  def vimeo( id )
9
- if @conf.mobile_agent? or @conf.iphone? or feed? then
9
+ if feed? then
10
10
  return %Q|<a href="http://vimeo.com/#{id}">Link to vimeo ##{id}</a></p><p>|
11
11
  end
12
12
 
@@ -44,18 +44,14 @@ def yahoo_map(lat, lon, options = {})
44
44
  options[:layer] ||= 17
45
45
  options[:size] ||= 'medium'
46
46
 
47
- if feed? or @conf.mobile_agent? then
47
+ if feed?
48
48
  return %Q|<p><a href="http://map.yahoo.co.jp/pl?type=scroll&amp;lat=#{lat}&amp;lon=#{lon}&amp;z=17&amp;mode=map&amp;pointer=on&amp;datum=wgs&amp;fa=ks&amp;home=on&amp;hlat=#{lat}&amp;hlon=#{lon}&amp;layout=&amp;ei=utf-8&amp;p=">Link to Yahoo! JAPAN Map </a></p>|
49
49
  end
50
50
 
51
51
  # define map size
52
- height = {'iphone' => '240px', 'small'=> '240px', 'medium' => '360px', 'large' => '480px'}
53
- width = {'iphone' => '240px', 'small' => '320px', 'medium' => '480px', 'large' => '640px'}
54
- if @conf.iphone? then
55
- size = 'iphone'
56
- else
57
- size = options[:size]
58
- end
52
+ height = {'small'=> '240px', 'medium' => '360px', 'large' => '480px'}
53
+ width = {'small' => '320px', 'medium' => '480px', 'large' => '640px'}
54
+ size = options[:size]
59
55
 
60
56
  ymapid = generate_ymapid(lat, lon, options[:layer], options[:size])
61
57
  ymap_info = {:ymapid => ymapid, :lat => lat, :lon => lon, :layer => options[:layer]}
@@ -6,15 +6,8 @@
6
6
  # usage: <%= youtube 'VIDEO_ID' %>
7
7
  #
8
8
  def youtube( video_id, size = [425,350] )
9
- if @conf.mobile_agent? or feed? then
9
+ if feed?
10
10
  %Q|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>|
11
- elsif defined?( :smartphone? ) and @conf.smartphone?
12
- size = [240, 194]
13
- <<-TAG
14
- <iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0">
15
- </iframe>
16
- <div class="youtube"><a href="http://www.youtube.com/watch?v=#{video_id}">YouTube (#{video_id})</a></div>
17
- TAG
18
11
  else
19
12
  <<-TAG
20
13
  <iframe class="youtube-player" type="text/html" width="#{size[0]}" height="#{size[1]}" src="http://www.youtube.com/embed/#{video_id}" frameborder="0">
@@ -152,11 +152,11 @@ class PluginFake
152
152
  end
153
153
 
154
154
  def mobile_agent?
155
- @cgi.mobile_agent?
155
+ false
156
156
  end
157
157
 
158
158
  def smartphone?
159
- @cgi.iphone?
159
+ false
160
160
  end
161
161
 
162
162
  def bot?
@@ -169,7 +169,7 @@ class PluginFake
169
169
  end
170
170
 
171
171
  def iphone?
172
- @conf.cgi.iphone?
172
+ false
173
173
  end
174
174
  alias ipod? iphone?
175
175
  end
@@ -182,17 +182,11 @@ class CGIFake
182
182
  end
183
183
 
184
184
  def mobile_agent?
185
- self.user_agent =~ %r[
186
- ^DoCoMo|
187
- ^(?:KDDI|UP\.Browser)|
188
- ^(?:J-(?:PHONE|EMULATOR)|Vodafone|SoftBank|MOT-|[VS]emulator)|
189
- WILLCOM|DDIPOCKET|
190
- PDXGW|ASTEL|Palmscape|Xiino|sharp\ pda\ browser|Windows\ CE|L-mode
191
- ]x
185
+ false
192
186
  end
193
187
 
194
188
  def iphone?
195
- self.user_agent =~ /iP(?:hone|od)/
189
+ false
196
190
  end
197
191
  end
198
192
 
@@ -5,8 +5,6 @@ describe "youtube plugin" do
5
5
  DUMMY_YOUTUBE_VIDEO_ID = 1234567890
6
6
 
7
7
  {
8
- 'DoCoMo' => %|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{DUMMY_YOUTUBE_VIDEO_ID}">YouTube (#{DUMMY_YOUTUBE_VIDEO_ID})</a></div>|,
9
- 'iPhone' => %|\t\t<iframe class="youtube-player" type="text/html" width="240" height="194" src="http://www.youtube.com/embed/#{DUMMY_YOUTUBE_VIDEO_ID}" frameborder="0">\n\t\t</iframe>\n\t\t<div class="youtube"><a href="http://www.youtube.com/watch?v=#{DUMMY_YOUTUBE_VIDEO_ID}">YouTube (#{DUMMY_YOUTUBE_VIDEO_ID})</a></div>\n|,
10
8
  'Mozilla' => %|\t\t<iframe class="youtube-player" type="text/html" width="425" height="350" src="http://www.youtube.com/embed/#{DUMMY_YOUTUBE_VIDEO_ID}" frameborder="0">\n\t\t</iframe>\n|
11
9
  }.each do |k,v|
12
10
  it 'should render object tag in :user_agent' do
@@ -244,22 +244,16 @@ begin
244
244
  'type' => 'text/html',
245
245
  'Vary' => 'User-Agent'
246
246
  }
247
- if @cgi.mobile_agent? then
248
- body = conf.to_mobile( tdiary.eval_rhtml( 'i.' ) )
249
- head['charset'] = conf.mobile_encoding
250
- head['Content-Length'] = body.bytesize.to_s
247
+ if @cgi['type'] == 'rss'
248
+ head['type'] = "application/xml; charset=#{conf.encoding}"
249
+ body = tdiary.eval_rxml
251
250
  else
252
- if @cgi['type'] == 'rss'
253
- head['type'] = "application/xml; charset=#{conf.encoding}"
254
- body = tdiary.eval_rxml
255
- else
256
- body = tdiary.eval_rhtml
257
- end
258
- head['charset'] = conf.encoding
259
- head['Content-Length'] = body.bytesize.to_s
260
- head['Pragma'] = 'no-cache'
261
- head['Cache-Control'] = 'no-cache'
251
+ body = tdiary.eval_rhtml
262
252
  end
253
+ head['charset'] = conf.encoding
254
+ head['Content-Length'] = body.bytesize.to_s
255
+ head['Pragma'] = 'no-cache'
256
+ head['Cache-Control'] = 'no-cache'
263
257
  print @cgi.header( head )
264
258
  print body
265
259
  rescue Exception
@@ -10,8 +10,8 @@ tDiary Image Gallery Ver 2.1.0 -- README.ja --
10
10
 
11
11
  ■使い方の詳細は…
12
12
   以下のサイトをご覧下さい。
13
- ・配布サイト
14
-    http://www1.whi.m-net.ne.jp/n-kashi/image-gallery2.html
13
+ ・ドキュメント・サイト
14
+    http://exception.rash.jp/tdiary/image-gallery2.html
15
15
  ・作者の日記のサポート・ページ
16
16
     http://exception.rash.jp/diary/?date=20010101
17
17
 
@@ -219,22 +219,16 @@ begin
219
219
  'type' => 'text/html',
220
220
  'Vary' => 'User-Agent'
221
221
  }
222
- if @cgi.mobile_agent? then
223
- body = conf.to_mobile( tdiary.eval_rhtml( 'i.' ) )
224
- head['charset'] = conf.mobile_encoding
225
- head['Content-Length'] = body.size.to_s
222
+ if @cgi['type'] == 'rss'
223
+ head['type'] = "application/xml; charset=#{conf.encoding}"
224
+ body = tdiary.eval_rxml
226
225
  else
227
- if @cgi['type'] == 'rss'
228
- head['type'] = "application/xml; charset=#{conf.encoding}"
229
- body = tdiary.eval_rxml
230
- else
231
- body = tdiary.eval_rhtml
232
- end
233
- head['charset'] = conf.encoding
234
- head['Content-Length'] = body.size.to_s
235
- head['Pragma'] = 'no-cache'
236
- head['Cache-Control'] = 'no-cache'
226
+ body = tdiary.eval_rhtml
237
227
  end
228
+ head['charset'] = conf.encoding
229
+ head['Content-Length'] = body.size.to_s
230
+ head['Pragma'] = 'no-cache'
231
+ head['Cache-Control'] = 'no-cache'
238
232
  print @cgi.header( head )
239
233
  print body
240
234
  rescue Exception
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.1.3
4
+ version: 4.2.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: 2015-06-29 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tdiary
@@ -121,6 +121,7 @@ files:
121
121
  - js/datepicker.js
122
122
  - js/editor.js
123
123
  - js/flickr.js
124
+ - js/hide_sidebar_smartphone.js
124
125
  - js/image_ex.js
125
126
  - js/jquery.socialbutton.js
126
127
  - js/nicovideo.js
@@ -227,7 +228,7 @@ files:
227
228
  - plugin/hb_footer4sec.rb
228
229
  - plugin/hb_footer4sec_js.rb
229
230
  - plugin/hide_comment_form.rb
230
- - plugin/hide_sidebar_iphone.rb
231
+ - plugin/hide_sidebar_smartphone.rb
231
232
  - plugin/iddy.rb
232
233
  - plugin/image_ex.rb
233
234
  - plugin/image_gps.rb
@@ -464,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
464
465
  version: '0'
465
466
  requirements: []
466
467
  rubyforge_project:
467
- rubygems_version: 2.4.5
468
+ rubygems_version: 2.5.0
468
469
  signing_key:
469
470
  specification_version: 4
470
471
  summary: tDiary contributions package
@@ -1,21 +0,0 @@
1
- # hide_sidebar_iphone.rb
2
- #
3
- # Copyright (C) 2008 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
4
- # You can redistribute it and/or modify it under GPL2.
5
- #
6
-
7
- add_header_proc do
8
- if @conf.iphone? then
9
- <<-CSS
10
- <style type="text/css"><!--
11
- div.sidebar {
12
- display: none;
13
- }
14
- div.main {
15
- width: 100%;
16
- float: none;
17
- }
18
- --></style>
19
- CSS
20
- end
21
- end