paginagmbh / redmine_lightbox2

Lightbox for image attachments in Redmine
MIT License
126 stars 96 forks source link

lightbox doesn't work in wiki #34

Closed mauro-miatello closed 7 years ago

mauro-miatello commented 7 years ago

my problem is in wiki, if I specify size:

{{thumbnail(TEST.PNG, size=640, title=Description)}}

it opens link directly

otherwirse, it opens a popup with error:

The requested content cannot be loaded. Please try again later.

tofi86 commented 7 years ago

hey, which version of the plugin do you use?

and which redmine version?

I just recently (2 days ago) patched an issue with thumbnail macros (see #33). So if you just cloned the plugin from master branch, the fix from #33 should be incorporated...

mauro-miatello commented 7 years ago

sorry, I've not seen the post this evening I'll try thanks

mauro-miatello commented 7 years ago

redmine 3.3.0 with Alternate theme lightbox 0.3.2

in the footer of the wiki it works

the two codes:

<a class="thumbnail" title="Koala.jpg" href="/attachments/825/Koala.jpg"><img alt="Koala.jpg" src="/attachments/thumbnail/825"></a>

<a class="lightbox" rel="thumbnails" title="Koala.jpg" href="/attachments/download/825/Koala.jpg"><img width="180" src="/attachments/download/825/Koala.jpg" alt="Koala"></a>

in the first, the "download" subfolder is missing

tofi86 commented 7 years ago

hey, this is a testcase I have in my dev environment:

bildschirmfoto-2017-02-04-um-13 02 40

It works well with size and title attribute in Redmine 3.3.0

The produced HTML for the thumbnail macro is

<a class="thumbnail" title="FooBar title" href="/attachments/download/32/test.png">
  <img alt="test.png" src="/attachments/thumbnail/32/300">
</a>
tofi86 commented 7 years ago

So if I understand your code correctly, the JavaScript isn't executed correctly to rewrite the URL for the thumbnail lightbox link.

Can you run the plugin migration again?

rake redmine:plugins:migrate RAILS_ENV=production

from the redmine root directory. Then please restart redmine instance.

then when loading the page, please open web console and change to console view. Relad the page with Ctrl+R and see whether there appear any JavaScript errors in the console...

tofi86 commented 7 years ago

Closing this because of inactivity...

@mmiat feel free to reopen whenever you'Re able to test again...

lialie commented 5 years ago

lightbox.js should also have 'bmp' extension which need rewrite the URL.