ui: Add withdrawal confirm popup.

This commit is contained in:
tecnovert 2021-11-01 17:33:51 +02:00
parent f9f26c92c2
commit 965db389f6
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
5 changed files with 16 additions and 13 deletions

View file

@ -58,7 +58,7 @@
<input name="accept_bid" type="submit" value="Accept Bid"><br/>
{% endif %}
{% if data.can_abandon == true %}
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick="confirmPopup()">
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick="return confirmPopup();">
{% endif %}
{% if data.show_txns %}
<input name="hide_txns" type="submit" value="Hide Info">
@ -90,7 +90,7 @@
<p><a href="/">home</a></p>
<script>
function confirmPopup() {
confirm("Are you sure?");
return confirm("Are you sure?");
}
</script>
</body></html>

View file

@ -45,10 +45,10 @@
<input name="edit_bid_submit" type="submit" value="Submit">
{% else %}
{% if data.was_received == 'True' %}
<input name="accept_bid" type="submit" value="Accept Bid" onclick='confirmPopup("Accept")'><br/>
<input name="accept_bid" type="submit" value="Accept Bid" onclick='return confirmPopup("Accept");'><br/>
{% endif %}
{% if data.can_abandon == true %}
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick='confirmPopup("Abandon")'>
<input name="abandon_bid" type="submit" value="Abandon Bid" onclick='return confirmPopup("Abandon");'>
{% endif %}
{% if data.show_txns %}
<input name="hide_txns" type="submit" value="Hide Info">
@ -116,7 +116,7 @@
<p><a href="/">home</a></p>
<script>
function confirmPopup(name) {
confirm(name + " Bid - Are you sure?");
return confirm(name + " Bid - Are you sure?");
}
</script>
</body></html>

View file

@ -65,7 +65,7 @@
{% else %}
<input type="submit" name="newbid" value="New Bid">
{% if data.sent == 'True' and data.was_revoked != true %}
<input name="revoke_offer" type="submit" value="Revoke Offer" onclick="confirmPopup()">
<input name="revoke_offer" type="submit" value="Revoke Offer" onclick="return confirmPopup();">
{% endif %}
{% endif %}
<input type="hidden" name="formid" value="{{ form_id }}">
@ -83,7 +83,7 @@
<script>
function confirmPopup() {
confirm("Are you sure?");
return confirm("Are you sure?");
}
</script>
</body></html>

View file

@ -38,10 +38,10 @@
{% endif %}
<tr><td><input type="submit" name="apply_{{ c.name }}" value="Apply">
{% if c.can_disable == true %}
<input type="submit" name="disable_{{ c.name }}" value="Disable" onclick="confirmPopup('Disable', '{{ c.name|capitalize }}')">
<input type="submit" name="disable_{{ c.name }}" value="Disable" onclick="return confirmPopup('Disable', '{{ c.name|capitalize }}');">
{% endif %}
{% if c.can_reenable == true %}
<input type="submit" name="enable_{{ c.name }}" value="Enable" onclick="confirmPopup('Enable', '{{ c.name|capitalize }}')">
<input type="submit" name="enable_{{ c.name }}" value="Enable" onclick="return confirmPopup('Enable', '{{ c.name|capitalize }}');">
{% endif %}
</td></tr>
</table>
@ -54,7 +54,7 @@
<p><a href="/">home</a></p>
<script>
function confirmPopup(action, coin_name) {
confirm(action + " " + coin_name + "?\nWill shutdown basicswap.");
return confirm(action + " " + coin_name + "?\nWill shutdown basicswap.");
}
</script>
</body></html>

View file

@ -35,12 +35,12 @@
<tr><td>Blocks:</td><td>{{ w.blocks }}</td></tr>
<tr><td>Synced:</td><td>{{ w.synced }}</td></tr>
<tr><td>Expected Seed:</td><td>{{ w.expected_seed }}</td>{% if w.expected_seed != true %}<td><input type="submit" name="reseed_{{ w.cid }}" value="Reseed wallet" onclick="confirmReseed()"></td>{% endif %}</tr>
<tr><td>Expected Seed:</td><td>{{ w.expected_seed }}</td>{% if w.expected_seed != true %}<td><input type="submit" name="reseed_{{ w.cid }}" value="Reseed wallet" onclick="return confirmReseed();"></td>{% endif %}</tr>
{% if w.cid == '1' %}
<tr><td>Stealth Address</td><td colspan=2>{{ w.stealth_address }}</td></tr>
{% endif %}
<tr><td><input type="submit" name="newaddr_{{ w.cid }}" value="Deposit Address"></td><td colspan=2>{{ w.deposit_address }}</td></tr>
<tr><td><input type="submit" name="withdraw_{{ w.cid }}" value="Withdraw"></td><td>Amount: <input type="text" name="amt_{{ w.cid }}" value="{{ w.wd_value }}"></td><td>Address: <input type="text" name="to_{{ w.cid }}" value="{{ w.wd_address }}"></td><td>Subtract fee: <input type="checkbox" name="subfee_{{ w.cid }}" {% if w.wd_subfee==true %} checked="true"{% endif %}></td></tr>
<tr><td><input type="submit" name="withdraw_{{ w.cid }}" value="Withdraw" onclick="return confirmWithdrawal();"></td><td>Amount: <input type="text" name="amt_{{ w.cid }}" value="{{ w.wd_value }}"></td><td>Address: <input type="text" name="to_{{ w.cid }}" value="{{ w.wd_address }}"></td><td>Subtract fee: <input type="checkbox" name="subfee_{{ w.cid }}" {% if w.wd_subfee==true %} checked="true"{% endif %}></td></tr>
{% if w.cid == '1' %}
<tr><td>Type From, To</td><td>
<select name="withdraw_type_from_{{ w.cid }}">
@ -67,7 +67,10 @@
<script>
function confirmReseed() {
confirm("Are you sure?\nBackup your wallet before and after.\nWon't detect used keys.\nShould only be used for new wallets.");
return confirm("Are you sure?\nBackup your wallet before and after.\nWon't detect used keys.\nShould only be used for new wallets.");
}
function confirmWithdrawal() {
return confirm("Are you sure?");
}
</script>
</body></html>