Widget:PriceCalculator: Difference between revisions
Jump to navigation
Jump to search
(truncate numbers, add tablestyle) |
(Visual changes.) |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<table id="bg3wiki-price-calculator-form"> | <div id="bg3wiki-price-calculator"> | ||
<table id="bg3wiki-price-calculator-form"> | |||
<tr> | |||
<th><label for="item-value">Item value</label></th><td><input type="number" id="item-value" size="7" value="1000"/></td> | |||
</tr> | |||
<tr> | |||
<th><label for="persuasion-mod">Persuasion modifier</label></th><td><input type="number" id="persuasion-mod" size="3" value="0"/></td> | |||
</tr> | |||
<tr> | |||
<th><label for="attitude">Attitude</label></th><td><input type="number" id="attitude" size="4"/></td> | |||
</tr> | |||
<tr> | |||
<th><label for="difficulty">Difficulty</label></th><td> | |||
<input type="radio" name="difficulty" id="difficulty-explorer" value="explorer" required/><label for="difficulty-explorer">Explorer</label> | |||
<input type="radio" name="difficulty" id="difficulty-balanced" value="balanced" checked /><label for="difficulty-balanced">Balanced</label> | |||
<input type="radio" name="difficulty" id="difficulty-tactician" value="tactician" /><label for="difficulty-tactician">Tactician</label> | |||
</td> | |||
</tr> | |||
<tr> | |||
<th></th><td><input type="button" value="Submit" id="submit" /></td> | |||
</table> | </tr> | ||
<div id="bg3wiki-price-calculator-result"></div> | </table> | ||
<hr/> | |||
<div id="bg3wiki-price-calculator-result"></div> | |||
</div> | |||
<script> | <script> | ||
document.querySelector("#bg3wiki-price-calculator-form #submit").addEventListener("click", do_calculation); | document.querySelector("#bg3wiki-price-calculator-form #submit").addEventListener("click", do_calculation); | ||
Line 66: | Line 69: | ||
table.classList.add('wikitable'); | table.classList.add('wikitable'); | ||
table.appendChild(create_output_row('Base item price', item_value)); | table.appendChild(create_output_row('Base item price', item_value)); | ||
table.appendChild(create_output_row('Item price | table.appendChild(create_output_row('Item price (selling)', price_sell)); | ||
table.appendChild(create_output_row('Item price | table.appendChild(create_output_row('Item price (buying)', price_buy)); | ||
output.appendChild(table); | output.appendChild(table); | ||
} | } |