This commit is contained in:
sairaj mote 2024-01-19 01:28:12 +05:30
parent db517b13bb
commit e14d1e0045
4 changed files with 37 additions and 5 deletions

View File

@ -921,8 +921,20 @@
window.addEventListener('hashchange', e => showPage(window.location.hash)) window.addEventListener('hashchange', e => showPage(window.location.hash))
window.addEventListener("load", () => { window.addEventListener("load", () => {
document.body.classList.remove('hide') document.body.classList.remove('hide')
document.querySelectorAll('sm-input[data-flo-id]').forEach(input => input.customValidation = floCrypto.validateAddr) document.querySelectorAll('sm-input[data-flo-id]').forEach(input => input.customValidation = (value) => {
document.querySelectorAll('sm-input[data-private-key]').forEach(input => input.customValidation = floCrypto.getPubKeyHex) if (!value) return { isValid: false, errorText: 'Please enter a FLO address' }
return {
isValid: floCrypto.validateFloID(value),
errorText: `Invalid FLO address.<br> It usually starts with "F"`
}
})
document.querySelectorAll('sm-input[data-private-key]').forEach(input => input.customValidation = (value) => {
if (!value) return { isValid: false, errorText: 'Please enter a private key' }
return {
isValid: floCrypto.getPubKeyHex(value),
errorText: `Invalid private key.<br> It's a long string of random characters usually starting with 'R'.`
}
})
document.addEventListener('keyup', (e) => { document.addEventListener('keyup', (e) => {
if (e.key === 'Escape') { if (e.key === 'Escape') {
closePopup() closePopup()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
scripts/floBlockchainAPI.min.js vendored Normal file

File diff suppressed because one or more lines are too long