Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to customize placement of refresh button in CCaptcha #3060

Closed
teo1978 opened this issue Nov 21, 2013 · 3 comments
Closed

Allow to customize placement of refresh button in CCaptcha #3060

teo1978 opened this issue Nov 21, 2013 · 3 comments

Comments

@teo1978
Copy link

teo1978 commented Nov 21, 2013

The refresh button in CCaptcha is placed after the captcha image in an ugly, hard-coded way in JavaScript.
Actually I think it's a bad idea to generate this html node via javascript in the first place: it would be preferrable to have the button html generated server-side and only its behavior assigned client side, or is there a good reason for that? Anyway.

The big issue is that its placement after the image is hard-coded in the js code.
Instead, it should be possible to customize it and decide whether to put it before or after the captcha image.

I think the best solution would be to have some sort of "template" property similar to those that are used in other widget.
So for example this property would have a default value of "{image} {button}" and one could change it to "{button} {image}" or "{image}
{button}", etc.

Currently, the only way to change its placement would be to replace the whole client script with a custom one.

@samdark
Copy link
Member

samdark commented Nov 21, 2013

Currently visual part can be changed via CSS.

@teo1978
Copy link
Author

teo1978 commented Nov 22, 2013

Yeah but you can't change the html code, for example whether the refresh button comes before or after the captcha image (you can have it appear visually before via css but that's unnecessarily tricky).
At the very least there should be an option to choose whether to have the button before or after the image, e.g. something like $buttonPlacement whose values would be either "beforeImage" or "afterImage" (or anything equivalent, e.g. a $buttonAfter which would be either true or false), but then I think a template would be much more flexible and effective, as it would allow not only to choose the order but also to place arbitrary html code between the two elements. If for example you want to put a "
" (or any other html node) between the image and button, currently the only way is to put it into the buttonLabel, which would be unelegant to say the least (and probably not even feasible at least in button mode).

@samdark
Copy link
Member

samdark commented Nov 22, 2013

OK. Makes sense.

@samdark samdark closed this as completed Nov 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants