Sha256: 269ee938e699947f2b465adf566cd1e5d79318f69c1ad87701717b09818709dd

Contents?: true

Size: 689 Bytes

Versions: 21

Compression:

Stored size: 689 Bytes

Contents

jQuery.fn.extend {
  reloadCaptcha: ->
    this[0].empty()
    grecaptcha.render this[0],
      sitekey: decko.recaptchaKey
}

initCaptcha = (form)->
  recapDiv = $("<div class='g-recaptcha' data-sitekey='#{decko.recaptchaKey}'>" +
    "</div>")
  $(form).children().last().after recapDiv
  recapUri = "https://www.google.com/recaptcha/api.js"

  # renders the first element with "g-recaptcha" class when loaded
  $.getScript recapUri

# call this if the recaptcha script is already initialized (via initCaptcha)
addCaptcha = (form)->
  recapDiv = $('<div class="g-recaptcha"></div>')
  $(form).children().last().after recapDiv
  grecaptcha.render recapDiv,
    sitekey: decko.recaptchaKey

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
card-1.96.8 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.7 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.6 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.5 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.4 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.3 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.2 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.1 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.96.0 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.95.3 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.95.2 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.95.1 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.95.0 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.94.1 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.94.0 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.93.13 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.93.12 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.93.11 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.93.10 mod/machines/lib/javascript/decko_recaptcha.js.coffee
card-1.93.9 mod/machines/lib/javascript/decko_recaptcha.js.coffee