mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
add showing of drawings' and sheets' names
This commit is contained in:
@@ -11,6 +11,7 @@ $(document).ready(function () {
|
|||||||
var theme = localStorage.getItem("theme") || systemTheme;
|
var theme = localStorage.getItem("theme") || systemTheme;
|
||||||
setTheme(theme);
|
setTheme(theme);
|
||||||
|
|
||||||
|
$("#dropdown-menu").change(displayDrawingsNames);
|
||||||
connectSocket();
|
connectSocket();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -74,13 +75,15 @@ function handleDrawingsData(data) {
|
|||||||
|
|
||||||
allDrawings[filename] = { drawings: drawings, sheets: sheets };
|
allDrawings[filename] = { drawings: drawings, sheets: sheets };
|
||||||
|
|
||||||
|
console.log(connectedClients);
|
||||||
|
|
||||||
if (connectedClients.hasOwnProperty(blenderId)) {
|
if (connectedClients.hasOwnProperty(blenderId)) {
|
||||||
if (!connectedClients[blenderId].shown) {
|
if (!connectedClients[blenderId].shown) {
|
||||||
connectedClients[blenderId] = {
|
connectedClients[blenderId] = {
|
||||||
shown: true,
|
shown: true,
|
||||||
ifc_file: filename,
|
ifc_file: filename,
|
||||||
};
|
};
|
||||||
// add(blenderId, data, filename);
|
addSelectOption(blenderId, filename);
|
||||||
} else {
|
} else {
|
||||||
// update(blenderId, data, filename);
|
// update(blenderId, data, filename);
|
||||||
}
|
}
|
||||||
@@ -89,10 +92,45 @@ function handleDrawingsData(data) {
|
|||||||
shown: true,
|
shown: true,
|
||||||
ifc_file: filename,
|
ifc_file: filename,
|
||||||
};
|
};
|
||||||
// add(blenderId, data, filename);
|
addSelectOption(blenderId, filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function addSelectOption(blenderId, filename) {
|
||||||
|
const filenameOption = $("<option></option>")
|
||||||
|
.attr("id", "blender" + blenderId)
|
||||||
|
.val(filename)
|
||||||
|
.text(filename);
|
||||||
|
$("#dropdown-menu").append(filenameOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayDrawingsNames() {
|
||||||
|
ifcFile = $("#dropdown-menu").val();
|
||||||
|
|
||||||
|
drawings = allDrawings[ifcFile].drawings;
|
||||||
|
sheets = allDrawings[ifcFile].sheets;
|
||||||
|
|
||||||
|
function createLabel(text, index, type) {
|
||||||
|
var label = $("<li></lio>")
|
||||||
|
.text(text)
|
||||||
|
.attr("id", index)
|
||||||
|
.click(function () {
|
||||||
|
console.log("ID:", $(this).attr("id"), "Name:", text);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (type === "drawing") $("#drawings-sub-panel").append(label);
|
||||||
|
else if (type === "sheet") $("#sheets-sub-panel").append(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
drawings.forEach(function (drawing, index) {
|
||||||
|
createLabel(drawing.name, index, "drawing");
|
||||||
|
});
|
||||||
|
|
||||||
|
sheets.forEach(function (sheet, index) {
|
||||||
|
createLabel(sheet.name, index, "sheet");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function setTheme(theme) {
|
function setTheme(theme) {
|
||||||
if (theme === "light") {
|
if (theme === "light") {
|
||||||
$("html").removeClass("dark").addClass("light");
|
$("html").removeClass("dark").addClass("light");
|
||||||
|
|||||||
@@ -55,10 +55,10 @@
|
|||||||
<div class="col-2 left">
|
<div class="col-2 left">
|
||||||
<!-- Dropdown menu -->
|
<!-- Dropdown menu -->
|
||||||
<div class="dropdown mb-3">
|
<div class="dropdown mb-3">
|
||||||
<label for="dropdown-menu">IFC File</label>
|
<label for="dropdown-menu">IFC File:</label>
|
||||||
<select class="p-0 pl-2" id="dropdown-menu">
|
<select class="p-0 pl-2" id="dropdown-menu">
|
||||||
<!-- IFC files will be dynamically populated here -->
|
<!-- IFC files will be dynamically populated here -->
|
||||||
<option value="" selected disabled hidden>Select IFC File</option>
|
<option value="" selected disabled hidden>IFC File</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<!-- Panel with sub-panels -->
|
<!-- Panel with sub-panels -->
|
||||||
@@ -77,16 +77,13 @@
|
|||||||
|
|
||||||
<div id="collapseOne" class="collapse show">
|
<div id="collapseOne" class="collapse show">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="sub-panel" id="sub-panel-1">
|
<div class="sub-panel pl-2" id="drawings-sub-panel">
|
||||||
<label>Item 1</label>
|
|
||||||
<label>Item 2</label>
|
|
||||||
<label>Item 3</label>
|
|
||||||
<!-- Drawings will be dynamically populated here -->
|
<!-- Drawings will be dynamically populated here -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card">
|
<div class="card pb-2">
|
||||||
<div class="card-header overflow-hidden" id="headingTwo">
|
<div class="card-header overflow-hidden" id="headingTwo">
|
||||||
<button
|
<button
|
||||||
class="btn p-0 w-100 text-left"
|
class="btn p-0 w-100 text-left"
|
||||||
@@ -98,7 +95,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="collapseTwo" class="collapse show">
|
<div id="collapseTwo" class="collapse show">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<ul class="sub-panel" id="sub-panel-2">
|
<ul class="sub-panel pl-2" id="sheets-sub-panel">
|
||||||
<!-- Sheets will be dynamically populated here -->
|
<!-- Sheets will be dynamically populated here -->
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user