mirror of
https://github.com/seigler/govobject-proposal
synced 2025-07-27 06:46:10 +00:00
Merge pull request #15 from hunterlester/development
further debugging @ https://dashpay.atlassian.net/browse/EV-126
This commit is contained in:
commit
ab35b556d1
5 changed files with 90 additions and 58 deletions
|
@ -36,7 +36,6 @@ i.fa {
|
||||||
}
|
}
|
||||||
|
|
||||||
.proposalBlock {
|
.proposalBlock {
|
||||||
/*margin-top: 6%;*/
|
|
||||||
padding: 7%;
|
padding: 7%;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
box-shadow: 0px 17px 24px 0px rgba(0, 0, 0, 0.16);
|
box-shadow: 0px 17px 24px 0px rgba(0, 0, 0, 0.16);
|
||||||
|
|
127
index.html
127
index.html
|
@ -53,6 +53,11 @@
|
||||||
console.log("socket.io initialized...");
|
console.log("socket.io initialized...");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on('disconnect', function() {
|
||||||
|
console.log('connection lost');
|
||||||
|
alert('We sorry; connection lost.');
|
||||||
|
});
|
||||||
|
|
||||||
return gov;
|
return gov;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -97,6 +102,7 @@
|
||||||
document.getElementById('step_two').click();
|
document.getElementById('step_two').click();
|
||||||
document.getElementsByClassName('progress-bar')[0].style.width = "50%";
|
document.getElementsByClassName('progress-bar')[0].style.width = "50%";
|
||||||
document.getElementsByClassName('progress-bar')[0].innerText = "Generated wallet commands";
|
document.getElementsByClassName('progress-bar')[0].innerText = "Generated wallet commands";
|
||||||
|
$('#network_toggle').addClass('hidden');
|
||||||
|
|
||||||
proposal.walletCommands();
|
proposal.walletCommands();
|
||||||
|
|
||||||
|
@ -108,6 +114,7 @@
|
||||||
|
|
||||||
$('#btnNew').click(function() {
|
$('#btnNew').click(function() {
|
||||||
proposal.resetProposal();
|
proposal.resetProposal();
|
||||||
|
$('#network_toggle').removeClass('hidden');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -121,9 +128,19 @@
|
||||||
|
|
||||||
// check if tx exists in insight
|
// check if tx exists in insight
|
||||||
txListener.getTx(function(err, res) {
|
txListener.getTx(function(err, res) {
|
||||||
if(err) console.log(err);
|
if(err) {
|
||||||
|
console.log("Error:", err);
|
||||||
|
if(err == 404) {
|
||||||
|
$('#feeTxid').addClass('validationError');
|
||||||
|
$('#feeTxid').val('Transaction ID not found');
|
||||||
|
} else if (err == 400) {
|
||||||
|
$('#feeTxid').addClass('validationError');
|
||||||
|
$('#feeTxid').val('Please paste a valid transaction ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if(res) {
|
if(res) {
|
||||||
console.log(res);
|
console.log("Response:", res);
|
||||||
|
|
||||||
// transaction exists, proceed to step three
|
// transaction exists, proceed to step three
|
||||||
document.getElementById('step_three').click();
|
document.getElementById('step_three').click();
|
||||||
|
@ -163,7 +180,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
|
|
||||||
<div class="btn-group" data-toggle="buttons">
|
<div id="network_toggle" class="btn-group" data-toggle="buttons">
|
||||||
<label class="btn btn-primary">
|
<label class="btn btn-primary">
|
||||||
<input type="radio" name="options" id="mainnet" autocomplete="off"> Mainnet
|
<input type="radio" name="options" id="mainnet" autocomplete="off"> Mainnet
|
||||||
</label>
|
</label>
|
||||||
|
@ -327,71 +344,75 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="step2" class="tab-pane fade">
|
<div id="step2" class="tab-pane fade">
|
||||||
<div class="row walletCommands hidden" id="walletCommandsHeader">
|
<div class="proposalBlock">
|
||||||
<div class="col-xs-12">
|
<div class="row walletCommands hidden" id="walletCommandsHeader">
|
||||||
<h2>Wallet Commands</h2>
|
<div class="col-xs-12">
|
||||||
</div>
|
<h2>Wallet Commands</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row walletCommands hidden" id="walletCommandsPrepare">
|
||||||
|
|
||||||
|
<div class="col-xs-12">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="prepareProposal">Prepare-Proposal Command:</label>
|
||||||
|
<div>Paste this proposal command into your Dash wallet console to spend a Fee transaction of 0.33 DASH.</div>
|
||||||
|
<textarea readonly class="form-control" id="prepareProposal" rows="4" placeholder=""></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row walletCommands hidden" id="walletCommandsTx">
|
||||||
|
|
||||||
|
<div class="col-xs-12">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="feeTxid">Fee Transaction ID:</label>
|
||||||
|
<div>Paste the transaction ID returned by the wallet below to generate the final submit command.</div>
|
||||||
|
<input type="text" class="form-control" id="feeTxid" value="" placeholder="<fee-txid>">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row walletCommands hidden" id="walletCommandsPrepare">
|
|
||||||
|
|
||||||
<div class="col-xs-12">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="prepareProposal">Prepare-Proposal Command:</label>
|
|
||||||
<div>Paste this proposal command into your Dash wallet console to spend a Fee transaction of 0.33 DASH.</div>
|
|
||||||
<textarea readonly class="form-control" id="prepareProposal" rows="4" placeholder=""></textarea>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row walletCommands hidden" id="walletCommandsTx">
|
|
||||||
|
|
||||||
<div class="col-xs-12">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="feeTxid">Fee Transaction ID:</label>
|
|
||||||
<div>Paste the transaction ID returned by the wallet below to generate the final submit command.</div>
|
|
||||||
<input type="text" class="form-control" id="feeTxid" value="" placeholder="<fee-txid>">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="step3" class="tab-pane fade">
|
<div id="step3" class="tab-pane fade">
|
||||||
|
<div class="proposalBlock">
|
||||||
|
<div class="row walletCommands hidden" id="walletCommandsProgress">
|
||||||
|
|
||||||
<div class="row walletCommands hidden" id="walletCommandsProgress">
|
<div class="col-xs-12">
|
||||||
|
|
||||||
<div class="col-xs-12">
|
<div class="form-group">
|
||||||
|
<label for="feeTxid">Fee Transaction Progress:</label>
|
||||||
|
<div id="progresstxt">We'll wait for 6 confirmations. Waiting for new blocks to confirm...</div>
|
||||||
|
<div id="progressbar"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
</div>
|
||||||
<label for="feeTxid">Fee Transaction Progress:</label>
|
|
||||||
<div id="progresstxt">We'll wait for 6 confirmations. Waiting for new blocks to confirm...</div>
|
|
||||||
<div id="progressbar"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="step4" class="tab-pane fade">
|
<div id="step4" class="tab-pane fade">
|
||||||
<div class="row walletCommands hidden" id="walletCommandsSubmit">
|
<div class="proposalBlock">
|
||||||
|
<div class="row walletCommands hidden" id="walletCommandsSubmit">
|
||||||
|
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="submitProposal">Submit Proposal Command:</label>
|
<label for="submitProposal">Submit Proposal Command:</label>
|
||||||
<div>Paste the Fee TX id to generate the proposal submit command. This is the final step and can be completed after 6 confirmations on the fee tx.</div>
|
<div>Paste the Fee TX id to generate the proposal submit command. This is the final step and can be completed after 6 confirmations on the fee tx.</div>
|
||||||
<textarea readonly class="form-control" id="submitProposal" rows="4" placeholder=""></textarea>
|
<textarea readonly class="form-control" id="submitProposal" rows="4" placeholder=""></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,7 +9,9 @@ function setFormEditable(edit) {
|
||||||
if (edit === true) {
|
if (edit === true) {
|
||||||
$('#btnPrepare').addClass('hidden');
|
$('#btnPrepare').addClass('hidden');
|
||||||
$('#btnEdit').removeClass('hidden');
|
$('#btnEdit').removeClass('hidden');
|
||||||
|
$('#btnEdit').removeAttr('disabled');
|
||||||
$('#btnNew').removeClass('hidden');
|
$('#btnNew').removeClass('hidden');
|
||||||
|
$('#btnNew').removeAttr('disabled');
|
||||||
} else {
|
} else {
|
||||||
$('#btnPrepare').removeClass('hidden');
|
$('#btnPrepare').removeClass('hidden');
|
||||||
$('#btnEdit').addClass('hidden');
|
$('#btnEdit').addClass('hidden');
|
||||||
|
@ -20,4 +22,4 @@ function setFormEditable(edit) {
|
||||||
var copyToClipboard = function(id) {
|
var copyToClipboard = function(id) {
|
||||||
document.getElementById(id).select();
|
document.getElementById(id).select();
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
};
|
};
|
||||||
|
|
|
@ -115,5 +115,15 @@ ProposalGenerator.prototype.resetProposal = function() {
|
||||||
$('.createProposal input').each(function() {
|
$('.createProposal input').each(function() {
|
||||||
$(this).val('');
|
$(this).val('');
|
||||||
});
|
});
|
||||||
setFormEditable(true);
|
$("#btnEdit").val('Edit Proposal');
|
||||||
|
$("#btnNew").val('New Proposal');
|
||||||
|
$("#btnPrepare").val('Create Proposal');
|
||||||
|
setFormEditable(false);
|
||||||
|
$('.walletCommands#walletCommandsHeader').addClass('hidden');
|
||||||
|
$('.walletCommands#walletCommandsPrepare').addClass('hidden');
|
||||||
|
$('.walletCommands#walletCommandsTx').addClass('hidden');
|
||||||
|
$('.walletCommands#walletCommandsProgress').addClass('hidden');
|
||||||
|
$('.walletCommands#walletCommandsSubmit').addClass('hidden');
|
||||||
|
|
||||||
|
this._mode = 'proposal';
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,7 +45,6 @@ TXListener.prototype.getTx = function(cb) {
|
||||||
format: "json"
|
format: "json"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
console.log(opts);
|
|
||||||
|
|
||||||
this._fetch(opts, cb);
|
this._fetch(opts, cb);
|
||||||
};
|
};
|
||||||
|
@ -80,7 +79,8 @@ TXListener.prototype._fetch = function(opts,cb) {
|
||||||
cb(null, data);
|
cb(null, data);
|
||||||
},
|
},
|
||||||
error: function (jqXHR, status, error) {
|
error: function (jqXHR, status, error) {
|
||||||
var err = eval("(" + jqXHR.responseText + ")");
|
var err = jqXHR.status;
|
||||||
|
//var err = eval("(" + jqXHR.responseText + ")");
|
||||||
cb(err, null);
|
cb(err, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue