mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-22 12:29:11 -04:00
Added the ability to identify and present the defined forms to the
adminstrator. The forms are presented as a checklist, I would have preferred a selection list, but Forge doesn't have one. The generated html to contain the recaptcha challenge is defined as <ul> as that was the only way to force itto line up.
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<script type="text/javascript" src="http://api.recaptcha.net/js/recaptcha_ajax.js"></script>
|
||||
<script>
|
||||
var site = (document.location.protocol == "http:") ? "<?= $form->recaptcha_site ?>" : "<?= $form->recaptcha_ssl_site ?>";
|
||||
var RecaptchaOptions = {lang: 'en'};
|
||||
var RecaptchaOptions = {lang: 'en', theme: "white"};
|
||||
|
||||
$("#gAdminRecaptcha form").ready(function() {
|
||||
$("#gAdminRecaptcha form ul li:last-child").before("<li id=recaptcha_div />");
|
||||
$("#gConfigureRecaptchaForm").ready(function() {
|
||||
$("#gConfigureRecaptchaForm :submit").before("<ul><li id=recaptcha_div /></ul>");
|
||||
$("#public_key").change(function() {
|
||||
showRecaptcha($(this).val());
|
||||
});
|
||||
@@ -22,15 +22,15 @@ function showRecaptcha(public_key) {
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
error: function(request, textStatus, errorThrown) {
|
||||
var public_key = $("#gAdminRecaptcha form ul li:first-child");
|
||||
var public_key = $("#gConfigureRecaptchaForm ul li:first-child");
|
||||
public_key.addClass("gError");
|
||||
$("#gAdminRecaptcha form ul li:first-child p").replaceWith("");
|
||||
$("#gConfigureRecaptchaForm ul li:first-child p").replaceWith("");
|
||||
public_key.append('<p class="gError">' + request.responseText + "</p>");
|
||||
},
|
||||
success: function(data, textStatus) {
|
||||
var public_key = $("#gAdminRecaptcha form ul li:first-child");
|
||||
var public_key = $("#gConfigureRecaptchaForm ul li:first-child");
|
||||
public_key.removeClass("gError");
|
||||
$("#gAdminRecaptcha form ul li:first-child p").replaceWith("");
|
||||
$("#gConfigureRecaptchaForm ul li:first-child p").replaceWith("");
|
||||
$("#recaptcha_div").html("<script type='text/javascript'>" + data.script + "</script" + ">");
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user