paginagmbh / redmine_lightbox2

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

DMSF thumbnails support #40

Closed dinya closed 7 years ago

dinya commented 7 years ago

Thanks a lot for amazing plugin!

The question

  1. Thumbnail with internal redmine macros
{{thumbnail(fig.png, size=300)}}
  1. Thumbnail with DMSF macros
{{dmsftn(777, size=300)}}

The first works well with redmine_lightbox2 (I use v0.3.2) --- the figure is opened in the current tab as window. The second doesn't work --- it's opened in the new tab like without redmine_lightbox2.

Is it possible to add DMSF thumbnails support?

tofi86 commented 7 years ago

This should be doable. I will try to have a look in the next couple of days...

tofi86 commented 7 years ago

Note: In Redmine 3.4 the DMFS plugin seems to have a bug with the size parameter: https://github.com/danmunn/redmine_dmsf/issues/746 It does not get evaluated.

tofi86 commented 7 years ago

Alright, this has been resolved with new version 0.4.1 for Redmine 3.4

tofi86 commented 7 years ago

This has been backported to Redmine 3.3 branch without testing and made available as version 0.3.4 for Redmine 3.3

dinya commented 7 years ago

Thanks for the work done!

But v0.3.4 doesn't work with {{dmsftn}} under Redmine 3.3.1 + DMSF 1.5.9 (from master) + Ruby 2.3.3-p222 (Ubuntu 16.04 x64): the figure is opened in the new tab like in the original Redmine.

tofi86 commented 7 years ago

Unfortunately I don't have a Redmine 3.3 around here for testing. I could set up a dev installation but that would take a while.

Can you please copy the HTML a element including img child element of the thumbnail and insert here?

And then please disable the lightbox plugin and copy the same, original element once again and insert here. This is the original element and I have to see what I have to modify.

dinya commented 7 years ago

Can you please copy the HTML a element including img child element of the thumbnail and insert here?

And then please disable the lightbox plugin and copy the same, original element once again and insert here. This is the original element and I have to see what I have to modify.

With redmine_lightbox2 v0.3.4

<a target="_blank" title="" data-downloadurl="image/png:TEST_IMAGE.png:/dmsf/files/351/view" href="/dmsf/files/351/view"><img alt="TEST_IMAGE" width="auto" height="200" src="/dmsf/files/351/view" /></a>

Without redmine_lightbox2 v0.3.4 (redmine_lightbox2 was deleted with bundle exec rake redmine:plugins:migrate NAME=redmine_lightbox2 VERSION=0 RAILS_ENV=production and plugin directory was removed from plugins)

<a target="_blank" title="" data-downloadurl="image/png:TEST_IMAGE.png:/dmsf/files/351/view" href="/dmsf/files/351/view"><img alt="TEST_IMAGE" width="auto" height="200" src="/dmsf/files/351/view" /></a>

They are seem identically?

tofi86 commented 7 years ago

Thanks! Indeed they look the same, but with the lightbox it should look different...

Which browser do you use?

Where did you use the thumbnail macro? On a wiki page or in an issue description/comment? Or somewhere else?

Can you reinstall the plugin and make sure you run the plugin migration? And also make sure to clear the browser cache for your redmine site after that so that JavaScript files get a fresh reload...

dinya commented 7 years ago

And also make sure to clear the browser cache for your redmine site after that so that JavaScript files get a fresh reload...

This helped. Thanks!

btw, {{dmsf_image(8)}} macros inserts image too. Will you add it's support?

dinya commented 7 years ago

... and description from dmsf file.

I mean adding the result of {{dmsfdesc(351)}} to the file name in the figure subscription (like for ordinary attachments)

tofi86 commented 7 years ago

This helped. Thanks!

Great! Glad it works now! :-)

tofi86 commented 7 years ago

btw, {{dmsf_image(8)}} macros inserts image too. Will you add it's support?

I had a look at this as well, but it does not generate a Thumbnail Link (a element) which I could use as an anchor for the lightbox. So no, this will not be supported.

tofi86 commented 7 years ago

... and description from dmsf file.

I mean adding the result of {{dmsfdesc(351)}} to the file name in the figure subscription (like for ordinary attachments)

