nanogallery2 icon indicating copy to clipboard operation
nanogallery2 copied to clipboard

Add description as alt text in viewer mode

Open jonkeane opened this issue 3 years ago • 3 comments

This adds the content from the description of the image to the alt tag when in viewer mode.

jonkeane avatar Jul 05 '21 18:07 jonkeane

I agree with this idea so the image has alt text by default, but I think this could be extended further to allow the user to specify alt text as a specific option if they so choose.

ajmeese7 avatar May 14 '23 17:05 ajmeese7

I agree with this idea so the image has alt text by default, but I think this could be extended further to allow the user to specify alt text as a specific option if they so choose.

I'm happy to try and add this as an option — but want to make sure I get what you're going for: Do you mean add an option like descriptionAsAlt: true to https://github.com/nanostudio-org/nanogallery2/blob/35b4e095988e460a8bc79ce549764c0b98121bb1/src/jquery.nanogallery2.core.js#L1325 and then surface that for configuration too? If it's true, do what's in this patch already, if false, then do nothing for alt text?

jonkeane avatar May 15 '23 13:05 jonkeane

@jonkeane I was thinking just have like an altText option that defaults to the description if not otherwise specified, something like the following modification to your code:

var alt_text = this.altText || this.description;

ajmeese7 avatar Jun 04 '23 18:06 ajmeese7