機能 #598 » open-link-media.patch
core/plugin/command/command.rb | ||
---|---|---|
126 | 126 |
command(:open_link, |
127 | 127 |
name: _('リンクを開く'), |
128 | 128 |
condition: Plugin::Command[:HasOneMessage] & lambda{ |opt| |
129 |
opt.messages[0].entity.to_a.any? {|u| u[:slug] == :urls } },
|
|
129 |
opt.messages[0].entity.to_a.any? {|u| [:urls, :media].include?(u[:slug]) } },
|
|
130 | 130 |
visible: true, |
131 | 131 |
role: :timeline) do |opt| |
132 | 132 |
opt.messages[0].entity.to_a.each {|u| |
133 |
::Gtk::TimeLine.openurl(u[:url]) if u[:slug] == :urls } end |
|
133 |
url = |
|
134 |
case u[:slug] |
|
135 |
when :urls |
|
136 |
u[:expanded_url] || u[:url] |
|
137 |
when :media |
|
138 |
u[:media_url] |
|
139 |
end |
|
140 |
::Gtk::TimeLine.openurl(url) if url } end |
|
134 | 141 | |
135 | 142 |
command(:new_pane, |
136 | 143 |
name: _('新規ペインに移動'), |