Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Planio/3.3 - PDF improvements #39

Merged
merged 2 commits into from
Jul 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/attachments/_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
:class => 'icon-only icon-magnifier lightbox_preview ' + attachment.filename.split('.').last.downcase,
:rel => 'attachments', :title => "#{attachment.filename}#{ (' - ' + attachment.description) unless attachment.description.blank? }" %>
<% end %>
<% if( attachment.filename =~ /.(pdf|swf)$/i ) %>
<% if attachment.is_pdf? %>
<%= link_to l(:button_view),
{ :controller => 'attachments', :action => 'download_inline',
:id => attachment, :filename => attachment.filename },
Expand Down Expand Up @@ -54,7 +54,7 @@
<%=
link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
{:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename},
:class => 'lightbox', :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
:class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
%>
</div>
<% end %>
Expand Down
7 changes: 6 additions & 1 deletion assets/javascripts/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ $(document).ready(function() {
closeSpeed : 150
});

$("div.attachments a.pdf").fancybox({
$("div.attachments a.pdf," +
"div.journal ul.details a[href$='.pdf']," +
"div.journal ul.details a[href$='.PDF']," +
"div.journal div.thumbnails a[href$='.pdf']," +
"div.journal div.thumbnails a[href$='.PDF']").fancybox({
type : 'iframe',
prevEffect : 'none',
nextEffect : 'none',
openSpeed : 300,
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
description 'This plugin lets you preview image, pdf and swf attachments in a lightbox.'
version '0.3.2'
url 'https://github.com/paginagmbh/redmine_lightbox2'
requires_redmine :version_or_higher => '3.3.0'
requires_redmine :version_or_higher => '3.2.0'
end


Expand Down