mirror of
https://github.com/bigchaindb/site.git
synced 2025-02-10 16:09:00 +01:00
add transaction link, disable post button by default
This commit is contained in:
parent
a8f9f6c913
commit
ebe0336437
@ -24,13 +24,11 @@ window.addEventListener('DOMContentLoaded', function domload(event){
|
||||
const messageInput = document.getElementById('message')
|
||||
|
||||
// quick form validation
|
||||
postButton.classList.add('disabled')
|
||||
|
||||
messageInput.addEventListener('input', function() {
|
||||
if (messageInput.value === '') {
|
||||
postButton.classList.add('disabled')
|
||||
postButton.setAttribute('disabled', '')
|
||||
} else {
|
||||
postButton.classList.remove('disabled')
|
||||
postButton.removeAttribute('disabled')
|
||||
}
|
||||
})
|
||||
|
||||
@ -60,6 +58,7 @@ window.addEventListener('DOMContentLoaded', function domload(event){
|
||||
const output = document.getElementsByClassName('output')[0]
|
||||
const messageSuccess = document.getElementsByClassName('message--success')[0]
|
||||
const messageFail = document.getElementsByClassName('message--fail')[0]
|
||||
const transactionLink = document.getElementsByClassName('transaction-link')[0]
|
||||
|
||||
conn.postTransaction(txSigned)
|
||||
.then((response) => {
|
||||
@ -72,6 +71,8 @@ window.addEventListener('DOMContentLoaded', function domload(event){
|
||||
const outputContent = JSON.stringify(response, null, 4) // indented with 4 spaces
|
||||
output.textContent = outputContent
|
||||
|
||||
transactionLink.href = 'https://test.ipdb.io/api/v1/transactions/' + response.id
|
||||
|
||||
}, reason => { // Error!
|
||||
console.log(reason)
|
||||
|
||||
|
@ -29,7 +29,7 @@ redirect_from:
|
||||
<p class="form-group message">
|
||||
A transaction can contain a digital asset along with a message. Type something to be sent along the asset.
|
||||
</p>
|
||||
<a class="btn btn-primary" id="post" href="#">Off you go</a>
|
||||
<button class="btn btn-primary" id="post" disabled>Off you go</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="grid__col">
|
||||
@ -53,7 +53,12 @@ redirect_from:
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p class="message message--success hide">Nicely done! You have just created an asset, sent it along in a signed transaction and retrieved the result of that transaction. Phew.</p>
|
||||
<div class="message message--success hide">
|
||||
<p>
|
||||
Nicely done! You have just created an asset, sent it along in a signed transaction and retrieved the result of that transaction. Phew.
|
||||
</p>
|
||||
<p><a class="transaction-link" href="https://test.ipdb.io/api/v1/transactions/">Check out your transaction on IPDB</a></p>
|
||||
</div>
|
||||
<p class="message message--fail hide">Shenanigans! Something's off. Would you mind trying again?</p>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user