// // Vex modals // /* global vex, fetch, ClipboardJS, QRious */ /* exported krlcModals */ /* eslint-disable spaced-comment */ //=require vex-js/dist/js/vex.combined.js //=require clipboard/dist/clipboard.js //=require qrious/dist/qrious.js /* eslint-enable spaced-comment */ const krlcModals = (() => { // eslint-disable-line no-unused-vars const _config = { btcVexTriggers: document.querySelectorAll('.js-vex-btc') } let btcAddress let ethAddress const _private = { getBtcAddress() { const url = '/api/site.json' fetch(url) .then(res => res.json()) .then(data_ => { btcAddress = data_[0].author.bitcoin ethAddress = data_[0].author.ether }) .catch(err => console.error(err)) return {btcAddress, ethAddress} }, vexBtc() { _config.btcVexTriggers.forEach(el => { el.addEventListener('click', e => { e.preventDefault() vex.defaultOptions.className = 'vex-theme-kremalicious vex-bitcoin' vex.dialog.buttons.YES.text = 'Close' vex.open({unsafeContent: `
${btcAddress}
${ethAddress}