Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions InteractiveHtmlBom/web/ibom.css
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ canvas:active {

.searchbox {
float: left;
min-width: 80px;
height: 40px;
margin: 10px 5px;
padding: 12px 32px;
Expand Down Expand Up @@ -422,20 +423,36 @@ canvas:active {
color: #666;
}

.search-row {
display: flex;
flex-wrap: wrap;
width: 100%;
}

.filter {
width: calc(60% - 64px);
flex: 3 1 0;
}

.reflookup {
width: calc(40% - 10px);
flex: 2 1 0;
}

.qty-multiplier {
flex: none;
width: 80px;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E");
background-position: 8px center;
padding: 0 4px 0 24px;
}

input[type=text]:focus {
input[type=text]:focus,
input[type=number]:focus {
background-color: white;
border: 1px solid #333;
}

.dark input[type=text]:focus {
.dark input[type=text]:focus,
.dark input[type=number]:focus {
background-color: #333;
border: 1px solid #ccc;
}
Expand Down
7 changes: 5 additions & 2 deletions InteractiveHtmlBom/web/ibom.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,15 @@
</div>
<div id="bot" class="split" style="flex: 1 1">
<div id="bomdiv" class="split split-horizontal">
<div style="width: 100%">
<div class="search-row">
<input id="reflookup" class="textbox searchbox reflookup hideonprint" type="text" placeholder="Ref lookup"
oninput="updateRefLookup(this.value)">
<input id="filter" class="textbox searchbox filter hideonprint" type="text" placeholder="Filter"
oninput="updateFilter(this.value)">
<div class="button-container hideonprint" style="float: left; margin: 0;">
<input id="qty-multiplier" class="textbox searchbox qty-multiplier hideonprint" type="number" min="1" step="1" value="1"
autocomplete="off" title="Quantity multiplier (number of boards)"
oninput="updateQtyMultiplier(this.value)">
<div class="button-container hideonprint" style="margin: 0;">
<button id="copy" title="Copy bom table to clipboard"
onclick="saveBomTable('clipboard')"></button>
</div>
Expand Down
11 changes: 10 additions & 1 deletion InteractiveHtmlBom/web/ibom.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var markedFootprints = new Set();
var highlightedFootprints = [];
var highlightedNet = null;
var lastClicked;
var qtyMultiplier = 1;

function dbg(html) {
dbgdiv.innerHTML = html;
Expand Down Expand Up @@ -726,7 +727,7 @@ function populateBomBody(placeholderColumn = null, placeHolderElements = null) {
} else if (column === "Quantity" && settings.bommode == "grouped") {
// Quantity
td = document.createElement("TD");
td.textContent = references.length;
td.textContent = references.length * qtyMultiplier;
tr.appendChild(td);
} else {
// All the other fields
Expand Down Expand Up @@ -857,6 +858,12 @@ function updateFilter(input) {
populateBomTable();
}

function updateQtyMultiplier(input) {
var value = parseInt(input);
qtyMultiplier = value > 0 ? value : 1;
populateBomTable();
}

function updateRefLookup(input) {
reflookup = input.toLowerCase();
populateBomTable();
Expand Down Expand Up @@ -1062,6 +1069,8 @@ function changeBomMode(mode) {
}
}

document.getElementById("qty-multiplier").hidden = mode != "grouped";

writeStorage("bommode", mode);
if (mode != settings.bommode) {
settings.bommode = mode;
Expand Down
Loading