Giter VIP home page Giter VIP logo

vaadin-recaptcha's Introduction

ReCaptcha Add-on for Vaadin 7

Vaadin-recaptcha is a wrapper component for ReCaptcha. See http://www.google.com/recaptcha

Online demo

Try the add-on demo at http://demo.webstar.hu/vaadin-recaptcha

Usage

  1. Create your keys at http://www.google.com/recaptcha

  2. Include recaptcha javascript ajax api in your application. Simplest way is annotating your UI, or a parent component:

    @JavaScript("http://www.google.com/recaptcha/api/js/recaptcha_ajax.js")
    public class MyUI extends UI {
    
  3. Create, and add the component to your UI

    ReCaptcha captcha = new ReCaptcha(
        your_private_key,
        your public_key,
        new ReCaptchaOptions() {{//your options
            theme = "white";
        }}
    );
    layout.addComponent(captcha);
    
  4. Validate somewhere in an event handler

    if (!captcha.validate()) {
        Notification.show("Invalid!", Notification.Type.ERROR_MESSAGE);
        captcha.reload();
    } else {
        //do your job
    }
    

See DummyRegWithReCaptcha.java

Documentation

For ReCaptcha options see: https://developers.google.com/recaptcha/docs/customization.

Known Issues and limitations

  1. The racaptha api renders with javascript using ajax after page load. It means the component becames visible after everything is rendered, with flickering, and layout repaint. To avoid this you can fix the size from css, or put the component into a fixed size parent.

  2. The javascript api does not support more recaptcha on one page.

  3. The javascript api does not suport changing options (like theme, or language) on the same page. Once a component is rendered, all other components inherit the options, until page reload.

vaadin-recaptcha's People

Contributors

kumm avatar

Watchers

Koziołek avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.