import './style.scss'; export default new Class({ Extends: Hedera.Form, Template: require('./ui.xml') ,activate() { var self = this; this.$.contactForm.onsubmit = function() { self._onSubmit(); return false; }; this.refreshCaptcha(); } ,refreshCaptcha() { params = { srv: 'rest:misc/captcha', stamp: new Date().getTime() }; this.$.captchaImg.src = '?'+ Vn.Url.makeUri(params); } ,_onSubmit() { this.conn.sendForm(this.$.contactForm, this._onResponse.bind(this)); } ,_onResponse(json) { var form = this.$.contactForm; if (json) { form.reset(); Htk.Toast.showMessage(_('DataSentSuccess')); } else Htk.Toast.showError(_('ErrorSendingData')); form['captcha'].value = ''; this.refreshCaptcha(); } });