@ -566,9 +566,11 @@
< div class = "ml-2 flex" >
{% if w.cid == '1' %}
{# PART #}
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}', '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 25%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}', '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 50%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 100%< / button >
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}', {{ w.cid }}, '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 25%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}', {{ w.cid }}, '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 50%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', {{ w.cid }}, '{{ w.blind_balance }}', '{{ w.anon_balance }}')" > 100%< / button >
< script >
function setAmount(percent, balance, blindBalance, anonBalance) {
function setAmount(percent, balance, cid , blindBalance, anonBalance) {
var amountInput = document.getElementById('amount');
var typeSelect = document.getElementById('withdraw_type');
var selectedType = typeSelect.value;
@ -578,31 +580,34 @@
switch(selectedType) {
case 'plain':
floatBalance = parseFloat(balance);
calculatedAmount = floatBalance * percent;
break;
case 'blind':
floatBalance = parseFloat(blindBalance);
calculatedAmount = floatBalance * percent;
break;
case 'anon':
floatBalance = parseFloat(anonBalance);
calculatedAmount = floatBalance * percent;
break;
default:
floatBalance = parseFloat(balance);
calculatedAmount = floatBalance * percent;
break;
}
calculatedAmount = floatBalance * percent;
amountInput.value = calculatedAmount.toFixed(8);
var subfeeCheckbox = document.querySelector(`[name="subfee_${cid}"]`);
if (subfeeCheckbox) {
subfeeCheckbox.checked = (percent === 1);
}
}
< / script >
{# / PART #}
{% elif w.cid == '3' %}
{# LTC #}
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}', '{{ w.mweb_balance }}', 'mweb')" > 25%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}', '{{ w.mweb_balance }}', 'mweb')" > 50%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', '{{ w.mweb_balance }}', 'mweb')" > 100%< / button >
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}', {{ w.cid }}, '{{ w.mweb_balance }}')" > 25%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}', {{ w.cid }}, '{{ w.mweb_balance }}')" > 50%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', {{ w.cid }}, '{{ w.mweb_balance }}')" > 100%< / button >
< script >
function setAmount(percent, balance, mwebBalance, selectedType) {
function setAmount(percent, balance, cid, mwebBalance) {
var amountInput = document.getElementById('amount');
var typeSelect = document.getElementById('withdraw_type');
var selectedType = typeSelect.value;
@ -612,36 +617,37 @@
switch(selectedType) {
case 'plain':
floatBalance = parseFloat(balance);
calculatedAmount = floatBalance * percent;
break;
case 'mweb':
floatBalance = parseFloat(mwebBalance);
calculatedAmount = floatBalance * percent;
break;
default:
floatBalance = parseFloat(balance);
calculatedAmount = floatBalance * percent;
break;
}
calculatedAmount = floatBalance * percent;
amountInput.value = calculatedAmount.toFixed(8);
var subfeeCheckbox = document.querySelector(`[name="subfee_${cid}"]`);
if (subfeeCheckbox) {
subfeeCheckbox.checked = (percent === 1);
}
}
< / script >
{# / LTC #}
{% else %}
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}')" > 25%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}')" > 50%< / button > < button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', '{{ w.cid }}')" > 100%< / button >
< button type = "button" class = "py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.25, '{{ w.balance }}', {{ w.cid }})" > 25%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(0.5, '{{ w.balance }}', {{ w.cid }})" > 50%< / button >
< button type = "button" class = "ml-2 py-1 px-2 bg-blue-500 text-white text-sm rounded-md focus:outline-none" onclick = "setAmount(1, '{{ w.balance }}', {{ w.cid }})" > 100%< / button >
< script >
function setAmount(percent, balance, cid) {
var amountInput = document.getElementById('amount');
var floatBalance;
var calculatedAmount;
var floatBalance = parseFloat(balance) ;
var calculatedAmount = floatBalance * percent ;
floatBalance = parseFloat(balance);
calculatedAmount = floatBalance * percent;
var specialCids = [6, 9];
const specialCids = [6, 9];
if (specialCids.includes(cid) & & percent === 1) {
if (specialCids.includes(parseInt(cid)) & & percent === 1) {
amountInput.setAttribute('data-hidden', 'true');
amountInput.placeholder = 'Sweep All';
amountInput.value = '';
@ -657,14 +663,19 @@
amountInput.disabled = false;
}
var sweepAllCheckbox = document.getElementById('sweepall');
let sweepAllCheckbox = document.getElementById('sweepall');
if (sweepAllCheckbox) {
if (specialCids.includes(cid) & & percent === 1) {
if (specialCids.includes(parseInt( cid) ) & & percent === 1) {
sweepAllCheckbox.checked = true;
} else {
sweepAllCheckbox.checked = false;
}
}
let subfeeCheckbox = document.querySelector(`[name="subfee_${cid}"]`);
if (subfeeCheckbox) {
subfeeCheckbox.checked = (percent === 1);
}
}
< / script >
{% endif %}
@ -672,10 +683,16 @@
< / td >
< / tr >
< tr class = "opacity-100 text-gray-500 dark:text-gray-100" >
{% if w.cid in '6, 9' %} {# XMR | WOW #}
{% if w.cid in [6, 9] %} {# XMR | WOW #}
< td class = "py-3 px-6 bold" > Sweep All:< / td >
< td class = "py-3 px-6" > < input class = "hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type = "checkbox" id = "sweepall" name = "sweepall_{{ w.cid }}" { % if w . wd_sweepall = =true % } checked = checked{% endif % } > < / td > {% else %} < td class = "py-3 px-6 bold" > Subtract Fee:< / td >
< td class = "py-3 px-6" > < input class = "hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type = "checkbox" name = "subfee_{{ w.cid }}" { % if w . wd_subfee = =true % } checked = checked{% endif % } > < / td >
< td class = "py-3 px-6" >
< input class = "hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type = "checkbox" id = "sweepall" name = "sweepall_{{ w.cid }}" { % if w . wd_sweepall = =true % } checked = checked{% endif % } >
< / td >
{% else %}
< td class = "py-3 px-6 bold" > Subtract Fee:< / td >
< td class = "py-3 px-6" >
< input class = "hover:border-blue-500 w-5 h-5 form-check-input text-blue-600 bg-gray-50 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-1 dark:bg-gray-500 dark:border-gray-400" type = "checkbox" name = "subfee_{{ w.cid }}" { % if w . wd_subfee = =true % } checked = checked{% endif % } >
< / td >
{% endif %}
< td >
< / td >