View Issue Details

IDProjectCategoryView StatusLast Update
0010210mantisbtfeaturepublic2016-11-20 06:34
ReporterChi-Yu Assigned Tocommunity  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.0a3 
Summary0010210: "Lightbox" support
Description

In my opinion, "Lightbox" would be a much more convenient way to go through multiple attached screenshots in a ticket than having to open every image in a new browser tab/window.

"Lightbox" can automatically create a "slideshow" of multiple attached images.

I tried to add this myself by adding the required scripts myself. This worked only partly as the "bug report page" suddenly had a black square on it, blocking all the fields.

TagsNo tags attached.

Activities

DGtlRift

DGtlRift

2009-03-16 08:46

reporter   ~0021055

This would make a great plugin rather then being included in the core.

jreese

jreese

2009-03-16 09:35

reporter   ~0021058

If you enable inline image previews, then you should be able to see all attached images directly on the bug view page. Lightbox just adds an extra, slow step to the process of viewing images, and doesn't work with many browsers, such as those on mobile devices.

Chi-Yu

Chi-Yu

2009-03-16 15:21

reporter   ~0021062

Inline image previews are size-limited. "Lightbox", as far as I know, uses the available space.

It's your project. Do whatever you feel is right.

jreese

jreese

2009-03-16 16:22

reporter   ~0021063

The size limitations are all configurable from the preset defaults:


$g_preview_attachments_inline_max_size = 256 * 1024;
$g_preview_max_width = 0;
$g_preview_max_height = 250;

I'm not trying to immediately shut down the idea, but I want to make sure that the problems don't already have existing solutions, without needing to bundle more third-party libraries, etc.

Chi-Yu

Chi-Yu

2009-03-16 16:44

reporter   ~0021064

I know that these are configurable but I don't like the idea of having multiple large pictures on the bug page. I would prefer small thumbnails and "Lightbox" to open a full view with "previous" and "next" links right on the same page.

But I would be happy with a plugin.

dregad

dregad

2014-04-28 08:26

developer   ~0040185

Interesting approach using CSS
http://tangledindesign.com/css-lightbox-made-practical-with-php/

kratib

kratib

2015-05-07 20:07

reporter   ~0050715

I've released this plugin to support Lightbox: https://github.com/infojunkie/MantisBT-Lightbox. Feel free to try it and open issues on the repo.

dregad

dregad

2015-05-08 03:16

developer   ~0050716

Hello Karim,

Thanks for the plugin.

I just had a quick look at the code, and noticed you're bundling jQuery/jQueryUI. I believe it would be preferable to replace that by a dependency on the existing plugins [1] to include them, thus avoiding code duplication. Also note that in 1.3.x branch, these libraries are bundled with Mantis.

In addition, I don't think the event you rely on to include the js scripts is the right one, EVENT_LAYOUT_RESOURCES would be more appropriate IMO.

Finally, if that's OK with you I would recommend to host this plugin in the mantisbt-plugins organization, see [2]

[1] https://github.com/mantisbt-plugins/jquery
https://github.com/mantisbt-plugins/jQuery-UI
[2] https://www.mantisbt.org/wiki/doku.php/mantisbt:mantis_plugins#the_github_mantisbt-plugins_organization

kratib

kratib

2015-05-08 13:29

reporter   ~0050720

Thanks for the feedback, I will make those changes. Couple of questions:

  • Regarding managing jQuery dependency: how best to depend on jQuery plugin for Mantis 1.2.x, but not require this dependency for Mantis 1.3.x? Any code example?

  • Regarding hooking on EVENT_LAYOUT_RESOURCES: how best to trigger my code for the bug view page only? I am currently checking that $_SERVER['PHP_SELF'] === '/view.php'. Is that ok?

Thanks!

kratib

kratib

2015-05-09 14:31

reporter   ~0050723

I've updated the code at https://github.com/infojunkie/MantisBT-Lightbox to use the jQuery module, and also figured out a way to manage dependencies.

Please review and let me know if I should push to mantisbt-plugins. Note: I already am maintaining the Slack plugin there: https://github.com/mantisbt-plugins/Slack

hoquang8

hoquang8

2016-11-07 22:44

reporter   ~0054462

I've installed Plugin Lightbox at https://github.com/infojunkie/MantisBT-Lightbox, however my view page only display one image. how to show all images in attactments

dregad

dregad

2016-11-08 06:21

developer   ~0054465

I'm resolving this issue, since the requested functionality is covered by the plugin developed by @kratib.

https://github.com/infojunkie/MantisBT-Lightbox

Please report problems in the plugin's own issue tracker on Github, or contact the author.

Note: it was requested to move the plugin to the mantisbt-plugin organization, but that never took place.