btcpayserver/BTCPayServer/wwwroot/js/wallet/wallet-camera-scanner.js

16 lines
631 B
JavaScript
Raw Normal View History

window.addEventListener("load", () => {
let $input = null;
initCameraScanningApp("Scan address or payment link", data => {
if (data.includes('?') || $input == null) {
document.getElementById("BIP21").value = data;
document.getElementById("SendForm").submit();
} else {
$input.value = data;
}
}, "scanModal");
document.getElementById('scanModal').addEventListener('show.bs.modal', e => {
const { index } = e.relatedTarget.dataset;
$input = index ? document.querySelector(`[name="Outputs[${index}].DestinationAddress"]`) : null;
});
2020-03-26 11:59:28 +01:00
});