diff --git a/css/cleantalk-admin-settings-page.min.css b/css/cleantalk-admin-settings-page.min.css index befc669d..8c225a7b 100644 --- a/css/cleantalk-admin-settings-page.min.css +++ b/css/cleantalk-admin-settings-page.min.css @@ -1 +1 @@ -.apbct_settings-field_title--radio,.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-right:10px;margin:0;font-size:14px;vertical-align:top;width:210px}.apbct_settings-field_content,.apbct_settings-field_title--radio,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}.apbct_settings-page{padding-right:10px}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%;padding-bottom:10px}.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-bottom:10px}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;text-align:center;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a,i.animate-spin{color:rgba(120,200,230,1)}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}.--invisible{visibility:hidden}.apbct_preloader{height:1em;width:1em;margin-left:.5em;display:inline-block}.key_changed_success,.key_changed_sync{font-size:1.5em;line-height:2em;vertical-align:middle}.--upper-case{text-transform:uppercase}#cleantalk-modal-content{text-align:center}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:20px}#apbct_settings__after_advanced_settings{margin-bottom:20px;width:70%}#apbct_settings__button_section{position:fixed;z-index:9999;width:100%;padding-bottom:40px}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}.apbct_notification__advanced_settings{margin:20px 0;font-weight:400}.apbct_settings_top_info__div{float:right;padding:0 20px 0 0;font-size:13px;position:relative}.apbct_settings_top_info__p{padding:0;margin:2px}.apbct_settings_top_info__btn{display:inline-flex;gap:10px}.apbct_hidden_section_nav_mob_btn{display:none;background-image:url(images/menu.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center}.apbct_hidden_section_nav_mob_btn-close{display:none}@media (max-width:768px){.apbct_settings_top_info__btn{display:inline-grid;width:100%;gap:5px}#apbct_settings__advanced_settings_inner,#apbct_settings__after_advanced_settings,.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:100%}.apbct_settings_top_info__sub_btn .apbct_bottom_links--left,.apbct_settings_top_info__sub_btn .apbct_bottom_links--other{margin-left:0;margin-right:0}#apbct_hidden_section_nav ul{display:none;background-color:#dadee3bd;margin:0;padding:10px;border-radius:3px}#apbct_hidden_section_nav{right:0;min-width:167px}.apbct_setting_radio::before{height:6px!important;width:6px!important;margin:4px!important}.apbct_setting_checkbox::before{height:15px!important;width:15px!important;margin:0 -.05rem!important}.apbct_setting_checkbox,.apbct_setting_radio{height:16px!important;width:16px!important}.apbct_hidden_section_nav_mob_btn{display:block;width:32px;height:28px;right:-120px;position:relative}.apbct_hidden_section_nav_mob_btn-close{display:block;position:relative;float:right;width:20px;height:22px;top:-5px;right:-5px;background-image:url(images/cancel.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center;text-align:center}}.apbct_settings_top_info__sub_btn{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.apbct_setting---comments__form_decoration_color{width:175px;height:33px} \ No newline at end of file +.apbct_settings-field_title--radio,.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-right:10px;margin:0;font-size:14px;vertical-align:top;width:210px}.apbct_preloader,.apbct_settings-field_content,.apbct_settings-field_title--radio,.cleantalk_link-auto,.cleantalk_link-manual,.ct-warning-test-failed,.ct_rate_block,.ct_settings_banner,i.animate-spin{display:inline-block}.apbct_settings-page{padding-right:10px}#apbctTopWarning{margin-bottom:5px}#apbctTopWarning h3{margin:10px 0 5px}#apbctTopWarning h4{margin:10px}#apbctTopWarning h4 span{margin-top:5px}.apbct_settings-subtitle{position:relative;top:-15px;margin:0}.apbct_settings-field_wrapper{margin:15px 0}.apbct_settings-field_wrapper--sub{margin-left:30px!important}.apbct_settings__label{margin-right:10px;font-size:17px;vertical-align:text-bottom}.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:70%;padding-bottom:10px}.apbct_settings-field_title--select,.apbct_settings-field_title--textarea{padding-bottom:10px}.apbct_input_text{min-width:255px;width:400px}.apbct_settings-field--api_key{font-size:14pt}.apbct_settings-long_description---show:hover{color:#aaa;cursor:pointer}.apbct_setting_textarea{min-width:300px}.cleantalk_link{text-decoration:none;font-size:13px;line-height:26px;margin:10px 0 0;padding:0 10px 1px;cursor:pointer;border-width:1px;border-style:solid;-webkit-appearance:none;white-space:nowrap;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.cleantalk_link-auto{background:#ccc;border-color:#999;-webkit-box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);color:#000;height:28px;-webkit-border-radius:2px;border-radius:2px}.cleantalk_link-auto:hover{color:#fff}.cleantalk_link-manual{background:#2ea2cc;border-color:#0074a2;-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);box-shadow:inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15);color:#fff;-webkit-border-radius:3px;border-radius:3px;text-align:center}.cleantalk_link-manual:hover{color:#000}.cleantalk_link[disabled=disabled]{background:#5d9db5;color:#000}.apbct_status_icon{vertical-align:text-bottom;margin:0 5px 0 8px}a.ct_support_link{color:#666;margin-right:.5em;font-size:10pt;font-weight:400}.ct-warning-test-failed{position:relative;padding:5px;margin:4px;border:3px solid rgba(240,50,50,1);border-radius:5px;background-color:rgba(255,200,200,1)}.ct_settings_banner{text-align:right;width:100%;margin:1em 0;vertical-align:top}#cleantalk-modal-content,.ct_rate_block{text-align:center}#ct_translate_plugin{margin-left:0}.ct_rate_block{width:370px;margin-right:3em;padding:.8em .8em 15px;border:1px dashed #666}#ct_translate_plugin .apbct_button_rate{margin-bottom:10px}.apbct_long_desc{position:absolute;background:#5a5a5a;min-width:80px;min-height:80px;max-width:500px;padding:10px;color:#fff;z-index:10}.apbct_long_desc a,i.animate-spin{color:rgba(120,200,230,1)}i.animate-spin{-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear;font-size:25px;line-height:20px;margin:25px}@keyframes spin{to{transform:rotate(359deg)}}.apbct_long_desc__cancel{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.5)}.apbct_long_desc__cancel:hover{color:#fff}.apbct_long_desc__angle{position:absolute;top:5px;left:-17px;width:10px;height:10px;background:#5a5a5a;-webkit-transform:rotate(135deg);-ms-transform:rotate(135deg);transform:rotate(135deg);-webkit-transform-origin:100% 100%;-ms-transform-origin:100% 100%;transform-origin:100% 100%}.apbct_long_desc__title{color:rgba(120,200,230,1);margin:0}.--hide{display:none}.apbct_preloader_button{height:15px;margin-left:5px;vertical-align:text-top;display:none}.--invisible{visibility:hidden}.apbct_preloader{height:1em;width:1em;margin-left:.5em}.key_changed_success,.key_changed_sync{font-size:1.5em;line-height:2em;vertical-align:middle}.--upper-case{text-transform:uppercase}#cleantalk-modal-content>*{display:block;width:100%}button.ct_support_link{border:none;background:0 0;color:#666;text-decoration:underline;cursor:pointer}.apbct-btn-as-link{padding:0;margin:0;vertical-align:baseline;color:gray;border:0;border-bottom:1px solid;cursor:pointer}#apbct-account-email[contenteditable=true]{padding:6px;background-color:#fff;border:1px solid #ccc}button[value=save_changes]:disabled{color:#2271b1;border-color:#2271b1;background:#f6f7f7}#apbct_settings__advanced_settings{position:relative}#apbct_settings__advanced_settings_inner{width:70%}#apbct_hidden_section_nav{position:absolute;top:0;right:20px}#apbct_settings__after_advanced_settings{margin-bottom:20px;width:70%}#apbct_settings__button_section{position:fixed;z-index:9999;width:100%;padding-bottom:40px}.apbct_highlighted{outline-offset:5px;outline-color:red;outline-width:3px!important;outline-style:solid!important}.apbct_notice_inner{display:flex;margin-top:10px!important}.apbct_notification__advanced_settings{margin:20px 0;font-weight:400}.apbct_settings_top_info__div{float:right;padding:0 20px 0 0;font-size:13px;position:relative}.apbct_settings_top_info__p{padding:0;margin:2px}.apbct_settings_top_info__btn{display:inline-flex;gap:10px}.apbct_hidden_section_nav_mob_btn{display:none;background-image:url(images/menu.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center}.apbct_hidden_section_nav_mob_btn-close{display:none}@media (max-width:768px){.apbct_settings_top_info__btn{display:inline-grid;width:100%;gap:5px}#apbct_settings__advanced_settings_inner,#apbct_settings__after_advanced_settings,.apbct_settings-field_content--radio,.apbct_settings-field_wrapper>.apbct_settings-field_description{width:100%}.apbct_settings_top_info__sub_btn .apbct_bottom_links--left,.apbct_settings_top_info__sub_btn .apbct_bottom_links--other{margin-left:0;margin-right:0}#apbct_hidden_section_nav ul{display:none;background-color:#dadee3bd;margin:0;padding:10px;border-radius:3px}#apbct_hidden_section_nav{right:0;min-width:167px}.apbct_setting_radio::before{height:6px!important;width:6px!important;margin:4px!important}.apbct_setting_checkbox::before{height:15px!important;width:15px!important;margin:0 -.05rem!important}.apbct_setting_checkbox,.apbct_setting_radio{height:16px!important;width:16px!important}.apbct_hidden_section_nav_mob_btn{display:block;width:32px;height:28px;right:-120px;position:relative}.apbct_hidden_section_nav_mob_btn-close{display:block;position:relative;float:right;width:20px;height:22px;top:-5px;right:-5px;background-image:url(images/cancel.svg);background-repeat:no-repeat;background-size:contain;background-position-y:center;text-align:center}.apbct_long_desc{left:-2%!important;max-width:95%;margin-top:10%}.apbct_long_desc__angle{display:none}}.apbct_settings_top_info__sub_btn{display:flex;flex-wrap:wrap;gap:10px;margin:15px 0}.apbct_setting---comments__form_decoration_color{width:175px;height:33px} \ No newline at end of file diff --git a/css/cleantalk-email-decoder.min.css b/css/cleantalk-email-decoder.min.css index 91d559a7..b26b046c 100644 --- a/css/cleantalk-email-decoder.min.css +++ b/css/cleantalk-email-decoder.min.css @@ -1 +1 @@ -.apbct_dog_one,.apbct_dog_three,.apbct_dog_two{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:apbct_dog}.apbct-email-encoder-popup{width:30vw;min-width:400px;font-size:16px}.apbct-email-encoder--popup-header{font-size:16px;color:#333}.apbct-email-encoder-elements_center{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px!important;color:#000!important}.top-margin-long{margin-top:5px}.apbct-tooltip{display:none}.apbct-email-encoder{position:relative}.apbct-blur{filter:blur(5px);transition:filter 2s}.apbct-email-encoder.no-blur .apbct-blur{filter:none}.apbct-email-encoder-select-whole-email{-webkit-user-select:all;user-select:all}.apbct-email-encoder-got-it-button{all:unset;margin-top:10px;padding:5px 10px;border-radius:5px;background-color:#333;color:#fff;cursor:pointer;transition:background-color .3s}.apbct-ee-animation-wrapper{display:flex;height:60px;justify-content:center;font-size:16px;align-items:center}.apbct_dog{margin:0 5px;color:transparent;text-shadow:0 0 2px #aaa}.apbct_dog_one{animation-delay:0s}.apbct_dog_two{animation-delay:.5s}.apbct_dog_three{animation-delay:1s}@keyframes apbct_dog{0%,100%,75%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}25%{scale:200%;color:unset;text-shadow:unset}} \ No newline at end of file +.apbct_dog_one,.apbct_dog_three,.apbct_dog_two{animation-duration:1.5s;animation-iteration-count:infinite;animation-name:apbct_dog}.apbct-email-encoder-popup{width:30vw;min-width:400px;font-size:16px}.apbct-email-encoder--popup-header{font-size:16px;color:#333}.apbct-email-encoder-elements_center{display:flex;flex-direction:column;justify-content:center;align-items:center;font-size:16px!important;color:#000!important}.top-margin-long{margin-top:5px}.apbct-tooltip{display:none}.apbct-email-encoder{position:relative}.apbct-blur{filter:blur(5px);transition:filter 2s}.apbct-email-encoder.no-blur .apbct-blur{filter:none}.apbct-email-encoder-select-whole-email{-webkit-user-select:all;user-select:all}.apbct-email-encoder-got-it-button{all:unset;margin-top:10px;padding:5px 10px;border-radius:5px;background-color:#333;color:#fff;cursor:pointer;transition:background-color .3s}.apbct-ee-animation-wrapper{display:flex;height:60px;justify-content:center;font-size:16px;align-items:center}.apbct_dog{margin:0 5px;color:transparent;text-shadow:0 0 2px #aaa}.apbct_dog_one{animation-delay:0s}.apbct_dog_two{animation-delay:.5s}.apbct_dog_three{animation-delay:1s}@keyframes apbct_dog{0%,100%,75%{scale:100%;color:transparent;text-shadow:0 0 2px #aaa}25%{scale:200%;color:unset;text-shadow:unset}}.apbct-email-encoder--settings_example_encoded{position:absolute}@media screen and (max-width:782px){.apbct-email-encoder--settings_example_encoded{position:relative;display:block}.apbct-email-encoder-popup{width:20vw;min-width:200px;font-size:16px;top:20%;left:75%}.apbct-email-encoder-elements_center{flex-direction:column!important;text-align:center}} \ No newline at end of file diff --git a/css/src/cleantalk-admin-settings-page.css b/css/src/cleantalk-admin-settings-page.css index ceecc6e3..42026e7a 100644 --- a/css/src/cleantalk-admin-settings-page.css +++ b/css/src/cleantalk-admin-settings-page.css @@ -419,6 +419,15 @@ button[value="save_changes"]:disabled { background-position-y: center; text-align: center; } + + .apbct_long_desc { + left: -2% !important; + max-width: 95%; + margin-top: 10%; + } + .apbct_long_desc__angle { + display: none; + } } .apbct_settings_top_info__sub_btn { diff --git a/css/src/cleantalk-email-decoder.css b/css/src/cleantalk-email-decoder.css index 7936daec..2427c868 100644 --- a/css/src/cleantalk-email-decoder.css +++ b/css/src/cleantalk-email-decoder.css @@ -106,4 +106,30 @@ } } +.apbct-email-encoder--settings_example_encoded { + position: absolute; +} + +@media screen and (max-width: 782px) { + .apbct-email-encoder--settings_example_encoded { + position: relative; + display: block; + } + + .apbct-email-encoder-popup { + width: 20vw; + min-width: 200px; + font-size: 16px; + top: 20%; + left: 75%; + } + + .apbct-email-encoder-elements_center { + flex-direction: column !important; + text-align: center; + } +} + + + diff --git a/js/apbct-public-bundle.min.js b/js/apbct-public-bundle.min.js index a4623c13..c43c3349 100644 --- a/js/apbct-public-bundle.min.js +++ b/js/apbct-public-bundle.min.js @@ -1 +1 @@ -function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);o_createClass(function e(t){_classCallCheck(this,e),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"restParameters",{}),_defineProperty(this,"selector",null),_defineProperty(this,"elements",[]),_defineProperty(this,"eventCallback",void 0),_defineProperty(this,"eventSelector",void 0),_defineProperty(this,"event",void 0),this.select(t)},[{key:"select",value:function(e){return e instanceof HTMLCollection?(this.selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(this.selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect(),this}},{key:"addElement",value:function(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(this.selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.deselect()}},{key:"push",value:function(e){this.elements.push(e)}},{key:"reduce",value:function(){this.elements=this.elements.slice(0,-1)}},{key:"deselect",value:function(){this.elements=[]}},{key:"css",value:function(e,t){if(t=t||!1,"object"===_typeof(e)){for(var o in e)if(Object.hasOwn(e,o))for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),a=0;a(e=document.createElement(e).constructor,!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))))(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==this.selector?null!==document.querySelector(this.selector+t):this.isWithoutSelector(e,t)):o}},{key:"isWithoutSelector",value:function(e,t){var o,n=!1,a=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(a.s();!(o=a.n()).done;)n=n||e===o.value}catch(e){a.e(e)}finally{a.f()}return n}},{key:"filter",value:function(e){this.selector=null;for(var t=this.elements.length-1;0<=t;t--)this.isElem(this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.deselect(),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))}var t=a.value,o=(t.style.opacity=0,t.style.display="block",+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var a,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(a=t.n()).done;)(()=>{function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"}var t=a.value,o=(t.style.opacity=1,+new Date);e()})()}catch(e){t.e(e)}finally{t.f()}}}]))();function ctProcessError(e,t){var o={},e=(e&&e.message?o.err={msg:e.message,file:e.fileName||!1,ln:e.lineNumber||lineNo||!1,col:e.columnNumber||columnNo||!1,stacktrace:e.stack||!1,cause:!!t&&JSON.stringify(t),errorObj:error||!1}:(o.err={msg:e},t&&(o.err.file=t)),o.url=window.location.href,o.userAgent=window.navigator.userAgent,"ct_js_errors");null===(n=localStorage.getItem(e))&&(n="[]");for(var n=JSON.parse(n),a=0;a{function n(e){for(var t in _classCallCheck(this,n),_defineProperty(this,"xhr",new XMLHttpRequest),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_defineProperty(this,"methods_to_convert_data_to_URL",["GET","HEAD"]),_defineProperty(this,"body",null),_defineProperty(this,"http_code",0),_defineProperty(this,"status_text",""),e)void 0!==this[t]&&(this[t]=e[t]);if(this.prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.xhr.responseType=this.responseType,this.xhr.timeout=this.timeout,this.xhr.onreadystatechange=function(){this.isWpNonceError()?this.getFreshNonceAndRerunXHR(e):this.onReadyStateChange()}.bind(this),this.xhr.onload=function(){this.onLoad()}.bind(this),this.xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.xhr.onerror=function(){this.onError()}.bind(this),this.xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.xhr.send(this.body)}return _createClass(n,[{key:"prepare",value:function(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}},{key:"complete",value:function(){this.http_code=this.xhr.status,this.status_text=this.xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}},{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),this.complete(),this.error(this.http_code,this.status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.status_text)}},{key:"onTimeout",value:function(){this.complete(),this.error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(this.complete(),"json"===this.responseType){if(null===this.xhr.response)return this.error(this.http_code,this.status_text,"No response"),!1;if(void 0!==this.xhr.response.error)return this.error(this.http_code,this.status_text,this.xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.xhr.response,this.data)}},{key:"isWpNonceError",value:function(){var e=!1,t=!1;return 4==this.xhr.readyState&&(e="object"===_typeof(this.xhr.response)&&null!==this.xhr.response&&this.xhr.response.hasOwnProperty("data")&&this.xhr.response.data.hasOwnProperty("status")&&403===this.xhr.response.data.status,t="-1"===this.xhr.response&&403===this.xhr.status),e||t}},{key:"getFreshNonceAndRerunXHR",value:function(e){var t,o="";e.hasOwnProperty("headers")&&e.headers.hasOwnProperty("X-WP-Nonce")&&(o=e.headers["X-WP-Nonce"]),""!==(o=e.hasOwnProperty("data")&&e.data.hasOwnProperty("_ajax_nonce")?e.data._ajax_nonce:o)&&((t={method:"POST"}).data={spbc_remote_call_action:"get_fresh_wpnonce",plugin_name:"antispam",nonce_prev:o,initial_request_params:e},t.notJson=!0,t.url=ctPublicFunctions.host_url,t.callback=function(){for(var e=arguments.length,t=new Array(e),o=0;o{function n(){for(var e=arguments.length,t=new Array(e),o=0;o{function a(){for(var e=arguments.length,t=new Array(e),o=0;o_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"elements",[]),this.getElements(),this.setListeners()},[{key:"getElements",value:function(){var e,t=this,o=document.querySelectorAll("*"),n=/^apbct-trusted-text--label/,a=/apbct_form_decoration--/,c=(this.setDecorationBackground(),Array.from(o).filter(function(e){return n.test(e.id)})),o=(c.forEach(function(e){t.elements.push(e)}),(c=Array.from(o).filter(function(e){return a.test(e.className)})).forEach(function(e){t.elements.push(e)}),document.querySelector(".apbct_form_decoration"));o&&(c=window.getComputedStyle(o,"::before"),e=window.getComputedStyle(o,"::after"),c)&&e&&this.elements.push(o)}},{key:"setDecorationBackground",value:function(){var e,t,o,n=document.querySelectorAll("#respond");document.querySelector('[class*="apbct_form_decoration"]')&&(t=(e=document.querySelector('[class*="apbct_form_decoration"]').getAttribute("class")).indexOf("_header__wrapper"),o=e.substring(0,t),n.forEach(function(e){e.className+=" "+o}))}},{key:"setListeners",value:function(){var r=this;this.elements.forEach(function(i){i&&(i.addEventListener("click",function(e){var t,o,n,a,c;if(-1!==i.className.indexOf("apbct_form_decoration"))return-1!==i.className.indexOf("header__wrapper")||(t=e.offsetX,e=e.offsetY,o=parseFloat(window.getComputedStyle(i,"::before").width)/2,n=parseFloat(window.getComputedStyle(i,"::before").height)/2,a=parseFloat(window.getComputedStyle(i,"::after").width)/2,c=parseFloat(window.getComputedStyle(i,"::after").height)/2,-1!==i.className.indexOf("christmas")&&(eMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"wrappers",[]),this.wrappers=this.findWrappers(),this.wrappers.length<1||this.checkBot()},[{key:"findWrappers",value:function(){return document.querySelectorAll("div.ct-encoded-form-wrapper")}},{key:"checkBot",value:function(){var t=this,e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer};"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("force_protection_check_bot",{data:e,method:"POST",callback:function(e){return t.checkBotCallback(e)}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&(e.action="apbct_force_protection_check_bot",apbct_public_sendAJAX(e,{callback:function(e){return t.checkBotCallback(e)}}))}},{key:"checkBotCallback",value:function(e){if(e.data&&e.data.status&&200!==e.data.status)console.log("ApbctForceProtection connection error occurred"),this.decodeForms();else{if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.log("ApbctForceProtection decodeForms error",e),void this.decodeForms()}"object"===_typeof(e)&&e.allow&&1===e.allow?this.decodeForms():this.showMessageForBot(e.message)}}},{key:"decodeForms",value:function(){var t;this.wrappers.forEach(function(e){t=e.querySelector("div.ct-encoded-form").dataset.encodedForm;try{t&&"string"==typeof t&&(e.outerHTML=atob(t))}catch(e){console.log(e)}})}},{key:"showMessageForBot",value:function(t){this.wrappers.forEach(function(e){e.querySelector("div.ct-encoded-form").dataset.encodedForm&&(e.outerHTML='
'+t+"
")})}}]))(),CTTypoData=(()=>_createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2{var t=r.value;if("undefined"!=typeof ctPublic&&1==+ctPublic.settings__forms__search_test&&("searchform"===t.getAttribute("id")||null!==t.getAttribute("class")&&-1!==t.getAttribute("class").indexOf("search-form")||null!==t.getAttribute("role")&&-1!==t.getAttribute("role").indexOf("search"))){if(t.querySelector("input.dgwt-wcas-search-input"))return;t.apbctSearchPrevOnsubmit=t.onsubmit,t.onsubmit=function(e){return ctSearchFormOnSubmitHandler(e,t)}}})()}catch(e){l.e(e)}finally{l.f()}apbctCatchXmlHttpRequest(),ctPublic.settings__comments__form_decoration&&new ApbctFormDecorator,apbctAjaxSetImportantParametersOnCacheExist(ctPublic.advancedCacheExists||ctPublic.varnishCacheExists)}function ctAddWCMiddlewares(){window.hasOwnProperty("wp")&&window.wp.hasOwnProperty("apiFetch")&&"function"==typeof window.wp.apiFetch.use&&window.wp.apiFetch.use(function(e,t){return"object"===_typeof(e)&&null!==e&&e.hasOwnProperty("data")&&e.hasOwnProperty("path")&&(e.data.hasOwnProperty("requests")&&0{var o,e,n;if(c.data.forEach(function(e){e.encoded_email===a[t].dataset.originalString&&(o=e)}),!1===o.is_allowed)return{v:void 0};void 0!==a[t].href&&0===a[t].href.indexOf("mailto:")?(e=a[t].href.replace("mailto:",""),n=a[t].innerHTML,a[t].innerHTML=n.replace(e,o.decoded_email),a[t].href="mailto:"+o.decoded_email,a[t].querySelectorAll("span.apbct-email-encoder").forEach(function(t){var o="";c.data.forEach(function(e){e.encoded_email===t.dataset.originalString&&(o=e.decoded_email)}),t.innerHTML=o})):(a[t].classList.add("no-blur"),setTimeout(function(){ctProcessDecodedDataResult(o,a[t])},2e3)),a[t].removeEventListener("click",ctFillDecodedEmailHandler)})(t))return e.v}function resetEncodedNodes(){void 0!==ctPublic.encodedEmailNodes&&ctPublic.encodedEmailNodes.forEach(function(e){e.addEventListener("click",ctFillDecodedEmailHandler)})}function getJavascriptClientData(){var e=0)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10{var t=e.value;o.forEach(function(e){t.classList.contains(e)&&(n=!0)})})()}catch(e){t.e(e)}finally{t.f()}return n}function isFormThatNeedCatchXhr(e){return null==document.querySelector("div.elementor-widget[title='Login/Signup']")&&!(!e||!e.action||-1===e.action.toString().indexOf("mailpoet_subscription_form"))}function getNoCookieData(){var e=apbctLocalStorage.getCleanTalkData(),t=apbctSessionStorage.getCleanTalkData(),e=_objectSpread(_objectSpread({},e),t),e=JSON.stringify(e);return"_ct_no_cookie_data_"+btoa(e)}function apbctWriteReferrersToSessionStorage(){var e=apbctSessionStorage.get("apbct_session_current_page");!1!==e&&document.location.href!==e&&apbctSessionStorage.set("apbct_prev_referer",e,!1),apbctSessionStorage.set("apbct_session_current_page",document.location.href,!1)}function apbctCheckAddToCartByGet(){document.querySelectorAll("a.add_to_cart_button:not(.product_type_variable):not(.wc-interactive)").forEach(function(n){n.addEventListener("click",function(e){var t=n.getAttribute("href"),o=apbctLocalStorage.get("bot_detector_event_token");o&&(-1===t.indexOf("?")?t+="?":t+="&",n.setAttribute("href",t+="ct_bot_detector_event_token="+o))})})}"loading"!==document.readyState?checkFormsExistForCatching():apbct_attach_event_handler(document,"DOMContentLoaded",checkFormsExistForCatching);var ctProtectOutsideIframeCheck,cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,ignoreURLConvert:!1,load:function(e){var t;this.loaded||(this.loading=!0,t=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:t,notJson:!0}))},open:function(){function e(){var e,t="";for(e in this.styles)t+=e+":"+this.styles[e]+";";return t}var t={styles:{"z-index":"9999999999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},i={styles:{overflow:"hidden"},toString:e},r=document.createElement("style"),i=(r.setAttribute("id","cleantalk-modal-styles"),r.innerHTML="body.cleantalk-modal-opened{"+i+"}",r.innerHTML+="#cleantalk-modal-overlay{"+t+"}",r.innerHTML+="#cleantalk-modal-close{"+n+"}",r.innerHTML+="#cleantalk-modal-close:before{"+a+"}",r.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(r),document.createElement("div")),t=(i.setAttribute("id","cleantalk-modal-overlay"),document.body.append(i),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),i.append(t),document.createElement("div")),a=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?/.*\/inc/g.test(this.loaded)||this.ignoreURLConvert?a.innerHTML=this.loaded:a.innerHTML=this.loaded.replace(/(https?:\/\/[^\s]+)/g,'$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(var e,t,o=0;o strong')).length)&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file +function ownKeys(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function _objectSpread(t){for(var e=1;e=e.length?{done:!0}:{done:!1,value:e[c++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=Array(t);oMath.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t'+t+"")})}}])}(),CTTypoData=function(){return _createClass(function e(){_classCallCheck(this,e),_defineProperty(this,"fieldData",{isAutoFill:!1,isUseBuffer:!1,speedDelta:0,firstKeyTimestamp:0,lastKeyTimestamp:0,lastDelta:0,countOfKey:0}),_defineProperty(this,"fields",document.querySelectorAll("textarea[name=comment]")),_defineProperty(this,"data",[])},[{key:"gatheringFields",value:function(){var o=this;Array.prototype.slice.call(this.fields).forEach(function(e,t){o.data.push(Object.assign({},o.fieldData))})}},{key:"setListeners",value:function(){var n=this;this.fields.forEach(function(e,t){e.addEventListener("paste",function(){n.data[t].isUseBuffer=!0})}),this.fields.forEach(function(e,t){e.addEventListener("onautocomplete",function(){n.data[t].isAutoFill=!0})}),this.fields.forEach(function(e,o){e.addEventListener("input",function(){n.data[o].countOfKey++;var e,t=+new Date;1===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].firstKeyTimestamp=t):(e=t-n.data[o].lastKeyTimestamp,2===n.data[o].countOfKey?(n.data[o].lastKeyTimestamp=t,n.data[o].lastDelta=e):2)/,t+"$1"))}function ctShowDecodeComment(e){e=e||"Can not decode email. Unknown reason";var t=document.getElementById("apbct_popup"),o=document.getElementById("apbct_popup_text");null!==t&&(document.body.classList.remove("apbct-popup-fade"),o.innerText="CleanTalk email decoder: "+e,setTimeout(function(){t.setAttribute("style","display:none")},3e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",a=0,c="",i=0,r=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===r.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(r.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),a++):(c+=" "+e.getAttribute("name"),i++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:a,invisible_fields:c,invisible_fields_count:i}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10$1'):(a.innerHTML="Loading...",this.load("get_options_template")),a.setAttribute("id","cleantalk-modal-content"),t.append(a),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};function ctProtectExternal(){for(var e,t,o=0;o strong')).length)&&(e.forEach(function(e,t){var o,n=document.createElement("div"),a=(n.setAttribute("class","apbct-real-user-badge"),document.createElement("img")),c=(a.setAttribute("src",s.imgPersonUrl),a.setAttribute("class","apbct-real-user-popup-img"),document.createElement("div")),i=(c.setAttribute("class","apbct-real-user-popup"),document.createElement("p")),r=(i.setAttribute("class","apbct-real-user-popup-header"),i.append(s.phrases.trpHeading),document.createElement("div")),l=(r.setAttribute("class","apbct-real-user-popup-content_row"),document.createElement("span"));l.append(s.phrases.trpContent1+" "),l.append(s.phrases.trpContent2),u&&((o=document.createElement("a")).setAttribute("href",s.trpContentLink),o.setAttribute("target","_blank"),o.text=s.phrases.trpContentLearnMore,l.append(" "),l.append(o)),r.append(l),c.append(i,r),n.append(a),e.append(n),e.append(c)}),document.querySelectorAll(".apbct-real-user-badge").forEach(function(n){var a=void 0,e=(n.addEventListener("click",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.toggle("visible")}),n.addEventListener("mouseenter",function(){var e=this.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.add("visible")}),n.addEventListener("mouseleave",function(){var t=this;a=setTimeout(function(){var e=t.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.nextElementSibling);e.addEventListener("mouseenter",function(){clearTimeout(a),e.classList.add("visible")}),e.addEventListener("mouseleave",function(){a=setTimeout(function(){e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},1e3)}),n.addEventListener("touchend",function(){var o=this;a=setTimeout(function(){var e=o.nextElementSibling,t=window.getSelection();e&&t&&e.classList.contains("apbct-real-user-popup")&&0===t.toString().length?e.classList.remove("visible"):(clearTimeout(a),document.addEventListener("selectionchange",function e(){var t=window.getSelection();t&&0===t.toString().length&&(a=setTimeout(function(){var e=n.nextElementSibling;e&&e.classList.contains("apbct-real-user-popup")&&e.classList.remove("visible")},3e3),document.removeEventListener("selectionchange",e))}))},3e3)})}))}); \ No newline at end of file diff --git a/js/cleantalk-admin-settings-page.min.js b/js/cleantalk-admin-settings-page.min.js index 8071bc97..e3e8440e 100644 --- a/js/cleantalk-admin-settings-page.min.js +++ b/js/cleantalk-admin-settings-page.min.js @@ -1,2 +1,2 @@ -function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("
");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c)}},n)}function apbctSaveButtonPosition(){var t,e,n,a,c,i,o,s;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,o=(i=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,s=i.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t{var e;"checkbox"===t.target.type?(e=t.target.checked?1:2,document.querySelectorAll("input[id^=apbct_setting_data__email_decoder]")[e].checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});let t=(new Date).getTimezoneOffset()/60*-1;jQuery("#ct_admin_timezone").val(t),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto",ct_admin_timezone:t},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));if(jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition(),window.addEventListener("scroll",apbctSaveButtonPosition),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("

Please, insert a correct access key before saving changes!

").insertAfter(jQuery("#apbct_setting_apikey")),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();let e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"})}); +function apbctBannerCheck(){let c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbctGetElems(a){for(let t=0,e=(a=a.split(",")).length,n;t{document.getElementById(t)&&"none"!==document.getElementById(t).style.display&&apbctShowHideElem(t)})}function apbctShowRequiredGroups(t,e){var n=document.getElementById("apbct_settings__dwpms_settings");n&&"none"===n.style.display&&((n=t).preventDefault(),apbctShowHideElem("apbct_settings__dwpms_settings"),document.getElementById(e).dispatchEvent(new n.constructor(n.type,n)))}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbctGetElemsNative(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependenciesGetState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependenciesGetState(t){let e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbctSettingsShowDescription(t,e){function c(t){var e=0!=jQuery(t.target).parent(".apbct_long_desc").length,t=jQuery(t.target).hasClass("apbct_long_desc__cancel");(0");var n=jQuery("#apbct_long_desc__"+e);n.append("").append("
").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("
").append("").append("

"+t.title+"

").append("

"+t.desc+"

"),jQuery(document).on("click",c)}},n)}function apbctSaveButtonPosition(){var t,e,n,a,c,i,o,s;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,o=(i=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,s=i.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t{var e;"checkbox"===t.target.type?(e=t.target.checked?1:2,document.querySelectorAll("input[id^=apbct_setting_data__email_decoder]")[e].checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});let t=(new Date).getTimezoneOffset()/60*-1;jQuery("#ct_admin_timezone").val(t),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto",ct_admin_timezone:t},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));if(jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");let n={};if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var a=e.val();if(""===a)return void e.css("border-color","red");n={template_name:a}}else n={template_id:t.data("id")};let c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){let c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("

"+t.data+"

").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("

"+t.data+"

").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&(ctSettingsPage.key_changed?(jQuery(".key_changed_sync").hide(300),jQuery(".key_changed_success").show(300),setTimeout(function(){document.location.reload()},3e3)):document.location.reload())}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbctSettingsShowDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbctBannerCheck(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbctSaveButtonPosition(),window.addEventListener("scroll",apbctSaveButtonPosition),jQuery("#ct_adv_showhide a").on("click",apbctSaveButtonPosition),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("

Please, insert a correct access key before saving changes!

").insertAfter(jQuery("#apbct_setting_apikey")),apbctHighlightElement("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("

Synchronization process failed. Please, check the acces key and restart the synch.

").insertAfter(jQuery("#apbct_button__sync")),apbctHighlightElement("apbct_setting_apikey",3),apbctHighlightElement("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();let e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))}),jQuery('button[id*="apbct-action-adjust-change-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_change"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-change-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),jQuery('button[id*="apbct-action-adjust-reverse-"]').click(function(t){t.preventDefault();var t={action:"apbct_action_adjust_reverse"},e=(t.adjust=jQuery(this).data("adjust"),{});e.button=document.getElementById("apbct-action-adjust-reverse-"+t.adjust),e.notJson=!0,e.callback=function(){document.location.reload()},apbct_admin_sendAJAX(t,e)}),document.querySelector(".apbct_hidden_section_nav_mob_btn").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="block",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="none"}),document.querySelector(".apbct_hidden_section_nav_mob_btn-close").addEventListener("click",()=>{document.querySelector("#apbct_hidden_section_nav ul").style.display="none",document.querySelector(".apbct_hidden_section_nav_mob_btn").style.display="block"})}); //# sourceMappingURL=cleantalk-admin-settings-page.min.js.map diff --git a/js/cleantalk-admin-settings-page.min.js.map b/js/cleantalk-admin-settings-page.min.js.map index 81c49c54..fd164635 100644 --- a/js/cleantalk-admin-settings-page.min.js.map +++ b/js/cleantalk-admin-settings-page.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\n // Top level settings\n jQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n if ( event.target.type === 'checkbox' ) {\n let currentTarget = event.target.checked ? 1 : 2;\n document.querySelectorAll('input[id^=apbct_setting_data__email_decoder]')[currentTarget].checked = true;\n } else {\n document.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n }\n });\n\n // Crunch for Right to Left direction languages\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\n jQuery('.apbct_switchers').css('text-align', 'right');\n }\n }\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function() {\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n let d = new Date();\n let timezone = d.getTimezoneOffset()/60*(-1);\n jQuery('#ct_admin_timezone').val(timezone);\n\n // Key KEY automatically\n jQuery('#apbct_button__get_key_auto').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__get_key_auto' ),\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.getTemplates) {\n cleantalkModal.loaded = result.getTemplates;\n cleantalkModal.open();\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\n let data = {};\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Sync button\n jQuery('#apbct_button__sync').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_sync'},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__sync' ),\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__sync .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__sync .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n if ( ctSettingsPage.key_changed ) {\n jQuery('.key_changed_sync').hide(300);\n jQuery('.key_changed_success').show(300);\n setTimeout(function() {\n document.location.reload();\n }, 3000);\n } else {\n document.location.reload();\n }\n }\n },\n },\n );\n });\n\n if ( ctSettingsPage.key_changed ) {\n jQuery('#apbct_button__sync').click();\n }\n\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\n self = jQuery(this);\n apbctSettingsShowDescription(self, self.attr('setting'));\n });\n\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\n apbctBannerCheck();\n }\n\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n }\n });\n\n apbctSaveButtonPosition();\n window.addEventListener('scroll', apbctSaveButtonPosition);\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\n\n\n /**\n * Change cleantalk account email\n */\n jQuery('#apbct-change-account-email').on('click', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#apbct-account-email');\n let accountEmail = accountEmailField.text();\n\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n apbct_admin_sendAJAX(\n {\n action: 'apbct_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#apbct-account-email').css('border-color', 'red');\n }\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n /**\n * Validate apkikey and hide get auto btn\n */\n jQuery('#apbct_setting_apikey').on('input', function() {\n let enteredValue = jQuery(this).val();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').off('click');\n if (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#apbct_bad_key_notice').length) {\n jQuery( '

' +\n 'Please, insert a correct access key before saving changes!' +\n '

' ).insertAfter( jQuery('#apbct_setting_apikey') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n },\n );\n return;\n }\n });\n\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n }\n\n /**\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n */\n if ( !ctSettingsPage.key_is_ok ) {\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#sync_required_notice').length) {\n jQuery( '

' +\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n apbctHighlightElement('apbct_button__sync', 3);\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n },\n );\n }\n\n /**\n * Open WP gallery for adding custom logo\n */\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\n e.preventDefault();\n\n const button = jQuery(this);\n\n const customUploader = wp.media({\n library: {\n type: 'image',\n },\n multiple: false,\n });\n\n customUploader.on('select', function() {\n const image = customUploader.state().get('selection').first().toJSON();\n\n button.parent().prev().attr( 'src', image.url );\n jQuery('#cleantalk_custom_logo').val( image.id );\n });\n\n customUploader.open();\n });\n\n /**\n * Remove selected logo\n */\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\n e.preventDefault();\n\n if ( true === confirm( 'Sure?' ) ) {\n const src = jQuery(this).parent().prev().data('src');\n jQuery(this).parent().prev().attr('src', src);\n jQuery(this).prev().prev().val('');\n }\n });\n\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_change';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_reverse';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\n });\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbctBannerCheck() {\n let bannerChecker = setInterval( function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#cleantalk_notice_renew').length) {\n jQuery('#cleantalk_notice_renew').hide('slow');\n }\n if (jQuery('#cleantalk_notice_trial').length) {\n jQuery('#cleantalk_notice_trial').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param {string|array} elems\n * @return {*}\n */\nfunction apbctGetElems(elems) {\n elems = elems.split(',');\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param {string|array} elems\n * @return {array}\n */\nfunction apbctGetElemsNative(elems) {\n // Make array from a string\n if (typeof elems === 'string') {\n elems = elems.split(',');\n }\n\n let out = [];\n\n elems.forEach(function(elem, i, arr) {\n // try to get elements with such IDs\n let tmp = document.getElementById(elem);\n if (tmp !== null) {\n out.push( tmp[key] );\n return;\n }\n\n // try to get elements with such class name\n // write each elem from collection to new element of output array\n tmp = document.getElementsByClassName(elem);\n if (tmp !== null && tmp.length !==0 ) {\n for (key in tmp) {\n if ( +key >= 0 ) {\n out.push( tmp[key] );\n }\n }\n }\n });\n\n return out;\n}\n\n/**\n * @param {string|array} elems\n */\nfunction apbctShowHideElem(elems) {\n elems = apbctGetElems(elems);\n for ( let i=0, len = elems.length; i < len; i++) {\n elems[i].each(function(i, elem) {\n elem = jQuery(elem);\n let label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(':visible')) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * @param {string|array} element\n */\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\n let toHide = [\n 'apbct_settings__dwpms_settings',\n 'apbct_settings__advanced_settings',\n 'trusted_and_affiliate__special_span',\n ];\n let index = toHide.indexOf(element);\n if (index !== -1) {\n toHide.splice(index, 1);\n }\n apbctShowHideElem(element);\n toHide.forEach((toHideElem) => {\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\n apbctShowHideElem(toHideElem);\n }\n });\n}\n\n/**\n * @param {mixed} event\n * @param {string} id\n */\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\n let required = document.getElementById('apbct_settings__dwpms_settings');\n if (required && required.style.display === 'none') {\n let originEvent = event;\n event.preventDefault();\n apbctShowHideElem('apbct_settings__dwpms_settings');\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param {string|array} ids\n * @param {int} enable\n */\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\n enable = ! isNaN(enable) ? enable : null;\n\n // Get elements\n let elems = apbctGetElemsNative( ids );\n\n elems.forEach(function(elem, i, arr) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n // Set defined state\n if (enable === null) {\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\n }\n\n enable === 1 ? doEnable() : doDisable();\n\n if ( elem.getAttribute('apbct_children') !== null) {\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\n if ( state !== null ) {\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n }\n }\n });\n}\n\n/**\n * @param {HTMLElement} elem\n * @return {int|null}\n */\nfunction apbctSettingsDependenciesGetState(elem) {\n let state;\n\n switch ( elem.getAttribute( 'type' ) ) {\n case 'checkbox':\n state = +elem.checked;\n break;\n case 'radio':\n state = +(+elem.getAttribute('value') === 1);\n break;\n default:\n state = null;\n }\n\n return state;\n}\n\n/**\n * @param {HTMLElement} label\n * @param {string} settingId\n */\nfunction apbctSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n if (typeof e === 'undefined' || (\n (jQuery(e.target).parent('.apbct_long_desc').length == 0 ||\n jQuery(e.target).hasClass('apbct_long_desc__cancel')\n ) &&\n !jQuery(e.target).hasClass('apbct_long_description__show'))\n ) {\n jQuery('.apbct_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n removeDescFunc();\n\n label.after('
');\n let obj = jQuery('#apbct_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top - 5,\n left: label.position().left + 25,\n });\n\n\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * save button, navigation menu, navigation button position\n */\nfunction apbctSaveButtonPosition() {\n if (\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\n document.getElementById('apbct_settings__button_section') === null ||\n document.getElementById('apbct_settings__advanced_settings') === null ||\n document.getElementById('apbct_hidden_section_nav') === null\n ) {\n return;\n }\n let docInnerHeight = window.innerHeight;\n let advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n let advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n let buttonBlock = document.getElementById('apbct_settings__button_section');\n let buttonHeight = buttonBlock.getBoundingClientRect().height;\n let navBlock = document.getElementById('apbct_hidden_section_nav');\n let navBlockOffset = navBlock.getBoundingClientRect().top;\n let navBlockHeight = navBlock.getBoundingClientRect().height;\n\n // Set Save button position\n if ( getComputedStyle(advSettingsBlock).display !== 'none' ) {\n jQuery('#apbct_settings__main_save_button').hide();\n if ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n buttonBlock.style.bottom = '';\n buttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n } else {\n buttonBlock.style.bottom = 0;\n buttonBlock.style.top = '';\n }\n } else {\n jQuery('#apbct_settings__main_save_button').show();\n }\n\n if (window.innerWidth <= 768 && advSettingsOffset < 0) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'grid';\n document.querySelector('#apbct_hidden_section_nav').style.top = docInnerHeight + 'px';\n } else if (window.innerWidth <= 768) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'none';\n }\n\n // Set nav position\n if ( advSettingsOffset <= 0 ) {\n navBlock.style.top = - advSettingsOffset + 30 + 'px';\n } else {\n navBlock.style.top = 0;\n }\n}\n\n/**\n * Hightlights element\n *\n * @param {string} id\n * @param {int} times\n */\nfunction apbctHighlightElement(id, times) {\n times = times-1 || 0;\n let keyField = jQuery('#'+id);\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\n keyField.addClass('apbct_highlighted');\n keyField.animate({opacity: 0}, 400, 'linear', function() {\n keyField.animate({opacity: 1}, 400, 'linear', function() {\n if (times>0) {\n apbctHighlightElement(id, times);\n } else {\n keyField.removeClass('apbct_highlighted');\n }\n });\n });\n}\n"],"names":["apbctBannerCheck","let","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","apbctExceptedShowHide","element","toHide","index","indexOf","splice","toHideElem","style","display","apbctShowRequiredGroups","event","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","checked","apbctSettingsShowDescription","settingId","removeDescFunc","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","setting_id","spinner","children","empty","title","desc","on","apbctSaveButtonPosition","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","bottom","innerWidth","querySelector","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","ready","currentTarget","querySelectorAll","parseInt","value","direction","val","attr","this","fadeOut","timezone","Date","getTimezoneOffset","ct_admin_timezone","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src","adjust"],"mappings":"AAkbA,SAASA,mBACLC,IAAIC,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAMhB,IAAIiB,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAAE,EAAIG,EAEzD,OAAOJ,CACX,CASA,SAASK,oBAAoBL,GAEJ,UAAjB,OAAOA,IACPA,EAAQA,EAAMG,MAAM,GAAG,GAG3BnB,IAAIsB,EAAM,GAsBV,OApBAN,EAAMO,QAAQ,SAASC,EAAMP,EAAGQ,GAE5BzB,IAAIoB,EAAMM,SAASC,eAAeH,CAAI,EACtC,GAAY,OAARJ,EACAE,EAAIM,KAAMR,EAAIS,IAAK,OAOvB,GAAY,QADZT,EAAMM,SAASI,uBAAuBN,CAAI,IACR,IAAdJ,EAAIR,OACpB,IAAKiB,OAAOT,EACK,GAAR,CAACS,KACFP,EAAIM,KAAMR,EAAIS,IAAK,CAInC,CAAC,EAEMP,CACX,CAKA,SAASS,kBAAkBf,GAEv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page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function() {\n // Top level settings\n jQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n if ( event.target.type === 'checkbox' ) {\n let currentTarget = event.target.checked ? 1 : 2;\n document.querySelectorAll('input[id^=apbct_setting_data__email_decoder]')[currentTarget].checked = true;\n } else {\n document.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n }\n });\n\n // Crunch for Right to Left direction languages\n if (document.getElementsByClassName('apbct_settings-title')[0]) {\n if (getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl') {\n jQuery('.apbct_switchers').css('text-align', 'right');\n }\n }\n\n // Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function() {\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n let d = new Date();\n let timezone = d.getTimezoneOffset()/60*(-1);\n jQuery('#ct_admin_timezone').val(timezone);\n\n // Key KEY automatically\n jQuery('#apbct_button__get_key_auto').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_get_key_auto', ct_admin_timezone: timezone},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__get_key_auto' ),\n spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n document.location.reload();\n }\n if (result.getTemplates) {\n cleantalkModal.loaded = result.getTemplates;\n cleantalkModal.open();\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n }\n },\n },\n );\n });\n\n // Import settings\n jQuery( document ).on('click', '#apbct_settings_templates_import_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n let templateNameInput = jQuery('#apbct_settings_templates_import_name');\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n let data = {\n 'template_id': optionSelected.data('id'),\n 'template_name': optionSelected.data('name'),\n 'settings': optionSelected.data('settings'),\n };\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_import', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Export settings\n jQuery( document ).on('click', '#apbct_settings_templates_export_button', function() {\n jQuery('#apbct-ajax-result').remove();\n let optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n let templateNameInput = jQuery('#apbct_settings_templates_export_name');\n let data = {};\n templateNameInput.css('border-color', 'inherit');\n if ( typeof optionSelected.data('id') === 'undefined' ) {\n console.log( 'Attribute \"data-id\" not set for the option.' );\n return;\n }\n if ( optionSelected.data('id') === 'new_template' ) {\n let templateName = templateNameInput.val();\n if ( templateName === '' ) {\n templateNameInput.css('border-color', 'red');\n return;\n }\n data = {\n 'template_name': templateName,\n };\n } else {\n data = {\n 'template_id': optionSelected.data('id'),\n };\n }\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_export', data: data},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Reset settings\n jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function() {\n let button = this;\n apbct_admin_sendAJAX(\n {action: 'settings_templates_reset'},\n {\n timeout: 25000,\n button: button,\n spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n notJson: true,\n callback: function(result, data, params, obj) {\n if (result.success) {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);\n }, 2000);\n document.addEventListener('cleantalkModalClosed', function( e ) {\n document.location.reload();\n });\n setTimeout(function() {\n cleantalkModal.close();\n }, 2000);\n } else {\n jQuery( '

' + result.data + '

' )\n .insertAfter( jQuery(button) );\n }\n },\n },\n );\n });\n\n // Sync button\n jQuery('#apbct_button__sync').on('click', function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_sync'},\n {\n timeout: 25000,\n button: document.getElementById('apbct_button__sync' ),\n spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n callback: function(result, data, params, obj) {\n jQuery('#apbct_button__sync .apbct_success').show(300);\n setTimeout(function() {\n jQuery('#apbct_button__sync .apbct_success').hide(300);\n }, 2000);\n if (result.reload) {\n if ( ctSettingsPage.key_changed ) {\n jQuery('.key_changed_sync').hide(300);\n jQuery('.key_changed_success').show(300);\n setTimeout(function() {\n document.location.reload();\n }, 3000);\n } else {\n document.location.reload();\n }\n }\n },\n },\n );\n });\n\n if ( ctSettingsPage.key_changed ) {\n jQuery('#apbct_button__sync').click();\n }\n\n jQuery(document).on('click', '.apbct_settings-long_description---show', function() {\n self = jQuery(this);\n apbctSettingsShowDescription(self, self.attr('setting'));\n });\n\n if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length) {\n apbctBannerCheck();\n }\n\n jQuery(document).on('change', '#apbct_settings_templates_export', function() {\n let optionSelected = jQuery('option:selected', this);\n if ( optionSelected.data('id') === 'new_template' ) {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n } else {\n jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n }\n });\n\n apbctSaveButtonPosition();\n window.addEventListener('scroll', apbctSaveButtonPosition);\n jQuery('#ct_adv_showhide a').on('click', apbctSaveButtonPosition);\n\n\n /**\n * Change cleantalk account email\n */\n jQuery('#apbct-change-account-email').on('click', function(e) {\n e.preventDefault();\n\n let $this = jQuery(this);\n let accountEmailField = jQuery('#apbct-account-email');\n let accountEmail = accountEmailField.text();\n\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $this.text($this.data('save-text'));\n accountEmailField.attr('contenteditable', 'true');\n accountEmailField.on('keydown', function(e) {\n if (e.code === 'Enter') {\n e.preventDefault();\n }\n });\n accountEmailField.on('input', function(e) {\n if (e.inputType === 'insertParagraph') {\n e.preventDefault();\n }\n });\n } else {\n apbct_admin_sendAJAX(\n {\n action: 'apbct_update_account_email',\n accountEmail: accountEmail,\n },\n {\n timeout: 5000,\n callback: function(result, data, params, obj) {\n if (result.success !== undefined && result.success === 'ok') {\n if (result.manuallyLink !== undefined) {\n jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n }\n }\n\n if (result.error !== undefined) {\n jQuery('#apbct-account-email').css('border-color', 'red');\n }\n },\n },\n );\n\n accountEmailField.attr('contenteditable', 'false');\n $this.text($this.data('default-text'));\n }\n });\n\n /**\n * Validate apkikey and hide get auto btn\n */\n jQuery('#apbct_setting_apikey').on('input', function() {\n let enteredValue = jQuery(this).val();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').off('click');\n if (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#apbct_bad_key_notice').length) {\n jQuery( '

' +\n 'Please, insert a correct access key before saving changes!' +\n '

' ).insertAfter( jQuery('#apbct_setting_apikey') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n },\n );\n return;\n }\n });\n\n if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n jQuery('#apbct_button__get_key_auto__wrapper').hide();\n }\n\n /**\n * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n */\n if ( !ctSettingsPage.key_is_ok ) {\n jQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n function(e) {\n e.preventDefault();\n if (!jQuery('#sync_required_notice').length) {\n jQuery( '

' +\n 'Synchronization process failed. Please, check the acces key and restart the synch.' +\n '

' ).insertAfter( jQuery('#apbct_button__sync') );\n }\n apbctHighlightElement('apbct_setting_apikey', 3);\n apbctHighlightElement('apbct_button__sync', 3);\n jQuery('#apbct_button__get_key_auto__wrapper').show();\n },\n );\n }\n\n /**\n * Open WP gallery for adding custom logo\n */\n jQuery('#apbct-custom-logo-open-gallery').click(function(e) {\n e.preventDefault();\n\n const button = jQuery(this);\n\n const customUploader = wp.media({\n library: {\n type: 'image',\n },\n multiple: false,\n });\n\n customUploader.on('select', function() {\n const image = customUploader.state().get('selection').first().toJSON();\n\n button.parent().prev().attr( 'src', image.url );\n jQuery('#cleantalk_custom_logo').val( image.id );\n });\n\n customUploader.open();\n });\n\n /**\n * Remove selected logo\n */\n jQuery('#apbct-custom-logo-remove-image').click(function(e) {\n e.preventDefault();\n\n if ( true === confirm( 'Sure?' ) ) {\n const src = jQuery(this).parent().prev().data('src');\n jQuery(this).parent().prev().attr('src', src);\n jQuery(this).prev().prev().val('');\n }\n });\n\n jQuery('button[id*=\"apbct-action-adjust-change-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_change';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-change-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n jQuery('button[id*=\"apbct-action-adjust-reverse-\"]').click(function(e) {\n e.preventDefault();\n\n let data = {};\n data.action = 'apbct_action_adjust_reverse';\n data.adjust = jQuery(this).data('adjust');\n\n let params = {};\n params.button = document.getElementById('apbct-action-adjust-reverse-' + data.adjust);\n params.notJson = true;\n\n params.callback = function() {\n document.location.reload();\n };\n\n apbct_admin_sendAJAX(data, params);\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'block';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'none';\n });\n\n document.querySelector('.apbct_hidden_section_nav_mob_btn-close').addEventListener('click', () => {\n document.querySelector('#apbct_hidden_section_nav ul').style.display = 'none';\n document.querySelector('.apbct_hidden_section_nav_mob_btn').style.display = 'block';\n });\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbctBannerCheck() {\n let bannerChecker = setInterval( function() {\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__check_renew_banner'},\n {\n callback: function(result, data, params, obj) {\n if (result.close_renew_banner) {\n if (jQuery('#cleantalk_notice_renew').length) {\n jQuery('#cleantalk_notice_renew').hide('slow');\n }\n if (jQuery('#cleantalk_notice_trial').length) {\n jQuery('#cleantalk_notice_trial').hide('slow');\n }\n clearInterval(bannerChecker);\n }\n },\n },\n );\n }, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param {string|array} elems\n * @return {*}\n */\nfunction apbctGetElems(elems) {\n elems = elems.split(',');\n for ( let i=0, len = elems.length, tmp; i < len; i++) {\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param {string|array} elems\n * @return {array}\n */\nfunction apbctGetElemsNative(elems) {\n // Make array from a string\n if (typeof elems === 'string') {\n elems = elems.split(',');\n }\n\n let out = [];\n\n elems.forEach(function(elem, i, arr) {\n // try to get elements with such IDs\n let tmp = document.getElementById(elem);\n if (tmp !== null) {\n out.push( tmp[key] );\n return;\n }\n\n // try to get elements with such class name\n // write each elem from collection to new element of output array\n tmp = document.getElementsByClassName(elem);\n if (tmp !== null && tmp.length !==0 ) {\n for (key in tmp) {\n if ( +key >= 0 ) {\n out.push( tmp[key] );\n }\n }\n }\n });\n\n return out;\n}\n\n/**\n * @param {string|array} elems\n */\nfunction apbctShowHideElem(elems) {\n elems = apbctGetElems(elems);\n for ( let i=0, len = elems.length; i < len; i++) {\n elems[i].each(function(i, elem) {\n elem = jQuery(elem);\n let label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(':visible')) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * @param {string|array} element\n */\nfunction apbctExceptedShowHide(element) { // eslint-disable-line no-unused-vars\n let toHide = [\n 'apbct_settings__dwpms_settings',\n 'apbct_settings__advanced_settings',\n 'trusted_and_affiliate__special_span',\n ];\n let index = toHide.indexOf(element);\n if (index !== -1) {\n toHide.splice(index, 1);\n }\n apbctShowHideElem(element);\n toHide.forEach((toHideElem) => {\n if (document.getElementById(toHideElem) && document.getElementById(toHideElem).style.display !== 'none') {\n apbctShowHideElem(toHideElem);\n }\n });\n}\n\n/**\n * @param {mixed} event\n * @param {string} id\n */\nfunction apbctShowRequiredGroups(event, id) { // eslint-disable-line no-unused-vars\n let required = document.getElementById('apbct_settings__dwpms_settings');\n if (required && required.style.display === 'none') {\n let originEvent = event;\n event.preventDefault();\n apbctShowHideElem('apbct_settings__dwpms_settings');\n document.getElementById(id).dispatchEvent(new originEvent.constructor(originEvent.type, originEvent));\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param {string|array} ids\n * @param {int} enable\n */\nfunction apbctSettingsDependencies(ids, enable) { // eslint-disable-line no-unused-vars\n enable = ! isNaN(enable) ? enable : null;\n\n // Get elements\n let elems = apbctGetElemsNative( ids );\n\n elems.forEach(function(elem, i, arr) {\n let doDisable = function() {\n elem.setAttribute('disabled', 'disabled');\n };\n let doEnable = function() {\n elem.removeAttribute('disabled');\n };\n\n // Set defined state\n if (enable === null) {\n enable = elem.getAttribute('disabled') === null ? 0 : 1;\n }\n\n enable === 1 ? doEnable() : doDisable();\n\n if ( elem.getAttribute('apbct_children') !== null) {\n let state = apbctSettingsDependenciesGetState( elem ) && enable;\n if ( state !== null ) {\n apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n }\n }\n });\n}\n\n/**\n * @param {HTMLElement} elem\n * @return {int|null}\n */\nfunction apbctSettingsDependenciesGetState(elem) {\n let state;\n\n switch ( elem.getAttribute( 'type' ) ) {\n case 'checkbox':\n state = +elem.checked;\n break;\n case 'radio':\n state = +(+elem.getAttribute('value') === 1);\n break;\n default:\n state = null;\n }\n\n return state;\n}\n\n/**\n * @param {HTMLElement} label\n * @param {string} settingId\n */\nfunction apbctSettingsShowDescription(label, settingId) {\n let removeDescFunc = function(e) {\n const callerIsPopup = jQuery(e.target).parent('.apbct_long_desc').length != 0;\n const callerIsHideCross = jQuery(e.target).hasClass('apbct_long_desc__cancel');\n const descIsShown = jQuery('.apbct_long_desc__title').length > 0;\n if (descIsShown && !callerIsPopup || callerIsHideCross) {\n jQuery('.apbct_long_desc').remove();\n jQuery(document).off('click', removeDescFunc);\n }\n };\n\n label.after('
');\n let obj = jQuery('#apbct_long_desc__'+settingId);\n obj.append('')\n .append('
')\n .css({\n top: label.position().top - 5,\n left: label.position().left + 25,\n });\n\n\n apbct_admin_sendAJAX(\n {action: 'apbct_settings__get__long_description', setting_id: settingId},\n {\n spinner: obj.children('img'),\n callback: function(result, data, params, obj) {\n obj.empty()\n .append('
')\n .append('')\n .append('

'+result.title+'

')\n .append('

'+result.desc+'

');\n\n jQuery(document).on('click', removeDescFunc);\n },\n },\n obj,\n );\n}\n\n/**\n * save button, navigation menu, navigation button position\n */\nfunction apbctSaveButtonPosition() {\n if (\n document.getElementById('apbct_settings__before_advanced_settings') === null ||\n document.getElementById('apbct_settings__after_advanced_settings') === null ||\n document.getElementById('apbct_settings__button_section') === null ||\n document.getElementById('apbct_settings__advanced_settings') === null ||\n document.getElementById('apbct_hidden_section_nav') === null\n ) {\n return;\n }\n let docInnerHeight = window.innerHeight;\n let advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n let advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n let buttonBlock = document.getElementById('apbct_settings__button_section');\n let buttonHeight = buttonBlock.getBoundingClientRect().height;\n let navBlock = document.getElementById('apbct_hidden_section_nav');\n let navBlockOffset = navBlock.getBoundingClientRect().top;\n let navBlockHeight = navBlock.getBoundingClientRect().height;\n\n // Set Save button position\n if ( getComputedStyle(advSettingsBlock).display !== 'none' ) {\n jQuery('#apbct_settings__main_save_button').hide();\n if ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n buttonBlock.style.bottom = '';\n buttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n } else {\n buttonBlock.style.bottom = 0;\n buttonBlock.style.top = '';\n }\n } else {\n jQuery('#apbct_settings__main_save_button').show();\n }\n\n if (window.innerWidth <= 768 && advSettingsOffset < 0) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'grid';\n document.querySelector('#apbct_hidden_section_nav').style.top = docInnerHeight + 'px';\n } else if (window.innerWidth <= 768) {\n document.querySelector('#apbct_hidden_section_nav').style.display = 'none';\n }\n\n // Set nav position\n if ( advSettingsOffset <= 0 ) {\n navBlock.style.top = - advSettingsOffset + 30 + 'px';\n } else {\n navBlock.style.top = 0;\n }\n}\n\n/**\n * Hightlights element\n *\n * @param {string} id\n * @param {int} times\n */\nfunction apbctHighlightElement(id, times) {\n times = times-1 || 0;\n let keyField = jQuery('#'+id);\n jQuery('html, body').animate({scrollTop: keyField.offset().top - 100}, 'slow');\n keyField.addClass('apbct_highlighted');\n keyField.animate({opacity: 0}, 400, 'linear', function() {\n keyField.animate({opacity: 1}, 400, 'linear', function() {\n if (times>0) {\n apbctHighlightElement(id, times);\n } else {\n keyField.removeClass('apbct_highlighted');\n }\n });\n });\n}\n"],"names":["apbctBannerCheck","let","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbctGetElems","elems","i","len","split","tmp","apbctGetElemsNative","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbctShowHideElem","each","label","next","prev","is","show","apbctExceptedShowHide","element","toHide","index","indexOf","splice","toHideElem","style","display","apbctShowRequiredGroups","event","id","required","originEvent","preventDefault","dispatchEvent","constructor","type","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependenciesGetState","checked","apbctSettingsShowDescription","settingId","removeDescFunc","e","callerIsPopup","target","parent","callerIsHideCross","hasClass","remove","off","after","append","css","top","position","left","setting_id","spinner","children","empty","title","desc","on","apbctSaveButtonPosition","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","bottom","innerWidth","querySelector","apbctHighlightElement","times","keyField","animate","scrollTop","offset","addClass","opacity","removeClass","ready","currentTarget","querySelectorAll","parseInt","value","direction","val","attr","this","fadeOut","timezone","Date","getTimezoneOffset","ct_admin_timezone","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src","adjust"],"mappings":"AAkbA,SAASA,mBACLC,IAAIC,EAAgBC,YAAa,WAC7BC,qBACI,CAACC,OAAQ,oCAAoC,EAC7C,CACIC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACjCH,EAAOI,qBACHC,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAE7CF,OAAO,yBAAyB,EAAEC,QAClCD,OAAO,yBAAyB,EAAEE,KAAK,MAAM,EAEjDC,cAAcb,CAAa,EAEnC,CACJ,CACJ,CACJ,EAAG,GAAM,CACb,CASA,SAASc,cAAcC,GAEnB,IAAMhB,IAAIiB,EAAE,EAAGC,GADfF,EAAQA,EAAMG,MAAM,GAAG,GACIP,OAAQQ,EAAKH,EAAIC,EAAKD,CAAC,GAC9CG,EAAMT,OAAO,IAAIK,EAAMC,EAAE,EACzBD,EAAMC,GAAoB,IAAfG,EAAIR,OAAeD,OAAO,IAAIK,EAAMC,EAAE,EAAIG,EAEzD,OAAOJ,CACX,CASA,SAASK,oBAAoBL,GAEJ,UAAjB,OAAOA,IACPA,EAAQA,EAAMG,MAAM,GAAG,GAG3BnB,IAAIsB,EAAM,GAsBV,OApBAN,EAAMO,QAAQ,SAASC,EAAMP,EAAGQ,GAE5BzB,IAAIoB,EAAMM,SAASC,eAAeH,CAAI,EACtC,GAAY,OAARJ,EACAE,EAAIM,KAAMR,EAAIS,IAAK,OAOvB,GAAY,QADZT,EAAMM,SAASI,uB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7D,MAAMC,QAAU,OACvEpB,SAASgF,cAAc,mCAAmC,EAAE7D,MAAMC,QAAU,OAChF,CAAC,CACL,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-admin.min.js b/js/cleantalk-admin.min.js index a22460ca..06603a6c 100644 --- a/js/cleantalk-admin.min.js +++ b/js/cleantalk-admin.min.js @@ -1,4 +1,4 @@ -function ctFillDecodedEmailHandler(){document.body.classList.add("apbct-popup-fade");var e,t,n,a,o=document.getElementById("apbct_popup");o?(o.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctAdminCommon.plugin_name+" is decoding the email addresses."):((o=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),o.setAttribute("id","apbct_popup"),(e=document.createElement("span")).classList="apbct-email-encoder-elements_center",(t=document.createElement("p")).innerText=ctAdminCommon.plugin_name,t.setAttribute("class","apbct-email-encoder--popup-header"),e.append(t),(t=document.createElement("div")).setAttribute("id","apbct_popup_text"),t.setAttribute("class","apbct-email-encoder-elements_center"),t.style.color="black",(n=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",n.innerText="The magic is on the way, please wait for a few seconds!",n.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",t.append(n),t.append(a),o.append(e),o.append(t),o.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(o)),apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.setAttribute("title",""),e.removeAttribute("style"),ctFillDecodedEmail(e,n)},2e3),e.removeEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmail(e,t){jQuery(e).html(jQuery(e).html().replace(/.+?(
)/,t+"$1"))}function apbct_admin_sendAJAX(t,n,a){let o=n.callback||null,c=n.callback_context||null,i=n.callback_params||null;var e=n.async||!0;let l=n.notJson||null;var r=n.timeout||15e3,a=a||null;let d=n.button||null,s=n.spinner||null,p=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),d&&(d.setAttribute("disabled","disabled"),d.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:
"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(i?o.apply(c,i.concat(e,t,n,a)):o(e,t,n,a))},error:function(e,t,n){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:r})}function ctDecorationSelectorActions(){var e=document.querySelector("#apbct_setting_comments__form_decoration_selector");let t=document.querySelector("#apbct_setting_comments__form_decoration_color"),n=document.querySelector("#apbct_setting_comments__form_decoration_text"),a="Default Theme";t&&n&&e&&(e.value===a&&(t.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")),e.addEventListener("change",function(e){e=e.target.value;e&&0

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3))}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),jQuery("#deactivate-cleantalk-spam-protect").on("click",function(e){e.preventDefault();var t,e=this.getAttribute("href");"undefined"!=typeof cleantalkModal&&"1"===ctAdminCommon.deactivation_banner_is_needed?(t=` +function ctFillDecodedEmailHandler(){document.body.classList.add("apbct-popup-fade");var e,t,n,a,o=document.getElementById("apbct_popup");o?(o.setAttribute("style","display: inherit"),document.getElementById("apbct_popup_text").innerHTML="Please wait while "+ctAdminCommon.plugin_name+" is decoding the email addresses."):((o=document.createElement("div")).setAttribute("class","apbct-popup apbct-email-encoder-popup"),o.setAttribute("id","apbct_popup"),(e=document.createElement("span")).classList="apbct-email-encoder-elements_center",(t=document.createElement("p")).innerText=ctAdminCommon.plugin_name,t.setAttribute("class","apbct-email-encoder--popup-header"),e.append(t),(t=document.createElement("div")).setAttribute("id","apbct_popup_text"),t.setAttribute("class","apbct-email-encoder-elements_center"),t.style.color="black",(n=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_first",n.innerText="The magic is on the way, please wait for a few seconds!",n.setAttribute("class","apbct-email-encoder-elements_center"),(a=document.createElement("p")).id="apbct_email_ecoder__popup_text_node_second",a.innerText="Decoding process to the original data.",t.append(n),t.append(a),o.append(e),o.append(t),o.append(apbctSetEmailDecoderPopupAnimation()),document.body.append(o)),apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode)}function apbctSetEmailDecoderPopupAnimation(){var t=["apbct_dog_one","apbct_dog_two","apbct_dog_three"],n=document.createElement("div");n.classList="apbct-ee-animation-wrapper";for(let e=0;e{e.setAttribute("title",""),e.removeAttribute("style"),ctFillDecodedEmail(e,n)},2e3),e.removeEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmail(e,t){jQuery(e).html(jQuery(e).html().replace(/.+?(
)/,t+"$1"))}function apbct_admin_sendAJAX(t,n,a){let o=n.callback||null,c=n.callback_context||null,i=n.callback_params||null;var e=n.async||!0;let l=n.notJson||null;var r=n.timeout||15e3,a=a||null;let d=n.button||null,s=n.spinner||null,p=n.progressbar||null;"string"==typeof t?t=t+"&_ajax_nonce="+ctAdminCommon._ajax_nonce+"&no_cache="+Math.random():(t._ajax_nonce=ctAdminCommon._ajax_nonce,t.no_cache=Math.random()),d&&(d.setAttribute("disabled","disabled"),d.style.cursor="not-allowed"),s&&jQuery(s).css("display","inline"),jQuery.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:t,async:e,success:function(e){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),(e=l?e:JSON.parse(e)).error?(setTimeout(function(){p&&p.fadeOut("slow")},1e3),"undefined"!=typeof cleantalkModal?(cleantalkModal.loaded="Error:
"+e.error.toString(),cleantalkModal.open()):alert("Error happens: "+(e.error||"Unkown"))):o&&(i?o.apply(c,i.concat(e,t,n,a)):o(e,t,n,a))},error:function(e,t,n){d&&(d.removeAttribute("disabled"),d.style.cursor="pointer"),s&&jQuery(s).css("display","none"),console.log("APBCT_AJAX_ERROR"),console.log(e),console.log(t),console.log(n)},timeout:r})}function ctDecorationSelectorActions(){var e=document.querySelector("#apbct_setting_comments__form_decoration_selector");let t=document.querySelector("#apbct_setting_comments__form_decoration_color"),n=document.querySelector("#apbct_setting_comments__form_decoration_text"),a="Default Theme";t&&n&&e&&(e.value===a&&(t.setAttribute("disabled","disabled"),n.setAttribute("disabled","disabled")),e.addEventListener("change",function(e){e=e.target.value;e&&0

'+ctAdminCommon.apbctNoticeDismissSuccess+"

"),setTimeout(function(){jQuery("#apbct-notice-dismiss-success").fadeOut()},2e3))}),jQuery(".ct_username .row-actions .delete a").on("click",function(e){e.preventDefault(),confirm(ctAdminCommon.notice_when_deleting_user_text)&&(window.location=this.href)});let n=document.querySelector("#apbct_setting_forms__force_protection__On");var e;n&&n.addEventListener("click",function(e){n.checked&&!confirm(ctAdminCommon.apbctNoticeForceProtectionOn)&&e.preventDefault()}),t(".apbct-restore-spam-order-button").click(function(){var e=t(this).data("spam-order-id"),e={action:"apbct_restore_spam_order",_ajax_nonce:ctAdminCommon._ajax_nonce,order_id:e};t.ajax({type:"POST",url:ctAdminCommon._ajax_url,data:e,success:function(e){e.success?window.location.reload():alert(e.data.message)}})}),jQuery("#deactivate-cleantalk-spam-protect").on("click",function(e){e.preventDefault();var t,e=this.getAttribute("href");"undefined"!=typeof cleantalkModal&&"1"===ctAdminCommon.deactivation_banner_is_needed?(t=`
${bannertText=ctAdminCommon.deactivation_banner_text.replace(/(https?:\/\/[^\s]+)/g,'$1')}
diff --git a/js/cleantalk-admin.min.js.map b/js/cleantalk-admin.min.js.map index e6f42f83..6a5bdf8b 100644 --- a/js/cleantalk-admin.min.js.map +++ b/js/cleantalk-admin.min.js.map @@ -1 +1 @@ -{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function($) {\n // Auto update banner close handler\n jQuery('.apbct_update_notice').on('click', 'button', function() {\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\n });\n\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\n .css('display', 'inline-block');\n\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n jQuery(e.target)\n .parent('.notice')\n .after('

' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '

');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Deactivation banner\n jQuery('#deactivate-cleantalk-spam-protect').on('click', function(e) {\n e.preventDefault();\n let deactivationLink = this.getAttribute('href');\n if ( typeof cleantalkModal !== 'undefined' && ctAdminCommon.deactivation_banner_is_needed === '1') {\n // force replace raw link to the href - fix for https://doboard.com/1/task/10192\n bannertText = ctAdminCommon.deactivation_banner_text\n .replace(/(https?:\\/\\/[^\\s]+)/g, '$1');\n const modalHTML = `\n
\n ${bannertText}\n
\n \n `;\n // look ahead ^ deactivationLink in the href was broken after modal handler URL converison\n cleantalkModal.loaded = modalHTML;\n // ignore URL conversions due modal handler\n cleantalkModal.ignoreURLConvert = true;\n cleantalkModal.open();\n } else {\n window.location.href = deactivationLink;\n }\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n ctDecorationSelectorActions();\n});\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler() {\n document.body.classList.add('apbct-popup-fade');\n let encoderPopup = document.getElementById('apbct_popup');\n\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctAdminCommon.plugin_name;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctAdminCommon.plugin_name + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {HTMLElement} encodedEmailNode\n */\nfunction apbctAjaxEmailDecodeBulk(encodedEmailNode) {\n const encodedEmail = encodedEmailNode.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n jQuery(encodedEmailNode).append(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNode);\n },\n 'notJson': true,\n },\n );\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNode\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNode) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n let email = result.data[0].decoded_email;\n\n // change text\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML + '.';\n firstNode.setAttribute('style', 'flex-direction: row;');\n // handle second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n secondNode.innerText = 'Happy conversations!';\n // remove animation\n popup.querySelector('.apbct-ee-animation-wrapper').remove();\n // remove second node\n popup.querySelector('#apbct_email_ecoder__popup_text_node_second').remove();\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNode, result);\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }, 3000);\n } else {\n console.log('result', result);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNode\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNode, decodingResult) {\n let currentResultData = decodingResult.data[0].decoded_email;\n encodedEmailNode.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n encodedEmailNode.setAttribute('title', '');\n encodedEmailNode.removeAttribute('style');\n ctFillDecodedEmail(encodedEmailNode, currentResultData);\n }, 2000);\n encodedEmailNode.removeEventListener('click', ctFillDecodedEmailHandler);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n jQuery(target).html(\n jQuery(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n/**\n* @return {void}\n */\nfunction ctDecorationSelectorActions() {\n const selector = document.querySelector('#apbct_setting_comments__form_decoration_selector');\n const colorPicker = document.querySelector('#apbct_setting_comments__form_decoration_color');\n const headingText = document.querySelector('#apbct_setting_comments__form_decoration_text');\n const defaultThemeExpectedValue = 'Default Theme';\n if (colorPicker && headingText && selector) {\n if (selector.value === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n }\n selector.addEventListener('change', function(event) {\n const selectedValue = event.target.value;\n if (selectedValue && selectedValue.length > 0 && selectedValue === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n } else {\n colorPicker.removeAttribute('disabled');\n headingText.removeAttribute('disabled');\n }\n });\n }\n}\n"],"names":["ctFillDecodedEmailHandler","document","body","classList","add","let","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","setAttribute","innerHTML","ctAdminCommon","plugin_name","waitingPopup","createElement","popupHeader","innerText","append","style","color","id","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","encodedEmailNode","animationElements","animationWrapper","i","length","apbctEEAnimationDogOne","encodedEmail","dataset","originalString","data","encodedEmails","JSON","stringify","0","apbctTooltip","jQuery","apbct_admin_sendAJAX","action","callback","result","apbctEmailEncoderCallbackBulk","notJson","success","is_allowed","setTimeout","firstNode","button","email","decoded_email","popup","querySelector","selectableEmail","title","outerHTML","remove","buttonWrapper","addEventListener","fillDecodedEmails","console","log","decodingResult","currentResultData","removeAttribute","ctFillDecodedEmail","removeEventListener","target","html","replace","params","obj","callbackContext","callback_context","callbackParams","callback_params","async","timeout","spinner","progressbar","_ajax_nonce","Math","random","no_cache","cursor","css","ajax","type","url","_ajax_url","parse","error","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","ctDecorationSelectorActions","selector","colorPicker","headingText","defaultThemeExpectedValue","value","event","selectedValue","ready","$","on","ctDate","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","parent","siblings","click","apbctNoticeName","attr","notice_id","after","apbctNoticeDismissSuccess","preventDefault","confirm","notice_when_deleting_user_text","window","this","href","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","modalHTML","deactivationLink","getAttribute","deactivation_banner_is_needed","bannertText","deactivation_banner_text","ignoreURLConvert","includes"],"mappings":"AA+HA,SAASA,4BACLC,SAASC,KAAKC,UAAUC,IAAI,kBAAkB,EAC9CC,IASQC,EAQAC,EAOAC,EAOAC,EA/BJC,EAAeT,SAASU,eAAe,aAAa,EAEnDD,GAyCDA,EAAaE,aAAa,QAAS,kBAAkB,EACrDX,SAASU,eAAe,kBAAkB,EAAEE,UACxC,qBAAuBC,cAAcC,YAAc,uCAzCnDC,EAAef,SAASgB,cAAc,KAAK,GAClCL,aAAa,QAAS,uCAAuC,EAC1EI,EAAaJ,aAAa,KAAM,aAAa,GAGzCN,EAAqBL,SAASgB,cAAc,MAAM,GACnCd,UAAY,uCAC3Be,EAAcjB,SAASgB,cAAc,GAAG,GAChCE,UAAYL,cAAcC,YACtCG,EAAYN,aAAa,QAAS,mCAAmC,EACrEN,EAAmBc,OAAOF,CAAW,GAGjCX,EAAmBN,SAASgB,cAAc,KAAK,GAClCL,aAAa,KAAM,kBAAkB,EACtDL,EAAiBK,aAAa,QAAS,qCAAqC,EAC5EL,EAAiBc,MAAMC,MAAQ,SAI3Bd,EAAmBP,SAASgB,cAAc,GAAG,GAChCM,GAAK,4CACtBf,EAAiBW,UAAY,0DAC7BX,EAAiBI,aAAa,QAAS,qCAAqC,GAIxEH,EAAoBR,SAASgB,cAAc,GAAG,GAChCM,GAAK,6CACvBd,EAAkBU,UAAY,yCAG9BZ,EAAiBa,OAAOZ,CAAgB,EACxCD,EAAiBa,OAAOX,CAAiB,EACzCO,EAAaI,OAAOd,CAAkB,EACtCU,EAAaI,OAAOb,CAAgB,EACpCS,EAAaI,OAAOI,mCAAmC,CAAC,EACxDvB,SAASC,KAAKkB,OAAOJ,CAAY,GAOrCS,yBAAyBX,cAAcY,gBAAgB,CAC3D,CAIA,SAASF,qCACL,IAAMG,EAAoB,CAA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NI,YAAc1I,cAAc2I,yBACvBhF,QAAQ,uBAAwB,qCAAqC;;;;qDAOjC4E;;cAIzCpD,eAAeC,OAASkD,EAExBnD,eAAeyD,iBAAmB,CAAA,EAClCzD,eAAeG,KAAK,GAEpBsC,OAAOhB,SAASkB,KAAOS,CAE/B,CAAC,EAGGX,OAAOhB,SAASkB,KAAKe,SAAS,oCAAoC,IAC9DjI,EAAmBzB,SAASuD,cAAc,wBAAwB,MAElE1C,cAAcY,iBAAmBA,GAChBL,MAAMmE,OAAS,UAChC9D,EAAiBoC,iBAAiB,QAAS9D,yBAAyB,GAI5E2G,4BAA4B,CAChC,CAAC"} \ No newline at end of file +{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function($) {\n // Auto update banner close handler\n jQuery('.apbct_update_notice').on('click', 'button', function() {\n let ctDate = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n let ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = 'apbct_update_banner_closed=1; path=/; expires=' +\n ctDate.toUTCString() + '; samesite=lax' + ctSecure;\n });\n\n jQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space', 'nowrap')\n .css('display', 'inline-block');\n\n jQuery('body').on('click', '.apbct-notice .notice-dismiss-link', function(e) {\n jQuery(e.target).parent().siblings('.apbct-notice .notice-dismiss').click();\n });\n jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e) {\n let apbctNoticeName = jQuery(e.target).parent().attr('id');\n if ( apbctNoticeName ) {\n apbct_admin_sendAJAX(\n {\n 'action': 'cleantalk_dismiss_notice',\n 'notice_id': apbctNoticeName,\n },\n {\n 'callback': null,\n 'notJson': true,\n },\n );\n jQuery(e.target)\n .parent('.notice')\n .after('

' +\n ctAdminCommon.apbctNoticeDismissSuccess +\n '

');\n setTimeout(function() {\n jQuery('#apbct-notice-dismiss-success').fadeOut();\n }, 2000);\n }\n });\n\n // Notice when deleting user\n jQuery('.ct_username .row-actions .delete a').on('click', function(e) {\n e.preventDefault();\n\n let result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n if (result) {\n window.location = this.href;\n }\n });\n\n let btnForceProtectionOn = document.querySelector('#apbct_setting_forms__force_protection__On');\n if (btnForceProtectionOn) {\n btnForceProtectionOn.addEventListener('click', function(e) {\n if (btnForceProtectionOn.checked) {\n let result = confirm(ctAdminCommon.apbctNoticeForceProtectionOn);\n\n if (!result) {\n e.preventDefault();\n }\n }\n });\n }\n // Restore spam order\n $('.apbct-restore-spam-order-button').click(function() {\n const spmOrderId = $(this).data('spam-order-id');\n let data = {\n action: 'apbct_restore_spam_order',\n _ajax_nonce: ctAdminCommon._ajax_nonce,\n order_id: spmOrderId,\n };\n $.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n success: function(result) {\n if (result.success) {\n window.location.reload();\n } else {\n alert(result.data.message);\n }\n },\n });\n });\n\n // Deactivation banner\n jQuery('#deactivate-cleantalk-spam-protect').on('click', function(e) {\n e.preventDefault();\n let deactivationLink = this.getAttribute('href');\n if ( typeof cleantalkModal !== 'undefined' && ctAdminCommon.deactivation_banner_is_needed === '1') {\n // force replace raw link to the href - fix for https://doboard.com/1/task/10192\n bannertText = ctAdminCommon.deactivation_banner_text\n .replace(/(https?:\\/\\/[^\\s]+)/g, '$1');\n const modalHTML = `\n
\n ${bannertText}\n
\n \n `;\n // look ahead ^ deactivationLink in the href was broken after modal handler URL converison\n cleantalkModal.loaded = modalHTML;\n // ignore URL conversions due modal handler\n cleantalkModal.ignoreURLConvert = true;\n cleantalkModal.open();\n } else {\n window.location.href = deactivationLink;\n }\n });\n\n // Email decoder example\n if (window.location.href.includes('options-general.php?page=cleantalk')) {\n let encodedEmailNode = document.querySelector('[data-original-string]');\n if (encodedEmailNode) {\n ctAdminCommon.encodedEmailNode = encodedEmailNode;\n encodedEmailNode.style.cursor = 'pointer';\n encodedEmailNode.addEventListener('click', ctFillDecodedEmailHandler);\n }\n }\n\n ctDecorationSelectorActions();\n});\n\n/**\n * @param {mixed} event\n */\nfunction ctFillDecodedEmailHandler() {\n document.body.classList.add('apbct-popup-fade');\n let encoderPopup = document.getElementById('apbct_popup');\n\n if (!encoderPopup) {\n // construct popup\n let waitingPopup = document.createElement('div');\n waitingPopup.setAttribute('class', 'apbct-popup apbct-email-encoder-popup');\n waitingPopup.setAttribute('id', 'apbct_popup');\n\n // construct text header\n let popupHeaderWrapper = document.createElement('span');\n popupHeaderWrapper.classList = 'apbct-email-encoder-elements_center';\n let popupHeader = document.createElement('p');\n popupHeader.innerText = ctAdminCommon.plugin_name;\n popupHeader.setAttribute('class', 'apbct-email-encoder--popup-header');\n popupHeaderWrapper.append(popupHeader);\n\n // construct text wrapper\n let popupTextWrapper = document.createElement('div');\n popupTextWrapper.setAttribute('id', 'apbct_popup_text');\n popupTextWrapper.setAttribute('class', 'apbct-email-encoder-elements_center');\n popupTextWrapper.style.color = 'black';\n\n // construct text first node\n // todo make translatable\n let popupTextWaiting = document.createElement('p');\n popupTextWaiting.id = 'apbct_email_ecoder__popup_text_node_first';\n popupTextWaiting.innerText = 'The magic is on the way, please wait for a few seconds!';\n popupTextWaiting.setAttribute('class', 'apbct-email-encoder-elements_center');\n\n // construct text second node\n // todo make translatable\n let popupTextDecoding = document.createElement('p');\n popupTextDecoding.id = 'apbct_email_ecoder__popup_text_node_second';\n popupTextDecoding.innerText = 'Decoding process to the original data.';\n\n // appending\n popupTextWrapper.append(popupTextWaiting);\n popupTextWrapper.append(popupTextDecoding);\n waitingPopup.append(popupHeaderWrapper);\n waitingPopup.append(popupTextWrapper);\n waitingPopup.append(apbctSetEmailDecoderPopupAnimation());\n document.body.append(waitingPopup);\n } else {\n encoderPopup.setAttribute('style', 'display: inherit');\n document.getElementById('apbct_popup_text').innerHTML =\n 'Please wait while ' + ctAdminCommon.plugin_name + ' is decoding the email addresses.';\n }\n\n apbctAjaxEmailDecodeBulk(ctAdminCommon.encodedEmailNode);\n}\n/**\n * @return {HTMLElement} event\n */\nfunction apbctSetEmailDecoderPopupAnimation() {\n const animationElements = ['apbct_dog_one', 'apbct_dog_two', 'apbct_dog_three'];\n const animationWrapper = document.createElement('div');\n animationWrapper.classList = 'apbct-ee-animation-wrapper';\n for (let i = 0; i < animationElements.length; i++) {\n const apbctEEAnimationDogOne = document.createElement('span');\n apbctEEAnimationDogOne.classList = 'apbct_dog ' + animationElements[i];\n apbctEEAnimationDogOne.innerText = '@';\n animationWrapper.append(apbctEEAnimationDogOne);\n }\n return animationWrapper;\n}\n\n/**\n * @param {HTMLElement} encodedEmailNode\n */\nfunction apbctAjaxEmailDecodeBulk(encodedEmailNode) {\n const encodedEmail = encodedEmailNode.dataset.originalString;\n let data = {\n encodedEmails: JSON.stringify({0: encodedEmail}),\n };\n\n // Adding a tooltip\n let apbctTooltip = document.createElement('div');\n apbctTooltip.setAttribute('class', 'apbct-tooltip');\n jQuery(encodedEmailNode).append(apbctTooltip);\n\n apbct_admin_sendAJAX(\n {\n 'action': 'apbct_decode_email',\n 'encodedEmails': data.encodedEmails,\n },\n {\n 'callback': function(result) {\n apbctEmailEncoderCallbackBulk(result, encodedEmailNode);\n },\n 'notJson': true,\n },\n );\n}\n\n/**\n * @param {mixed} result\n * @param {mixed} encodedEmailNode\n */\nfunction apbctEmailEncoderCallbackBulk(result, encodedEmailNode) {\n if (result.success && result.data[0].is_allowed === true) {\n // start process of visual decoding\n setTimeout(function() {\n let email = result.data[0].decoded_email;\n\n // change text\n let popup = document.getElementById('apbct_popup');\n if (popup !== null) {\n // handle first node\n let firstNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_first');\n // get email selectable by click\n let selectableEmail = document.createElement('b');\n selectableEmail.setAttribute('class', 'apbct-email-encoder-select-whole-email');\n selectableEmail.innerText = email;\n selectableEmail.title = 'Click to select the whole data';\n // add email to the first node\n firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML;\n firstNode.setAttribute('style', 'flex-direction: row;');\n // handle second node\n let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second');\n secondNode.innerText = 'Happy conversations!';\n // remove animation\n popup.querySelector('.apbct-ee-animation-wrapper').remove();\n // remove second node\n popup.querySelector('#apbct_email_ecoder__popup_text_node_second').remove();\n // add button\n let buttonWrapper = document.createElement('span');\n buttonWrapper.classList = 'apbct-email-encoder-elements_center top-margin-long';\n let button = document.createElement('button');\n button.innerText = 'Got it';\n button.classList = 'apbct-email-encoder-got-it-button';\n button.addEventListener('click', function() {\n document.body.classList.remove('apbct-popup-fade');\n popup.setAttribute('style', 'display:none');\n fillDecodedEmails(encodedEmailNode, result);\n });\n buttonWrapper.append(button);\n popup.append(buttonWrapper);\n }\n }, 3000);\n } else {\n console.log('result', result);\n }\n}\n\n/**\n * Run filling for every node with decoding result.\n * @param {mixed} encodedEmailNode\n * @param {mixed} decodingResult\n */\nfunction fillDecodedEmails(encodedEmailNode, decodingResult) {\n let currentResultData = decodingResult.data[0].decoded_email;\n encodedEmailNode.classList.add('no-blur');\n // fill the nodes\n setTimeout(() => {\n encodedEmailNode.setAttribute('title', '');\n encodedEmailNode.removeAttribute('style');\n ctFillDecodedEmail(encodedEmailNode, currentResultData);\n }, 2000);\n encodedEmailNode.removeEventListener('click', ctFillDecodedEmailHandler);\n}\n\n/**\n * @param {mixed} target\n * @param {string} email\n */\nfunction ctFillDecodedEmail(target, email) {\n jQuery(target).html(\n jQuery(target)\n .html()\n .replace(/.+?(
)/, email + '$1'),\n );\n}\n\n// eslint-disable-next-line camelcase,require-jsdoc,no-unused-vars\nfunction apbct_admin_sendAJAX(data, params, obj) {\n // Default params\n let callback = params.callback || null;\n let callbackContext = params.callback_context || null;\n let callbackParams = params.callback_params || null;\n let async = params.async || true;\n let notJson = params.notJson || null;\n let timeout = params.timeout || 15000;\n var obj = obj || null; // eslint-disable-line no-var\n let button = params.button || null;\n let spinner = params.spinner || null;\n let progressbar = params.progressbar || null;\n\n if (typeof (data) === 'string') {\n data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n } else {\n data._ajax_nonce = ctAdminCommon._ajax_nonce;\n data.no_cache = Math.random();\n }\n // Button and spinner\n if (button) {\n button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed';\n }\n if (spinner) jQuery(spinner).css('display', 'inline');\n\n jQuery.ajax({\n type: 'POST',\n url: ctAdminCommon._ajax_url,\n data: data,\n async: async,\n success: function(result) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n if (!notJson) result = JSON.parse(result);\n if (result.error) {\n setTimeout(function() {\n if (progressbar) progressbar.fadeOut('slow');\n }, 1000);\n if ( typeof cleantalkModal !== 'undefined' ) {\n // Show the result by modal\n cleantalkModal.loaded = 'Error:
' + result.error.toString();\n cleantalkModal.open();\n } else {\n alert('Error happens: ' + (result.error || 'Unkown'));\n }\n } else {\n if (callback) {\n if (callbackParams) {\n callback.apply( callbackContext, callbackParams.concat( result, data, params, obj ) );\n } else {\n callback(result, data, params, obj);\n }\n }\n }\n },\n error: function(jqXHR, textStatus, errorThrown) {\n if (button) {\n button.removeAttribute('disabled'); button.style.cursor = 'pointer';\n }\n if (spinner) jQuery(spinner).css('display', 'none');\n console.log('APBCT_AJAX_ERROR');\n console.log(jqXHR);\n console.log(textStatus);\n console.log(errorThrown);\n },\n timeout: timeout,\n });\n}\n/**\n* @return {void}\n */\nfunction ctDecorationSelectorActions() {\n const selector = document.querySelector('#apbct_setting_comments__form_decoration_selector');\n const colorPicker = document.querySelector('#apbct_setting_comments__form_decoration_color');\n const headingText = document.querySelector('#apbct_setting_comments__form_decoration_text');\n const defaultThemeExpectedValue = 'Default Theme';\n if (colorPicker && headingText && selector) {\n if (selector.value === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n }\n selector.addEventListener('change', function(event) {\n const selectedValue = event.target.value;\n if (selectedValue && selectedValue.length > 0 && selectedValue === defaultThemeExpectedValue) {\n colorPicker.setAttribute('disabled', 'disabled');\n headingText.setAttribute('disabled', 'disabled');\n } else {\n colorPicker.removeAttribute('disabled');\n headingText.removeAttribute('disabled');\n }\n });\n }\n}\n"],"names":["ctFillDecodedEmailHandler","document","body","classList","add","let","popupHeaderWrapper","popupTextWrapper","popupTextWaiting","popupTextDecoding","encoderPopup","getElementById","setAttribute","innerHTML","ctAdminCommon","plugin_name","waitingPopup","createElement","popupHeader","innerText","append","style","color","id","apbctSetEmailDecoderPopupAnimation","apbctAjaxEmailDecodeBulk","encodedEmailNode","animationElements","animationWrapper","i","length","apbctEEAnimationDogOne","encodedEmail","dataset","originalString","data","encodedEmails","JSON","stringify","0","apbctTooltip","jQuery","apbct_admin_sendAJAX","action","callback","result","apbctEmailEncoderCallbackBulk","notJson","success","is_allowed","setTimeout","firstNode","button","email","decoded_email","popup","querySelector","selectableEmail","title","outerHTML","remove","buttonWrapper","addEventListener","fillDecodedEmails","console","log","decodingResult","currentResultData","removeAttribute","ctFillDecodedEmail","removeEventListener","target","html","replace","params","obj","callbackContext","callback_context","callbackParams","callback_params","async","timeout","spinner","progressbar","_ajax_nonce","Math","random","no_cache","cursor","css","ajax","type","url","_ajax_url","parse","error","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","ctDecorationSelectorActions","selector","colorPicker","headingText","defaultThemeExpectedValue","value","event","selectedValue","ready","$","on","ctDate","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","parent","siblings","click","apbctNoticeName","attr","notice_id","after","apbctNoticeDismissSuccess","preventDefault","confirm","notice_when_deleting_user_text","window","this","href","btnForceProtectionOn","checked","apbctNoticeForceProtectionOn","spmOrderId","order_id","reload","message","modalHTML","deactivationLink","getAttribute","deactivation_banner_is_needed","bannertText","deactivation_banner_text","ignoreURLConvert","includes"],"mappings":"AA+HA,SAASA,4BACLC,SAASC,KAAKC,UAAUC,IAAI,kBAAkB,EAC9CC,IASQC,EAQAC,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AAS,oCAAoC,IAC9DjI,EAAmBzB,SAASuD,cAAc,wBAAwB,MAElE1C,cAAcY,iBAAmBA,GAChBL,MAAMmE,OAAS,UAChC9D,EAAiBoC,iBAAiB,QAAS9D,yBAAyB,GAI5E2G,4BAA4B,CAChC,CAAC"} \ No newline at end of file diff --git a/js/cleantalk-dashboard-widget.min.js b/js/cleantalk-dashboard-widget.min.js index 09a5e06b..bc663742 100644 --- a/js/cleantalk-dashboard-widget.min.js +++ b/js/cleantalk-dashboard-widget.min.js @@ -1,2 +1,2 @@ -jQuery(document).ready(function(){jQuery(".ct_widget_refresh_link").on("click",function(){jQuery(".ct_preloader").show(),setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),setTimeout(function(){jQuery("#ct_refresh_form").submit()},2500)}),"#ct_widget"==location.hash&&setTimeout(function(){window.scrollTo(0,jQuery("#ct_widget_wrapper").offset().top-130)},1),jQuery("#ct_widget_wrapper").parent().css("padding",0),locale=navigator.language||navigator.userLanguage;var o=new Intl.DateTimeFormat(locale,{month:"short",day:"numeric"});var e=document.getElementById("ct_widget_chart"),t=(t=>{var a={labels:[],counts:[]};for(let e=0;e 0; + if (descIsShown && !callerIsPopup || callerIsHideCross) { jQuery('.apbct_long_desc').remove(); jQuery(document).off('click', removeDescFunc); } }; - removeDescFunc(); - label.after('
'); let obj = jQuery('#apbct_long_desc__'+settingId); obj.append('') diff --git a/js/src/cleantalk-admin.js b/js/src/cleantalk-admin.js index 5a010c20..026148a4 100644 --- a/js/src/cleantalk-admin.js +++ b/js/src/cleantalk-admin.js @@ -242,7 +242,7 @@ function apbctEmailEncoderCallbackBulk(result, encodedEmailNode) { selectableEmail.innerText = email; selectableEmail.title = 'Click to select the whole data'; // add email to the first node - firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML + '.'; + firstNode.innerHTML = 'The original one is ' + selectableEmail.outerHTML; firstNode.setAttribute('style', 'flex-direction: row;'); // handle second node let secondNode = popup.querySelector('#apbct_email_ecoder__popup_text_node_second'); diff --git a/lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php b/lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php index 75bbd721..dd7a589b 100644 --- a/lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php +++ b/lib/Cleantalk/ApbctWP/Antispam/EmailEncoder.php @@ -125,7 +125,7 @@ public static function getEncoderOptionDescription($example_email = '') return sprintf( $template, $common_description, - empty($example_encoded) ? ' ' : '' . $example_encoded . '' + empty($example_encoded) ? ' ' : '' . $example_encoded . '' ); }