Skip to content

Commit 5a7358f

Browse files
committed
Implement bom mode toggle
Switches between grouped, ungrouped and netlist Fixes #127
1 parent d3b3317 commit 5a7358f

File tree

8 files changed

+245
-104
lines changed

8 files changed

+245
-104
lines changed

InteractiveHtmlBom/web/ibom.css

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,26 @@ button:focus {
6767

6868
button#tb-btn {
6969
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.32 290.12h5.82M1.32 291.45h5.82' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 292.5v4.23M.26 292.63H8.2' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='1.35' y='295.73'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
70-
background-size: 32px 32px;
71-
background-position: 5px 5px;
72-
background-repeat: no-repeat;
7370
}
7471

7572
button#lr-btn {
7673
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' fill='none' stroke='%23000' stroke-width='.4' stroke-linejoin='round'/%3E%3Cpath d='M1.06 290.12H3.7m-2.64 1.33H3.7m-2.64 1.32H3.7m-2.64 1.3H3.7m-2.64 1.33H3.7' fill='none' stroke='%23000' stroke-width='.4'/%3E%3Cpath d='M4.37 288.8v7.94m0-4.11h3.96' fill='none' stroke='%23000' stroke-width='.3'/%3E%3Ctext font-weight='700' font-size='3.17' font-family='sans-serif'%3E%3Ctspan x='5.11' y='291.96'%3EF%3C/tspan%3E%3Ctspan x='5.03' y='295.68'%3EB%3C/tspan%3E%3C/text%3E%3C/g%3E%3C/svg%3E%0A");
77-
background-size: 32px 32px;
78-
background-position: 5px 5px;
79-
background-repeat: no-repeat;
8074
}
8175

8276
button#bom-btn {
8377
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8.47 8.47'%3E%3Crect transform='translate(0 -288.53)' ry='1.17' y='288.8' x='.27' height='7.94' width='7.94' fill='%23f9f9f9'/%3E%3Cg transform='translate(0 -288.53)' fill='none' stroke='%23000' stroke-width='.4'%3E%3Crect width='7.94' height='7.94' x='.27' y='288.8' ry='1.17' stroke-linejoin='round'/%3E%3Cpath d='M1.59 290.12h5.29M1.59 291.45h5.33M1.59 292.75h5.33M1.59 294.09h5.33M1.59 295.41h5.33'/%3E%3C/g%3E%3C/svg%3E");
84-
background-size: 32px 32px;
85-
background-position: 5px 5px;
86-
background-repeat: no-repeat;
78+
}
79+
80+
button#bom-grouped-btn {
81+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%23000' stroke-linejoin='round' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-linecap='square' stroke-width='2' d='M6 10h4m4 0h5m4 0h3M6.1 22h3m3.9 0h5m4 0h4m-16-8h4m4 0h4'/%3E%3Cpath stroke-linecap='null' d='M5 17.5h22M5 26.6h22M5 5.5h22'/%3E%3C/g%3E%3C/svg%3E");
82+
}
83+
84+
button#bom-ungrouped-btn {
85+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg stroke='%23000' stroke-linejoin='round' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-linecap='square' stroke-width='2' d='M6 10h4m-4 8h3m-3 8h4'/%3E%3Cpath stroke-linecap='null' d='M5 13.5h22m-22 8h22M5 5.5h22'/%3E%3C/g%3E%3C/svg%3E");
86+
}
87+
88+
button#bom-netlist-btn {
89+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cg fill='none' stroke='%23000' class='layer'%3E%3Crect width='29' height='29' x='1.5' y='1.5' stroke-width='2' fill='%23fff' rx='5' ry='5'/%3E%3Cpath stroke-width='2' d='M6 26l6-6v-8m13.8-6.3l-6 6v8'/%3E%3Ccircle cx='11.8' cy='9.5' r='2.8' stroke-width='2'/%3E%3Ccircle cx='19.8' cy='22.8' r='2.8' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
8790
}
8891

8992
button#copy {
@@ -138,6 +141,12 @@ textarea.clipboard-temp {
138141
filter: invert(1);
139142
}
140143

144+
.button-container button {
145+
background-size: 32px 32px;
146+
background-position: 5px 5px;
147+
background-repeat: no-repeat;
148+
}
149+
141150
@media print {
142151
.hideonprint {
143152
display: none;

InteractiveHtmlBom/web/ibom.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@
136136
<button id="tb-btn" class="right-most-button" onclick="changeBomLayout('top-bottom')"
137137
title="BOM top, drawings bot"></button>
138138
</div>
139+
<div class="button-container hideonprint"
140+
style="float: right; position: relative; top: 8px">
141+
<button id="bom-grouped-btn" class="left-most-button" onclick="changeBomMode('grouped')"
142+
title="Grouped BOM"></button>
143+
<button id="bom-ungrouped-btn" class="middle-button" onclick="changeBomMode('ungrouped')"
144+
title="Ungrouped BOM"></button>
145+
<button id="bom-netlist-btn" class="right-most-button" onclick="changeBomMode('netlist')"
146+
title="Netlist"></button>
147+
</div>
139148
<div class="hideonprint menu" style="float: right; top: 8px;">
140149
<button class="statsbtn"></button>
141150
<div class="menu-content">

0 commit comments

Comments
 (0)