OpenTally/html/index.html

350 lines
12 KiB
HTML

<!--
* OpenTally: Open-source election vote counting
* Copyright © 2021–2022 Lee Yingtong Li (RunasSudo)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>OpenTally</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css" integrity="sha512-NhSC1YmyruXifcj/KFRWoC561YpHpc5Jtzgvbuzx5VozKpWvQ+4nXhPdFgmx8xqexRcpAglTj9sIBWINXa8x5w==" crossorigin="anonymous" />
<link rel="stylesheet" type="text/css" href="main.css?v=GITVERSION">
</head>
<body class="interactive">
<div id="divLoading">
Loading&hellip;
</div>
<div id="divUI" style="display: none;">
<div class="menudiv">
<input type="file" id="bltFile">
<button onclick="clickCount()">Count</button>
<label>
Preset:
<select id="selPreset" onchange="changePreset()">
<optgroup label="Recommended">
<option value="wigm" selected>OpenTally WIGM</option>
<option value="scottish">Scottish STV</option>
<option value="meek87">OpenTally Meek</option>
</optgroup>
<optgroup label="Legislative">
<option value="senate">Australian Senate STV</option>
<option value="act">Australian Capital Territory STV</option>
<option value="nswlg">NSW Local Government STV</option>
<option value="wa">Western Australia STV</option>
<option value="meeknz">Meek STV (New Zealand)</option>
<option value="minneapolis">Minneapolis STV</option>
<option value="cambridge">Cambridge STV</option>
<option value="dail">Dáil Éireann STV</option>
</optgroup>
<optgroup label="Hand-count">
<option value="prsa77">PRSA 1977</option>
<option value="ers97">ERS97</option>
<option value="ers76">ERS76</option>
<option value="ers73">ERS73</option>
<option value="cofe">Church of England</option>
</optgroup>
<optgroup label="Computer-count">
<option value="meek06">Meek STV (2006)</option>
<option value="vdc">van der Craats (‘Wright’) STV</option>
</optgroup>
</select>
</label>
<button id="btnAdvancedOptions" onclick="clickAdvancedOptions()">Show advanced options</button>
OpenTally (revision <span id="spanRevNum"></span>)
&middot; <a href="https://yingtongli.me/opentally/">Information and instructions</a>
</div>
<div id="divAdvancedOptions" class="menudiv cols-12 cols-sm-6" style="display: none;">
<div class="col-6" style="align-self: start;">
<div class="subheading">
Method specification:
</div>
<div>
<label>
Quota:
<select id="selQuotaCriterion">
<option value="geq">&geq;</option>
<option value="gt" selected>&gt;</option>
</select>
</label>
<label>
<select id="selQuota">
<option value="droop" selected>Droop</option>
<option value="droop_exact">Droop (exact)</option>
<option value="hare">Hare</option>
<option value="hare_exact">Hare (exact)</option>
</select>
</label>
<label>
<select id="selQuotaMode">
<option value="static" selected>Static quota</option>
<!--<option value="progressive">Progressive quota</option>-->
<option value="ers97">Static with ERS97 rules</option>
<option value="ers76">Static with ERS76 rules</option>
<option value="dynamic_by_total">Dynamic by total vote</option>
<option value="dynamic_by_active">Dynamic by active vote</option>
</select>
</label>
</div>
<div>
<label>
Surplus order:
<select id="selSurplus">
<option value="by_size" selected>By size</option>
<option value="by_order">By order</option>
</select>
</label>
<label>
Method:
<select id="selMethod">
<option value="wig" selected>Weighted inclusive Gregory</option>
<option value="uig">Unweighted inclusive Gregory</option>
<option value="eg">Exclusive Gregory (last bundle)</option>
<option value="meek">Meek method</option>
<option value="hare">Hare (exclusive sample)</option>
<option value="ihare">Inclusive Hare (sample)</option>
</select>
</label>
<label>
<select id="selPapers">
<option value="both" selected>Include non-transferable ballots</option>
<option value="transferable">Use transferable ballots only</option>
<option value="subtract_nontransferable">Subtract non-transferables</option>
</select>
</label>
</div>
<div>
<label style="margin-right:1em;">
<span class="pill-grey" title="This option has effect only if “Method” is set to a Gregory method">Gregory</span>
Exclusion:
<select id="selExclusion">
<option value="single_stage" selected>Single stage</option>
<option value="by_value">By value</option>
<option value="by_source">By source</option>
<option value="parcels_by_order">By parcel (by order)</option>
<option value="reset_and_reiterate">Reset and re-iterate</option>
</select>
</label>
<label>
<input type="checkbox" id="chkMeekNZExclusion">
<span class="pill-grey" title="This option has effect only if “Method” is set to “Meek method”">Meek</span>
NZ-style exclusion
</label>
</div>
<div>
<label style="margin-right:1em;">
<span class="pill-grey" title="This option has effect only if “Method” is set to a Hare method">Hare</span>
Sample method:
<select id="selSample">
<option value="stratify" selected>Stratify</option>
<!--<option value="stratify_floor" selected>Stratify (floor)</option>-->
<option value="by_order">By order</option>
<option value="cincinnati">Cincinnati</option>
</select>
</label>
<label>
<input type="checkbox" id="chkSamplePerBallot">
Per-ballot transfers
</label>
</div>
<div class="subheading">
Tie-breaking:
</div>
<div>
<label>
Ties:
<select id="selTies">
<option value="backwards,random" selected>Backwards then random</option>
<option value="forwards,random">Forwards then random</option>
<option value="random">Random</option>
<option value="prompt">Prompt</option>
</select>
</label>
<label>
Random seed:
<input type="text" id="txtSeed" value="">
</label>
</div>
<div class="subheading">
Constraints:
</div>
<div>
<label>
<input type="file" id="conFile">
</label>
<label>
Method:
<select id="selConstraintMethod">
<option value="guard_doom" selected>Guard/doom</option>
<option value="repeat_count">Repeat count</option>
</select>
</label>
</div>
<div class="subheading">
Report options:
</div>
<div class="col-12">
<label style="margin-right:1em;">
Report style:
<select id="selReport">
<option value="votes">Votes only</option>
<option value="votes_transposed" selected>Votes (transposed)</option>
<option value="ballots_votes">Ballots and votes</option>
</select>
</label>
</div>
<label class="col-12">
Display up to
<input type="number" id="txtPPDP" value="2" min="0" style="width: 3em;">
d.p.
</label>
</div>
<div class="col-6 cols-12" style="align-self: start;">
<div class="col-12 subheading">
Numeric representation:
</div>
<div class="col-12">
<label style="margin-right:1em;">
Numbers:
<select id="selNumbers">
<option value="rational" selected>Rational</option>
<option value="fixed">Fixed</option>
<option value="gfixed">Fixed (guarded)</option>
<option value="float64">Float (64-bit)</option>
</select>
</label>
<label>
<span class="pill-grey" title="This option has effect only if “Numbers” is set to “Fixed” or “Fixed (guarded)”">Fixed</span>
Decimal places:
<input type="number" id="txtDP" value="5" min="0" style="width: 3em;">
</label>
</div>
<div class="col-12 subheading">
Count optimisations:
</div>
<label class="col-6">
<input type="checkbox" id="chkBulkElection" checked>
Early bulk election
</label>
<label class="col-6">
<input type="checkbox" id="chkBulkExclusion">
Bulk exclusion
</label>
<label class="col-6">
<input type="checkbox" id="chkDeferSurpluses">
Defer surpluses
</label>
<label class="col-6">
<input type="checkbox" id="chkImmediateElect" checked>
Immediate election
</label>
<label class="col-12">
Minimum threshold:
<input type="number" id="txtMinThreshold" value="0" min="0" style="width: 3em;">
</label>
<div class="col-12 subheading">
Rounding:
</div>
<div class="col-6">
<label>
<input type="checkbox" id="chkRoundQuota">
Quota:
</label>
<label>
<input type="number" id="txtRoundQuota" value="0" min="0" style="width: 3em;">
d.p.
</label>
</div>
<div class="col-6">
<label>
<input type="checkbox" id="chkRoundVotes">
Votes:
</label>
<label>
<input type="number" id="txtRoundVotes" value="0" min="0" style="width: 3em;">
d.p.
</label>
</div>
<div class="col-6">
<label>
<input type="checkbox" id="chkRoundSFs">
Surplus fractions:
</label>
<label>
<input type="number" id="txtRoundSFs" value="0" min="0" style="width: 3em;">
d.p.
</label>
</div>
<div class="col-6">
<label>
<input type="checkbox" id="chkRoundValues">
Ballot values:
</label>
<label>
<input type="number" id="txtRoundValues" value="0" min="0" style="width: 3em;">
d.p.
</label>
</div>
<label class="col-12">
<span class="pill-grey" title="This option has effect only if “Method” is a Gregory method">Gregory</span>
Round subtransfers:
<select id="selSumTransfers">
<option value="single_step" selected>Single step</option>
<option value="by_value">By value</option>
<option value="by_value_and_source">By value and source</option>
<option value="by_parcel">By parcel</option>
<option value="per_ballot">Per ballot</option>
</select>
</label>
<label class="col-12">
<span class="pill-grey" title="This option has effect only if “Method” is set to “Meek method”">Meek</span>
Surplus tolerance:
<input type="text" id="txtMeekSurplusTolerance" value="0.001%" style="width: 5em;">
</label>
</div>
</div>
<div id="resultsDiv">
<div id="resultLogs1" style="white-space: pre-wrap;"></div>
<table id="result" class="result"></table>
<div id="resultLogs2"></div>
</div>
<div id="printPane" style="display: none;">
<button onclick="printResult()">Print result</button>
<label>
Paper size:
<select id="selPaperSize">
<option value="A4" selected>A4</option>
<option value="A3">A3</option>
<option value="letter">US Letter</option>
</select>
(Landscape)
</label>
</div>
</div>
<div id="printWarning">Printing directly from this page is not supported. Use the ‘Print result’ button to generate a printer-friendly report.</div>
<script src="vendor/vanilla-js-dropdown.min.js"></script>
<script src="index.js?v=GITVERSION"></script>
<script src="presets.js?v=GITVERSION"></script>
</body>
</html>