CoreFiles by mySites.guru
joomla-field-send-test-mail-es5.min.js1 lines, 4,550 bytes, from Joomla_4.0.0-beta4-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta3
md5
431c63d66b7e313739fc06ed2e50ca3e
sha1
ea5ff68b3bdb83ff4b8aba9b409e10d221c23263
sha256
bcf92ab0ed18a662bd59f389a730075a103e25fe2c04638189e71b29a0b9e97f
"use strict";function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}function _inherits(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),b&&_setPrototypeOf(a,b)}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _possibleConstructorReturn(a,b){return b&&("object"===_typeof(b)||"function"==typeof b)?b:_assertThisInitialized(a)}function _assertThisInitialized(a){if(void 0===a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function _wrapNativeSuper(a){var b="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(a){function c(){return _construct(a,arguments,_getPrototypeOf(this).constructor)}if(null===a||!_isNativeFunction(a))return a;if("function"!=typeof a)throw new TypeError("Super expression must either be null or a function");if("undefined"!=typeof b){if(b.has(a))return b.get(a);b.set(a,c)}return c.prototype=Object.create(a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(c,a)},_wrapNativeSuper(a)}function _construct(){return _construct=_isNativeReflectConstruct()?Reflect.construct:function(b,c,d){var e=[null];e.push.apply(e,c);var a=Function.bind.apply(b,e),f=new a;return d&&_setPrototypeOf(f,d.prototype),f},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(a){return!1}}function _isNativeFunction(a){return-1!==Function.toString.call(a).indexOf("[native code]")}function _setPrototypeOf(a,b){return _setPrototypeOf=Object.setPrototypeOf||function(a,b){return a.__proto__=b,a},_setPrototypeOf(a,b)}function _getPrototypeOf(a){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},_getPrototypeOf(a)}(function(a,b){var c=function(a){function c(){var a;if(_classCallCheck(this,c),a=d.call(this),!b)throw new Error("Joomla API is not properly initiated");if(!a.getAttribute("uri"))throw new Error("No valid url for validation");return a}_inherits(c,a);var d=_createSuper(c);return _createClass(c,[{key:"connectedCallback",value:function connectedCallback(){var a=this,b=document.getElementById("sendtestmail");b&&b.addEventListener("click",function(){a.sendTestMail(a)})}},{key:"sendTestMail",value:function sendTestMail(){var a={smtpauth:document.getElementById("jform_smtpauth1").checked?1:0,smtpuser:this.querySelector("[name=\"jform[smtpuser]\"]").value,smtppass:this.querySelector("[name=\"jform[smtppass]\"]").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};b.removeMessages(),b.request({url:this.getAttribute("uri"),method:"POST",data:JSON.stringify(a),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:function onSuccess(a){a=JSON.parse(a),"object"===_typeof(a.messages)&&null!==a.messages&&b.renderMessages(a.messages)},onError:function onError(a){b.renderMessages(b.ajaxErrorsMessages(a))}})}}]),c}(_wrapNativeSuper(HTMLElement));a.define("joomla-field-send-test-mail",c)})(customElements,Joomla);

The same content is in 4 releases, Joomla 4.0.0-beta to 4.0.0-beta4. See them all, or every version of this file.