tdiary-contrib 5.0.6 → 5.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/tdiary/contrib/version.rb +1 -1
- data/plugin/comment_pushbullet.rb +4 -3
- data/plugin/en/nicovideo.rb +0 -4
- data/plugin/google_photos.rb +1 -1
- data/plugin/ja/nicovideo.rb +0 -4
- data/plugin/nicovideo.rb +5 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 83f450ca5f0bd73c888d7495ed05323b5104d3f67c3ca8f077dbf64e61409aa5
|
4
|
+
data.tar.gz: 4d6f9afd972dd55417dd82ea98f57a0acbd3bda8db2637ceecdd1edd84907c09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6330a3ef7dd885b07b75ddd3d16ca8b4c9857a52b596c5c8dba6f5121ced57b5c30833c10df38f47497696a54d397f0c3ee7424ae8441cc29f95a1196faa576
|
7
|
+
data.tar.gz: 621078f662b39ffa102b0a08df3717450fed12542465c4f9e75e70ad7bb09f5d125e9951529d00c377c33ebfb7b5c787e344a84286cededb31b71c68a27a4f09
|
@@ -26,7 +26,7 @@
|
|
26
26
|
# You can distribute this file under the GPL2 or any later version.
|
27
27
|
#
|
28
28
|
def comment_pushbullet
|
29
|
-
require '
|
29
|
+
require 'pushbullet_ruby'
|
30
30
|
|
31
31
|
header = (@conf['comment_mail.header'] || '').dup
|
32
32
|
header << ":#{@conf.date_format}" unless /%[a-zA-Z%]/ =~ header
|
@@ -35,8 +35,9 @@ def comment_pushbullet
|
|
35
35
|
body = @comment.body.sub( /[\r\n]+\Z/, '' )
|
36
36
|
link = @conf.base_url + anchor(@date.strftime('%Y%m%d')) + '#c' + "%02d"%serial
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
client = PushbulletRuby::Client.new(@conf['comment_pushbullet.access_token'])
|
39
|
+
params = {title: title, url: link, body: body}
|
40
|
+
client.push_link(id: client.me, params: params)
|
40
41
|
end
|
41
42
|
|
42
43
|
add_update_proc do
|
data/plugin/en/nicovideo.rb
CHANGED
data/plugin/google_photos.rb
CHANGED
@@ -9,7 +9,7 @@ def google_photos(src, width, height, alt="photo", place="photo", scale=nil)
|
|
9
9
|
scale = scale || @conf['google_photos.scale'] || 100
|
10
10
|
width = width.to_i * (scale.to_f / 100)
|
11
11
|
height = height.to_i * (scale.to_f / 100)
|
12
|
-
%Q|<img title="#{alt}" width="#{width}" height="#{height}" alt="#{alt}" src="#{src}" class="#{place} google">|
|
12
|
+
%Q|<img title="#{alt}" width="#{width.to_i}" height="#{height.to_i}" alt="#{alt}" src="#{src}" class="#{place} google">|
|
13
13
|
end
|
14
14
|
|
15
15
|
def google_photos_left(src, width, height, alt="photo", scale=nil)
|
data/plugin/ja/nicovideo.rb
CHANGED
data/plugin/nicovideo.rb
CHANGED
@@ -73,17 +73,12 @@ def nicovideo_iframe( video_id )
|
|
73
73
|
%Q|<iframe src="http://www.nicovideo.jp/thumb/#{video_id}" scrolling="no" style="border:1px solid #CCC;" frameborder="0"><a href="http://www.nicovideo.jp/watch/#{video_id}">#{label || 'link for nicovideo'}</a></iframe>\n|
|
74
74
|
end
|
75
75
|
|
76
|
-
def nicovideo_player(
|
76
|
+
def nicovideo_player(video_id, size = [640,360])
|
77
77
|
if feed?
|
78
|
-
nicovideo( video_id )
|
79
|
-
elsif base_url =~ /\Ahttps:/
|
80
78
|
nicovideo(video_id)
|
81
79
|
else
|
82
|
-
q = ''
|
83
|
-
|
84
|
-
q = "?w=#{h size[0]}&h=#{h size[1]}"
|
85
|
-
end
|
86
|
-
%Q|<script type="text/javascript" src="#{nicovideo_player_path}/thumb_watch/#{video_id}#{q}"></script>|
|
80
|
+
q = size ? "?w=#{h size[0]}&h=#{h size[1]}" : ''
|
81
|
+
%Q|<script type="application/javascript" src="https://embed.nicovideo.jp/watch/#{video_id}/script#{q}"></script>|
|
87
82
|
end
|
88
83
|
end
|
89
84
|
|
@@ -93,16 +88,15 @@ def nicovideo( video_id, label = nil, link = nil )
|
|
93
88
|
r << %Q|<div id="thumbnail-#{video_id}">|
|
94
89
|
api = nicovideo_call_api( video_id )
|
95
90
|
thumb = @conf.to_native( nicovideo_inline( video_id, api, label, link ), 'UTF-8' )
|
96
|
-
thumb.gsub!( /"INLINE_PLAYER"/, %Q|"#" onclick="return nicovideoPlayer( '#{video_id}' );"| )
|
97
91
|
r << thumb
|
98
92
|
r << '</div>'
|
99
93
|
if feed?
|
100
94
|
r.gsub!( /<a(?:[ \t\n\r][^>]*)?>/, '' )
|
101
95
|
r.gsub!( %r{</a[ \t\n\r]*>}, '' )
|
102
|
-
|
96
|
+
else
|
103
97
|
r << %Q|<div id="player-#{video_id}" style="display:none;background-color:#000;margin-left:2em;padding-bottom:4px;">|
|
104
98
|
r << %Q|<a name="player-#{video_id}">|
|
105
|
-
r << nicovideo_player(
|
99
|
+
r << nicovideo_player(video_id, [640,360])
|
106
100
|
r << %Q|</a>|
|
107
101
|
r << %Q|<div class="nicovideo-player-close" style="margin:4px;padding:8px;">|
|
108
102
|
r << %Q|<a href="#" onclick="return nicovideoThumbnail( '#{video_id}' )" style="background-color:black; color:white; margin:2px; padding:8px; border-color:white; border-radius:6px; border-width:2px; border-style:solid; text-decoration:none;">▲CLOSE PLAYER</a>|
|
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: 5.0.
|
4
|
+
version: 5.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tDiary contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tdiary
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: pushbullet_ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -506,7 +506,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
506
506
|
version: '0'
|
507
507
|
requirements: []
|
508
508
|
rubyforge_project:
|
509
|
-
rubygems_version: 2.
|
509
|
+
rubygems_version: 2.7.3
|
510
510
|
signing_key:
|
511
511
|
specification_version: 4
|
512
512
|
summary: tDiary contributions package
|