Autohandling should allow paths which are to be excluded / included
| Project: | Lightbox2 |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
On my site I use the automatic handling to display galleries of images. I also display lists of locations photographs were taken (with a single photo) and galleries of photos (likewise with a single photo). The photos in each of these should link to the location or gallery respectively.
Unfortunately the autohandler instead changes them all to open the image in a lightbox. I have worked around this in the javascript by adding a jQuery filter which restricts the autohandler to only allow nodes that have a path beginning with "/image", but I would prefer that a system were integrated into the autohandler itself by adding two configuration options, one specifying paths to allow and another specifying paths to deny. Ideally these should also allow regular expressions (although it's possibly confusing for some users that way).
For reference, my changes to the javascript were in auto_image_handling.js, changing
$("a:has("+classes+")").each(function(i) {
into
$("a:has("+classes+")").filter(
function() {
var m = new RegExp('^http:\/\/'+this.host+'\/image');
return this.href.match(m);
})
.each(function(i) {
If you think that this is a feature that is worth having, let me know, and I will go ahead and implement a patch for you.
