芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/media/system/js/fields/joomla-field-send-test-mail-es5.min.js
!function(){"use strict";function e(t){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(t)}function t(e,r){return(t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,r)}function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function o(e,n,u){return(o=r()?Reflect.construct:function(e,r,o){var n=[null];n.push.apply(n,r);var u=new(Function.bind.apply(e,n));return o&&t(u,o.prototype),u}).apply(null,arguments)}function n(r){var u="function"==typeof Map?new Map:void 0;return(n=function(r){if(null===r||(n=r,-1===Function.toString.call(n).indexOf("[native code]")))return r;var n;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==u){if(u.has(r))return u.get(r);u.set(r,s)}function s(){return o(r,arguments,e(this).constructor)}return s.prototype=Object.create(r.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),t(s,r)})(r)}!function(e,r){var o=function(e){var o,n;function u(){var t;if(t=e.call(this)||this,!r)throw new Error("Joomla API is not properly initiated");if(!t.getAttribute("uri"))throw new Error("No valid url for validation");return t}n=e,(o=u).prototype=Object.create(n.prototype),o.prototype.constructor=o,t(o,n);var s=u.prototype;return s.connectedCallback=function(){var e=this,t=document.getElementById("sendtestmail");t&&t.addEventListener("click",(function(){e.sendTestMail(e)}))},s.sendTestMail=function(){var e={smtpauth:document.getElementById("jform_smtpauth1").checked?1:0,smtpuser:this.querySelector('[name="jform[smtpuser]"]').value,smtphost:this.querySelector('[name="jform[smtphost]"]').value,smtpsecure:this.querySelector('[name="jform[smtpsecure]"]').value,smtpport:this.querySelector('[name="jform[smtpport]"]').value,mailfrom:this.querySelector('[name="jform[mailfrom]"]').value,fromname:this.querySelector('[name="jform[fromname]"]').value,mailer:this.querySelector('[name="jform[mailer]"]').value,mailonline:document.getElementById("jform_mailonline1").checked?1:0},t=this.querySelector('[name="jform[smtppass]"]');!1===t.disabled&&(e.smtppass=t.value),r.removeMessages(),r.request({url:this.getAttribute("uri"),method:"POST",data:JSON.stringify(e),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:function(e){var t;try{t=JSON.parse(e)}catch(e){console.error(e)}"object"==typeof t.messages&&null!==t.messages&&r.renderMessages(t.messages),document.body.scrollIntoView({behavior:"smooth"})},onError:function(e){r.renderMessages(r.ajaxErrorsMessages(e)),document.body.scrollIntoView({behavior:"smooth"})}})},u}(n(HTMLElement));e.define("joomla-field-send-test-mail",o)}(customElements,Joomla)}();