diff --git a/src/resources/js/utils.js b/src/resources/js/utils.js index 17312f73..9ca700c0 100644 --- a/src/resources/js/utils.js +++ b/src/resources/js/utils.js @@ -1,134 +1,187 @@ /** * Clear (bootstrap) form validation state */ const clearFormValidation = (form) => { $(form).find('.is-invalid').removeClass('is-invalid') $(form).find('.invalid-feedback').remove() } /** * File downloader */ const downloadFile = (url, filename) => { // TODO: This might not be a best way for big files as the content // will be stored (temporarily) in browser memory // TODO: This method does not show the download progress in the browser // but it could be implemented in the UI, axios has 'progress' property axios.get(url, { responseType: 'blob' }) .then(response => { const link = document.createElement('a') if (!filename) { const contentDisposition = response.headers['content-disposition'] filename = 'unknown' if (contentDisposition) { const match = contentDisposition.match(/filename="?(.+)"?/); if (match && match.length === 2) { filename = match[1]; } } } link.href = window.URL.createObjectURL(response.data) link.download = filename link.click() }) } /** * Create an object copy with specified properties only */ const pick = (obj, properties) => { let result = {} properties.forEach(prop => { if (prop in obj) { result[prop] = obj[prop] } }) return result } const loader = '
{{ $t('signup.step1') }}
{{ $t('signup.step2') }}
{{ $t('signup.step3', { app: $root.appName }) }}
{{ checkout.content }}
{{ checkout.content }}
{{ wallet.notice }}
{{ $t('wallet.payment-method', { method: mandate.method }) }}
{{ $t('wallet.receipts-hint') }}
{{ $t('wallet.receipts-none') }}
{{ $t('wallet.currency-conv', { wc: wallet.currency, pc: selectedPaymentMethod.currency }) }}
{{ $t('wallet.coinbase-hint', { wc: wallet.currency }) }}
{{ $t('wallet.banktransfer-hint') }}
{{ $t('wallet.payment-amount-hint') }}