Modules
- tw2.bootstrap
- tw2.bootstrap.forms
- tw2.captcha
- tw2.core
- tw2.d3
- tw2.dynforms
- tw2.dyntext
- tw2.etc
- tw2.excanvas
- tw2.forms
- tw2.jit
- tw2.jqplugins.chosen
- tw2.jqplugins.cookies
- tw2.jqplugins.dynatree
- tw2.jqplugins.fg
- tw2.jqplugins.flot
- tw2.jqplugins.fullcalendar
- tw2.jqplugins.jqgrid
- tw2.jqplugins.jqplot
- tw2.jqplugins.portlets
- tw2.jqplugins.select2
- tw2.jqplugins.ui
- tw2.jquery
- tw2.lesscss
- tw2.polymaps
- tw2.protovis.conventional
- tw2.protovis.core
- tw2.protovis.custom
- tw2.protovis.hierarchies
- tw2.qrcode
- tw2.rrd
- tw2.slideymenu
- tw2.sqla
- tw2.tinymce
- tw2.tipster
- tw2.util.html5shim
- tw2.wysihtml5
tw2.captcha
A captcha w2 widgets.
Get this source from http://github.com/toscawidgets/tw2.captcha
Captcha
- size
- Size of the field
- placeholder
- Placeholder text (HTML5 Only)
- audio
- Boolean to enable or not audio captcha.
- audio_icon
- URL for an audio icon.
- jpeg_generator
- Algorithm used to render the captcha image. Options:vanasco_dowty, mcdermott
- text_generator
- Text displayed on the captcha image.
- timeout
- Time in minutes during which the captcha will be valid.
- controller_prefix
- URL prefix of captcha controller
- picture_width
- Picture width in pixel.
- picture_height
- Picture width in pixel.
- picture_bg_color
- Picture background color.
- picture_fg_color
- Picture foreground color.
- text_font_size_min
- Minimal font size for the text on the captcha.
- text_font_size_max
- Maximal font size for the text on the captcha.
- text_font_path
- Full path to the font to be used in for the text. Either relative to the package or absolute.
- text_render_mode
- Rendering method for the text.
- ascii_char
- Character allowed in the ascii text
- num_char
- Number of character to put on the captcha
- start_range
- For the equation, minimum number allowed
- stop_range
- For the equation, maximum number allowed
class DemoCaptcha(Captcha):
key = "lkdsfhaldskflkfdalkfkahg;ahupiuyghi"
audio = True
jpeg_generator = 'vanasco_dowty'
text_generator = 'random_equation'
<%namespace name="tw" module="tw2.core.mako_util"/>
<span id="${w.attrs['id']}:wrapper">
<img id="${w.attrs['id']}_img"
src="${w.controller_prefix}/image/${w.payload}"/>
% if w.audio:
<a href="${w.controller_prefix}/audio/${w.payload}">
<img src="${w.audio_icon}" alt="Audio file" />
</a>
% endif
<input type="hidden"
id="${w.attrs['id']}:payload"
name="${w.attrs['id']}:payload"
value="${w.payload}"/>
<input type="text"
id="${w.attrs['id']}:value"
name="${w.attrs['id']}:value"/>
</span>