Add presets dropdown
This commit is contained in:
parent
baec51bd35
commit
c6d8ba16dd
|
@ -32,17 +32,17 @@
|
|||
<div class="menudiv">
|
||||
<input type="file" id="bltFile">
|
||||
<button onclick="clickCount()">Count</button>
|
||||
<!--<label>
|
||||
<label>
|
||||
Preset:
|
||||
<select id="selPreset" onchange="changePreset()">
|
||||
<option value="scottish" selected>Scottish STV</option>
|
||||
<option value="senate">Australian Senate STV</option>
|
||||
<option value="meek">Meek STV</option>
|
||||
<option value="wright">Wright STV</option>
|
||||
<!--<option value="meek">Meek STV</option>
|
||||
<option value="wright">Wright STV</option>-->
|
||||
<option value="prsa77">PRSA 1977</option>
|
||||
<option value="ers97">ERS97</option>
|
||||
<!--<option value="ers97">ERS97</option>-->
|
||||
</select>
|
||||
</label>-->
|
||||
</label>
|
||||
<button id="btnAdvancedOptions" onclick="clickAdvancedOptions()">Show advanced options</button>
|
||||
OpenTally (revision <span id="spanRevNum"></span>)
|
||||
<!--· <a href="https://yingtongli.me/blog/2020/12/24/pyrcv2.html">Information and instructions</a> ·
|
||||
|
@ -106,9 +106,9 @@
|
|||
<label>
|
||||
Exclusion:
|
||||
<select id="selExclusion">
|
||||
<option value="single_stage" selected>Exclude in single stage</option>
|
||||
<option value="by_value">Exclude by value</option>
|
||||
<option value="parcels_by_order">Exclude by parcel (by order)</option>
|
||||
<option value="single_stage" selected>Single stage</option>
|
||||
<option value="by_value">By value</option>
|
||||
<option value="parcels_by_order">By parcel (by order)</option>
|
||||
<!--<option value="wright">Wright method (re-iterate)</option>-->
|
||||
</select>
|
||||
</label>
|
||||
|
|
|
@ -113,3 +113,73 @@ async function clickCount() {
|
|||
'decimals': document.getElementById('txtDP').value,
|
||||
});
|
||||
}
|
||||
|
||||
// Presets
|
||||
|
||||
function changePreset() {
|
||||
if (document.getElementById('selPreset').value === 'scottish') {
|
||||
document.getElementById('selQuotaCriterion').value = 'geq';
|
||||
document.getElementById('selQuota').value = 'droop';
|
||||
//document.getElementById('selQuotaMode').value = 'static';
|
||||
//document.getElementById('chkBulkElection').checked = true;
|
||||
//document.getElementById('chkBulkExclusion').checked = false;
|
||||
//document.getElementById('chkDeferSurpluses').checked = false;
|
||||
document.getElementById('selNumbers').value = 'fixed';
|
||||
document.getElementById('txtDP').value = '5';
|
||||
document.getElementById('txtPPDP').value = '2';
|
||||
document.getElementById('chkRoundQuota').checked = true;
|
||||
document.getElementById('txtRoundQuota').value = '0';
|
||||
document.getElementById('chkRoundVotes').checked = false;
|
||||
document.getElementById('chkRoundTVs').checked = false;
|
||||
document.getElementById('chkRoundWeights').checked = false;
|
||||
document.getElementById('selSurplus').value = 'by_size';
|
||||
document.getElementById('selTransfers').value = 'wig';
|
||||
document.getElementById('selPapers').value = 'both';
|
||||
document.getElementById('selExclusion').value = 'single_stage';
|
||||
//document.getElementById('selTies').value = 'backwards_random';
|
||||
} else if (document.getElementById('selPreset').value === 'senate') {
|
||||
document.getElementById('selQuotaCriterion').value = 'geq';
|
||||
document.getElementById('selQuota').value = 'droop';
|
||||
//document.getElementById('selQuotaMode').value = 'static';
|
||||
//document.getElementById('chkBulkElection').checked = true;
|
||||
//document.getElementById('chkBulkExclusion').checked = true;
|
||||
//document.getElementById('chkDeferSurpluses').checked = false;
|
||||
document.getElementById('selNumbers').value = 'fixed';
|
||||
document.getElementById('txtDP').value = '5';
|
||||
document.getElementById('txtPPDP').value = '0';
|
||||
document.getElementById('chkRoundQuota').checked = true;
|
||||
document.getElementById('txtRoundQuota').value = '0';
|
||||
document.getElementById('chkRoundVotes').checked = true;
|
||||
document.getElementById('txtRoundVotes').value = '0';
|
||||
document.getElementById('chkRoundTVs').checked = false;
|
||||
document.getElementById('chkRoundWeights').checked = false;
|
||||
document.getElementById('selSurplus').value = 'by_order';
|
||||
document.getElementById('selTransfers').value = 'uig';
|
||||
document.getElementById('selPapers').value = 'both';
|
||||
document.getElementById('selExclusion').value = 'by_value';
|
||||
//document.getElementById('selTies').value = 'backwards_random';
|
||||
} else if (document.getElementById('selPreset').value === 'prsa77') {
|
||||
document.getElementById('selQuotaCriterion').value = 'geq';
|
||||
document.getElementById('selQuota').value = 'droop';
|
||||
//document.getElementById('selQuotaMode').value = 'static';
|
||||
//document.getElementById('chkBulkElection').checked = true;
|
||||
//document.getElementById('chkBulkExclusion').checked = false;
|
||||
//document.getElementById('chkDeferSurpluses').checked = true;
|
||||
document.getElementById('selNumbers').value = 'fixed';
|
||||
document.getElementById('txtDP').value = '5';
|
||||
document.getElementById('txtPPDP').value = '3';
|
||||
document.getElementById('chkRoundQuota').checked = true;
|
||||
document.getElementById('txtRoundQuota').value = '3';
|
||||
document.getElementById('chkRoundVotes').checked = true;
|
||||
document.getElementById('txtRoundVotes').value = '3';
|
||||
document.getElementById('chkRoundTVs').checked = true;
|
||||
document.getElementById('txtRoundTVs').value = '3';
|
||||
document.getElementById('chkRoundWeights').checked = true;
|
||||
document.getElementById('txtRoundWeights').value = '3';
|
||||
document.getElementById('selSurplus').value = 'by_order';
|
||||
document.getElementById('selTransfers').value = 'eg';
|
||||
document.getElementById('selPapers').value = 'transferable';
|
||||
document.getElementById('selExclusion').value = 'parcels_by_order';
|
||||
//document.getElementById('selTies').value = 'backwards_random';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue