Plugin Directory

Changeset 3098902


Ignore:
Timestamp:
06/06/2024 07:10:45 PM (22 months ago)
Author:
hcaptcha
Message:

Update to version 4.2.1 from GitHub

Location:
hcaptcha-for-forms-and-more
Files:
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hcaptcha-for-forms-and-more/tags/4.2.1/assets/js/general.js

    r3095958 r3098902  
    152152    function clearMessage() {
    153153        $message.remove();
    154         $( '<div id="hcaptcha-message"></div>' ).insertAfter( '#hcaptcha-options h2' );
     154        $( '<div id="hcaptcha-message"></div>' ).insertAfter( '.hcaptcha-header-bar' );
    155155        $message = $( msgSelector );
    156156    }
  • hcaptcha-for-forms-and-more/tags/4.2.1/assets/js/general.min.js

    r3095958 r3098902  
    1 (()=>{var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var a=function(a){var n="#hcaptcha-message",c=a(n),o=a("form.hcaptcha-general"),r=a('[name="hcaptcha_settings[site_key]"]'),i=a('[name="hcaptcha_settings[secret_key]"]'),s=a("#check_config"),l=a("#reset_notifications"),h=a('[name="hcaptcha_settings[theme]"]'),p=a('[name="hcaptcha_settings[size]"]'),u=a('[name="hcaptcha_settings[language]"]'),d=a('[name="hcaptcha_settings[mode]"]'),f=a('[name="hcaptcha_settings[custom_themes][]"]'),v=a(".hcaptcha-general-custom-prop select"),m=a(".hcaptcha-general-custom-value input"),g=a('[name="hcaptcha_settings[config_params]"]'),b=a(".hcaptcha-section-enterprise + table input"),y=a('[name="hcaptcha_settings[recaptcha_compat_off][]"]'),C=o.find("#submit"),j={},O=r.val(),H=i.val(),k=T();j[HCaptchaGeneralObject.modeLive]=HCaptchaGeneralObject.siteKey,j[HCaptchaGeneralObject.modeTestPublisher]=HCaptchaGeneralObject.modeTestPublisherSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseSafeEndUser]=HCaptchaGeneralObject.modeTestEnterpriseSafeEndUserSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseBotDetected]=HCaptchaGeneralObject.modeTestEnterpriseBotDetectedSiteKey;var G=!1,S=!1,_=[];function w(e){var t={};return e.each((function(){var e=a(this),n=e.attr("name").replace(/hcaptcha_settings\[(.+)]/,"$1");t[n]=e.val()})),t}function T(){return w(b)}function A(){c.remove(),a('<div id="hcaptcha-message"></div>').insertAfter("#hcaptcha-options h2"),c=a(n)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e=void 0===e?"":String(e),e=(e+="\n"+function(){for(var e=["recaptchacompat disabled","Missing sitekey - https://hcaptcha.com/docs/configuration#jsapi"],t=[],a=0;a<_.length;a++){for(var n=_[a],c=n[0],o=n[1],r=Object.keys(o),i=[],s=0;s<r.length;s++){var l=o[s];"string"==typeof l&&-1===e.indexOf(l)&&i.push([c,l].join(" "))}t.push(i.join("\n"))}return _=[],t.join("\n")}()).trim()){c.removeClass(),c.addClass(t+" notice is-dismissible");var n=e.split("\n").map((function(e){return"<p>".concat(e,"</p>")}));c.html(n.join("")),a(document).trigger("wp-updates-notice-added");var o=a("#wpwrap").position().top;a("html, body").animate({scrollTop:c.offset().top-o-parseInt(c.css("margin-bottom"))},1e3)}}function x(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-success")}function N(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-error")}function L(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(hCaptcha.getParams(),t);hCaptcha.setParams(a);var n=document.querySelector("#hcaptcha-options .h-captcha");for(var c in n.innerHTML="",t.theme=null==t||null===(e=t.theme)||void 0===e||null===(e=e.palette)||void 0===e?void 0:e.mode,t.theme||delete t.theme,t)n.setAttribute("data-".concat(c),"".concat(t[c]));hCaptcha.bindEvents()}function K(e,a){var n=function(e){return e&&"object"===t(e)};return n(e)&&n(a)?(Object.keys(a).forEach((function(t){var c=e[t],o=a[t];Array.isArray(c)&&Array.isArray(o)?e[t]=c.concat(o):n(c)&&n(o)?e[t]=K(Object.assign({},c),o):e[t]=o})),e):a}function U(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(var n in e){var c=a?"".concat(a,"--").concat(n):n;if("object"===t(e[n])&&null!==e[n])U(e[n],c);else{var o=e[n],r=c.replace(/theme--/g,""),i="".concat(r,"=").concat(o),s=v.find('option[value*="'.concat(r,'="]'));1===s.length&&(s.attr("value",i),s.is(":selected")&&m.val(o))}}}function B(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=g.val().trim();a=a||null;try{e=JSON.parse(a)}catch(e){return g.css("background-color","#ffabaf"),C.attr("disabled",!0),void N("Bad JSON!")}e=K(e,t),g.val(JSON.stringify(e,null,2)),U(e),f.prop("checked")||(e={sitekey:r.val(),theme:h.val(),size:p.val(),hl:u.val()}),L(e)}function P(){r.val()===O&&i.val()===H?(G=!1,A(),C.attr("disabled",!1)):G||(G=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))}function J(e){return e=e.replace(/(http|https):\/\//,""),"https://"+new URL("https://"+e).host}!function(){_=[];var e=console.log,t=console.warn,a=console.info,n=console.error,c=console.clear;console.log=function(t){_.push(["Console log:",arguments]),e.apply(console,arguments)},console.warn=function(e){_.push(["Console warn:",arguments]),t.apply(console,arguments)},console.info=function(e){_.push(["Console info:",arguments]),a.apply(console,arguments)},console.error=function(e){_.push(["Console error:",arguments]),n.apply(console,arguments)},console.clear=function(){_=[],c()}}(),document.addEventListener("hCaptchaLoaded",(function(){N()})),s.on("click",(function(e){e.preventDefault(),""!==a(".hcaptcha-general-sample-hcaptcha iframe").attr("data-hcaptcha-response")?function(){A(),C.attr("disabled",!0);var e={action:HCaptchaGeneralObject.checkConfigAction,nonce:HCaptchaGeneralObject.checkConfigNonce,mode:d.val(),siteKey:r.val(),secretKey:i.val(),"h-captcha-response":a('textarea[name="h-captcha-response"]').val()};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:e,beforeSend:function(){return x(HCaptchaGeneralObject.checkingConfigMsg)}}).done((function(e){e.success?(O=r.val(),H=i.val(),k=w(b),S=!1,x(e.data),C.attr("disabled",!1)):N(e.data)})).fail((function(e){N(e.statusText)})).always((function(){L()}))}():kaggDialog.confirm({title:HCaptchaGeneralObject.completeHCaptchaTitle,content:HCaptchaGeneralObject.completeHCaptchaContent,type:"info",buttons:{ok:{text:HCaptchaGeneralObject.OKBtnText}},onAction:function(){return window.hCaptchaReset(document.querySelector(".hcaptcha-general-sample-hcaptcha"))}})})),r.on("change",(function(e){L({sitekey:a(e.target).val()}),P()})),i.on("change",(function(){P()})),h.on("change",(function(e){L({theme:a(e.target).val()})})),p.on("change",(function(e){var t=a("#hcaptcha-invisible-notice"),n=a(e.target).val();"invisible"===n?t.show():t.hide(),L({size:n})})),u.on("change",(function(e){L({hl:a(e.target).val()})})),d.on("change",(function(e){var t=a(e.target).val();j.hasOwnProperty(t)&&(t===HCaptchaGeneralObject.modeLive?(r.attr("disabled",!1),i.attr("disabled",!1)):(r.attr("disabled",!0),i.attr("disabled",!0)),L({sitekey:j[t]}))})),f.on("change",(function(){B()})),g.on("blur",(function(){B()})),g.on("focus",(function(){g.css("background-color","unset"),C.attr("disabled",!1)})),b.on("change",(function(){!function(){var t={onload:"hCaptchaOnLoad",render:"explicit"};y.prop("checked")&&(t.recaptchacompat="off"),f.prop("checked")&&(t.custom="true");var a={asset_host:"assethost",endpoint:"endpoint",host:"host",image_host:"imghost",report_api:"reportapi",sentry:"sentry"},n=T();for(var c in a){var o=n[c].trim();o&&(t[a[c]]=encodeURIComponent(J(o)))}var r=n.api_host.trim();r=J(r=r||"js.hcaptcha.com")+"/1/api.js";var i=new URL(r);for(var s in t)i.searchParams.append(s,t[s]);document.getElementById("hcaptcha-api").remove(),delete e.g.hcaptcha,document.querySelector("#hcaptcha-options .h-captcha").innerHTML="";var l=document.getElementsByTagName("head")[0],h=document.createElement("script");h.type="text/javascript",h.id="hcaptcha-api",h.src=i.href,l.appendChild(h)}(),JSON.stringify(T())===JSON.stringify(k)?(S=!1,A(),C.attr("disabled",!1)):S||(S=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))})),a(".hcaptcha-general h3").on("click",(function(e){var t=a(e.currentTarget);t.toggleClass("closed");var n={action:HCaptchaGeneralObject.toggleSectionAction,nonce:HCaptchaGeneralObject.toggleSectionNonce,section:t.attr("class").replaceAll(/(hcaptcha-section-|closed)/g,"").trim(),status:!t.hasClass("closed")};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:n}).done((function(e){e.success||N(e.data)})).fail((function(e){N(e.statusText)}))})),s.removeAttr("name"),l.removeAttr("name"),v.removeAttr("name"),m.removeAttr("name"),v.find("option").each((function(){var e=a(this);e.val().split("=")[1]||e.attr("disabled",!0)})),m.val(""),v.on("change",(function(){var e=a(this).find("option:selected").val().split("="),t=e[0],n=e[1];"palette--mode"===t?(m.attr("type","text"),m.val(n)):(m.val(n),m.attr("type","color"))})),m.on("change",(function(e){var t=a(e.target).val(),n=v.find("option:selected"),c=n.val().split("="),o=c[0],r=t;n.val(o+"="+t),B(r=(o="theme--"+c[0]).split("--").reverse().reduce((function(e,t){var a={};return a[t]=e,a}),r))}))};window.hCaptchaGeneral=a,jQuery(document).ready(a)})();
     1(()=>{var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var a=function(a){var n="#hcaptcha-message",c=a(n),o=a("form.hcaptcha-general"),r=a('[name="hcaptcha_settings[site_key]"]'),i=a('[name="hcaptcha_settings[secret_key]"]'),s=a("#check_config"),l=a("#reset_notifications"),h=a('[name="hcaptcha_settings[theme]"]'),p=a('[name="hcaptcha_settings[size]"]'),u=a('[name="hcaptcha_settings[language]"]'),d=a('[name="hcaptcha_settings[mode]"]'),f=a('[name="hcaptcha_settings[custom_themes][]"]'),v=a(".hcaptcha-general-custom-prop select"),m=a(".hcaptcha-general-custom-value input"),g=a('[name="hcaptcha_settings[config_params]"]'),b=a(".hcaptcha-section-enterprise + table input"),y=a('[name="hcaptcha_settings[recaptcha_compat_off][]"]'),C=o.find("#submit"),j={},O=r.val(),H=i.val(),k=T();j[HCaptchaGeneralObject.modeLive]=HCaptchaGeneralObject.siteKey,j[HCaptchaGeneralObject.modeTestPublisher]=HCaptchaGeneralObject.modeTestPublisherSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseSafeEndUser]=HCaptchaGeneralObject.modeTestEnterpriseSafeEndUserSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseBotDetected]=HCaptchaGeneralObject.modeTestEnterpriseBotDetectedSiteKey;var G=!1,S=!1,_=[];function w(e){var t={};return e.each((function(){var e=a(this),n=e.attr("name").replace(/hcaptcha_settings\[(.+)]/,"$1");t[n]=e.val()})),t}function T(){return w(b)}function A(){c.remove(),a('<div id="hcaptcha-message"></div>').insertAfter(".hcaptcha-header-bar"),c=a(n)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e=void 0===e?"":String(e),e=(e+="\n"+function(){for(var e=["recaptchacompat disabled","Missing sitekey - https://hcaptcha.com/docs/configuration#jsapi"],t=[],a=0;a<_.length;a++){for(var n=_[a],c=n[0],o=n[1],r=Object.keys(o),i=[],s=0;s<r.length;s++){var l=o[s];"string"==typeof l&&-1===e.indexOf(l)&&i.push([c,l].join(" "))}t.push(i.join("\n"))}return _=[],t.join("\n")}()).trim()){c.removeClass(),c.addClass(t+" notice is-dismissible");var n=e.split("\n").map((function(e){return"<p>".concat(e,"</p>")}));c.html(n.join("")),a(document).trigger("wp-updates-notice-added");var o=a("#wpwrap").position().top;a("html, body").animate({scrollTop:c.offset().top-o-parseInt(c.css("margin-bottom"))},1e3)}}function x(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-success")}function N(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-error")}function L(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(hCaptcha.getParams(),t);hCaptcha.setParams(a);var n=document.querySelector("#hcaptcha-options .h-captcha");for(var c in n.innerHTML="",t.theme=null==t||null===(e=t.theme)||void 0===e||null===(e=e.palette)||void 0===e?void 0:e.mode,t.theme||delete t.theme,t)n.setAttribute("data-".concat(c),"".concat(t[c]));hCaptcha.bindEvents()}function K(e,a){var n=function(e){return e&&"object"===t(e)};return n(e)&&n(a)?(Object.keys(a).forEach((function(t){var c=e[t],o=a[t];Array.isArray(c)&&Array.isArray(o)?e[t]=c.concat(o):n(c)&&n(o)?e[t]=K(Object.assign({},c),o):e[t]=o})),e):a}function U(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(var n in e){var c=a?"".concat(a,"--").concat(n):n;if("object"===t(e[n])&&null!==e[n])U(e[n],c);else{var o=e[n],r=c.replace(/theme--/g,""),i="".concat(r,"=").concat(o),s=v.find('option[value*="'.concat(r,'="]'));1===s.length&&(s.attr("value",i),s.is(":selected")&&m.val(o))}}}function B(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=g.val().trim();a=a||null;try{e=JSON.parse(a)}catch(e){return g.css("background-color","#ffabaf"),C.attr("disabled",!0),void N("Bad JSON!")}e=K(e,t),g.val(JSON.stringify(e,null,2)),U(e),f.prop("checked")||(e={sitekey:r.val(),theme:h.val(),size:p.val(),hl:u.val()}),L(e)}function P(){r.val()===O&&i.val()===H?(G=!1,A(),C.attr("disabled",!1)):G||(G=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))}function J(e){return e=e.replace(/(http|https):\/\//,""),"https://"+new URL("https://"+e).host}!function(){_=[];var e=console.log,t=console.warn,a=console.info,n=console.error,c=console.clear;console.log=function(t){_.push(["Console log:",arguments]),e.apply(console,arguments)},console.warn=function(e){_.push(["Console warn:",arguments]),t.apply(console,arguments)},console.info=function(e){_.push(["Console info:",arguments]),a.apply(console,arguments)},console.error=function(e){_.push(["Console error:",arguments]),n.apply(console,arguments)},console.clear=function(){_=[],c()}}(),document.addEventListener("hCaptchaLoaded",(function(){N()})),s.on("click",(function(e){e.preventDefault(),""!==a(".hcaptcha-general-sample-hcaptcha iframe").attr("data-hcaptcha-response")?function(){A(),C.attr("disabled",!0);var e={action:HCaptchaGeneralObject.checkConfigAction,nonce:HCaptchaGeneralObject.checkConfigNonce,mode:d.val(),siteKey:r.val(),secretKey:i.val(),"h-captcha-response":a('textarea[name="h-captcha-response"]').val()};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:e,beforeSend:function(){return x(HCaptchaGeneralObject.checkingConfigMsg)}}).done((function(e){e.success?(O=r.val(),H=i.val(),k=w(b),S=!1,x(e.data),C.attr("disabled",!1)):N(e.data)})).fail((function(e){N(e.statusText)})).always((function(){L()}))}():kaggDialog.confirm({title:HCaptchaGeneralObject.completeHCaptchaTitle,content:HCaptchaGeneralObject.completeHCaptchaContent,type:"info",buttons:{ok:{text:HCaptchaGeneralObject.OKBtnText}},onAction:function(){return window.hCaptchaReset(document.querySelector(".hcaptcha-general-sample-hcaptcha"))}})})),r.on("change",(function(e){L({sitekey:a(e.target).val()}),P()})),i.on("change",(function(){P()})),h.on("change",(function(e){L({theme:a(e.target).val()})})),p.on("change",(function(e){var t=a("#hcaptcha-invisible-notice"),n=a(e.target).val();"invisible"===n?t.show():t.hide(),L({size:n})})),u.on("change",(function(e){L({hl:a(e.target).val()})})),d.on("change",(function(e){var t=a(e.target).val();j.hasOwnProperty(t)&&(t===HCaptchaGeneralObject.modeLive?(r.attr("disabled",!1),i.attr("disabled",!1)):(r.attr("disabled",!0),i.attr("disabled",!0)),L({sitekey:j[t]}))})),f.on("change",(function(){B()})),g.on("blur",(function(){B()})),g.on("focus",(function(){g.css("background-color","unset"),C.attr("disabled",!1)})),b.on("change",(function(){!function(){var t={onload:"hCaptchaOnLoad",render:"explicit"};y.prop("checked")&&(t.recaptchacompat="off"),f.prop("checked")&&(t.custom="true");var a={asset_host:"assethost",endpoint:"endpoint",host:"host",image_host:"imghost",report_api:"reportapi",sentry:"sentry"},n=T();for(var c in a){var o=n[c].trim();o&&(t[a[c]]=encodeURIComponent(J(o)))}var r=n.api_host.trim();r=J(r=r||"js.hcaptcha.com")+"/1/api.js";var i=new URL(r);for(var s in t)i.searchParams.append(s,t[s]);document.getElementById("hcaptcha-api").remove(),delete e.g.hcaptcha,document.querySelector("#hcaptcha-options .h-captcha").innerHTML="";var l=document.getElementsByTagName("head")[0],h=document.createElement("script");h.type="text/javascript",h.id="hcaptcha-api",h.src=i.href,l.appendChild(h)}(),JSON.stringify(T())===JSON.stringify(k)?(S=!1,A(),C.attr("disabled",!1)):S||(S=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))})),a(".hcaptcha-general h3").on("click",(function(e){var t=a(e.currentTarget);t.toggleClass("closed");var n={action:HCaptchaGeneralObject.toggleSectionAction,nonce:HCaptchaGeneralObject.toggleSectionNonce,section:t.attr("class").replaceAll(/(hcaptcha-section-|closed)/g,"").trim(),status:!t.hasClass("closed")};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:n}).done((function(e){e.success||N(e.data)})).fail((function(e){N(e.statusText)}))})),s.removeAttr("name"),l.removeAttr("name"),v.removeAttr("name"),m.removeAttr("name"),v.find("option").each((function(){var e=a(this);e.val().split("=")[1]||e.attr("disabled",!0)})),m.val(""),v.on("change",(function(){var e=a(this).find("option:selected").val().split("="),t=e[0],n=e[1];"palette--mode"===t?(m.attr("type","text"),m.val(n)):(m.val(n),m.attr("type","color"))})),m.on("change",(function(e){var t=a(e.target).val(),n=v.find("option:selected"),c=n.val().split("="),o=c[0],r=t;n.val(o+"="+t),B(r=(o="theme--"+c[0]).split("--").reverse().reduce((function(e,t){var a={};return a[t]=e,a}),r))}))};window.hCaptchaGeneral=a,jQuery(document).ready(a)})();
  • hcaptcha-for-forms-and-more/tags/4.2.1/assets/js/integrations.js

    r3095958 r3098902  
    3232    function clearMessage() {
    3333        $message.remove();
    34         $( '<div id="hcaptcha-message"></div>' ).insertAfter( '#hcaptcha-options h2' );
     34        $( '<div id="hcaptcha-message"></div>' ).insertAfter( '.hcaptcha-header-bar' );
    3535        $message = $( msgSelector );
    3636    }
  • hcaptcha-for-forms-and-more/tags/4.2.1/assets/js/integrations.min.js

    r3095958 r3098902  
    1 (()=>{function t(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,o,r,c=[],s=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;s=!1}else for(;!(s=(n=o.call(a)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=a.return&&(r=a.return(),Object(r)!==r))return}finally{if(l)throw i}}return c}}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var a=function(e){var a="#hcaptcha-message",n=e(a),i=e("#wpwrap"),o=e("#adminmenuwrap"),r=e("#hcaptcha-integrations-search");function c(t,a){n.removeClass(),n.addClass(a+" notice settings-error is-dismissible"),n.html("<p>".concat(t,"</p>")),e(document).trigger("wp-updates-notice-added");var r=n.clone();n.css("visibility","hidden"),r.css("margin","0px"),r.css("top",i.position().top),r.css("z-index","999999");var c="block"===o.css("display")?o.width():0;r.css("left",c),r.width(e(window).width()-c),r.css("position","fixed"),e("body").append(r),setTimeout((function(){n.css("visibility","unset"),r.remove()}),3e3)}function s(t){c(t,"notice-error")}function l(t){return t.is(jQuery(".form-table").eq(0))}function u(t,a,n){var i=!1,o=a.toLowerCase(),r=!l(t),c=n.find("fieldset");c.attr("disabled",r),c.find("input").attr("disabled",r),t.find("tbody").children().each((function(t,a){var r=e(a).find(".hcaptcha-integrations-logo img").attr("alt");if((r=(r=r||"").replace(" Logo","")).toLowerCase()>o)return n.insertBefore(e(a)),i=!0,!1})),i||t.find("tbody").append(n)}e(".form-table img").on("click",(function(o){function r(){var a,o,r=v?"on":"off",d=(o=document.querySelector(".kagg-dialog select"))&&null!==(a=o.value)&&void 0!==a?a:"",m={action:HCaptchaIntegrationsObject.action,nonce:HCaptchaIntegrationsObject.nonce,activate:v,entity:f,status:g,newTheme:d};p.addClass(r),e.post({url:HCaptchaIntegrationsObject.ajaxUrl,data:m}).done((function(a){if(void 0!==a.success)if(void 0!==a.data.themes&&(window.HCaptchaIntegrationsObject.themes=a.data.themes,window.HCaptchaIntegrationsObject.defaultTheme=a.data.defaultTheme),a.success){var o=e(".form-table").eq(v?0:1),r=i.position().top;!function(t,a,n){if("theme"===a){var i=e(".form-table"),o=t?"":'[data-label="'+n+'"]',r=i.eq(t?0:1).find('.hcaptcha-integrations-logo img[data-entity="theme"]'+o);if(r.length){var c=i.eq(t?1:0),s=r.closest("tr");u(c,r.attr("data-label"),s)}}}(v,f,d),u(o,h,p),function(t){c(t,"notice-success")}(a.data.message),function(a){for(var n=e(".form-table"),i=0,o=Object.entries(a);i<o.length;i++){var r=t(o[i],2),c=r[0],s=r[1],d="hcaptcha-integrations-"+c.replace(/_/g,"-"),f=e("tr.".concat(d));l(f.closest(".form-table"))!==s&&u(n.eq(s?0:1),f.find(".hcaptcha-integrations-logo img").attr("alt"),f)}}(a.data.stati),e("html, body").animate({scrollTop:p.offset().top-r-n.outerHeight()},1e3)}else{var g,m;s(null!==(g=null===(m=a.data)||void 0===m?void 0:m.message)&&void 0!==g?g:a.data)}else c(HCaptchaIntegrationsObject.unexpectedErrorMsg,"notice-error")})).fail((function(t){s(t.statusText)})).always((function(){p.removeClass("on off")}))}o.preventDefault(),n.remove(),e('<div id="hcaptcha-message"></div>').insertAfter("#hcaptcha-options h2"),n=e(a);var d=e(o.target),f=d.data("entity");if(f=f||"",-1!==e.inArray(f,["core","theme","plugin"])&&-1===e.inArray(f,["core"])){var h=d.attr("alt");h=(h=h||"").replace(" Logo","");var p=d.closest("tr"),g=p.attr("class");g=g.replace("hcaptcha-integrations-","");var m,v,b="";if(p.find("fieldset").attr("disabled"))m="plugin"===f?HCaptchaIntegrationsObject.activateMsg:HCaptchaIntegrationsObject.activateThemeMsg,v=!0;else{if("plugin"===f)m=HCaptchaIntegrationsObject.deactivateMsg;else{for(var y in m=HCaptchaIntegrationsObject.deactivateThemeMsg,b="<p>"+HCaptchaIntegrationsObject.selectThemeMsg+"</p>",b+="<select>",HCaptchaIntegrationsObject.themes){var w=y===HCaptchaIntegrationsObject.defaultTheme?' selected="selected"':"";b+='<option value="'.concat(y,'"').concat(w,">").concat(HCaptchaIntegrationsObject.themes[y],"</option>")}b+="</select>"}v=!1}-1===e.inArray(f,["theme"])||v||0!==Object.keys(HCaptchaIntegrationsObject.themes).length?(m=m.replace("%s",h),o.ctrlKey?r():kaggDialog.confirm({title:m,content:b,type:v?"activate":"deactivate",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText},cancel:{text:HCaptchaIntegrationsObject.CancelBtnText}},onAction:function(t){t&&r()}})):kaggDialog.confirm({title:HCaptchaIntegrationsObject.onlyOneThemeMsg,content:"",type:"info",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText}}})}}));var d,f,h;r.on("input",(d=function(){var t=r.val().trim().toLowerCase(),a=e(".hcaptcha-integrations-logo img"),n=null;if(a.each((function(a,i){var o=e(i);if("core"!==o.data("entity")){var r,c=o.closest("tr");o.data("label").toLowerCase().includes(t)?(c.show(),n=null!==(r=n)&&void 0!==r?r:c):c.hide()}})),n){var i=n.offset().top+n.outerHeight()-e(window).height()+5;e("html").stop().animate({scrollTop:i},1e3)}},f=100,function(){var t=this,e=arguments;clearTimeout(h),h=setTimeout((function(){return d.apply(t,e)}),f)})),e("#hcaptcha-options").keydown((function(t){e(t.target).is(r)&&13===t.which&&t.preventDefault()}))};window.hCaptchaIntegrations=a,jQuery(document).ready(a)})();
     1(()=>{function t(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,o,r,c=[],s=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;s=!1}else for(;!(s=(n=o.call(a)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=a.return&&(r=a.return(),Object(r)!==r))return}finally{if(l)throw i}}return c}}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var a=function(e){var a="#hcaptcha-message",n=e(a),i=e("#wpwrap"),o=e("#adminmenuwrap"),r=e("#hcaptcha-integrations-search");function c(t,a){n.removeClass(),n.addClass(a+" notice settings-error is-dismissible"),n.html("<p>".concat(t,"</p>")),e(document).trigger("wp-updates-notice-added");var r=n.clone();n.css("visibility","hidden"),r.css("margin","0px"),r.css("top",i.position().top),r.css("z-index","999999");var c="block"===o.css("display")?o.width():0;r.css("left",c),r.width(e(window).width()-c),r.css("position","fixed"),e("body").append(r),setTimeout((function(){n.css("visibility","unset"),r.remove()}),3e3)}function s(t){c(t,"notice-error")}function l(t){return t.is(jQuery(".form-table").eq(0))}function d(t,a,n){var i=!1,o=a.toLowerCase(),r=!l(t),c=n.find("fieldset");c.attr("disabled",r),c.find("input").attr("disabled",r),t.find("tbody").children().each((function(t,a){var r=e(a).find(".hcaptcha-integrations-logo img").attr("alt");if((r=(r=r||"").replace(" Logo","")).toLowerCase()>o)return n.insertBefore(e(a)),i=!0,!1})),i||t.find("tbody").append(n)}e(".form-table img").on("click",(function(o){function r(){var a,o,r=v?"on":"off",u=(o=document.querySelector(".kagg-dialog select"))&&null!==(a=o.value)&&void 0!==a?a:"",m={action:HCaptchaIntegrationsObject.action,nonce:HCaptchaIntegrationsObject.nonce,activate:v,entity:f,status:g,newTheme:u};p.addClass(r),e.post({url:HCaptchaIntegrationsObject.ajaxUrl,data:m}).done((function(a){if(void 0!==a.success)if(void 0!==a.data.themes&&(window.HCaptchaIntegrationsObject.themes=a.data.themes,window.HCaptchaIntegrationsObject.defaultTheme=a.data.defaultTheme),a.success){var o=e(".form-table").eq(v?0:1),r=i.position().top;!function(t,a,n){if("theme"===a){var i=e(".form-table"),o=t?"":'[data-label="'+n+'"]',r=i.eq(t?0:1).find('.hcaptcha-integrations-logo img[data-entity="theme"]'+o);if(r.length){var c=i.eq(t?1:0),s=r.closest("tr");d(c,r.attr("data-label"),s)}}}(v,f,u),d(o,h,p),function(t){c(t,"notice-success")}(a.data.message),function(a){for(var n=e(".form-table"),i=0,o=Object.entries(a);i<o.length;i++){var r=t(o[i],2),c=r[0],s=r[1],u="hcaptcha-integrations-"+c.replace(/_/g,"-"),f=e("tr.".concat(u));l(f.closest(".form-table"))!==s&&d(n.eq(s?0:1),f.find(".hcaptcha-integrations-logo img").attr("alt"),f)}}(a.data.stati),e("html, body").animate({scrollTop:p.offset().top-r-n.outerHeight()},1e3)}else{var g,m;s(null!==(g=null===(m=a.data)||void 0===m?void 0:m.message)&&void 0!==g?g:a.data)}else c(HCaptchaIntegrationsObject.unexpectedErrorMsg,"notice-error")})).fail((function(t){s(t.statusText)})).always((function(){p.removeClass("on off")}))}o.preventDefault(),n.remove(),e('<div id="hcaptcha-message"></div>').insertAfter(".hcaptcha-header-bar"),n=e(a);var u=e(o.target),f=u.data("entity");if(f=f||"",-1!==e.inArray(f,["core","theme","plugin"])&&-1===e.inArray(f,["core"])){var h=u.attr("alt");h=(h=h||"").replace(" Logo","");var p=u.closest("tr"),g=p.attr("class");g=g.replace("hcaptcha-integrations-","");var m,v,b="";if(p.find("fieldset").attr("disabled"))m="plugin"===f?HCaptchaIntegrationsObject.activateMsg:HCaptchaIntegrationsObject.activateThemeMsg,v=!0;else{if("plugin"===f)m=HCaptchaIntegrationsObject.deactivateMsg;else{for(var y in m=HCaptchaIntegrationsObject.deactivateThemeMsg,b="<p>"+HCaptchaIntegrationsObject.selectThemeMsg+"</p>",b+="<select>",HCaptchaIntegrationsObject.themes){var w=y===HCaptchaIntegrationsObject.defaultTheme?' selected="selected"':"";b+='<option value="'.concat(y,'"').concat(w,">").concat(HCaptchaIntegrationsObject.themes[y],"</option>")}b+="</select>"}v=!1}-1===e.inArray(f,["theme"])||v||0!==Object.keys(HCaptchaIntegrationsObject.themes).length?(m=m.replace("%s",h),o.ctrlKey?r():kaggDialog.confirm({title:m,content:b,type:v?"activate":"deactivate",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText},cancel:{text:HCaptchaIntegrationsObject.CancelBtnText}},onAction:function(t){t&&r()}})):kaggDialog.confirm({title:HCaptchaIntegrationsObject.onlyOneThemeMsg,content:"",type:"info",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText}}})}}));var u,f,h;r.on("input",(u=function(){var t=r.val().trim().toLowerCase(),a=e(".hcaptcha-integrations-logo img"),n=null;if(a.each((function(a,i){var o=e(i);if("core"!==o.data("entity")){var r,c=o.closest("tr");o.data("label").toLowerCase().includes(t)?(c.show(),n=null!==(r=n)&&void 0!==r?r:c):c.hide()}})),n){var i=n.offset().top+n.outerHeight()-e(window).height()+5;e("html").stop().animate({scrollTop:i},1e3)}},f=100,function(){var t=this,e=arguments;clearTimeout(h),h=setTimeout((function(){return u.apply(t,e)}),f)})),e("#hcaptcha-options").keydown((function(t){e(t.target).is(r)&&13===t.which&&t.preventDefault()}))};window.hCaptchaIntegrations=a,jQuery(document).ready(a)})();
  • hcaptcha-for-forms-and-more/tags/4.2.1/changelog.txt

    r3095958 r3098902  
     1= 4.2.1 =
     2* Fixed message layout on the General and Integrations pages.
     3* Fixed processing of WooCommerce Register form.
     4
    15= 4.2.0 =
    26* The minimum required WordPress version is now 5.3.
  • hcaptcha-for-forms-and-more/tags/4.2.1/hcaptcha.php

    r3095958 r3098902  
    1111 * Plugin URI:           https://www.hcaptcha.com/
    1212 * Description:          hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
    13  * Version:              4.2.0
     13 * Version:              4.2.1
    1414 * Requires at least:    5.1
    1515 * Requires PHP:         7.0
     
    4040 * Plugin version.
    4141 */
    42 const HCAPTCHA_VERSION = '4.2.0';
     42const HCAPTCHA_VERSION = '4.2.1';
    4343
    4444/**
  • hcaptcha-for-forms-and-more/tags/4.2.1/readme.txt

    r3095958 r3098902  
    55Tested up to: 6.5
    66Requires PHP: 7.0.0
    7 Stable tag: 4.2.0
     7Stable tag: 4.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    561561== Changelog ==
    562562
     563= 4.2.1 =
     564* Fixed message layout on the General and Integrations pages.
     565* Fixed processing of WooCommerce Register form.
     566
    563567= 4.2.0 =
    564568* The minimum required WordPress version is now 5.3.
  • hcaptcha-for-forms-and-more/tags/4.2.1/src/php/Admin/Events/Events.php

    r3095958 r3098902  
    3939        }
    4040
    41         add_action( 'hcap_verify_request', [ $this, 'save_event' ], -PHP_INT_MAX, 2 );
     41        add_filter( 'hcap_verify_request', [ $this, 'save_event' ], -PHP_INT_MAX, 2 );
    4242    }
    4343
     
    4848     * @param array             $error_codes Error codes.
    4949     *
    50      * @return void
     50     * @return string|null
    5151     */
    5252    public function save_event( $result, array $error_codes ) {
     
    5454
    5555        if ( ! ( is_string( $result ) || is_null( $result ) ) ) {
    56             return;
     56            return $result;
    5757        }
    5858
     
    8686            ]
    8787        );
     88
     89        return $result;
    8890    }
    8991
  • hcaptcha-for-forms-and-more/tags/4.2.1/src/php/Settings/General.php

    r3095958 r3098902  
    621621            case self::SECTION_KEYS:
    622622                $this->print_header();
     623
     624                ?>
     625                <div id="hcaptcha-message"></div>
     626                <?php
     627
    623628                $this->notifications->show();
    624629                $this->print_section_header( $arguments['id'], __( 'Keys', 'hcaptcha-for-forms-and-more' ) );
     
    955960     */
    956961    private function flatten_array( array $arr ): array {
    957         static $level  = [];
    958         static $result = [];
     962        static $level = [], $result = [];
    959963
    960964        foreach ( $arr as $key => $value ) {
  • hcaptcha-for-forms-and-more/tags/4.2.1/vendor/composer/installed.php

    r3095958 r3098902  
    22    'root' => array(
    33        'name' => 'hcaptcha/hcaptcha-wordpress-plugin',
    4         'pretty_version' => '4.2.0',
    5         'version' => '4.2.0.0',
    6         'reference' => 'aa580b1c05ee0aff974fbf1d99e92341a6f82094',
     4        'pretty_version' => '4.2.1',
     5        'version' => '4.2.1.0',
     6        'reference' => '6b037ed32f8ada5bcff7b8fd1d41c2e6cde5eaaf',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'hcaptcha/hcaptcha-wordpress-plugin' => array(
    14             'pretty_version' => '4.2.0',
    15             'version' => '4.2.0.0',
    16             'reference' => 'aa580b1c05ee0aff974fbf1d99e92341a6f82094',
     14            'pretty_version' => '4.2.1',
     15            'version' => '4.2.1.0',
     16            'reference' => '6b037ed32f8ada5bcff7b8fd1d41c2e6cde5eaaf',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
  • hcaptcha-for-forms-and-more/trunk/assets/js/general.js

    r3095958 r3098902  
    152152    function clearMessage() {
    153153        $message.remove();
    154         $( '<div id="hcaptcha-message"></div>' ).insertAfter( '#hcaptcha-options h2' );
     154        $( '<div id="hcaptcha-message"></div>' ).insertAfter( '.hcaptcha-header-bar' );
    155155        $message = $( msgSelector );
    156156    }
  • hcaptcha-for-forms-and-more/trunk/assets/js/general.min.js

    r3095958 r3098902  
    1 (()=>{var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var a=function(a){var n="#hcaptcha-message",c=a(n),o=a("form.hcaptcha-general"),r=a('[name="hcaptcha_settings[site_key]"]'),i=a('[name="hcaptcha_settings[secret_key]"]'),s=a("#check_config"),l=a("#reset_notifications"),h=a('[name="hcaptcha_settings[theme]"]'),p=a('[name="hcaptcha_settings[size]"]'),u=a('[name="hcaptcha_settings[language]"]'),d=a('[name="hcaptcha_settings[mode]"]'),f=a('[name="hcaptcha_settings[custom_themes][]"]'),v=a(".hcaptcha-general-custom-prop select"),m=a(".hcaptcha-general-custom-value input"),g=a('[name="hcaptcha_settings[config_params]"]'),b=a(".hcaptcha-section-enterprise + table input"),y=a('[name="hcaptcha_settings[recaptcha_compat_off][]"]'),C=o.find("#submit"),j={},O=r.val(),H=i.val(),k=T();j[HCaptchaGeneralObject.modeLive]=HCaptchaGeneralObject.siteKey,j[HCaptchaGeneralObject.modeTestPublisher]=HCaptchaGeneralObject.modeTestPublisherSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseSafeEndUser]=HCaptchaGeneralObject.modeTestEnterpriseSafeEndUserSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseBotDetected]=HCaptchaGeneralObject.modeTestEnterpriseBotDetectedSiteKey;var G=!1,S=!1,_=[];function w(e){var t={};return e.each((function(){var e=a(this),n=e.attr("name").replace(/hcaptcha_settings\[(.+)]/,"$1");t[n]=e.val()})),t}function T(){return w(b)}function A(){c.remove(),a('<div id="hcaptcha-message"></div>').insertAfter("#hcaptcha-options h2"),c=a(n)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e=void 0===e?"":String(e),e=(e+="\n"+function(){for(var e=["recaptchacompat disabled","Missing sitekey - https://hcaptcha.com/docs/configuration#jsapi"],t=[],a=0;a<_.length;a++){for(var n=_[a],c=n[0],o=n[1],r=Object.keys(o),i=[],s=0;s<r.length;s++){var l=o[s];"string"==typeof l&&-1===e.indexOf(l)&&i.push([c,l].join(" "))}t.push(i.join("\n"))}return _=[],t.join("\n")}()).trim()){c.removeClass(),c.addClass(t+" notice is-dismissible");var n=e.split("\n").map((function(e){return"<p>".concat(e,"</p>")}));c.html(n.join("")),a(document).trigger("wp-updates-notice-added");var o=a("#wpwrap").position().top;a("html, body").animate({scrollTop:c.offset().top-o-parseInt(c.css("margin-bottom"))},1e3)}}function x(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-success")}function N(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-error")}function L(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(hCaptcha.getParams(),t);hCaptcha.setParams(a);var n=document.querySelector("#hcaptcha-options .h-captcha");for(var c in n.innerHTML="",t.theme=null==t||null===(e=t.theme)||void 0===e||null===(e=e.palette)||void 0===e?void 0:e.mode,t.theme||delete t.theme,t)n.setAttribute("data-".concat(c),"".concat(t[c]));hCaptcha.bindEvents()}function K(e,a){var n=function(e){return e&&"object"===t(e)};return n(e)&&n(a)?(Object.keys(a).forEach((function(t){var c=e[t],o=a[t];Array.isArray(c)&&Array.isArray(o)?e[t]=c.concat(o):n(c)&&n(o)?e[t]=K(Object.assign({},c),o):e[t]=o})),e):a}function U(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(var n in e){var c=a?"".concat(a,"--").concat(n):n;if("object"===t(e[n])&&null!==e[n])U(e[n],c);else{var o=e[n],r=c.replace(/theme--/g,""),i="".concat(r,"=").concat(o),s=v.find('option[value*="'.concat(r,'="]'));1===s.length&&(s.attr("value",i),s.is(":selected")&&m.val(o))}}}function B(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=g.val().trim();a=a||null;try{e=JSON.parse(a)}catch(e){return g.css("background-color","#ffabaf"),C.attr("disabled",!0),void N("Bad JSON!")}e=K(e,t),g.val(JSON.stringify(e,null,2)),U(e),f.prop("checked")||(e={sitekey:r.val(),theme:h.val(),size:p.val(),hl:u.val()}),L(e)}function P(){r.val()===O&&i.val()===H?(G=!1,A(),C.attr("disabled",!1)):G||(G=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))}function J(e){return e=e.replace(/(http|https):\/\//,""),"https://"+new URL("https://"+e).host}!function(){_=[];var e=console.log,t=console.warn,a=console.info,n=console.error,c=console.clear;console.log=function(t){_.push(["Console log:",arguments]),e.apply(console,arguments)},console.warn=function(e){_.push(["Console warn:",arguments]),t.apply(console,arguments)},console.info=function(e){_.push(["Console info:",arguments]),a.apply(console,arguments)},console.error=function(e){_.push(["Console error:",arguments]),n.apply(console,arguments)},console.clear=function(){_=[],c()}}(),document.addEventListener("hCaptchaLoaded",(function(){N()})),s.on("click",(function(e){e.preventDefault(),""!==a(".hcaptcha-general-sample-hcaptcha iframe").attr("data-hcaptcha-response")?function(){A(),C.attr("disabled",!0);var e={action:HCaptchaGeneralObject.checkConfigAction,nonce:HCaptchaGeneralObject.checkConfigNonce,mode:d.val(),siteKey:r.val(),secretKey:i.val(),"h-captcha-response":a('textarea[name="h-captcha-response"]').val()};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:e,beforeSend:function(){return x(HCaptchaGeneralObject.checkingConfigMsg)}}).done((function(e){e.success?(O=r.val(),H=i.val(),k=w(b),S=!1,x(e.data),C.attr("disabled",!1)):N(e.data)})).fail((function(e){N(e.statusText)})).always((function(){L()}))}():kaggDialog.confirm({title:HCaptchaGeneralObject.completeHCaptchaTitle,content:HCaptchaGeneralObject.completeHCaptchaContent,type:"info",buttons:{ok:{text:HCaptchaGeneralObject.OKBtnText}},onAction:function(){return window.hCaptchaReset(document.querySelector(".hcaptcha-general-sample-hcaptcha"))}})})),r.on("change",(function(e){L({sitekey:a(e.target).val()}),P()})),i.on("change",(function(){P()})),h.on("change",(function(e){L({theme:a(e.target).val()})})),p.on("change",(function(e){var t=a("#hcaptcha-invisible-notice"),n=a(e.target).val();"invisible"===n?t.show():t.hide(),L({size:n})})),u.on("change",(function(e){L({hl:a(e.target).val()})})),d.on("change",(function(e){var t=a(e.target).val();j.hasOwnProperty(t)&&(t===HCaptchaGeneralObject.modeLive?(r.attr("disabled",!1),i.attr("disabled",!1)):(r.attr("disabled",!0),i.attr("disabled",!0)),L({sitekey:j[t]}))})),f.on("change",(function(){B()})),g.on("blur",(function(){B()})),g.on("focus",(function(){g.css("background-color","unset"),C.attr("disabled",!1)})),b.on("change",(function(){!function(){var t={onload:"hCaptchaOnLoad",render:"explicit"};y.prop("checked")&&(t.recaptchacompat="off"),f.prop("checked")&&(t.custom="true");var a={asset_host:"assethost",endpoint:"endpoint",host:"host",image_host:"imghost",report_api:"reportapi",sentry:"sentry"},n=T();for(var c in a){var o=n[c].trim();o&&(t[a[c]]=encodeURIComponent(J(o)))}var r=n.api_host.trim();r=J(r=r||"js.hcaptcha.com")+"/1/api.js";var i=new URL(r);for(var s in t)i.searchParams.append(s,t[s]);document.getElementById("hcaptcha-api").remove(),delete e.g.hcaptcha,document.querySelector("#hcaptcha-options .h-captcha").innerHTML="";var l=document.getElementsByTagName("head")[0],h=document.createElement("script");h.type="text/javascript",h.id="hcaptcha-api",h.src=i.href,l.appendChild(h)}(),JSON.stringify(T())===JSON.stringify(k)?(S=!1,A(),C.attr("disabled",!1)):S||(S=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))})),a(".hcaptcha-general h3").on("click",(function(e){var t=a(e.currentTarget);t.toggleClass("closed");var n={action:HCaptchaGeneralObject.toggleSectionAction,nonce:HCaptchaGeneralObject.toggleSectionNonce,section:t.attr("class").replaceAll(/(hcaptcha-section-|closed)/g,"").trim(),status:!t.hasClass("closed")};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:n}).done((function(e){e.success||N(e.data)})).fail((function(e){N(e.statusText)}))})),s.removeAttr("name"),l.removeAttr("name"),v.removeAttr("name"),m.removeAttr("name"),v.find("option").each((function(){var e=a(this);e.val().split("=")[1]||e.attr("disabled",!0)})),m.val(""),v.on("change",(function(){var e=a(this).find("option:selected").val().split("="),t=e[0],n=e[1];"palette--mode"===t?(m.attr("type","text"),m.val(n)):(m.val(n),m.attr("type","color"))})),m.on("change",(function(e){var t=a(e.target).val(),n=v.find("option:selected"),c=n.val().split("="),o=c[0],r=t;n.val(o+"="+t),B(r=(o="theme--"+c[0]).split("--").reverse().reduce((function(e,t){var a={};return a[t]=e,a}),r))}))};window.hCaptchaGeneral=a,jQuery(document).ready(a)})();
     1(()=>{var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var a=function(a){var n="#hcaptcha-message",c=a(n),o=a("form.hcaptcha-general"),r=a('[name="hcaptcha_settings[site_key]"]'),i=a('[name="hcaptcha_settings[secret_key]"]'),s=a("#check_config"),l=a("#reset_notifications"),h=a('[name="hcaptcha_settings[theme]"]'),p=a('[name="hcaptcha_settings[size]"]'),u=a('[name="hcaptcha_settings[language]"]'),d=a('[name="hcaptcha_settings[mode]"]'),f=a('[name="hcaptcha_settings[custom_themes][]"]'),v=a(".hcaptcha-general-custom-prop select"),m=a(".hcaptcha-general-custom-value input"),g=a('[name="hcaptcha_settings[config_params]"]'),b=a(".hcaptcha-section-enterprise + table input"),y=a('[name="hcaptcha_settings[recaptcha_compat_off][]"]'),C=o.find("#submit"),j={},O=r.val(),H=i.val(),k=T();j[HCaptchaGeneralObject.modeLive]=HCaptchaGeneralObject.siteKey,j[HCaptchaGeneralObject.modeTestPublisher]=HCaptchaGeneralObject.modeTestPublisherSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseSafeEndUser]=HCaptchaGeneralObject.modeTestEnterpriseSafeEndUserSiteKey,j[HCaptchaGeneralObject.modeTestEnterpriseBotDetected]=HCaptchaGeneralObject.modeTestEnterpriseBotDetectedSiteKey;var G=!1,S=!1,_=[];function w(e){var t={};return e.each((function(){var e=a(this),n=e.attr("name").replace(/hcaptcha_settings\[(.+)]/,"$1");t[n]=e.val()})),t}function T(){return w(b)}function A(){c.remove(),a('<div id="hcaptcha-message"></div>').insertAfter(".hcaptcha-header-bar"),c=a(n)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(e=void 0===e?"":String(e),e=(e+="\n"+function(){for(var e=["recaptchacompat disabled","Missing sitekey - https://hcaptcha.com/docs/configuration#jsapi"],t=[],a=0;a<_.length;a++){for(var n=_[a],c=n[0],o=n[1],r=Object.keys(o),i=[],s=0;s<r.length;s++){var l=o[s];"string"==typeof l&&-1===e.indexOf(l)&&i.push([c,l].join(" "))}t.push(i.join("\n"))}return _=[],t.join("\n")}()).trim()){c.removeClass(),c.addClass(t+" notice is-dismissible");var n=e.split("\n").map((function(e){return"<p>".concat(e,"</p>")}));c.html(n.join("")),a(document).trigger("wp-updates-notice-added");var o=a("#wpwrap").position().top;a("html, body").animate({scrollTop:c.offset().top-o-parseInt(c.css("margin-bottom"))},1e3)}}function x(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-success")}function N(){E(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","notice-error")}function L(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=Object.assign(hCaptcha.getParams(),t);hCaptcha.setParams(a);var n=document.querySelector("#hcaptcha-options .h-captcha");for(var c in n.innerHTML="",t.theme=null==t||null===(e=t.theme)||void 0===e||null===(e=e.palette)||void 0===e?void 0:e.mode,t.theme||delete t.theme,t)n.setAttribute("data-".concat(c),"".concat(t[c]));hCaptcha.bindEvents()}function K(e,a){var n=function(e){return e&&"object"===t(e)};return n(e)&&n(a)?(Object.keys(a).forEach((function(t){var c=e[t],o=a[t];Array.isArray(c)&&Array.isArray(o)?e[t]=c.concat(o):n(c)&&n(o)?e[t]=K(Object.assign({},c),o):e[t]=o})),e):a}function U(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";for(var n in e){var c=a?"".concat(a,"--").concat(n):n;if("object"===t(e[n])&&null!==e[n])U(e[n],c);else{var o=e[n],r=c.replace(/theme--/g,""),i="".concat(r,"=").concat(o),s=v.find('option[value*="'.concat(r,'="]'));1===s.length&&(s.attr("value",i),s.is(":selected")&&m.val(o))}}}function B(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=g.val().trim();a=a||null;try{e=JSON.parse(a)}catch(e){return g.css("background-color","#ffabaf"),C.attr("disabled",!0),void N("Bad JSON!")}e=K(e,t),g.val(JSON.stringify(e,null,2)),U(e),f.prop("checked")||(e={sitekey:r.val(),theme:h.val(),size:p.val(),hl:u.val()}),L(e)}function P(){r.val()===O&&i.val()===H?(G=!1,A(),C.attr("disabled",!1)):G||(G=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))}function J(e){return e=e.replace(/(http|https):\/\//,""),"https://"+new URL("https://"+e).host}!function(){_=[];var e=console.log,t=console.warn,a=console.info,n=console.error,c=console.clear;console.log=function(t){_.push(["Console log:",arguments]),e.apply(console,arguments)},console.warn=function(e){_.push(["Console warn:",arguments]),t.apply(console,arguments)},console.info=function(e){_.push(["Console info:",arguments]),a.apply(console,arguments)},console.error=function(e){_.push(["Console error:",arguments]),n.apply(console,arguments)},console.clear=function(){_=[],c()}}(),document.addEventListener("hCaptchaLoaded",(function(){N()})),s.on("click",(function(e){e.preventDefault(),""!==a(".hcaptcha-general-sample-hcaptcha iframe").attr("data-hcaptcha-response")?function(){A(),C.attr("disabled",!0);var e={action:HCaptchaGeneralObject.checkConfigAction,nonce:HCaptchaGeneralObject.checkConfigNonce,mode:d.val(),siteKey:r.val(),secretKey:i.val(),"h-captcha-response":a('textarea[name="h-captcha-response"]').val()};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:e,beforeSend:function(){return x(HCaptchaGeneralObject.checkingConfigMsg)}}).done((function(e){e.success?(O=r.val(),H=i.val(),k=w(b),S=!1,x(e.data),C.attr("disabled",!1)):N(e.data)})).fail((function(e){N(e.statusText)})).always((function(){L()}))}():kaggDialog.confirm({title:HCaptchaGeneralObject.completeHCaptchaTitle,content:HCaptchaGeneralObject.completeHCaptchaContent,type:"info",buttons:{ok:{text:HCaptchaGeneralObject.OKBtnText}},onAction:function(){return window.hCaptchaReset(document.querySelector(".hcaptcha-general-sample-hcaptcha"))}})})),r.on("change",(function(e){L({sitekey:a(e.target).val()}),P()})),i.on("change",(function(){P()})),h.on("change",(function(e){L({theme:a(e.target).val()})})),p.on("change",(function(e){var t=a("#hcaptcha-invisible-notice"),n=a(e.target).val();"invisible"===n?t.show():t.hide(),L({size:n})})),u.on("change",(function(e){L({hl:a(e.target).val()})})),d.on("change",(function(e){var t=a(e.target).val();j.hasOwnProperty(t)&&(t===HCaptchaGeneralObject.modeLive?(r.attr("disabled",!1),i.attr("disabled",!1)):(r.attr("disabled",!0),i.attr("disabled",!0)),L({sitekey:j[t]}))})),f.on("change",(function(){B()})),g.on("blur",(function(){B()})),g.on("focus",(function(){g.css("background-color","unset"),C.attr("disabled",!1)})),b.on("change",(function(){!function(){var t={onload:"hCaptchaOnLoad",render:"explicit"};y.prop("checked")&&(t.recaptchacompat="off"),f.prop("checked")&&(t.custom="true");var a={asset_host:"assethost",endpoint:"endpoint",host:"host",image_host:"imghost",report_api:"reportapi",sentry:"sentry"},n=T();for(var c in a){var o=n[c].trim();o&&(t[a[c]]=encodeURIComponent(J(o)))}var r=n.api_host.trim();r=J(r=r||"js.hcaptcha.com")+"/1/api.js";var i=new URL(r);for(var s in t)i.searchParams.append(s,t[s]);document.getElementById("hcaptcha-api").remove(),delete e.g.hcaptcha,document.querySelector("#hcaptcha-options .h-captcha").innerHTML="";var l=document.getElementsByTagName("head")[0],h=document.createElement("script");h.type="text/javascript",h.id="hcaptcha-api",h.src=i.href,l.appendChild(h)}(),JSON.stringify(T())===JSON.stringify(k)?(S=!1,A(),C.attr("disabled",!1)):S||(S=!0,N(HCaptchaGeneralObject.checkConfigNotice),C.attr("disabled",!0))})),a(".hcaptcha-general h3").on("click",(function(e){var t=a(e.currentTarget);t.toggleClass("closed");var n={action:HCaptchaGeneralObject.toggleSectionAction,nonce:HCaptchaGeneralObject.toggleSectionNonce,section:t.attr("class").replaceAll(/(hcaptcha-section-|closed)/g,"").trim(),status:!t.hasClass("closed")};a.post({url:HCaptchaGeneralObject.ajaxUrl,data:n}).done((function(e){e.success||N(e.data)})).fail((function(e){N(e.statusText)}))})),s.removeAttr("name"),l.removeAttr("name"),v.removeAttr("name"),m.removeAttr("name"),v.find("option").each((function(){var e=a(this);e.val().split("=")[1]||e.attr("disabled",!0)})),m.val(""),v.on("change",(function(){var e=a(this).find("option:selected").val().split("="),t=e[0],n=e[1];"palette--mode"===t?(m.attr("type","text"),m.val(n)):(m.val(n),m.attr("type","color"))})),m.on("change",(function(e){var t=a(e.target).val(),n=v.find("option:selected"),c=n.val().split("="),o=c[0],r=t;n.val(o+"="+t),B(r=(o="theme--"+c[0]).split("--").reverse().reduce((function(e,t){var a={};return a[t]=e,a}),r))}))};window.hCaptchaGeneral=a,jQuery(document).ready(a)})();
  • hcaptcha-for-forms-and-more/trunk/assets/js/integrations.js

    r3095958 r3098902  
    3232    function clearMessage() {
    3333        $message.remove();
    34         $( '<div id="hcaptcha-message"></div>' ).insertAfter( '#hcaptcha-options h2' );
     34        $( '<div id="hcaptcha-message"></div>' ).insertAfter( '.hcaptcha-header-bar' );
    3535        $message = $( msgSelector );
    3636    }
  • hcaptcha-for-forms-and-more/trunk/assets/js/integrations.min.js

    r3095958 r3098902  
    1 (()=>{function t(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,o,r,c=[],s=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;s=!1}else for(;!(s=(n=o.call(a)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=a.return&&(r=a.return(),Object(r)!==r))return}finally{if(l)throw i}}return c}}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var a=function(e){var a="#hcaptcha-message",n=e(a),i=e("#wpwrap"),o=e("#adminmenuwrap"),r=e("#hcaptcha-integrations-search");function c(t,a){n.removeClass(),n.addClass(a+" notice settings-error is-dismissible"),n.html("<p>".concat(t,"</p>")),e(document).trigger("wp-updates-notice-added");var r=n.clone();n.css("visibility","hidden"),r.css("margin","0px"),r.css("top",i.position().top),r.css("z-index","999999");var c="block"===o.css("display")?o.width():0;r.css("left",c),r.width(e(window).width()-c),r.css("position","fixed"),e("body").append(r),setTimeout((function(){n.css("visibility","unset"),r.remove()}),3e3)}function s(t){c(t,"notice-error")}function l(t){return t.is(jQuery(".form-table").eq(0))}function u(t,a,n){var i=!1,o=a.toLowerCase(),r=!l(t),c=n.find("fieldset");c.attr("disabled",r),c.find("input").attr("disabled",r),t.find("tbody").children().each((function(t,a){var r=e(a).find(".hcaptcha-integrations-logo img").attr("alt");if((r=(r=r||"").replace(" Logo","")).toLowerCase()>o)return n.insertBefore(e(a)),i=!0,!1})),i||t.find("tbody").append(n)}e(".form-table img").on("click",(function(o){function r(){var a,o,r=v?"on":"off",d=(o=document.querySelector(".kagg-dialog select"))&&null!==(a=o.value)&&void 0!==a?a:"",m={action:HCaptchaIntegrationsObject.action,nonce:HCaptchaIntegrationsObject.nonce,activate:v,entity:f,status:g,newTheme:d};p.addClass(r),e.post({url:HCaptchaIntegrationsObject.ajaxUrl,data:m}).done((function(a){if(void 0!==a.success)if(void 0!==a.data.themes&&(window.HCaptchaIntegrationsObject.themes=a.data.themes,window.HCaptchaIntegrationsObject.defaultTheme=a.data.defaultTheme),a.success){var o=e(".form-table").eq(v?0:1),r=i.position().top;!function(t,a,n){if("theme"===a){var i=e(".form-table"),o=t?"":'[data-label="'+n+'"]',r=i.eq(t?0:1).find('.hcaptcha-integrations-logo img[data-entity="theme"]'+o);if(r.length){var c=i.eq(t?1:0),s=r.closest("tr");u(c,r.attr("data-label"),s)}}}(v,f,d),u(o,h,p),function(t){c(t,"notice-success")}(a.data.message),function(a){for(var n=e(".form-table"),i=0,o=Object.entries(a);i<o.length;i++){var r=t(o[i],2),c=r[0],s=r[1],d="hcaptcha-integrations-"+c.replace(/_/g,"-"),f=e("tr.".concat(d));l(f.closest(".form-table"))!==s&&u(n.eq(s?0:1),f.find(".hcaptcha-integrations-logo img").attr("alt"),f)}}(a.data.stati),e("html, body").animate({scrollTop:p.offset().top-r-n.outerHeight()},1e3)}else{var g,m;s(null!==(g=null===(m=a.data)||void 0===m?void 0:m.message)&&void 0!==g?g:a.data)}else c(HCaptchaIntegrationsObject.unexpectedErrorMsg,"notice-error")})).fail((function(t){s(t.statusText)})).always((function(){p.removeClass("on off")}))}o.preventDefault(),n.remove(),e('<div id="hcaptcha-message"></div>').insertAfter("#hcaptcha-options h2"),n=e(a);var d=e(o.target),f=d.data("entity");if(f=f||"",-1!==e.inArray(f,["core","theme","plugin"])&&-1===e.inArray(f,["core"])){var h=d.attr("alt");h=(h=h||"").replace(" Logo","");var p=d.closest("tr"),g=p.attr("class");g=g.replace("hcaptcha-integrations-","");var m,v,b="";if(p.find("fieldset").attr("disabled"))m="plugin"===f?HCaptchaIntegrationsObject.activateMsg:HCaptchaIntegrationsObject.activateThemeMsg,v=!0;else{if("plugin"===f)m=HCaptchaIntegrationsObject.deactivateMsg;else{for(var y in m=HCaptchaIntegrationsObject.deactivateThemeMsg,b="<p>"+HCaptchaIntegrationsObject.selectThemeMsg+"</p>",b+="<select>",HCaptchaIntegrationsObject.themes){var w=y===HCaptchaIntegrationsObject.defaultTheme?' selected="selected"':"";b+='<option value="'.concat(y,'"').concat(w,">").concat(HCaptchaIntegrationsObject.themes[y],"</option>")}b+="</select>"}v=!1}-1===e.inArray(f,["theme"])||v||0!==Object.keys(HCaptchaIntegrationsObject.themes).length?(m=m.replace("%s",h),o.ctrlKey?r():kaggDialog.confirm({title:m,content:b,type:v?"activate":"deactivate",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText},cancel:{text:HCaptchaIntegrationsObject.CancelBtnText}},onAction:function(t){t&&r()}})):kaggDialog.confirm({title:HCaptchaIntegrationsObject.onlyOneThemeMsg,content:"",type:"info",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText}}})}}));var d,f,h;r.on("input",(d=function(){var t=r.val().trim().toLowerCase(),a=e(".hcaptcha-integrations-logo img"),n=null;if(a.each((function(a,i){var o=e(i);if("core"!==o.data("entity")){var r,c=o.closest("tr");o.data("label").toLowerCase().includes(t)?(c.show(),n=null!==(r=n)&&void 0!==r?r:c):c.hide()}})),n){var i=n.offset().top+n.outerHeight()-e(window).height()+5;e("html").stop().animate({scrollTop:i},1e3)}},f=100,function(){var t=this,e=arguments;clearTimeout(h),h=setTimeout((function(){return d.apply(t,e)}),f)})),e("#hcaptcha-options").keydown((function(t){e(t.target).is(r)&&13===t.which&&t.preventDefault()}))};window.hCaptchaIntegrations=a,jQuery(document).ready(a)})();
     1(()=>{function t(t,a){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var n,i,o,r,c=[],s=!0,l=!1;try{if(o=(a=a.call(t)).next,0===e){if(Object(a)!==a)return;s=!1}else for(;!(s=(n=o.call(a)).done)&&(c.push(n.value),c.length!==e);s=!0);}catch(t){l=!0,i=t}finally{try{if(!s&&null!=a.return&&(r=a.return(),Object(r)!==r))return}finally{if(l)throw i}}return c}}(t,a)||function(t,a){if(!t)return;if("string"==typeof t)return e(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,a)}(t,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=new Array(e);a<e;a++)n[a]=t[a];return n}var a=function(e){var a="#hcaptcha-message",n=e(a),i=e("#wpwrap"),o=e("#adminmenuwrap"),r=e("#hcaptcha-integrations-search");function c(t,a){n.removeClass(),n.addClass(a+" notice settings-error is-dismissible"),n.html("<p>".concat(t,"</p>")),e(document).trigger("wp-updates-notice-added");var r=n.clone();n.css("visibility","hidden"),r.css("margin","0px"),r.css("top",i.position().top),r.css("z-index","999999");var c="block"===o.css("display")?o.width():0;r.css("left",c),r.width(e(window).width()-c),r.css("position","fixed"),e("body").append(r),setTimeout((function(){n.css("visibility","unset"),r.remove()}),3e3)}function s(t){c(t,"notice-error")}function l(t){return t.is(jQuery(".form-table").eq(0))}function d(t,a,n){var i=!1,o=a.toLowerCase(),r=!l(t),c=n.find("fieldset");c.attr("disabled",r),c.find("input").attr("disabled",r),t.find("tbody").children().each((function(t,a){var r=e(a).find(".hcaptcha-integrations-logo img").attr("alt");if((r=(r=r||"").replace(" Logo","")).toLowerCase()>o)return n.insertBefore(e(a)),i=!0,!1})),i||t.find("tbody").append(n)}e(".form-table img").on("click",(function(o){function r(){var a,o,r=v?"on":"off",u=(o=document.querySelector(".kagg-dialog select"))&&null!==(a=o.value)&&void 0!==a?a:"",m={action:HCaptchaIntegrationsObject.action,nonce:HCaptchaIntegrationsObject.nonce,activate:v,entity:f,status:g,newTheme:u};p.addClass(r),e.post({url:HCaptchaIntegrationsObject.ajaxUrl,data:m}).done((function(a){if(void 0!==a.success)if(void 0!==a.data.themes&&(window.HCaptchaIntegrationsObject.themes=a.data.themes,window.HCaptchaIntegrationsObject.defaultTheme=a.data.defaultTheme),a.success){var o=e(".form-table").eq(v?0:1),r=i.position().top;!function(t,a,n){if("theme"===a){var i=e(".form-table"),o=t?"":'[data-label="'+n+'"]',r=i.eq(t?0:1).find('.hcaptcha-integrations-logo img[data-entity="theme"]'+o);if(r.length){var c=i.eq(t?1:0),s=r.closest("tr");d(c,r.attr("data-label"),s)}}}(v,f,u),d(o,h,p),function(t){c(t,"notice-success")}(a.data.message),function(a){for(var n=e(".form-table"),i=0,o=Object.entries(a);i<o.length;i++){var r=t(o[i],2),c=r[0],s=r[1],u="hcaptcha-integrations-"+c.replace(/_/g,"-"),f=e("tr.".concat(u));l(f.closest(".form-table"))!==s&&d(n.eq(s?0:1),f.find(".hcaptcha-integrations-logo img").attr("alt"),f)}}(a.data.stati),e("html, body").animate({scrollTop:p.offset().top-r-n.outerHeight()},1e3)}else{var g,m;s(null!==(g=null===(m=a.data)||void 0===m?void 0:m.message)&&void 0!==g?g:a.data)}else c(HCaptchaIntegrationsObject.unexpectedErrorMsg,"notice-error")})).fail((function(t){s(t.statusText)})).always((function(){p.removeClass("on off")}))}o.preventDefault(),n.remove(),e('<div id="hcaptcha-message"></div>').insertAfter(".hcaptcha-header-bar"),n=e(a);var u=e(o.target),f=u.data("entity");if(f=f||"",-1!==e.inArray(f,["core","theme","plugin"])&&-1===e.inArray(f,["core"])){var h=u.attr("alt");h=(h=h||"").replace(" Logo","");var p=u.closest("tr"),g=p.attr("class");g=g.replace("hcaptcha-integrations-","");var m,v,b="";if(p.find("fieldset").attr("disabled"))m="plugin"===f?HCaptchaIntegrationsObject.activateMsg:HCaptchaIntegrationsObject.activateThemeMsg,v=!0;else{if("plugin"===f)m=HCaptchaIntegrationsObject.deactivateMsg;else{for(var y in m=HCaptchaIntegrationsObject.deactivateThemeMsg,b="<p>"+HCaptchaIntegrationsObject.selectThemeMsg+"</p>",b+="<select>",HCaptchaIntegrationsObject.themes){var w=y===HCaptchaIntegrationsObject.defaultTheme?' selected="selected"':"";b+='<option value="'.concat(y,'"').concat(w,">").concat(HCaptchaIntegrationsObject.themes[y],"</option>")}b+="</select>"}v=!1}-1===e.inArray(f,["theme"])||v||0!==Object.keys(HCaptchaIntegrationsObject.themes).length?(m=m.replace("%s",h),o.ctrlKey?r():kaggDialog.confirm({title:m,content:b,type:v?"activate":"deactivate",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText},cancel:{text:HCaptchaIntegrationsObject.CancelBtnText}},onAction:function(t){t&&r()}})):kaggDialog.confirm({title:HCaptchaIntegrationsObject.onlyOneThemeMsg,content:"",type:"info",buttons:{ok:{text:HCaptchaIntegrationsObject.OKBtnText}}})}}));var u,f,h;r.on("input",(u=function(){var t=r.val().trim().toLowerCase(),a=e(".hcaptcha-integrations-logo img"),n=null;if(a.each((function(a,i){var o=e(i);if("core"!==o.data("entity")){var r,c=o.closest("tr");o.data("label").toLowerCase().includes(t)?(c.show(),n=null!==(r=n)&&void 0!==r?r:c):c.hide()}})),n){var i=n.offset().top+n.outerHeight()-e(window).height()+5;e("html").stop().animate({scrollTop:i},1e3)}},f=100,function(){var t=this,e=arguments;clearTimeout(h),h=setTimeout((function(){return u.apply(t,e)}),f)})),e("#hcaptcha-options").keydown((function(t){e(t.target).is(r)&&13===t.which&&t.preventDefault()}))};window.hCaptchaIntegrations=a,jQuery(document).ready(a)})();
  • hcaptcha-for-forms-and-more/trunk/changelog.txt

    r3095958 r3098902  
     1= 4.2.1 =
     2* Fixed message layout on the General and Integrations pages.
     3* Fixed processing of WooCommerce Register form.
     4
    15= 4.2.0 =
    26* The minimum required WordPress version is now 5.3.
  • hcaptcha-for-forms-and-more/trunk/hcaptcha.php

    r3095958 r3098902  
    1111 * Plugin URI:           https://www.hcaptcha.com/
    1212 * Description:          hCaptcha keeps out bots and spam while putting privacy first. It is a drop-in replacement for reCAPTCHA.
    13  * Version:              4.2.0
     13 * Version:              4.2.1
    1414 * Requires at least:    5.1
    1515 * Requires PHP:         7.0
     
    4040 * Plugin version.
    4141 */
    42 const HCAPTCHA_VERSION = '4.2.0';
     42const HCAPTCHA_VERSION = '4.2.1';
    4343
    4444/**
  • hcaptcha-for-forms-and-more/trunk/readme.txt

    r3095958 r3098902  
    55Tested up to: 6.5
    66Requires PHP: 7.0.0
    7 Stable tag: 4.2.0
     7Stable tag: 4.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    561561== Changelog ==
    562562
     563= 4.2.1 =
     564* Fixed message layout on the General and Integrations pages.
     565* Fixed processing of WooCommerce Register form.
     566
    563567= 4.2.0 =
    564568* The minimum required WordPress version is now 5.3.
  • hcaptcha-for-forms-and-more/trunk/src/php/Admin/Events/Events.php

    r3095958 r3098902  
    3939        }
    4040
    41         add_action( 'hcap_verify_request', [ $this, 'save_event' ], -PHP_INT_MAX, 2 );
     41        add_filter( 'hcap_verify_request', [ $this, 'save_event' ], -PHP_INT_MAX, 2 );
    4242    }
    4343
     
    4848     * @param array             $error_codes Error codes.
    4949     *
    50      * @return void
     50     * @return string|null
    5151     */
    5252    public function save_event( $result, array $error_codes ) {
     
    5454
    5555        if ( ! ( is_string( $result ) || is_null( $result ) ) ) {
    56             return;
     56            return $result;
    5757        }
    5858
     
    8686            ]
    8787        );
     88
     89        return $result;
    8890    }
    8991
  • hcaptcha-for-forms-and-more/trunk/src/php/Settings/General.php

    r3095958 r3098902  
    621621            case self::SECTION_KEYS:
    622622                $this->print_header();
     623
     624                ?>
     625                <div id="hcaptcha-message"></div>
     626                <?php
     627
    623628                $this->notifications->show();
    624629                $this->print_section_header( $arguments['id'], __( 'Keys', 'hcaptcha-for-forms-and-more' ) );
     
    955960     */
    956961    private function flatten_array( array $arr ): array {
    957         static $level  = [];
    958         static $result = [];
     962        static $level = [], $result = [];
    959963
    960964        foreach ( $arr as $key => $value ) {
  • hcaptcha-for-forms-and-more/trunk/vendor/composer/installed.php

    r3095958 r3098902  
    22    'root' => array(
    33        'name' => 'hcaptcha/hcaptcha-wordpress-plugin',
    4         'pretty_version' => '4.2.0',
    5         'version' => '4.2.0.0',
    6         'reference' => 'aa580b1c05ee0aff974fbf1d99e92341a6f82094',
     4        'pretty_version' => '4.2.1',
     5        'version' => '4.2.1.0',
     6        'reference' => '6b037ed32f8ada5bcff7b8fd1d41c2e6cde5eaaf',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1212    'versions' => array(
    1313        'hcaptcha/hcaptcha-wordpress-plugin' => array(
    14             'pretty_version' => '4.2.0',
    15             'version' => '4.2.0.0',
    16             'reference' => 'aa580b1c05ee0aff974fbf1d99e92341a6f82094',
     14            'pretty_version' => '4.2.1',
     15            'version' => '4.2.1.0',
     16            'reference' => '6b037ed32f8ada5bcff7b8fd1d41c2e6cde5eaaf',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.