This is not doable because the description does not exist in the html code when {{dmsftn()}} macro was executed. I only add lightbox effect with javascript when page is loaded but in that stage I cannot pull the description with a macro anymore. Sorry.

dinya commented 7 years ago

I have filename.doc (ms office) file with id 100 in DMSF. I linked to the file with {{dmsf(100)}} on the wiki page.

When I click to corresdoning link the redmine_lightbox2 tries to render the dmsf document and shows popup window titled with filename.doc:

The requested content cannot be loaded.
Please try again later.
tofi86 commented 7 years ago

Thanks for reporting this. I will try to have a look this week...

tofi86 commented 7 years ago

I pushed a fix to the master branch for Redmine 3.4 and to the redmine-3.3 branch for Redmine 3.3

Can you please test it? It should work.

doc documents will not show in a lightbox, other documents will not as well, but PDF documents inserted with {{dmsf(100)}} will show in a preview lightbox.

Is this okay? If so, please tell me and I will release a new version in the next couple of days...

dinya commented 7 years ago

Unfortunately without any changes.

May be I made a mistake while update? I use redmine 3.3 and I made

git fetch
git checkout redmine-3.3
bundle exec rake redmine:plugins:migrate RAILS_ENV=production 

What I noted. After saving the text with {{dmsf(100)}} (docx) the plugin works: download -- not preview. But if I reload the page the plugin tries to show the preview window again

tofi86 commented 7 years ago

I assume you have already cloned the repository and checked out the branch redmine-3.3. In that case you only fetched the changes, but did not pull them:

git fetch
git checkout redmine-3.3
git pull
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

Try again and reload the page without cache (clear browser cache first or e.g. with Firefox use Ctrl+Shift+R).

dinya commented 7 years ago

@tofi86

It's ok now. Thanks!

tofi86 commented 7 years ago

Perfect! Glad it works! Enjoy!

dinya commented 7 years ago

@tofi86

*.bmp files are not avalible in preview.

tofi86 commented 7 years ago

As far as I know, bmp is also not supported as thumbnail in Redmine. The plugin never supported bmp files for preview, only JPG, JPEG, PNG, GIF.

dinya commented 6 years ago

Dear @tofi86,

Redmine DMSF 1.6.x allows documents attachements to issue.

Is it doable to add preview thumbnails of DMS section with preview lightbox?

Current variant

current

Attachments section

```html

test_image0.jpg View test_image0.jpg 763 KB Redmine Admin, 04/19/2018 12:16 PM Delete
Test image0
```

DMS section

```html

test image1 View (760 KB) Redmine Admin, 04/19/2018 12:17 PM

test ms word document (24.1 KB) Redmine Admin, 04/19/2018 12:38 PM

```

Want

want

DMS section like this

```html

test image1 View (760 KB) Redmine Admin, 04/19/2018 12:17 PM

test ms word document (24.1 KB) Redmine Admin, 04/19/2018 12:38 PM

test image1
```

My environment

My environment

``` Environment: Redmine version 3.4.5.stable Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux] Rails version 4.2.8 Environment production Database adapter Mysql2 SCM: Git 2.7.4 Filesystem Redmine plugins: ... redmine_dmsf 1.6.1 ... redmine_lightbox2 0.4.3 ... ```

tofi86 commented 6 years ago

The dmsf project needs to fix severe bug https://github.com/danmunn/redmine_dmsf/issues/845 first before I can do this.

Anyways, how is it possible to attach dmsf files to an issue? Haven't found a solution (but also couldn't access projects settings due to bug mentioned above).

dinya commented 6 years ago

Anyways, how is it possible to attach dmsf files to an issue? Haven't found a solution (but also couldn't access projects settings due to bug mentioned above).

Look at redmine_dmsf plugin settings in Administration. According to changelog this feature since 1.6.0. It looks like checkbox named smth like "Attach*issue*" (sorry, haven't Redmine with dmsf v1.6.x onboard near at hand).

tofi86 commented 6 years ago

found it, thanks! "act as attachable"

tofi86 commented 6 years ago

added a separate issue for this request => #53

@dinya please always open a new issue for requests in the future...

dinya commented 6 years ago

@tofi86

please always open a new issue for requests in the future...

Okay. Pardon, I just thought the request is in this issue context.