diff --git a/debian/changelog b/debian/changelog index 196bc3ac..87edd34d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (22.48.4) stable; urgency=low +hedera-web (22.48.5) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/checkout/index.js b/forms/ecomerce/checkout/index.js index df10cd88..85f0ea0e 100644 --- a/forms/ecomerce/checkout/index.js +++ b/forms/ecomerce/checkout/index.js @@ -150,13 +150,9 @@ export default new Class({ this.$.assistant.moveNext(); }, - goNextStep() { - this.$.assistant.moveNext(); - }, - onAddressClick(addressId) { this.$.lot.set('address', addressId); - this.goNextStep(); + this.$.assistant.moveNext(); }, onAddressChange() { diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js index 6ee274bd..dc759476 100644 --- a/js/hedera/tpv.js +++ b/js/hedera/tpv.js @@ -24,22 +24,18 @@ module.exports = new Class({ } ,async _realPay(amount, company) { - if (!isNumeric(amount) || amount <= 0) - throw new UserError(_('AmountError')); - - let json; - - try { - json = await this.conn.send('tpv/transaction', { - amount: parseInt(amount) - ,urlOk: this._makeUrl('ok') - ,urlKo: this._makeUrl('ko') - ,company: company - }); - } catch(err) { - throw new UserError(_('PayError')); + if (!isNumeric(amount) || amount <= 0) { + Htk.Toast.showError(_('AmountError')); + return; } + const json = await this.conn.send('tpv/transaction', { + amount: parseInt(amount) + ,urlOk: this._makeUrl('ok') + ,urlKo: this._makeUrl('ko') + ,company + }); + const postValues = json.postValues; const form = document.createElement('form'); diff --git a/js/htk/field/index.js b/js/htk/field/index.js index d8b7102d..7ac73698 100644 --- a/js/htk/field/index.js +++ b/js/htk/field/index.js @@ -10,15 +10,7 @@ module.exports = new Class({ value: { type: String ,set(x) { - if (Vn.Value.compare(x, this._value)) - return; - - if (x instanceof Date) - x = x.clone(); - - this.valueChanged(x); - this.putValue(x); - this._notifyChanges(); + this._setValue(x); } ,get() { return this._value; @@ -109,11 +101,11 @@ module.exports = new Class({ ,_lockField: false ,_setValue(newValue) { - if (!this._putValue(newValue)) - return; - + if (!this._putValue(newValue)) return; + newValue = this._value; + if (!this._lockField) - this.putValue(newValue); + this.putValue(this._value); if (this.conditionalFunc) this.conditionalFunc(this, newValue); diff --git a/js/htk/radio/index.js b/js/htk/radio/index.js index 270a1f3f..06d87a4d 100644 --- a/js/htk/radio/index.js +++ b/js/htk/radio/index.js @@ -54,7 +54,7 @@ module.exports = new Class({ ,render() { var radio = Vn.Browser.createRadio('', this.doc); radio.checked = false; - radio.addEventListener('change', this._onChange.bind(this)); + radio.addEventListener('change', () => this._onChange()); this._node = radio; } diff --git a/js/htk/radio/radio-group.js b/js/htk/radio/radio-group.js index ebeaaba2..942a93ba 100644 --- a/js/htk/radio/radio-group.js +++ b/js/htk/radio/radio-group.js @@ -4,8 +4,6 @@ var htkRadioGroupUid = 0; module.exports = new Class({ Extends: Htk.Field ,Tag: 'htk-radio-group' - - ,radioLock: false ,initialize(props) { this.clear(); diff --git a/js/vn/value.js b/js/vn/value.js index dc7584ed..413037e7 100644 --- a/js/vn/value.js +++ b/js/vn/value.js @@ -140,52 +140,33 @@ function sprintf(formatString) { }); } -module.exports = { - regexpNumber: /%\.([0-9]+)d/g - ,regexpString: /%s/g +function format(value, format) { + if (value === null || value === undefined) + return ''; - ,equals - ,diff - ,partialDiff - ,kvClone - ,simpleClone - ,simpleEquals - ,sprintf - - ,compare(a, b) { - if (a === b) - return true; - if (a instanceof Date && b instanceof Date) - return a.getTime() === b.getTime(); - - return false; + if (format) + switch (typeof value) { + case 'number': + return format.replace(/%\.([0-9]+)d/g, + (_, digits) => new Number(value).toFixed(parseInt(digits))); + case 'string': + return format.replace(/%s/g, + () => value); + case 'object': + if (value instanceof Date) + return VnDate.strftime(value, format); } - - ,format(value, format) { - if (value === null || value === undefined) - return ''; - if (format) - switch (typeof value) { - case 'number': - return format.replace(this.regexpNumber, - this.replaceNumber.bind(null, value)); - case 'string': - return format.replace(this.regexpString, - this.replaceString.bind(null, value)); - case 'object': - if (value instanceof Date) - return VnDate.strftime(value, format); - } - - return value; - } + return value; +} - ,replaceNumber(value, token, digits) { - return new Number(value).toFixed(parseInt(digits)); - } - - ,replaceString(value) { - return value; - } +module.exports = { + equals, + diff, + partialDiff, + kvClone, + simpleClone, + simpleEquals, + sprintf, + format, }; diff --git a/package.json b/package.json index dc6d4f20..11df0f03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "22.48.4", + "version": "22.48.5", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": {