Omeka icon indicating copy to clipboard operation
Omeka copied to clipboard

Allow "transparent" as a valid value.

Open seantwalsh opened this issue 8 years ago • 10 comments

seantwalsh avatar Jul 20 '16 18:07 seantwalsh

The "transparent" option is missing the start-of-string and end-of-string anchors, so it will validate anything with "transparent" in it anywhere, opening a big hole in the validation.

zerocrates avatar Jul 20 '16 19:07 zerocrates

Also, the validation message has to be updated to correctly reflect what values are legal.

zerocrates avatar Jul 20 '16 19:07 zerocrates

Just out of curiosity, what's your use-case for having transparent in the custom color selector?

zerocrates avatar Jul 21 '16 21:07 zerocrates

I'm creating a custom theme for a client who wish to make it public once it is finalized. One of the key things this theme will do is allow for a lot of customization via the theme configuration. In some cases I can imagine that having transparent colors would be needed to implement designs with background graphics.

While a user can leave a color field empty it ultimately defaults to what the theme provides vs. being transparent.

seantwalsh avatar Jul 23 '16 17:07 seantwalsh

@kimisgold are we doing any programmatic lightening/darkening of user-set colors that would have to take account of the ability to set "transparent"? I seem to remember that we are somewhere.

zerocrates avatar Jul 23 '16 17:07 zerocrates

We do in the Thanks, Roy theme. It'd be pretty simple to accommodate, especially since it only occurs in one theme.

kimisgold avatar Jul 25 '16 14:07 kimisgold

Fixing Thanks, Roy to understand "transparent" won't be difficult, but I'm concerned about the many themes out there that are local edits of Thanks, Roy or otherwise are based off of it.

If allowing "transparent" was triggered by an option on the validator (with the default being to not allow it), that would avoid any possible problem as any old theme that couldn't deal with it would also not specify the option.

zerocrates avatar Jul 26 '16 19:07 zerocrates

Completely understandable, I can work on making it triggered via an option on the validator.

seantwalsh avatar Jul 26 '16 19:07 seantwalsh

Thanks! Feel free to ask for advice if you think you need it. As I remember, validator options are pretty straightforward but there's just some boilerplate involved (accepting both arrays and Zend_Config objects at least).

zerocrates avatar Jul 26 '16 19:07 zerocrates

I'm trying to get things wrapped up for 2.5, so if there's no movement here by the end of the week, I'm going to push this off of the 2.5 release.

zerocrates avatar Dec 13 '16 19:12 zerocrates