From 1fc914fc3c98cca504465a8e40bb41ccbf73f3e9 Mon Sep 17 00:00:00 2001 From: Chad Johnston Date: Mon, 4 Mar 2013 19:16:39 -0700 Subject: [PATCH] Update readme --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 78f49e9..cce6d5e 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,49 @@ This plugin is designed to make using the ReCaptcha and Mailhide services within # Installation -This plugin is easily installed from the Grails plugin repository. +Add the following to your `grails-app/conf/BuildConfig.groovy` + + … + plugins { + … + compile ':recaptcha:0.6.2' + … + } + +Upon installation, run `grails recaptcha-quickstart` to create the skeleton configuration. The quickstart has two targets: `integrated` or `standalone`, depending on where you'd like the configuration to live. -Issue this command to install: `grails install-plugin recaptcha`. +## Integrated Configuration +Integrated configuration adds the following to the end of your `Config.groovy` file: -# Usage - ReCaptcha + // Added by the Recaptcha plugin: + recaptcha { + // These keys are generated by the ReCaptcha service + publicKey = "" + privateKey = "" -The plugin is simple to use. In order to use it, there are four basic steps: + // Include the noscript tags in the generated captcha + includeNoScript = true -## Edit the Configuration + // Force language change. See this for more: http://code.google.com/p/recaptcha/issues/detail?id=133 + forceLanguageInURL = false + + // Set to false to disable the display of captcha + enabled = true + + // Communicate using HTTPS + useSecureAPI = true + } + + mailhide { + // Generated by the Mailhide service + publicKey = "" + privateKey = "" + } + +This configuration can be modified to mimic the standalone if there is a need for different behavior depending on the current environment. -The plugin creates a file called `RecaptchaConfig.groovy` in `grails-app/conf` that has the following content: +## Standalone Configuration +Standlaone configuration creates a file called `RecaptchaConfig.groovy` in `grails-app/conf` with the following content: recaptcha { // These keys are generated by the ReCaptcha service @@ -53,7 +85,14 @@ The plugin creates a file called `RecaptchaConfig.groovy` in `grails-app/conf } } } -The values are pretty self-explanatory, and match with values used by the ReCaptcha service. You must enter your public and private ReCaptcha keys, or errors will be thrown when trying to display a captcha. Note that you can override values within the `environments` closure. + +# Usage - ReCaptcha + +The plugin is simple to use. In order to use it, there are four basic steps: + +## Edit the Configuration + +The configuration values are pretty self-explanatory, and match with values used by the ReCaptcha service. You must enter your public and private ReCaptcha keys, or errors will be thrown when trying to display a captcha. ## Use the Tag Library @@ -62,7 +101,7 @@ The plugin includes four ReCaptcha tags: ``, `` tag is a simple utility tag that will render the contents of the tag if the captcha is enabled in `RecaptchaConfig.groovy`. * The `` tag is a simple utility tag that will render the contents of the tag if the captcha is disabled in `RecaptchaConfig.groovy`. * The `` tag is responsible for generating the correct HTML output to display the captcha. It supports four attributes: "theme", "lang", "tabindex", and "custom\_theme\_widget". These attributes map directly to the values that can be set according to the ReCaptcha API. See the [ReCaptcha Client Guide](https://developers.google.com/recaptcha/intro) for more details. -* The `` tag is responsible for creating the correct HTML output to display the captcha in an AJAX manner. The tag creates a JavaScript method called `showRecaptcha` that takes an element name as a parameter. This elemtn will contain the generated ReCaptcha widget. This tag supports the same attributes as the `` tag. +* The `` tag is responsible for creating the correct HTML output to display the captcha in an AJAX manner. The tag creates a JavaScript method called `showRecaptcha` that takes an element name as a parameter. This element will contain the generated ReCaptcha widget. This tag supports the same attributes as the `` tag. * The `` tag will render its contents if the previous validation failed. Some ReCaptcha themes, like "clean", do not display error messages and require the developer to show an error message. Use this tag if you're using one of these themes. ## Verify the Captcha @@ -263,6 +302,7 @@ will create: ### CHANGELOG +* 0.6.2 Remove spurious `println` left over. Change install behavior to not create `RecaptchaConfig.groovy` in `_Install.groovy`. Add new script `recaptcha-quickstart` to handle creation of required configuration. * 0.6.0 Add the ability to display the widget using AJAX. Change plugin to require Grails 2.0 at a minimum. * 0.5.3 Add the ability to force a different language to be displayed. * 0.5.1 & 0.5.2 Update to use the new ReCaptcha URLs.