Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +740 -440
templates/proposed-GUI.html
CHANGED
|
@@ -33,7 +33,7 @@
|
|
| 33 |
{% include 'loading.html' %}
|
| 34 |
</div>
|
| 35 |
<!--Main tab links-->
|
| 36 |
-
<div class="tab">
|
| 37 |
<div class="container" id="toggle">
|
| 38 |
<div class="bar1"></div>
|
| 39 |
<div class="bar2"></div>
|
|
@@ -45,11 +45,16 @@
|
|
| 45 |
<a class="tablinks" id="LegendHist" href="{{ url_for('legendDirectory') }}">
|
| 46 |
Legends History <i class="fa fa-caret-down"></i>
|
| 47 |
</a>
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
<button class="dropbtn" onclick="userguideclick()"><img id="infoImg" src="data:image/png;base64,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"></button>
|
| 50 |
-
</div>
|
| 51 |
|
| 52 |
-
|
|
|
|
| 53 |
<div id="mySidebar" class="slide-out">
|
| 54 |
<div id="menuOptions">
|
| 55 |
<li onclick="openTab(event, 'home')" >Measure Plans </li>
|
|
@@ -58,6 +63,7 @@
|
|
| 58 |
</div>
|
| 59 |
|
| 60 |
<div id="home" class="tabcontent" >
|
|
|
|
| 61 |
<div id="loading" hidden> </div>
|
| 62 |
|
| 63 |
<div id="canvaswindow" hidden="until-found">
|
|
@@ -70,8 +76,9 @@
|
|
| 70 |
</div>
|
| 71 |
<input type="button" value="Save" id="savecanvas" />
|
| 72 |
</div>
|
| 73 |
-
|
| 74 |
<div id="rightside" hidden="until-found">
|
|
|
|
| 75 |
<div id="backgroundimg" >
|
| 76 |
<div id="imgs">
|
| 77 |
<!-- image here -->
|
|
@@ -123,7 +130,8 @@
|
|
| 123 |
|
| 124 |
</div>
|
| 125 |
<div id="measureCheckbox">
|
| 126 |
-
<select style="margin-left: -1%;" hidden name="measureselectname" id="measureselectid" multiple size="5"></select>
|
|
|
|
| 127 |
<div id="dxfdiv" hidden="until-found">
|
| 128 |
<input type="button" id="pdftodxfFileButton" onclick="document.getElementById('pdftodxfFile').click();" value="Upload DXF File" >
|
| 129 |
<input type="file" id="pdftodxfFile" name="pdftodxfFilename" >
|
|
@@ -144,7 +152,8 @@
|
|
| 144 |
<input type="search" onkeyup=filterFunction(this.id) id="relevantSearchInput">
|
| 145 |
<br>
|
| 146 |
<div id ="relvdiv">
|
| 147 |
-
<
|
|
|
|
| 148 |
<iframe id="pdfFrame" hidden></iframe>
|
| 149 |
</div>
|
| 150 |
</div>
|
|
@@ -184,6 +193,9 @@
|
|
| 184 |
</div>
|
| 185 |
<audio id="myAudio" autoplay></audio>
|
| 186 |
</form>
|
|
|
|
|
|
|
|
|
|
| 187 |
|
| 188 |
<div id ="duplicater" class="duplicaterclass" hidden="until-found">
|
| 189 |
<label id="labelArrayId" hidden="until-found"> </label>
|
|
@@ -268,7 +280,7 @@
|
|
| 268 |
</ul>
|
| 269 |
|
| 270 |
</div>
|
| 271 |
-
|
| 272 |
<div class="dropdown-content">
|
| 273 |
<div id="userguidetext">
|
| 274 |
<div id="textfirstpage">
|
|
@@ -544,7 +556,7 @@
|
|
| 544 |
<input type="number" id="textextra" name="text0name" placeholder="Eg: 1" >
|
| 545 |
<input type="text" id="text0extra" name="text1name" placeholder="Eg: Wall Type" >
|
| 546 |
<input type="text" id="text1extra" name="text2name" placeholder="Eg:NBS K10/" >
|
| 547 |
-
<input type="number" id="text2extra" name="text3name" placeholder="Eg: 3" >
|
| 548 |
|
| 549 |
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script>
|
| 550 |
<lord-icon
|
|
@@ -601,6 +613,15 @@
|
|
| 601 |
<script >
|
| 602 |
|
| 603 |
///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 604 |
// Function to send the Dropbox link and keyword to the server
|
| 605 |
function getURLParams() {
|
| 606 |
const urlParams = new URLSearchParams(window.location.search);
|
|
@@ -686,32 +707,57 @@ var prjids=[]
|
|
| 686 |
|
| 687 |
displayprjnames()
|
| 688 |
function displayprjnames(){
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
|
| 703 |
-
|
| 704 |
-
|
| 705 |
-
|
| 706 |
-
|
| 707 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 708 |
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 715 |
}
|
| 716 |
/*Get chosen value and send to flask to get project parts*/
|
| 717 |
|
|
@@ -775,8 +821,17 @@ function isValueNotInDropdown(dropdown, value) {
|
|
| 775 |
function displayprojsections(projectid,Partid){
|
| 776 |
console.log(seconddropdown.selectedIndex)
|
| 777 |
document.getElementById("all").style.display = "block";
|
| 778 |
-
measSelect.
|
| 779 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 780 |
$.get('/getprojectsections/'+JSON.stringify([projectid,Partid]))
|
| 781 |
.success(function(data){
|
| 782 |
document.getElementById("all").style.display = "none";
|
|
@@ -1043,52 +1098,131 @@ if (document.getElementById('imgContainer')) {
|
|
| 1043 |
//___________________________________________________________________________________________________________
|
| 1044 |
/*Toggle Tab View of Home and Legend along with the Menu bar icon*/
|
| 1045 |
function openTab(evt, tabname) {
|
| 1046 |
-
// Declare all variables
|
| 1047 |
var i, tabcontent, tablinks;
|
| 1048 |
|
| 1049 |
-
|
|
|
|
|
|
|
| 1050 |
tabcontent = document.getElementsByClassName("tabcontent");
|
| 1051 |
for (i = 0; i < tabcontent.length; i++) {
|
| 1052 |
tabcontent[i].style.display = "none";
|
| 1053 |
}
|
| 1054 |
|
| 1055 |
-
//
|
| 1056 |
tablinks = document.getElementsByClassName("tablinks");
|
| 1057 |
for (i = 0; i < tablinks.length; i++) {
|
| 1058 |
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
| 1059 |
}
|
| 1060 |
|
| 1061 |
-
// Show
|
| 1062 |
-
document.getElementById(tabname)
|
| 1063 |
-
|
| 1064 |
-
|
| 1065 |
-
|
| 1066 |
-
|
| 1067 |
-
|
| 1068 |
-
|
| 1069 |
-
|
| 1070 |
-
}
|
| 1071 |
}
|
| 1072 |
-
|
|
|
|
| 1073 |
document.getElementById("pagetitle").click();
|
| 1074 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1075 |
|
| 1076 |
-
|
| 1077 |
-
|
| 1078 |
-
|
| 1079 |
-
|
| 1080 |
-
//
|
| 1081 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1082 |
|
| 1083 |
-
|
| 1084 |
-
//
|
|
|
|
|
|
|
| 1085 |
|
| 1086 |
-
|
|
|
|
| 1087 |
|
| 1088 |
-
|
| 1089 |
-
|
|
|
|
|
|
|
| 1090 |
|
| 1091 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1092 |
console.log('pdfname===',pdfname)
|
| 1093 |
fetch('/get-pdf/'+JSON.stringify(pdfname))
|
| 1094 |
.then(response => response.blob())
|
|
@@ -1096,7 +1230,7 @@ function downloadPdf(pdfname) {
|
|
| 1096 |
const url = URL.createObjectURL(blob);
|
| 1097 |
var link = document.createElement('a');
|
| 1098 |
link.href = url;
|
| 1099 |
-
link.download =
|
| 1100 |
link.dispatchEvent(new MouseEvent('click'));
|
| 1101 |
})
|
| 1102 |
.catch(error => console.error('Error fetching PDF:', error));
|
|
@@ -1352,7 +1486,7 @@ function getSelectValues(select) {
|
|
| 1352 |
//___________________________________________________________________________________________________________
|
| 1353 |
|
| 1354 |
//Retrieves list of projects
|
| 1355 |
-
|
| 1356 |
function getproj(){
|
| 1357 |
getALLMCTNAMES();
|
| 1358 |
|
|
@@ -1364,301 +1498,465 @@ function getSelectValues(select) {
|
|
| 1364 |
|
| 1365 |
var sections = document.getElementsByClassName("selectionsProjs")[0];
|
| 1366 |
chooseFirstdrpdwn();
|
| 1367 |
-
|
| 1368 |
-
|
| 1369 |
-
.
|
| 1370 |
-
|
| 1371 |
-
|
| 1372 |
-
|
| 1373 |
-
|
| 1374 |
-
|
| 1375 |
-
|
| 1376 |
-
|
| 1377 |
-
|
| 1378 |
-
|
| 1379 |
-
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
|
| 1383 |
-
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
-
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
|
| 1392 |
-
|
| 1393 |
-
|
| 1394 |
-
|
| 1395 |
-
|
| 1396 |
-
|
| 1397 |
-
|
| 1398 |
-
relvSelect.removeAttribute("hidden");
|
| 1399 |
-
measSelect.innerHTML='';
|
| 1400 |
-
|
| 1401 |
-
var optn2 = document.createElement("OPTION");
|
| 1402 |
-
optn2.text= 'Select project to measure';
|
| 1403 |
-
optn2.value=''
|
| 1404 |
-
optn2.hidden=true;
|
| 1405 |
-
optn2.id='hidden';
|
| 1406 |
-
|
| 1407 |
-
measSelect.add(optn2);
|
| 1408 |
-
document.getElementById("hidden").required = true;
|
| 1409 |
-
|
| 1410 |
-
relvSelect.innerHTML='';
|
| 1411 |
-
for (i = 0; i < relvDocs.length; i++) {
|
| 1412 |
-
//relevant documents
|
| 1413 |
-
var optn1 = document.createElement("OPTION");
|
| 1414 |
-
optn1.text= relvDocs[i][0];
|
| 1415 |
-
optn1.value= relvDocs[i][0] ;
|
| 1416 |
-
optn1.id=relvDocs[i][1] ;
|
| 1417 |
-
relvSelect.add(optn1);
|
| 1418 |
-
if (data=='No projects found'){
|
| 1419 |
-
optn1.style.color='#bdbcbc';
|
| 1420 |
-
optn1.style.cursor='not-allowed';
|
| 1421 |
-
optn1.setAttribute('disabled',true);
|
| 1422 |
-
}
|
| 1423 |
-
}
|
| 1424 |
-
const nameSet = new Set(); // To track unique names
|
| 1425 |
-
|
| 1426 |
-
for (i = 0; i < docsToMeasure.length; i++) {
|
| 1427 |
-
//to measure documents
|
| 1428 |
-
var optn2 = document.createElement("OPTION");
|
| 1429 |
-
let name = docsToMeasure[i][0]; // Extract name
|
| 1430 |
-
optn2.text= docsToMeasure[i][0];
|
| 1431 |
-
optn2.value= docsToMeasure[i][0] ;
|
| 1432 |
-
optn2.id=docsToMeasure[i][1] ;
|
| 1433 |
-
measSelect.add(optn2);
|
| 1434 |
-
measoptns.push(optn2);
|
| 1435 |
-
|
| 1436 |
-
// Check for duplicates
|
| 1437 |
-
if (nameSet.has(name)) {
|
| 1438 |
-
optn2.style.color = "red"; // Highlight duplicate (optional)
|
| 1439 |
-
PopupElement.textContent = 'Duplicate project names were detected while retrieving the project PDFs. Please visit Dropbox and rename the files to ensure each project has a unique name. Once the renaming is complete, return to the console and click on the Dropbox icon to retrieve the updated project names.';
|
| 1440 |
-
ShowPopUp();
|
| 1441 |
-
} else {
|
| 1442 |
-
nameSet.add(name); // Add unique name to the set
|
| 1443 |
-
}
|
| 1444 |
|
| 1445 |
-
|
| 1446 |
-
|
| 1447 |
-
|
| 1448 |
-
optn2.setAttribute('disabled',true);
|
| 1449 |
-
}
|
| 1450 |
-
}
|
| 1451 |
-
console.log(nameSet)
|
| 1452 |
-
relvids.push(relvSelect) ;
|
| 1453 |
-
measids.push(measSelect);
|
| 1454 |
-
//to open pdf in a new tab (relevant documents)
|
| 1455 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1456 |
|
| 1457 |
-
|
| 1458 |
-
|
| 1459 |
-
|
| 1460 |
-
|
| 1461 |
-
|
| 1462 |
|
| 1463 |
-
|
| 1464 |
-
|
| 1465 |
-
|
| 1466 |
-
|
| 1467 |
-
|
| 1468 |
-
|
| 1469 |
-
|
| 1470 |
-
|
| 1471 |
-
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
| 1476 |
-
|
| 1477 |
-
|
| 1478 |
-
|
| 1479 |
-
|
| 1480 |
-
|
| 1481 |
-
|
| 1482 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1483 |
|
| 1484 |
-
|
|
|
|
| 1485 |
|
| 1486 |
-
|
| 1487 |
-
|
| 1488 |
-
|
| 1489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1490 |
if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) {
|
| 1491 |
-
downloadPdf(
|
| 1492 |
-
|
| 1493 |
-
|
| 1494 |
-
else{
|
| 1495 |
-
window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
|
| 1496 |
}
|
|
|
|
|
|
|
|
|
|
| 1497 |
canvasimg='';
|
| 1498 |
ry=[[]];
|
| 1499 |
levelcheckbox.checked=false;
|
| 1500 |
-
pdfname=
|
| 1501 |
measSelect.style.boxShadow='none';
|
| 1502 |
|
| 1503 |
|
| 1504 |
document.getElementById("all").style.display = "block";
|
| 1505 |
|
| 1506 |
pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
|
| 1507 |
-
|
| 1508 |
-
|
| 1509 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1510 |
|
| 1511 |
|
| 1512 |
-
|
| 1513 |
-
|
| 1514 |
-
|
| 1515 |
-
|
| 1516 |
-
|
| 1517 |
-
|
| 1518 |
-
|
| 1519 |
-
|
| 1520 |
-
|
| 1521 |
-
|
| 1522 |
-
|
| 1523 |
-
|
| 1524 |
-
|
| 1525 |
-
|
| 1526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1527 |
|
| 1528 |
-
|
| 1529 |
-
|
| 1530 |
-
|
| 1531 |
-
|
| 1532 |
-
|
| 1533 |
-
|
| 1534 |
-
|
| 1535 |
-
|
| 1536 |
-
|
| 1537 |
-
|
| 1538 |
-
|
| 1539 |
-
|
| 1540 |
-
|
| 1541 |
-
|
| 1542 |
-
|
| 1543 |
-
|
| 1544 |
-
|
| 1545 |
-
|
| 1546 |
-
|
| 1547 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1548 |
|
| 1549 |
-
|
| 1550 |
-
|
| 1551 |
-
|
| 1552 |
-
|
| 1553 |
-
|
| 1554 |
-
|
| 1555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1556 |
}
|
| 1557 |
-
|
| 1558 |
-
|
| 1559 |
-
|
| 1560 |
-
|
| 1561 |
-
areaRatio.required=true;
|
| 1562 |
-
selectunitA=document.getElementById('selectunitA')
|
| 1563 |
-
selectunitA.removeAttribute('hidden')
|
| 1564 |
-
|
| 1565 |
-
areadiv.append(areaRatiolbl,areaRatio,selectunitA)
|
| 1566 |
-
var br2= document.createElement("br");
|
| 1567 |
-
var br3= document.createElement("br");
|
| 1568 |
-
var prmdiv=document.createElement("div");
|
| 1569 |
-
prmdiv.id='prmdiv'
|
| 1570 |
-
var prmRatiolbl= document.createElement("label");
|
| 1571 |
-
prmRatiolbl.innerText='Perimeter:'
|
| 1572 |
-
prmRatiolbl.id='radiolbl';
|
| 1573 |
-
|
| 1574 |
-
var prmRatio= document.createElement("input");
|
| 1575 |
-
prmRatio.type='number';
|
| 1576 |
-
prmRatio.id='perimlvlinput';
|
| 1577 |
-
prmRatio.className='lvlinput';
|
| 1578 |
-
prmRatio.name='prmRatio';
|
| 1579 |
-
prmRatio.style.textAlign='right';
|
| 1580 |
-
// prmRatio.onchange=setNumberDecimal();
|
| 1581 |
-
prmRatio.style.marginLeft='49px';
|
| 1582 |
-
prmRatio.step=".0000001";
|
| 1583 |
-
prmRatio.addEventListener('change',function(){
|
| 1584 |
-
prmRatio.value=(Number(prmRatio.value)).toFixed(7)
|
| 1585 |
-
prmRatio.style.boxShadow='none';
|
| 1586 |
-
})
|
| 1587 |
-
prmRatio.required=true;
|
| 1588 |
-
selectunitP=document.getElementById('selectunitP')
|
| 1589 |
-
selectunitP.removeAttribute('hidden')
|
| 1590 |
-
|
| 1591 |
-
prmdiv.append(prmRatiolbl, prmRatio,selectunitP)
|
| 1592 |
-
var ratiosdiv= document.getElementById("ratios");
|
| 1593 |
-
ratiosdiv.innerHTML='';
|
| 1594 |
-
ratiosdiv.append(scalelbl);
|
| 1595 |
-
ratiosdiv.append(br1);
|
| 1596 |
-
ratiosdiv.append(areadiv)
|
| 1597 |
-
ratiosdiv.append(prmdiv)
|
| 1598 |
-
areainpixels=data[0];
|
| 1599 |
-
prminpixels=data[1];
|
| 1600 |
-
|
| 1601 |
-
|
| 1602 |
-
})
|
| 1603 |
-
.error(function(jqXHR, textStatus, errorThrown) {
|
| 1604 |
-
PopupElement.textContent='Error occured while uploading the pdf to the Dropbox. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 1605 |
-
ShowPopUp();
|
| 1606 |
});
|
| 1607 |
-
|
| 1608 |
-
|
| 1609 |
-
|
| 1610 |
-
|
| 1611 |
-
|
| 1612 |
-
|
| 1613 |
-
|
| 1614 |
-
|
| 1615 |
-
|
| 1616 |
-
|
| 1617 |
-
|
| 1618 |
-
|
| 1619 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1620 |
}
|
| 1621 |
-
else
|
| 1622 |
-
ratioPunit=1;
|
| 1623 |
-
|
| 1624 |
-
})
|
| 1625 |
-
// }
|
| 1626 |
-
// for 2.8 multiple pdfs
|
| 1627 |
-
// else{
|
| 1628 |
-
// pdfnames=getSelectValues(elem)
|
| 1629 |
-
// }
|
| 1630 |
-
});
|
| 1631 |
-
|
| 1632 |
-
});
|
| 1633 |
-
|
| 1634 |
-
document.addEventListener("click", function(event) {
|
| 1635 |
-
const iframe = document.getElementById("pdfFrame");
|
| 1636 |
-
if (!iframe.contains(event.target)) {
|
| 1637 |
-
const iframe = document.getElementById("pdfFrame");
|
| 1638 |
-
iframe.style.display = "none";
|
| 1639 |
-
}
|
| 1640 |
-
});
|
| 1641 |
-
document.getElementById('measureADRbutton').onclick= function()
|
| 1642 |
-
{
|
| 1643 |
-
if (!measSelect.value)
|
| 1644 |
-
measSelect.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
|
| 1645 |
|
| 1646 |
-
|
| 1647 |
-
|
| 1648 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1649 |
PopupElement.textContent='Error occured while retrieving the Project Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 1650 |
ShowPopUp();
|
| 1651 |
-
|
| 1652 |
-
|
| 1653 |
-
if( projsec.value.startsWith('3.2') || projsec.value.startsWith('2.8') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.1') || projsec.value.startsWith('2.7')){
|
| 1654 |
-
document.getElementById('arealvlinput').setAttribute('disabled',true)
|
| 1655 |
-
document.getElementById('selectunitA').setAttribute('disabled',true)
|
| 1656 |
-
}
|
| 1657 |
-
else{ // section 1.0
|
| 1658 |
-
document.getElementById('arealvlinput').removeAttribute('disabled')
|
| 1659 |
-
document.getElementById('selectunitA').removeAttribute('disabled')
|
| 1660 |
-
}
|
| 1661 |
-
}
|
| 1662 |
}
|
| 1663 |
//___________________________________________________________________________________________________________
|
| 1664 |
//___________________________________________________________________________________________________________
|
|
@@ -1740,9 +2038,16 @@ function ImgSide(imgdata, spreadsheetLink, pdfLink) {
|
|
| 1740 |
legendbutton.style.boxShadow = 'none';
|
| 1741 |
});
|
| 1742 |
|
| 1743 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1744 |
window.open(spreadsheetLink);
|
| 1745 |
});
|
|
|
|
| 1746 |
//////////////////////////////////////////////////////////////
|
| 1747 |
var imgbutton = document.createElement("button");
|
| 1748 |
imgbutton.className = 'measureADRbutton2';
|
|
@@ -1882,8 +2187,7 @@ function getData(form) {
|
|
| 1882 |
|
| 1883 |
console.log(formData,formvalues)
|
| 1884 |
// iterate through entries...
|
| 1885 |
-
|
| 1886 |
-
tomeasureproj=formvalues['measureselectname']; //proj name
|
| 1887 |
|
| 1888 |
|
| 1889 |
if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
|
|
@@ -1937,12 +2241,16 @@ function getData(form) {
|
|
| 1937 |
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
|
| 1938 |
formData.append('answers',JSON.stringify(answers))
|
| 1939 |
}
|
| 1940 |
-
else if (formvalues['selectprojs'].startsWith('2.
|
| 1941 |
{
|
| 1942 |
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
|
| 1943 |
formData.append('answers',JSON.stringify(answers))
|
| 1944 |
}
|
| 1945 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1946 |
}
|
| 1947 |
|
| 1948 |
if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ) //formvalues['selectprojs'].startsWith('2.1')
|
|
@@ -1950,26 +2258,17 @@ function getData(form) {
|
|
| 1950 |
// console.log(formData)
|
| 1951 |
$.ajax({
|
| 1952 |
type: "POST",
|
| 1953 |
-
|
| 1954 |
url: "/savebase64Img/",
|
| 1955 |
-
|
| 1956 |
-
|
| 1957 |
-
contentType: "application/json",
|
| 1958 |
-
|
| 1959 |
-
// convert data/object to JSON to send
|
| 1960 |
-
data: formData,
|
| 1961 |
processData: false, // Prevent jQuery from automatically processing the data
|
| 1962 |
contentType: false,
|
| 1963 |
-
// files:formvalues['pdftodxfFilename'],
|
| 1964 |
-
|
| 1965 |
-
// expect JSON data in return (e.g. Flask jsonify)
|
| 1966 |
-
// dataType: "json",
|
| 1967 |
-
|
| 1968 |
-
// handle response
|
| 1969 |
success: function(response) {
|
| 1970 |
console.log(response);
|
| 1971 |
},
|
| 1972 |
error: function(err) {
|
|
|
|
|
|
|
| 1973 |
PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 1974 |
ShowPopUp();
|
| 1975 |
|
|
@@ -1979,8 +2278,8 @@ function getData(form) {
|
|
| 1979 |
// var mp3_url = 'https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3';
|
| 1980 |
// (new Audio(mp3_url)).play()
|
| 1981 |
// retrieveLinks()
|
| 1982 |
-
|
| 1983 |
-
|
| 1984 |
|
| 1985 |
|
| 1986 |
document.getElementById("loading").hidden = true;
|
|
@@ -2034,16 +2333,14 @@ function getData(form) {
|
|
| 2034 |
|
| 2035 |
}
|
| 2036 |
if (formvalues['selectprojs'].startsWith('2.8'))
|
| 2037 |
-
{ //
|
| 2038 |
-
|
| 2039 |
// SimilarAreaDictionary=data[1];
|
| 2040 |
// listofimages=data[0];
|
| 2041 |
dropboxLink=data[1];
|
| 2042 |
-
|
| 2043 |
-
|
| 2044 |
-
|
| 2045 |
-
|
| 2046 |
-
|
| 2047 |
}
|
| 2048 |
if (formvalues['selectprojs'].startsWith('2.2'))
|
| 2049 |
{
|
|
@@ -2080,6 +2377,26 @@ function getData(form) {
|
|
| 2080 |
// if (!(formvalues['selectprojs'].startsWith('2.8')))
|
| 2081 |
// {
|
| 2082 |
ImgSide(data[0],spreadsheetURL,dropboxLink)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2083 |
// }
|
| 2084 |
|
| 2085 |
// else{
|
|
@@ -2118,7 +2435,7 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2118 |
dict1: JSON.stringify(list1),
|
| 2119 |
spreadsheetId: spreadsheetId,
|
| 2120 |
pdfpathpath: JSON.stringify(pdfpath),
|
| 2121 |
-
path: Object.fromEntries(formData)['
|
| 2122 |
}),
|
| 2123 |
dataType: "json",
|
| 2124 |
success: function (data1) {
|
|
@@ -2127,6 +2444,8 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2127 |
},
|
| 2128 |
error: function (err) {
|
| 2129 |
console.error('Error occurred during first AJAX call:', err);
|
|
|
|
|
|
|
| 2130 |
PopupElement.textContent = 'Error occurred. Refresh and try again. If the error continues, please contact the ADR team to fix it.';
|
| 2131 |
ShowPopUp();
|
| 2132 |
}
|
|
@@ -2146,7 +2465,7 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2146 |
dict1: JSON.stringify(list1),
|
| 2147 |
spreadsheetId: spreadsheetId,
|
| 2148 |
pdfpathpath: JSON.stringify(pdfpath),
|
| 2149 |
-
path: Object.fromEntries(formData)['
|
| 2150 |
}),
|
| 2151 |
dataType: "json"
|
| 2152 |
});
|
|
@@ -2165,7 +2484,7 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2165 |
document.getElementById("loading").style.marginTop = '20%';
|
| 2166 |
document.getElementById("loading").style.marginLeft = '65%';
|
| 2167 |
|
| 2168 |
-
updatepreview([pdfpath, Object.fromEntries(formData)['
|
| 2169 |
|
| 2170 |
await $.ajax({
|
| 2171 |
type: "POST",
|
|
@@ -2174,7 +2493,7 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2174 |
data: JSON.stringify({
|
| 2175 |
dict: JSON.stringify(SimilarAreaDictionary),
|
| 2176 |
deletedrows: delrows2,
|
| 2177 |
-
path: Object.fromEntries(formData)['
|
| 2178 |
spreadsheetId: spreadsheetId,
|
| 2179 |
areaPermArr: JSON.stringify(data[7]),
|
| 2180 |
section: Object.fromEntries(formData)['selectprojs'],
|
|
@@ -2188,6 +2507,8 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2188 |
}
|
| 2189 |
|
| 2190 |
} catch (err) {
|
|
|
|
|
|
|
| 2191 |
console.error('Error occurred during fetchAndCompareData:', err);
|
| 2192 |
PopupElement.textContent = 'Error occurred. Refresh and try again. If the error continues, please contact the ADR team to fix it.';
|
| 2193 |
ShowPopUp();
|
|
@@ -2213,80 +2534,55 @@ if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].sta
|
|
| 2213 |
/////////////////////////
|
| 2214 |
});
|
| 2215 |
}
|
| 2216 |
-
// trial for 2.1 - tameem's code--- delete and deploy in the above if statement
|
| 2217 |
-
// else{
|
| 2218 |
-
// $.ajax({
|
| 2219 |
-
// type: "POST",
|
| 2220 |
-
// url: "/2.1Trial/",
|
| 2221 |
-
|
| 2222 |
-
// // set content type header to use Flask response.get_json()
|
| 2223 |
-
// contentType: "application/json",
|
| 2224 |
-
|
| 2225 |
-
// // convert data/object to JSON to send
|
| 2226 |
-
// data: JSON.stringify({allvalues:answers}),
|
| 2227 |
-
|
| 2228 |
-
// // expect JSON data in return (e.g. Flask jsonify)
|
| 2229 |
-
// dataType: "json",
|
| 2230 |
-
|
| 2231 |
-
// // handle response
|
| 2232 |
-
// success: function(response) {
|
| 2233 |
-
// console.log(response);
|
| 2234 |
-
// },
|
| 2235 |
-
// error: function(err) {
|
| 2236 |
-
// PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 2237 |
-
// ShowPopUp();
|
| 2238 |
-
// }
|
| 2239 |
-
// }).done(function(data){
|
| 2240 |
-
// spreadsheetURL=data[0];
|
| 2241 |
-
// var backimg=document.getElementById('backgroundimg');
|
| 2242 |
-
// var rightside=document.getElementById('rightside');
|
| 2243 |
-
// document.getElementById("loading").hidden = true;
|
| 2244 |
-
// document.getElementById('duplicater').removeAttribute('hidden');
|
| 2245 |
-
// document.getElementById('doneebackground').removeAttribute('hidden');
|
| 2246 |
-
// document.getElementById('summarytoXML').removeAttribute('hidden');
|
| 2247 |
-
// document.getElementById('measureADRbutton').removeAttribute('disabled');
|
| 2248 |
-
// document.getElementById('measureADRbutton').style.cursor='pointer';
|
| 2249 |
-
// document.getElementById('measureADRbutton').style.color = 'white';
|
| 2250 |
-
// document.getElementById('measureADRbutton').style.backgroundColor="#16c72e";
|
| 2251 |
-
|
| 2252 |
-
// document.getElementById('measureADRbutton').addEventListener('mouseover',function(){
|
| 2253 |
-
// document.getElementById('measureADRbutton').style.color='black';
|
| 2254 |
-
// document.getElementById('measureADRbutton').style.boxShadow=' 0 0 8px 2px #16c72e';
|
| 2255 |
-
// })
|
| 2256 |
-
|
| 2257 |
-
// document.getElementById('measureADRbutton').addEventListener('mouseout',function(){
|
| 2258 |
-
// document.getElementById('measureADRbutton').style.color='white';
|
| 2259 |
-
// document.getElementById('measureADRbutton').style.boxShadow='none';
|
| 2260 |
-
// });
|
| 2261 |
-
|
| 2262 |
-
// var legendbutton= document.createElement("button");
|
| 2263 |
-
// legendbutton.className='measureADRbutton2';
|
| 2264 |
-
// legendbutton.innerText='Legend and Data created';
|
| 2265 |
-
// legendbutton.style.backgroundColor='rgb(5, 43, 235)';
|
| 2266 |
-
// legendbutton.addEventListener('mouseover',function(){
|
| 2267 |
-
// legendbutton.style.boxShadow='0 0 8px 2px rgb(5, 43, 235)';
|
| 2268 |
-
// })
|
| 2269 |
-
// legendbutton.addEventListener('mouseout',function(){
|
| 2270 |
-
// legendbutton.style.boxShadow='none';
|
| 2271 |
-
// })
|
| 2272 |
-
|
| 2273 |
-
// legendbutton.addEventListener('click',function(){
|
| 2274 |
-
// window.open( spreadsheetURL);
|
| 2275 |
-
|
| 2276 |
-
// })
|
| 2277 |
-
// underimg.append(legendbutton);
|
| 2278 |
-
|
| 2279 |
-
// })
|
| 2280 |
-
|
| 2281 |
-
// }
|
| 2282 |
|
| 2283 |
}
|
| 2284 |
//___________________________________________________________________________________________________________
|
| 2285 |
//___________________________________________________________________________________________________________
|
| 2286 |
document.getElementById("myForm").addEventListener("submit", function (e) {
|
| 2287 |
-
|
| 2288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2289 |
});
|
|
|
|
| 2290 |
////////////////////////////////////////////
|
| 2291 |
var measitemVal='';
|
| 2292 |
|
|
@@ -2930,7 +3226,7 @@ console.log()
|
|
| 2930 |
if (sectionNumber.startsWith('2.7'))
|
| 2931 |
{
|
| 2932 |
textextra= cloneExtra.children[0]
|
| 2933 |
-
textextra.style.backgroundColor = "
|
| 2934 |
textextra.style.cursor='not-allowed';
|
| 2935 |
textextra.disabled="disabled";
|
| 2936 |
|
|
@@ -2938,7 +3234,7 @@ if (sectionNumber.startsWith('2.7'))
|
|
| 2938 |
if (sectionNumber.startsWith('2.8'))
|
| 2939 |
{
|
| 2940 |
text2extra= cloneExtra.children[3]
|
| 2941 |
-
text2extra.style.backgroundColor = "
|
| 2942 |
text2extra.style.cursor='not-allowed';
|
| 2943 |
text2extra.disabled="disabled";
|
| 2944 |
}
|
|
@@ -3375,9 +3671,12 @@ function filterFunction(id) {
|
|
| 3375 |
input = document.getElementById(id);
|
| 3376 |
filter = input.value.toUpperCase();
|
| 3377 |
if (id.toString().startsWith('tomeasure'))
|
| 3378 |
-
|
|
|
|
|
|
|
| 3379 |
else
|
| 3380 |
-
a = document.getElementById("relvselectid").children;
|
|
|
|
| 3381 |
// a = div.getElementsByTagName("option");
|
| 3382 |
for (i = 0; i < a.length; i++) {
|
| 3383 |
txtValue = a[i].textContent || a[i].innerText;
|
|
@@ -3401,7 +3700,7 @@ document.getElementById("refreshDropboxButtonID").disabled=false;
|
|
| 3401 |
|
| 3402 |
document.getElementById("refreshDropboxButtonID").onclick = function()
|
| 3403 |
{
|
| 3404 |
-
TopTextModal.textContent='Warning
|
| 3405 |
if (document.getElementById("refreshDropboxButtonID").disabled==false)
|
| 3406 |
overlayme.style.display = "block";
|
| 3407 |
overlaymeText.textContent='The console updates projects retrieved from Dropbox automatically at 9:00 am and 9:00 p.m. If you need to access any projects in between, just click on this button. Please note that it will refresh the files related to the project you chose only.';
|
|
@@ -3415,7 +3714,7 @@ var TopTextModal = document.getElementById("TopTextModalWarning");
|
|
| 3415 |
document.getElementById("refreshAPIbutton").disabled=false;
|
| 3416 |
document.getElementById("refreshAPIbutton").onclick = function()
|
| 3417 |
{
|
| 3418 |
-
TopTextModal.textContent='Warning
|
| 3419 |
if (document.getElementById("refreshAPIbutton").disabled==false)
|
| 3420 |
{
|
| 3421 |
console.log(overlaymeText.textContent)
|
|
@@ -3432,7 +3731,8 @@ document.getElementById("popupforextratext").onclick = function(){
|
|
| 3432 |
if (sectionNumber.startsWith('2.7'))
|
| 3433 |
{
|
| 3434 |
textextra= document.getElementById("textextra")
|
| 3435 |
-
textextra.style.backgroundColor = "
|
|
|
|
| 3436 |
textextra.style.cursor='not-allowed';
|
| 3437 |
textextra.disabled="disabled";
|
| 3438 |
|
|
@@ -3440,7 +3740,7 @@ if (sectionNumber.startsWith('2.7'))
|
|
| 3440 |
if (sectionNumber.startsWith('2.8'))
|
| 3441 |
{
|
| 3442 |
text2extra= document.getElementById("text2extra")
|
| 3443 |
-
text2extra.style.backgroundColor = "
|
| 3444 |
text2extra.style.cursor='not-allowed';
|
| 3445 |
text2extra.disabled="disabled";
|
| 3446 |
}
|
|
@@ -3460,7 +3760,7 @@ function confirmDialogR() {
|
|
| 3460 |
/* code executed if confirm is clicked */
|
| 3461 |
overlayme.style.display = "none";
|
| 3462 |
console.log(document.getElementById("confirm").parentElement.parentElement.children[0].textContent)
|
| 3463 |
-
if (document.getElementById("confirm").parentElement.parentElement.children[0].textContent.startsWith('
|
| 3464 |
{
|
| 3465 |
console.log('hereeeeeeeee')
|
| 3466 |
callrefreshDropbox();
|
|
|
|
| 33 |
{% include 'loading.html' %}
|
| 34 |
</div>
|
| 35 |
<!--Main tab links-->
|
| 36 |
+
<div class="tab" >
|
| 37 |
<div class="container" id="toggle">
|
| 38 |
<div class="bar1"></div>
|
| 39 |
<div class="bar2"></div>
|
|
|
|
| 45 |
<a class="tablinks" id="LegendHist" href="{{ url_for('legendDirectory') }}">
|
| 46 |
Legends History <i class="fa fa-caret-down"></i>
|
| 47 |
</a>
|
| 48 |
+
<!-- Container for dynamic tabs -->
|
| 49 |
+
|
| 50 |
+
<div id="dynamicTabs" class="dynamicdropdownclass">
|
| 51 |
+
<!-- This will be the dropdown content (FramestabsDropdown) -->
|
| 52 |
+
<!-- <div id="FramestabsDropdown"></div> -->
|
| 53 |
+
</div>
|
| 54 |
<button class="dropbtn" onclick="userguideclick()"><img id="infoImg" src="data:image/png;base64,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"></button>
|
|
|
|
| 55 |
|
| 56 |
+
</div>
|
| 57 |
+
<div id="FramestabsDropdown"> </div>
|
| 58 |
<div id="mySidebar" class="slide-out">
|
| 59 |
<div id="menuOptions">
|
| 60 |
<li onclick="openTab(event, 'home')" >Measure Plans </li>
|
|
|
|
| 63 |
</div>
|
| 64 |
|
| 65 |
<div id="home" class="tabcontent" >
|
| 66 |
+
|
| 67 |
<div id="loading" hidden> </div>
|
| 68 |
|
| 69 |
<div id="canvaswindow" hidden="until-found">
|
|
|
|
| 76 |
</div>
|
| 77 |
<input type="button" value="Save" id="savecanvas" />
|
| 78 |
</div>
|
| 79 |
+
|
| 80 |
<div id="rightside" hidden="until-found">
|
| 81 |
+
|
| 82 |
<div id="backgroundimg" >
|
| 83 |
<div id="imgs">
|
| 84 |
<!-- image here -->
|
|
|
|
| 130 |
|
| 131 |
</div>
|
| 132 |
<div id="measureCheckbox">
|
| 133 |
+
<!-- <select style="margin-left: -1%;" hidden name="measureselectname" id="measureselectid" multiple size="5"></select> -->
|
| 134 |
+
<div id="measureContainer" hidden required></div>
|
| 135 |
<div id="dxfdiv" hidden="until-found">
|
| 136 |
<input type="button" id="pdftodxfFileButton" onclick="document.getElementById('pdftodxfFile').click();" value="Upload DXF File" >
|
| 137 |
<input type="file" id="pdftodxfFile" name="pdftodxfFilename" >
|
|
|
|
| 152 |
<input type="search" onkeyup=filterFunction(this.id) id="relevantSearchInput">
|
| 153 |
<br>
|
| 154 |
<div id ="relvdiv">
|
| 155 |
+
<div id="relvselectid" hidden></div>
|
| 156 |
+
<!-- <select style="margin-left: -1%;" hidden name="relvselectname" id="relvselectid" multiple size="5"> </select> -->
|
| 157 |
<iframe id="pdfFrame" hidden></iframe>
|
| 158 |
</div>
|
| 159 |
</div>
|
|
|
|
| 193 |
</div>
|
| 194 |
<audio id="myAudio" autoplay></audio>
|
| 195 |
</form>
|
| 196 |
+
<div id="progressBar" hidden>
|
| 197 |
+
<div id="progress">0%</div>
|
| 198 |
+
</div>
|
| 199 |
|
| 200 |
<div id ="duplicater" class="duplicaterclass" hidden="until-found">
|
| 201 |
<label id="labelArrayId" hidden="until-found"> </label>
|
|
|
|
| 280 |
</ul>
|
| 281 |
|
| 282 |
</div>
|
| 283 |
+
<div id="consoleContent"></div>
|
| 284 |
<div class="dropdown-content">
|
| 285 |
<div id="userguidetext">
|
| 286 |
<div id="textfirstpage">
|
|
|
|
| 556 |
<input type="number" id="textextra" name="text0name" placeholder="Eg: 1" >
|
| 557 |
<input type="text" id="text0extra" name="text1name" placeholder="Eg: Wall Type" >
|
| 558 |
<input type="text" id="text1extra" name="text2name" placeholder="Eg:NBS K10/" >
|
| 559 |
+
<input type="number" id="text2extra" name="text3name" placeholder="Eg: 3" min="0">
|
| 560 |
|
| 561 |
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script>
|
| 562 |
<lord-icon
|
|
|
|
| 613 |
<script >
|
| 614 |
|
| 615 |
///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
function updateProgressBar(value) {
|
| 619 |
+
const progressBar = document.getElementById('progress');
|
| 620 |
+
progressBar.style.width = value + '%';
|
| 621 |
+
progressBar.innerText = Math.round(value) + '%';
|
| 622 |
+
}
|
| 623 |
+
|
| 624 |
+
|
| 625 |
// Function to send the Dropbox link and keyword to the server
|
| 626 |
function getURLParams() {
|
| 627 |
const urlParams = new URLSearchParams(window.location.search);
|
|
|
|
| 707 |
|
| 708 |
displayprjnames()
|
| 709 |
function displayprjnames(){
|
| 710 |
+
|
| 711 |
+
var eventSource = new EventSource('/getprojectnames/');
|
| 712 |
+
document.getElementById('progressBar').removeAttribute('hidden')
|
| 713 |
+
document.getElementById('progressBar').style.display='block';
|
| 714 |
+
eventSource.onmessage = function (event) {
|
| 715 |
+
var progress = parseInt(event.data); // Progress value from Flask
|
| 716 |
+
if (progress <= 100) {
|
| 717 |
+
console.log(progress); // Log progress for debugging
|
| 718 |
+
document.getElementById('progress').style.width = progress + '%';
|
| 719 |
+
document.getElementById('progress').textContent = progress + '%';
|
| 720 |
+
} else {
|
| 721 |
+
// Final data handling when progress reaches 100%
|
| 722 |
+
console.log('Process completed!');
|
| 723 |
+
|
| 724 |
+
// Parse and handle the final response data (documentsToMeasure, RelevantDocuments, extracted_path)
|
| 725 |
+
var data = JSON.parse(event.data); // Assuming the result is a JSON array
|
| 726 |
+
console.log('Final result:', data);
|
| 727 |
+
// You can use this data to update your page or handle it accordingly
|
| 728 |
+
|
| 729 |
+
eventSource.close(); // Close the connection when finished
|
| 730 |
+
document.getElementById('progressBar').setAttribute('hidden',true)
|
| 731 |
+
document.getElementById('progressBar').style.display='none';
|
| 732 |
+
document.getElementById('progress').style.width = '0%'; // Reset progress for the next process
|
| 733 |
+
document.getElementById('progress').textContent = '0%';
|
| 734 |
+
|
| 735 |
+
document.getElementById("all").style.display = "none";
|
| 736 |
+
prjids=data[1];
|
| 737 |
+
var op0 = document.createElement("OPTION") ;
|
| 738 |
+
op0.text= 'Projects'
|
| 739 |
+
op0.value= "";
|
| 740 |
+
op0.hidden=true;
|
| 741 |
+
firstdropdown.add(op0);
|
| 742 |
+
for (let i=0;i<data[0].length;i++)
|
| 743 |
+
{
|
| 744 |
+
opt=document.createElement("option");
|
| 745 |
+
opt.textContent=data[0][i];
|
| 746 |
+
opt.text=data[0][i];
|
| 747 |
+
firstdropdown.append(opt);
|
| 748 |
+
PrjNamesArray.push(data[0][i]);
|
| 749 |
+
}
|
| 750 |
|
| 751 |
+
}
|
| 752 |
+
}
|
| 753 |
+
|
| 754 |
+
|
| 755 |
+
eventSource.onerror = function (error) {
|
| 756 |
+
console.error('Error occurred:', error);
|
| 757 |
+
eventSource.close(); // Close on error
|
| 758 |
+
PopupElement.textContent='Error occured while retrieving the Project Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 759 |
+
ShowPopUp();
|
| 760 |
+
};
|
| 761 |
}
|
| 762 |
/*Get chosen value and send to flask to get project parts*/
|
| 763 |
|
|
|
|
| 821 |
function displayprojsections(projectid,Partid){
|
| 822 |
console.log(seconddropdown.selectedIndex)
|
| 823 |
document.getElementById("all").style.display = "block";
|
| 824 |
+
if (measSelect && measSelect.hasChildNodes()) {
|
| 825 |
+
while (measSelect.firstChild) {
|
| 826 |
+
measSelect.removeChild(measSelect.firstChild);
|
| 827 |
+
}
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
if (relvSelect && relvSelect.hasChildNodes()) {
|
| 831 |
+
while (relvSelect.firstChild) {
|
| 832 |
+
relvSelect.removeChild(relvSelect.firstChild);
|
| 833 |
+
}
|
| 834 |
+
}
|
| 835 |
$.get('/getprojectsections/'+JSON.stringify([projectid,Partid]))
|
| 836 |
.success(function(data){
|
| 837 |
document.getElementById("all").style.display = "none";
|
|
|
|
| 1098 |
//___________________________________________________________________________________________________________
|
| 1099 |
/*Toggle Tab View of Home and Legend along with the Menu bar icon*/
|
| 1100 |
function openTab(evt, tabname) {
|
|
|
|
| 1101 |
var i, tabcontent, tablinks;
|
| 1102 |
|
| 1103 |
+
|
| 1104 |
+
|
| 1105 |
+
// Hide all tab contents
|
| 1106 |
tabcontent = document.getElementsByClassName("tabcontent");
|
| 1107 |
for (i = 0; i < tabcontent.length; i++) {
|
| 1108 |
tabcontent[i].style.display = "none";
|
| 1109 |
}
|
| 1110 |
|
| 1111 |
+
// Remove "active" class from all tab buttons
|
| 1112 |
tablinks = document.getElementsByClassName("tablinks");
|
| 1113 |
for (i = 0; i < tablinks.length; i++) {
|
| 1114 |
tablinks[i].className = tablinks[i].className.replace(" active", "");
|
| 1115 |
}
|
| 1116 |
|
| 1117 |
+
// Show selected tab content and mark button as active
|
| 1118 |
+
var tab = document.getElementById(tabname);
|
| 1119 |
+
if (tab) {
|
| 1120 |
+
tab.style.display = "block";
|
| 1121 |
+
tab.className += " active";
|
| 1122 |
+
// evt.currentTarget.className += " active";
|
| 1123 |
+
} else {
|
| 1124 |
+
console.error('Tab content with ID ' + tabname + ' not found.');
|
| 1125 |
+
}
|
|
|
|
| 1126 |
}
|
| 1127 |
+
|
| 1128 |
+
// Start with the first tab open
|
| 1129 |
document.getElementById("pagetitle").click();
|
| 1130 |
|
| 1131 |
+
// Function to add a new tab dynamically
|
| 1132 |
+
function addIframeTab(title, url) {
|
| 1133 |
+
var tabId = "tab_" + Date.now(); // Unique ID for each tab
|
| 1134 |
+
|
| 1135 |
+
// Create a new button in the ribbon
|
| 1136 |
+
var newTab = document.createElement("button");
|
| 1137 |
+
newTab.className = "tablinks";
|
| 1138 |
+
newTab.innerHTML = title + ' <i class="fa fa-times" onclick="removeTab(event, \'' + tabId + '\')"></i>';
|
| 1139 |
+
newTab.onclick = function (event) {
|
| 1140 |
+
// Delay opening the tab to ensure it has been added to the DOM
|
| 1141 |
+
setTimeout(function() {
|
| 1142 |
+
openTab(event, tabId);
|
| 1143 |
+
}, 10); // 10ms delay to allow DOM rendering
|
| 1144 |
+
};
|
| 1145 |
|
| 1146 |
+
// Dynamically create tab labels and append them to FramestabsDropdown
|
| 1147 |
+
var tabnameDrpdwn = document.createElement("label");
|
| 1148 |
+
tabnameDrpdwn.className = "tabslabel";
|
| 1149 |
+
tabnameDrpdwn.innerHTML = title
|
| 1150 |
+
// Append new tab button to the dynamicTabs container
|
| 1151 |
+
document.getElementById("dynamicTabs").appendChild(newTab);
|
| 1152 |
+
document.getElementById("FramestabsDropdown").appendChild(tabnameDrpdwn);
|
| 1153 |
+
tabnameDrpdwn.addEventListener('click',function(){
|
| 1154 |
+
openTab('click',tabId)
|
| 1155 |
+
})
|
| 1156 |
+
|
| 1157 |
+
// Event listener for mouseover on dynamicTabs
|
| 1158 |
+
document.getElementById("dynamicTabs").addEventListener('mouseover', function() {
|
| 1159 |
+
// Check and log all the labels inside FramestabsDropdown
|
| 1160 |
+
const labels = document.getElementById("FramestabsDropdown").children;
|
| 1161 |
+
if (labels.length > 0) {
|
| 1162 |
+
document.getElementById("FramestabsDropdown").style.display = 'block';
|
| 1163 |
+
}
|
| 1164 |
+
});
|
| 1165 |
|
| 1166 |
+
document.getElementById("FramestabsDropdown").addEventListener('mouseover', function() {
|
| 1167 |
+
// Stay visible when hovering over the dropdown
|
| 1168 |
+
document.getElementById("FramestabsDropdown").style.display = 'block';
|
| 1169 |
+
});
|
| 1170 |
|
| 1171 |
+
document.addEventListener('click', function(event) {
|
| 1172 |
+
const dropdown = document.getElementById("FramestabsDropdown");
|
| 1173 |
|
| 1174 |
+
if (!dropdown.contains(event.target)) {
|
| 1175 |
+
dropdown.style.display = 'none';
|
| 1176 |
+
}
|
| 1177 |
+
});
|
| 1178 |
|
| 1179 |
+
// Handle clicks inside iframes
|
| 1180 |
+
document.querySelectorAll("iframe").forEach((iframe) => {
|
| 1181 |
+
iframe.contentWindow?.addEventListener("mousedown", function () {
|
| 1182 |
+
document.getElementById("FramestabsDropdown").style.display = "none";
|
| 1183 |
+
});
|
| 1184 |
+
});
|
| 1185 |
+
|
| 1186 |
+
|
| 1187 |
+
|
| 1188 |
+
//FramestabsDropdown
|
| 1189 |
+
// Create a corresponding iframe container in the console
|
| 1190 |
+
var iframeContainer = document.createElement("div");
|
| 1191 |
+
iframeContainer.id = tabId;
|
| 1192 |
+
iframeContainer.className = "tabcontent";
|
| 1193 |
+
iframeContainer.style.display = "none"; // Initially hidden
|
| 1194 |
+
|
| 1195 |
+
// Create the iframe and set its source
|
| 1196 |
+
var iframe = document.createElement("iframe");
|
| 1197 |
+
iframe.src = url;
|
| 1198 |
+
iframe.style.width = "100%";
|
| 1199 |
+
iframe.style.height = "100vh";
|
| 1200 |
+
|
| 1201 |
+
iframeContainer.appendChild(iframe);
|
| 1202 |
+
|
| 1203 |
+
// Append the iframe container to the consoleContent area
|
| 1204 |
+
document.getElementById("consoleContent").appendChild(iframeContainer);
|
| 1205 |
+
|
| 1206 |
+
// Open the new tab after the content is added
|
| 1207 |
+
setTimeout(function() {
|
| 1208 |
+
newTab.click();
|
| 1209 |
+
}, 10); // Short delay before clicking the new tab
|
| 1210 |
+
}
|
| 1211 |
+
|
| 1212 |
+
// Function to remove a tab
|
| 1213 |
+
function removeTab(event, tabId) {
|
| 1214 |
+
event.stopPropagation(); // Prevent tab click event
|
| 1215 |
+
|
| 1216 |
+
var tabButton = event.target.parentElement;
|
| 1217 |
+
var tabContent = document.getElementById(tabId);
|
| 1218 |
+
|
| 1219 |
+
if (tabButton) tabButton.remove();
|
| 1220 |
+
if (tabContent) tabContent.remove();
|
| 1221 |
+
|
| 1222 |
+
// Switch to the home tab if the removed tab was active
|
| 1223 |
+
document.getElementById("pagetitle").click();
|
| 1224 |
+
}
|
| 1225 |
+
function downloadPdf(pdfname,downloadPDFName) {
|
| 1226 |
console.log('pdfname===',pdfname)
|
| 1227 |
fetch('/get-pdf/'+JSON.stringify(pdfname))
|
| 1228 |
.then(response => response.blob())
|
|
|
|
| 1230 |
const url = URL.createObjectURL(blob);
|
| 1231 |
var link = document.createElement('a');
|
| 1232 |
link.href = url;
|
| 1233 |
+
link.download = downloadPDFName;
|
| 1234 |
link.dispatchEvent(new MouseEvent('click'));
|
| 1235 |
})
|
| 1236 |
.catch(error => console.error('Error fetching PDF:', error));
|
|
|
|
| 1486 |
//___________________________________________________________________________________________________________
|
| 1487 |
|
| 1488 |
//Retrieves list of projects
|
| 1489 |
+
var doorSchedulePDF;
|
| 1490 |
function getproj(){
|
| 1491 |
getALLMCTNAMES();
|
| 1492 |
|
|
|
|
| 1498 |
|
| 1499 |
var sections = document.getElementsByClassName("selectionsProjs")[0];
|
| 1500 |
chooseFirstdrpdwn();
|
| 1501 |
+
var eventSource = new EventSource('/getmethod/' + JSON.stringify(projectVal));
|
| 1502 |
+
document.getElementById('progressBar').removeAttribute('hidden')
|
| 1503 |
+
document.getElementById('progressBar').style.display='block';
|
| 1504 |
+
eventSource.onmessage = function (event) {
|
| 1505 |
+
var progress = parseInt(event.data); // Progress value from Flask
|
| 1506 |
+
if (progress <= 100) {
|
| 1507 |
+
console.log(progress); // Log progress for debugging
|
| 1508 |
+
document.getElementById('progress').style.width = progress + '%';
|
| 1509 |
+
document.getElementById('progress').textContent = progress + '%';
|
| 1510 |
+
} else {
|
| 1511 |
+
// Final data handling when progress reaches 100%
|
| 1512 |
+
console.log('Process completed!');
|
| 1513 |
+
|
| 1514 |
+
// Parse and handle the final response data (documentsToMeasure, RelevantDocuments, extracted_path)
|
| 1515 |
+
var data = JSON.parse(event.data); // Assuming the result is a JSON array
|
| 1516 |
+
console.log('Final result:', data);
|
| 1517 |
+
// You can use this data to update your page or handle it accordingly
|
| 1518 |
+
|
| 1519 |
+
eventSource.close(); // Close the connection when finished
|
| 1520 |
+
document.getElementById('progressBar').setAttribute('hidden',true)
|
| 1521 |
+
document.getElementById('progressBar').style.display='none';
|
| 1522 |
+
document.getElementById('progress').style.width = '0%'; // Reset progress for the next process
|
| 1523 |
+
document.getElementById('progress').textContent = '0%';
|
| 1524 |
+
|
| 1525 |
+
|
| 1526 |
+
document.getElementById('refreshDropboxButtonID').style.display = "block";
|
| 1527 |
+
document.getElementById("all").style.display = "none";
|
| 1528 |
+
if (sections.value.startsWith('3.2') || sections.value.startsWith('3.3') || sections.value.startsWith('2.7') ){
|
| 1529 |
+
document.getElementById('dxfdiv').removeAttribute('hidden');
|
| 1530 |
+
document.getElementById('pdftodxfFile').setAttribute('required',true)
|
| 1531 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1532 |
|
| 1533 |
+
else{
|
| 1534 |
+
document.getElementById('dxfdiv').setAttribute('hidden',true)
|
| 1535 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1536 |
|
| 1537 |
+
extracted_path=data[2]
|
| 1538 |
+
var docsToMeasure=data[0]; //
|
| 1539 |
+
var relvDocs=data[1]
|
| 1540 |
+
var projname = document.getElementsByClassName("selectionsProj")[0];
|
| 1541 |
+
var projpart = document.getElementsByClassName("selectionsProjp")[0];
|
| 1542 |
+
var projsec = document.getElementsByClassName("selectionsProjs")[0];
|
| 1543 |
|
| 1544 |
+
var meas = document.getElementById("measureCheckbox") ;
|
| 1545 |
+
var relv = document.getElementById("relvdiv") ;
|
| 1546 |
+
const measids=[];
|
| 1547 |
+
const relvids=[];
|
| 1548 |
+
const measoptns=[];
|
| 1549 |
|
| 1550 |
+
// var measSelect = document.getElementById("measureselectid");
|
| 1551 |
+
var measSelect = document.getElementById("measureContainer");
|
| 1552 |
+
|
| 1553 |
+
var relvSelect = document.getElementById("relvselectid");
|
| 1554 |
+
var levelcheckbox= document.getElementById("levelcheckbox");
|
| 1555 |
+
|
| 1556 |
+
|
| 1557 |
+
measSelect.removeAttribute("hidden");
|
| 1558 |
+
relvSelect.removeAttribute("hidden");
|
| 1559 |
+
if (measSelect && measSelect.hasChildNodes()) {
|
| 1560 |
+
while (measSelect.firstChild) {
|
| 1561 |
+
measSelect.removeChild(measSelect.firstChild);
|
| 1562 |
+
}
|
| 1563 |
+
}
|
| 1564 |
+
|
| 1565 |
+
var optn2 = document.createElement("div"); // Use a <div> instead of <option>
|
| 1566 |
+
optn2.textContent = 'Select project to measure'; // Set text content
|
| 1567 |
+
optn2.hidden = true; // Keep it hidden
|
| 1568 |
+
optn2.id = 'hidden';
|
| 1569 |
+
|
| 1570 |
+
measSelect.appendChild(optn2); // Append to div instead of .add()
|
| 1571 |
+
document.getElementById("hidden").required = true;
|
| 1572 |
+
|
| 1573 |
+
|
| 1574 |
+
if (relvSelect && relvSelect.hasChildNodes()) {
|
| 1575 |
+
while (relvSelect.firstChild) {
|
| 1576 |
+
relvSelect.removeChild(relvSelect.firstChild);
|
| 1577 |
+
}
|
| 1578 |
+
}
|
| 1579 |
+
const nameSet = new Set(); // To track unique names
|
| 1580 |
+
const nameSetRelv = new Set(); // To track unique names
|
| 1581 |
+
|
| 1582 |
+
// Action foconst nameSet = new Set(); // To track unique names
|
| 1583 |
+
|
| 1584 |
+
// Action for when the checkbox is clicked
|
| 1585 |
+
function handleCheckboxChange(event) {
|
| 1586 |
+
// Uncheck all checkboxes before checking the current one
|
| 1587 |
+
document.querySelectorAll('input[name="measureCheckbox"]').forEach(checkbox => {
|
| 1588 |
+
checkbox.checked = false;
|
| 1589 |
+
});
|
| 1590 |
|
| 1591 |
+
// Check the current checkbox
|
| 1592 |
+
event.target.checked = true;
|
| 1593 |
|
| 1594 |
+
// Action when checkbox is clicked (e.g., log the selected project)
|
| 1595 |
+
let selectedValue = event.target.value;
|
| 1596 |
+
console.log("Selected project:", selectedValue);
|
| 1597 |
+
|
| 1598 |
+
// Highlight the selected item
|
| 1599 |
+
document.querySelectorAll(".measure-item").forEach(item => {
|
| 1600 |
+
item.style.backgroundColor = ''; // Reset background color for all items
|
| 1601 |
+
});
|
| 1602 |
+
event.target.closest(".measure-item").style.backgroundColor = '#d3f8d3'; // Highlight the selected item
|
| 1603 |
+
|
| 1604 |
+
|
| 1605 |
+
|
| 1606 |
+
// Show alert immediately to prompt the user
|
| 1607 |
if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) {
|
| 1608 |
+
// downloadPdf(selectedValue);
|
| 1609 |
+
downloadPdf(selectedValue,'DXF_File_:'+selectedValue)
|
| 1610 |
+
// window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
|
|
|
|
|
|
|
| 1611 |
}
|
| 1612 |
+
// else{
|
| 1613 |
+
// window.alert("Measure the purple shape drawn on the PDF using Foxit Reader, Bluebeam, or any other external tool, then enter its area and perimeter in your desired scale.");
|
| 1614 |
+
// }
|
| 1615 |
canvasimg='';
|
| 1616 |
ry=[[]];
|
| 1617 |
levelcheckbox.checked=false;
|
| 1618 |
+
pdfname=selectedValue;
|
| 1619 |
measSelect.style.boxShadow='none';
|
| 1620 |
|
| 1621 |
|
| 1622 |
document.getElementById("all").style.display = "block";
|
| 1623 |
|
| 1624 |
pixelArr=[projname.value, projpart.value,projsec.value, pdfname]
|
| 1625 |
+
// Open popup immediately before initiating the PDF download
|
| 1626 |
+
var eventSource = new EventSource('/pixelimg/' + JSON.stringify(pixelArr));
|
| 1627 |
+
document.getElementById('progressBar').removeAttribute('hidden')
|
| 1628 |
+
document.getElementById('progressBar').style.display='block';
|
| 1629 |
+
eventSource.onmessage = function (event) {
|
| 1630 |
+
var progress = parseInt(event.data); // Progress value from Flask
|
| 1631 |
+
if (progress <= 100) {
|
| 1632 |
+
console.log(progress); // Log progress for debugging
|
| 1633 |
+
document.getElementById('progress').style.width = progress + '%';
|
| 1634 |
+
document.getElementById('progress').textContent = progress + '%';
|
| 1635 |
+
} else {
|
| 1636 |
+
// Final data handling when progress reaches 100%
|
| 1637 |
+
console.log('Process completed!');
|
| 1638 |
+
|
| 1639 |
+
// Parse and handle the final response data (documentsToMeasure, RelevantDocuments, extracted_path)
|
| 1640 |
+
var data = JSON.parse(event.data); // Assuming the result is a JSON array
|
| 1641 |
+
console.log('Final result:', data);
|
| 1642 |
+
// You can use this data to update your page or handle it accordingly
|
| 1643 |
+
|
| 1644 |
+
eventSource.close(); // Close the connection when finished
|
| 1645 |
+
|
| 1646 |
+
document.getElementById('progressBar').setAttribute('hidden',true)
|
| 1647 |
+
document.getElementById('progressBar').style.display='none';
|
| 1648 |
+
document.getElementById('progress').style.width = '0%'; // Reset progress for the next process
|
| 1649 |
+
document.getElementById('progress').textContent = '0%';
|
| 1650 |
+
document.getElementById("all").style.display = "none";
|
| 1651 |
+
// Display link or any additional data if needed
|
| 1652 |
+
window.open(data[2]);
|
| 1653 |
+
downloadPdf(pdfname,'Pixel_Conversion_File_:'+pdfname)
|
| 1654 |
+
document.getElementById("all").style.display = "none";
|
| 1655 |
+
|
| 1656 |
+
document.getElementById('measureADRbutton').onclick= function()
|
| 1657 |
+
{
|
| 1658 |
+
if (!areaRatio.value){
|
| 1659 |
+
if (!(projsec.value.startsWith('3.2')) & !(projsec.value.startsWith('2.8')) & !(projsec.value.startsWith('3.3')) & !(projsec.value.startsWith('2.7')) )
|
| 1660 |
+
areaRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
|
| 1661 |
+
}
|
| 1662 |
+
if (!prmRatio.value)
|
| 1663 |
+
{
|
| 1664 |
+
if (!(projsec.value.startsWith('2.8')))
|
| 1665 |
+
prmRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
|
| 1666 |
+
}
|
| 1667 |
+
|
| 1668 |
+
}
|
| 1669 |
+
document.getElementById('radiosColors').removeAttribute('hidden');
|
| 1670 |
+
var scalelbl= document.createElement("label");
|
| 1671 |
+
scalelbl.innerText='Scale Document';
|
| 1672 |
+
scalelbl.id='measureLabel';
|
| 1673 |
+
var br1= document.createElement("br");
|
| 1674 |
+
var areadiv=document.createElement("div");
|
| 1675 |
+
areadiv.id='areadiv'
|
| 1676 |
+
var areaRatiolbl= document.createElement("label");
|
| 1677 |
+
areaRatiolbl.innerText='Area:'
|
| 1678 |
+
areaRatiolbl.id='radiolbl';
|
| 1679 |
+
|
| 1680 |
+
var areaRatio= document.createElement("input");
|
| 1681 |
+
areaRatio.type='number';
|
| 1682 |
+
areaRatio.id='arealvlinput';
|
| 1683 |
+
areaRatio.className='lvlinput';
|
| 1684 |
+
areaRatio.name='areaRatio';
|
| 1685 |
+
areaRatio.style.marginLeft='78px';
|
| 1686 |
+
areaRatio.style.textAlign='right';
|
| 1687 |
+
areaRatio.step=".0000001";
|
| 1688 |
+
areaRatio.min = "0"; // Allow only positive numbers (>= 0)
|
| 1689 |
+
if( projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.1') || projsec.value.startsWith('2.7')){
|
| 1690 |
+
areaRatio.setAttribute('disabled',true)
|
| 1691 |
+
areaRatio.style.cursor='not-allowed';
|
| 1692 |
+
areaRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1693 |
+
document.getElementById('selectunitA').setAttribute('disabled',true)
|
| 1694 |
+
document.getElementById('selectunitA').style.cursor='not-allowed';
|
| 1695 |
+
document.getElementById('selectunitA').style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1696 |
+
}
|
| 1697 |
+
|
| 1698 |
+
else{ // section 1.0
|
| 1699 |
+
areaRatio.removeAttribute('disabled')
|
| 1700 |
+
areaRatio.style.cursor='pointer';
|
| 1701 |
+
document.getElementById('selectunitA').removeAttribute('disabled')
|
| 1702 |
+
document.getElementById('selectunitA').style.cursor='pointer';
|
| 1703 |
+
}
|
| 1704 |
+
areaRatio.addEventListener('change',function(){
|
| 1705 |
+
areaRatio.value=(Number(areaRatio.value)).toFixed(7)
|
| 1706 |
+
areaRatio.style.boxShadow='none';
|
| 1707 |
+
})
|
| 1708 |
+
areaRatio.required=true;
|
| 1709 |
+
selectunitA=document.getElementById('selectunitA')
|
| 1710 |
+
selectunitA.removeAttribute('hidden')
|
| 1711 |
+
|
| 1712 |
+
areadiv.append(areaRatiolbl,areaRatio,selectunitA)
|
| 1713 |
+
var br2= document.createElement("br");
|
| 1714 |
+
var br3= document.createElement("br");
|
| 1715 |
+
var prmdiv=document.createElement("div");
|
| 1716 |
+
prmdiv.id='prmdiv'
|
| 1717 |
+
var prmRatiolbl= document.createElement("label");
|
| 1718 |
+
prmRatiolbl.innerText='Perimeter:'
|
| 1719 |
+
prmRatiolbl.id='radiolbl';
|
| 1720 |
+
|
| 1721 |
+
var prmRatio= document.createElement("input");
|
| 1722 |
+
prmRatio.type='number';
|
| 1723 |
+
prmRatio.id='perimlvlinput';
|
| 1724 |
+
prmRatio.className='lvlinput';
|
| 1725 |
+
prmRatio.name='prmRatio';
|
| 1726 |
+
prmRatio.style.textAlign='right';
|
| 1727 |
+
prmRatio.style.marginLeft='49px';
|
| 1728 |
+
prmRatio.step=".0000001";
|
| 1729 |
+
prmRatio.min = "0"; // Allow only positive numbers (>= 0)
|
| 1730 |
+
prmRatio.addEventListener('change',function(){
|
| 1731 |
+
prmRatio.value=(Number(prmRatio.value)).toFixed(7)
|
| 1732 |
+
prmRatio.style.boxShadow='none';
|
| 1733 |
+
})
|
| 1734 |
+
prmRatio.required=true;
|
| 1735 |
+
selectunitP=document.getElementById('selectunitP')
|
| 1736 |
+
selectunitP.removeAttribute('hidden')
|
| 1737 |
+
|
| 1738 |
+
prmdiv.append(prmRatiolbl, prmRatio,selectunitP)
|
| 1739 |
+
var ratiosdiv= document.getElementById("ratios");
|
| 1740 |
+
ratiosdiv.innerHTML='';
|
| 1741 |
+
ratiosdiv.append(scalelbl);
|
| 1742 |
+
ratiosdiv.append(br1);
|
| 1743 |
+
ratiosdiv.append(areadiv)
|
| 1744 |
+
ratiosdiv.append(prmdiv)
|
| 1745 |
+
areainpixels=data[0];
|
| 1746 |
+
prminpixels=data[1];
|
| 1747 |
+
|
| 1748 |
+
|
| 1749 |
+
if( projsec.value.startsWith('2.8')) {
|
| 1750 |
+
areaRatio.setAttribute('disabled',true)
|
| 1751 |
+
areaRatio.style.cursor='not-allowed';
|
| 1752 |
+
areaRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1753 |
+
document.getElementById('selectunitA').setAttribute('disabled',true)
|
| 1754 |
+
document.getElementById('selectunitA').style.cursor='not-allowed';
|
| 1755 |
+
document.getElementById('selectunitA').style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1756 |
+
|
| 1757 |
+
prmRatio.setAttribute('disabled',true)
|
| 1758 |
+
prmRatio.style.cursor='not-allowed';
|
| 1759 |
+
prmRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1760 |
+
document.getElementById('selectunitP').setAttribute('disabled',true)
|
| 1761 |
+
document.getElementById('selectunitP').style.cursor='not-allowed';
|
| 1762 |
+
document.getElementById('selectunitP').style.backgroundColor='rgba(101, 101, 101, 0.27)'
|
| 1763 |
+
}
|
| 1764 |
+
};
|
| 1765 |
+
}
|
| 1766 |
|
| 1767 |
|
| 1768 |
+
eventSource.onerror = function (error) {
|
| 1769 |
+
console.error('Error occurred:', error);
|
| 1770 |
+
eventSource.close(); // Close on error
|
| 1771 |
+
PopupElement.textContent='Error occured while uploading the pdf to the Dropbox. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 1772 |
+
ShowPopUp();
|
| 1773 |
+
};
|
| 1774 |
+
|
| 1775 |
+
selectunitA.addEventListener('change',function(){
|
| 1776 |
+
value=document.getElementById('selectunitA').value
|
| 1777 |
+
if (value=='mm2')
|
| 1778 |
+
ratioAunit=1000000;
|
| 1779 |
+
else
|
| 1780 |
+
ratioAunit=1;
|
| 1781 |
+
})
|
| 1782 |
+
selectunitP.addEventListener('change',function(){
|
| 1783 |
+
value=document.getElementById('selectunitP').value
|
| 1784 |
+
if (value=='mm'){
|
| 1785 |
+
ratioPunit=1000;
|
| 1786 |
+
}
|
| 1787 |
+
else
|
| 1788 |
+
ratioPunit=1;
|
| 1789 |
+
|
| 1790 |
+
})
|
| 1791 |
+
// }
|
| 1792 |
+
// for 2.8 multiple pdfs
|
| 1793 |
+
// else{
|
| 1794 |
+
// pdfnames=getSelectValues(elem)
|
| 1795 |
+
// }
|
| 1796 |
+
}
|
| 1797 |
+
|
| 1798 |
+
// Action for when the label is clicked (no checkbox change)
|
| 1799 |
+
function handleLabelClick(event) {
|
| 1800 |
+
// Action when label is clicked (e.g., log the selected project via the label)
|
| 1801 |
+
let selectedLabel = event.target.textContent;
|
| 1802 |
+
console.log("Label clicked: ", selectedLabel);
|
| 1803 |
+
// Optional: Highlight the selected item
|
| 1804 |
+
document.querySelectorAll(".measure-item").forEach(item => {
|
| 1805 |
+
item.style.backgroundColor = ''; // Reset background color for all items
|
| 1806 |
+
});
|
| 1807 |
+
// event.target.closest(".measure-item").style.backgroundColor = '#919592'; // Highlight the selected item
|
| 1808 |
+
// Show loading indicator
|
| 1809 |
+
document.getElementById("all").style.display = "block";
|
| 1810 |
+
fetch('/getdropboxurl/'+ JSON.stringify(selectedLabel), {
|
| 1811 |
+
|
| 1812 |
+
method: 'POST',
|
| 1813 |
+
headers: { 'Content-Type': 'application/json' },
|
| 1814 |
+
body: JSON.stringify({ filename: "your_pdf_filename_here.pdf" })
|
| 1815 |
+
})
|
| 1816 |
+
.then(response => response.blob())
|
| 1817 |
+
.then(blob => {
|
| 1818 |
+
document.getElementById("all").style.display = "none";
|
| 1819 |
+
const url = URL.createObjectURL(blob);
|
| 1820 |
+
// Set the URL to the iframe's src to load the content inside the page
|
| 1821 |
+
addIframeTab(selectedLabel,url);
|
| 1822 |
+
// addIframeTab("Google", "https://www.google.com");
|
| 1823 |
+
})
|
| 1824 |
+
.catch(function(jqXHR, textStatus, errorThrown) {
|
| 1825 |
+
// Handle error
|
| 1826 |
+
PopupElement.textContent = 'Error occurred while retrieving the dropbox URL. Refresh and try again. If the error continues, please contact the ADR team to fix it.';
|
| 1827 |
+
ShowPopUp();
|
| 1828 |
+
});
|
| 1829 |
+
}
|
| 1830 |
|
| 1831 |
+
for (let i = 0; i < docsToMeasure.length; i++) {
|
| 1832 |
+
let name = docsToMeasure[i][0];
|
| 1833 |
+
|
| 1834 |
+
// Create div for the measure item
|
| 1835 |
+
let div = document.createElement("div");
|
| 1836 |
+
div.className = "measure-item";
|
| 1837 |
+
|
| 1838 |
+
// Create the checkbox
|
| 1839 |
+
let checkbox = document.createElement("input");
|
| 1840 |
+
checkbox.type = "checkbox";
|
| 1841 |
+
checkbox.name = "measureCheckbox";
|
| 1842 |
+
checkbox.value = name;
|
| 1843 |
+
checkbox.onclick = handleCheckboxChange; // Handle checkbox click
|
| 1844 |
+
|
| 1845 |
+
// Create the label
|
| 1846 |
+
let label = document.createElement("label");
|
| 1847 |
+
label.textContent = name;
|
| 1848 |
+
label.onclick = handleLabelClick; // Handle label click
|
| 1849 |
+
|
| 1850 |
+
// Append checkbox and label to the div
|
| 1851 |
+
div.appendChild(checkbox);
|
| 1852 |
+
div.appendChild(label);
|
| 1853 |
+
|
| 1854 |
+
// Append the item to the select container
|
| 1855 |
+
measSelect.appendChild(div);
|
| 1856 |
+
// Check for duplicates
|
| 1857 |
+
if (nameSet.has(name)) {
|
| 1858 |
+
label.style.color = "red"; // Highlight duplicate (optional)
|
| 1859 |
|
| 1860 |
+
document.getElementById("TopTextModal").textContent='Error: Duplicates Error'
|
| 1861 |
+
PopupElement.textContent = 'Duplicate project names were detected while retrieving the project PDFs. Please visit Dropbox and rename the relevant files that you will be working on to ensure each project has a unique name. Once the renaming is complete, return to the console and click on the Dropbox icon to retrieve the updated project names.';
|
| 1862 |
+
ShowPopUp();
|
| 1863 |
+
} else {
|
| 1864 |
+
nameSet.add(name); // Add unique name to the set
|
| 1865 |
+
}
|
| 1866 |
+
}
|
| 1867 |
+
|
| 1868 |
+
|
| 1869 |
+
|
| 1870 |
+
for (let i = 0; i < relvDocs.length; i++) {
|
| 1871 |
+
let name = relvDocs[i][0];
|
| 1872 |
+
|
| 1873 |
+
// Create div for the measure item
|
| 1874 |
+
let div = document.createElement("div");
|
| 1875 |
+
div.className = "relv-item"; //relvselectid .relv-item
|
| 1876 |
+
// Create the label
|
| 1877 |
+
let label = document.createElement("label");
|
| 1878 |
+
label.textContent = name;
|
| 1879 |
+
label.onclick= function(event)
|
| 1880 |
+
{
|
| 1881 |
+
// Action when label is clicked (e.g., log the selected project via the label)
|
| 1882 |
+
let relevantDocumentName = event.target.textContent;
|
| 1883 |
+
console.log("Label clicked: ", relevantDocumentName);
|
| 1884 |
+
if (projsec.value.startsWith('2.8')){
|
| 1885 |
+
doorSchedulePDF=relevantDocumentName
|
| 1886 |
+
console.log(doorSchedulePDF)
|
| 1887 |
}
|
| 1888 |
+
// Optional: Highlight the selected item
|
| 1889 |
+
document.querySelectorAll(".relv-item").forEach(item => {
|
| 1890 |
+
item.style.backgroundColor = ''; // Reset background color for all items
|
| 1891 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1892 |
});
|
| 1893 |
+
event.target.closest(".relv-item").style.backgroundColor ='#d3f8d3'; // Highlight the selected item
|
| 1894 |
+
document.getElementById('relvselectid').style.boxShadow='';
|
| 1895 |
+
};
|
| 1896 |
+
|
| 1897 |
+
|
| 1898 |
+
div.appendChild(label);
|
| 1899 |
+
|
| 1900 |
+
// Append the item to the select container
|
| 1901 |
+
relvSelect.appendChild(div);
|
| 1902 |
+
// Handle duplicate names
|
| 1903 |
+
if (nameSetRelv.has(name)) {
|
| 1904 |
+
label.style.color = "red"; // Highlight duplicate (optional)
|
| 1905 |
+
} else {
|
| 1906 |
+
nameSetRelv.add(name);
|
| 1907 |
+
}
|
| 1908 |
+
}
|
| 1909 |
+
|
| 1910 |
+
relvids.push(relvSelect) ;
|
| 1911 |
+
measids.push(measSelect);
|
| 1912 |
+
|
| 1913 |
+
document.addEventListener("click", function(event) {
|
| 1914 |
+
const iframe = document.getElementById("pdfFrame");
|
| 1915 |
+
if (!iframe.contains(event.target)) {
|
| 1916 |
+
const iframe = document.getElementById("pdfFrame");
|
| 1917 |
+
iframe.style.display = "none";
|
| 1918 |
+
}
|
| 1919 |
+
});
|
| 1920 |
+
document.getElementById('measureADRbutton').onclick= function()
|
| 1921 |
+
{
|
| 1922 |
+
if (!measSelect.value) {
|
| 1923 |
+
measSelect.style.boxShadow = '0 0 8px 2px rgb(255, 0, 0)';
|
| 1924 |
+
measSelect.setAttribute("required", "")
|
| 1925 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1926 |
|
| 1927 |
+
if (!relvSelect.value) {
|
| 1928 |
+
if (sectionNumber.startsWith('2.8')) {
|
| 1929 |
+
relvSelect.style.boxShadow = '0 0 8px 2px rgb(255, 0, 0)';
|
| 1930 |
+
relvSelect.setAttribute("required", "")
|
| 1931 |
+
}
|
| 1932 |
+
}
|
| 1933 |
+
|
| 1934 |
+
|
| 1935 |
+
}
|
| 1936 |
+
|
| 1937 |
+
}
|
| 1938 |
+
|
| 1939 |
+
|
| 1940 |
+
if (document.getElementById('arealvlinput')){
|
| 1941 |
+
if( projsec.value.startsWith('3.2') || projsec.value.startsWith('2.8') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.1') || projsec.value.startsWith('2.7')){
|
| 1942 |
+
document.getElementById('arealvlinput').setAttribute('disabled',true)
|
| 1943 |
+
document.getElementById('selectunitA').setAttribute('disabled',true)
|
| 1944 |
+
}
|
| 1945 |
+
else{ // section 1.0
|
| 1946 |
+
document.getElementById('arealvlinput').removeAttribute('disabled')
|
| 1947 |
+
document.getElementById('selectunitA').removeAttribute('disabled')
|
| 1948 |
+
}
|
| 1949 |
+
}
|
| 1950 |
+
|
| 1951 |
+
};
|
| 1952 |
+
|
| 1953 |
+
eventSource.onerror = function (error) {
|
| 1954 |
+
console.error('Error occurred:', error);
|
| 1955 |
+
eventSource.close(); // Close on error
|
| 1956 |
PopupElement.textContent='Error occured while retrieving the Project Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 1957 |
ShowPopUp();
|
| 1958 |
+
};
|
| 1959 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1960 |
}
|
| 1961 |
//___________________________________________________________________________________________________________
|
| 1962 |
//___________________________________________________________________________________________________________
|
|
|
|
| 2038 |
legendbutton.style.boxShadow = 'none';
|
| 2039 |
});
|
| 2040 |
|
| 2041 |
+
|
| 2042 |
+
if (sectionNumber.startsWith('2.8')){
|
| 2043 |
+
legendbutton.setAttribute('disabled',true);
|
| 2044 |
+
legendbutton.style.cursor='not-allowed';
|
| 2045 |
+
}
|
| 2046 |
+
else{
|
| 2047 |
+
legendbutton.addEventListener('click', function () {
|
| 2048 |
window.open(spreadsheetLink);
|
| 2049 |
});
|
| 2050 |
+
}
|
| 2051 |
//////////////////////////////////////////////////////////////
|
| 2052 |
var imgbutton = document.createElement("button");
|
| 2053 |
imgbutton.className = 'measureADRbutton2';
|
|
|
|
| 2187 |
|
| 2188 |
console.log(formData,formvalues)
|
| 2189 |
// iterate through entries...
|
| 2190 |
+
tomeasureproj=formvalues['measureCheckbox']; //proj name
|
|
|
|
| 2191 |
|
| 2192 |
|
| 2193 |
if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){
|
|
|
|
| 2241 |
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
|
| 2242 |
formData.append('answers',JSON.stringify(answers))
|
| 2243 |
}
|
| 2244 |
+
else if (formvalues['selectprojs'].startsWith('2.1'))
|
| 2245 |
{
|
| 2246 |
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
|
| 2247 |
formData.append('answers',JSON.stringify(answers))
|
| 2248 |
}
|
| 2249 |
+
else if (formvalues['selectprojs'].startsWith('2.8') )
|
| 2250 |
+
{
|
| 2251 |
+
answers.push(tomeasureproj, 0,[] , 0,0,pdfpath , doorSchedulePDF);
|
| 2252 |
+
formData.append('answers',JSON.stringify(answers))
|
| 2253 |
+
}
|
| 2254 |
}
|
| 2255 |
|
| 2256 |
if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ) //formvalues['selectprojs'].startsWith('2.1')
|
|
|
|
| 2258 |
// console.log(formData)
|
| 2259 |
$.ajax({
|
| 2260 |
type: "POST",
|
|
|
|
| 2261 |
url: "/savebase64Img/",
|
| 2262 |
+
contentType: "application/json", // set content type header to use Flask response.get_json()
|
| 2263 |
+
data: formData,// convert data/object to JSON to send
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2264 |
processData: false, // Prevent jQuery from automatically processing the data
|
| 2265 |
contentType: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2266 |
success: function(response) {
|
| 2267 |
console.log(response);
|
| 2268 |
},
|
| 2269 |
error: function(err) {
|
| 2270 |
+
var TopTextModal = document.getElementById("TopTextModalWarning");
|
| 2271 |
+
TopTextModal.textContent='Error'
|
| 2272 |
PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
|
| 2273 |
ShowPopUp();
|
| 2274 |
|
|
|
|
| 2278 |
// var mp3_url = 'https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3';
|
| 2279 |
// (new Audio(mp3_url)).play()
|
| 2280 |
// retrieveLinks()
|
| 2281 |
+
if (!(formvalues['selectprojs'].startsWith('2.8')) )
|
| 2282 |
+
startDropdownUpdates(); // Start the dropdown updates
|
| 2283 |
|
| 2284 |
|
| 2285 |
document.getElementById("loading").hidden = true;
|
|
|
|
| 2333 |
|
| 2334 |
}
|
| 2335 |
if (formvalues['selectprojs'].startsWith('2.8'))
|
| 2336 |
+
{ //base64.b64encode(buffer).decode('utf-8') ,pdflink,list1.to_dict(), repeated_labels , not_found]
|
| 2337 |
+
// /* data[0]--> img , data[1]-->dataframe (goes to legend lsa ) , data [2] -->pdf dropbox shareable link ,data[3]-> spreadsheetId, data[4],spreadsheeturl */
|
| 2338 |
// SimilarAreaDictionary=data[1];
|
| 2339 |
// listofimages=data[0];
|
| 2340 |
dropboxLink=data[1];
|
| 2341 |
+
list1= data[2] // list of pdf markups
|
| 2342 |
+
Repeated_Labels2_8=data[3]
|
| 2343 |
+
Not_Found2_8=data[4]
|
|
|
|
|
|
|
| 2344 |
}
|
| 2345 |
if (formvalues['selectprojs'].startsWith('2.2'))
|
| 2346 |
{
|
|
|
|
| 2377 |
// if (!(formvalues['selectprojs'].startsWith('2.8')))
|
| 2378 |
// {
|
| 2379 |
ImgSide(data[0],spreadsheetURL,dropboxLink)
|
| 2380 |
+
if (formvalues['selectprojs'].startsWith('2.8')) {
|
| 2381 |
+
let messages = [];
|
| 2382 |
+
|
| 2383 |
+
if (Repeated_Labels2_8.length > 0) {
|
| 2384 |
+
messages.push('The following label(s) are represented on multiple doors: ' + Repeated_Labels2_8);
|
| 2385 |
+
}
|
| 2386 |
+
|
| 2387 |
+
if (Not_Found2_8.length > 0) {
|
| 2388 |
+
messages.push('The following label(s) not found on the plan: ' + Not_Found2_8);
|
| 2389 |
+
}
|
| 2390 |
+
|
| 2391 |
+
if (messages.length > 0) {
|
| 2392 |
+
var TopTextModal = document.getElementById("TopTextModalWarning");
|
| 2393 |
+
TopTextModal.textContent = 'Warning';
|
| 2394 |
+
|
| 2395 |
+
PopupElement.textContent = messages.join('\n'); // Show both messages if both conditions are met
|
| 2396 |
+
ShowPopUp();
|
| 2397 |
+
}
|
| 2398 |
+
}
|
| 2399 |
+
|
| 2400 |
// }
|
| 2401 |
|
| 2402 |
// else{
|
|
|
|
| 2435 |
dict1: JSON.stringify(list1),
|
| 2436 |
spreadsheetId: spreadsheetId,
|
| 2437 |
pdfpathpath: JSON.stringify(pdfpath),
|
| 2438 |
+
path: Object.fromEntries(formData)['measureCheckbox']
|
| 2439 |
}),
|
| 2440 |
dataType: "json",
|
| 2441 |
success: function (data1) {
|
|
|
|
| 2444 |
},
|
| 2445 |
error: function (err) {
|
| 2446 |
console.error('Error occurred during first AJAX call:', err);
|
| 2447 |
+
var TopTextModal = document.getElementById("TopTextModalWarning");
|
| 2448 |
+
TopTextModal.textContent='Error'
|
| 2449 |
PopupElement.textContent = 'Error occurred. Refresh and try again. If the error continues, please contact the ADR team to fix it.';
|
| 2450 |
ShowPopUp();
|
| 2451 |
}
|
|
|
|
| 2465 |
dict1: JSON.stringify(list1),
|
| 2466 |
spreadsheetId: spreadsheetId,
|
| 2467 |
pdfpathpath: JSON.stringify(pdfpath),
|
| 2468 |
+
path: Object.fromEntries(formData)['measureCheckbox']
|
| 2469 |
}),
|
| 2470 |
dataType: "json"
|
| 2471 |
});
|
|
|
|
| 2484 |
document.getElementById("loading").style.marginTop = '20%';
|
| 2485 |
document.getElementById("loading").style.marginLeft = '65%';
|
| 2486 |
|
| 2487 |
+
updatepreview([pdfpath, Object.fromEntries(formData)['measureCheckbox']]);
|
| 2488 |
|
| 2489 |
await $.ajax({
|
| 2490 |
type: "POST",
|
|
|
|
| 2493 |
data: JSON.stringify({
|
| 2494 |
dict: JSON.stringify(SimilarAreaDictionary),
|
| 2495 |
deletedrows: delrows2,
|
| 2496 |
+
path: Object.fromEntries(formData)['measureCheckbox'],
|
| 2497 |
spreadsheetId: spreadsheetId,
|
| 2498 |
areaPermArr: JSON.stringify(data[7]),
|
| 2499 |
section: Object.fromEntries(formData)['selectprojs'],
|
|
|
|
| 2507 |
}
|
| 2508 |
|
| 2509 |
} catch (err) {
|
| 2510 |
+
var TopTextModal = document.getElementById("TopTextModalWarning");
|
| 2511 |
+
TopTextModal.textContent='Error'
|
| 2512 |
console.error('Error occurred during fetchAndCompareData:', err);
|
| 2513 |
PopupElement.textContent = 'Error occurred. Refresh and try again. If the error continues, please contact the ADR team to fix it.';
|
| 2514 |
ShowPopUp();
|
|
|
|
| 2534 |
/////////////////////////
|
| 2535 |
});
|
| 2536 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2537 |
|
| 2538 |
}
|
| 2539 |
//___________________________________________________________________________________________________________
|
| 2540 |
//___________________________________________________________________________________________________________
|
| 2541 |
document.getElementById("myForm").addEventListener("submit", function (e) {
|
| 2542 |
+
let isChecked = document.querySelector('input[name="measureCheckbox"]:checked') !== null;
|
| 2543 |
+
let sectionNumber = projsec.value; // Ensure projsec is defined
|
| 2544 |
+
let isRelvClicked = document.querySelector(".relv-item[style*='background-color']") !== null;
|
| 2545 |
+
|
| 2546 |
+
let TopTextModal = document.getElementById("TopTextModal");
|
| 2547 |
+
TopTextModal.textContent = "Warning: Missing Inputs";
|
| 2548 |
+
if (sectionNumber.startsWith('2.8')) {
|
| 2549 |
+
|
| 2550 |
+
// If section starts with '2.8', both measureCheckbox and relv-item must be selected
|
| 2551 |
+
if (!isChecked & !isRelvClicked) {
|
| 2552 |
+
document.getElementById('relvselectid').style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
|
| 2553 |
+
e.preventDefault(); // Prevent form submission
|
| 2554 |
+
PopupElement.textContent = "Please select at least one project from 'Documents to Measure' and one relevant item rom 'Other Relevant Documents' before proceeding!";
|
| 2555 |
+
ShowPopUp();
|
| 2556 |
+
return;
|
| 2557 |
+
}
|
| 2558 |
+
else if (!isChecked){
|
| 2559 |
+
|
| 2560 |
+
e.preventDefault(); // Prevent form submission
|
| 2561 |
+
PopupElement.textContent = "Please select at least one project from 'Documents to Measure' before proceeding!";
|
| 2562 |
+
ShowPopUp();
|
| 2563 |
+
return;
|
| 2564 |
+
}
|
| 2565 |
+
else if (!isRelvClicked){
|
| 2566 |
+
document.getElementById('relvselectid').style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
|
| 2567 |
+
e.preventDefault(); // Prevent form submission
|
| 2568 |
+
PopupElement.textContent = "Please select at least one relevant item from 'Other Relevant Documents' before proceeding!";
|
| 2569 |
+
ShowPopUp();
|
| 2570 |
+
return;
|
| 2571 |
+
}
|
| 2572 |
+
} else {
|
| 2573 |
+
// If section is not '2.8', only measureCheckbox is required
|
| 2574 |
+
if (!isChecked) {
|
| 2575 |
+
e.preventDefault(); // Prevent form submission
|
| 2576 |
+
PopupElement.textContent = "Please select at least one project before proceeding from 'Documents to Measure' section!";
|
| 2577 |
+
ShowPopUp();
|
| 2578 |
+
return;
|
| 2579 |
+
}
|
| 2580 |
+
}
|
| 2581 |
+
|
| 2582 |
+
// If validation passes, proceed with form submission
|
| 2583 |
+
getData(e.target);
|
| 2584 |
});
|
| 2585 |
+
|
| 2586 |
////////////////////////////////////////////
|
| 2587 |
var measitemVal='';
|
| 2588 |
|
|
|
|
| 3226 |
if (sectionNumber.startsWith('2.7'))
|
| 3227 |
{
|
| 3228 |
textextra= cloneExtra.children[0]
|
| 3229 |
+
textextra.style.backgroundColor = "rgba(101, 101, 101, 0.27)";
|
| 3230 |
textextra.style.cursor='not-allowed';
|
| 3231 |
textextra.disabled="disabled";
|
| 3232 |
|
|
|
|
| 3234 |
if (sectionNumber.startsWith('2.8'))
|
| 3235 |
{
|
| 3236 |
text2extra= cloneExtra.children[3]
|
| 3237 |
+
text2extra.style.backgroundColor ="rgba(101, 101, 101, 0.27)";
|
| 3238 |
text2extra.style.cursor='not-allowed';
|
| 3239 |
text2extra.disabled="disabled";
|
| 3240 |
}
|
|
|
|
| 3671 |
input = document.getElementById(id);
|
| 3672 |
filter = input.value.toUpperCase();
|
| 3673 |
if (id.toString().startsWith('tomeasure'))
|
| 3674 |
+
a = document.querySelectorAll("#measureContainer .measure-item");
|
| 3675 |
+
|
| 3676 |
+
// a = document.getElementById("measureselectid").children;
|
| 3677 |
else
|
| 3678 |
+
// a = document.getElementById("relvselectid").children;
|
| 3679 |
+
a = document.querySelectorAll("#relvselectid .relv-item");
|
| 3680 |
// a = div.getElementsByTagName("option");
|
| 3681 |
for (i = 0; i < a.length; i++) {
|
| 3682 |
txtValue = a[i].textContent || a[i].innerText;
|
|
|
|
| 3700 |
|
| 3701 |
document.getElementById("refreshDropboxButtonID").onclick = function()
|
| 3702 |
{
|
| 3703 |
+
TopTextModal.textContent='Warning: Dropbox Refresh';
|
| 3704 |
if (document.getElementById("refreshDropboxButtonID").disabled==false)
|
| 3705 |
overlayme.style.display = "block";
|
| 3706 |
overlaymeText.textContent='The console updates projects retrieved from Dropbox automatically at 9:00 am and 9:00 p.m. If you need to access any projects in between, just click on this button. Please note that it will refresh the files related to the project you chose only.';
|
|
|
|
| 3714 |
document.getElementById("refreshAPIbutton").disabled=false;
|
| 3715 |
document.getElementById("refreshAPIbutton").onclick = function()
|
| 3716 |
{
|
| 3717 |
+
TopTextModal.textContent='Warning: MC Refresh';
|
| 3718 |
if (document.getElementById("refreshAPIbutton").disabled==false)
|
| 3719 |
{
|
| 3720 |
console.log(overlaymeText.textContent)
|
|
|
|
| 3731 |
if (sectionNumber.startsWith('2.7'))
|
| 3732 |
{
|
| 3733 |
textextra= document.getElementById("textextra")
|
| 3734 |
+
textextra.style.backgroundColor = "rgba(101, 101, 101, 0.27)";
|
| 3735 |
+
// textextra.style.border='2px solid #2f83c6'
|
| 3736 |
textextra.style.cursor='not-allowed';
|
| 3737 |
textextra.disabled="disabled";
|
| 3738 |
|
|
|
|
| 3740 |
if (sectionNumber.startsWith('2.8'))
|
| 3741 |
{
|
| 3742 |
text2extra= document.getElementById("text2extra")
|
| 3743 |
+
text2extra.style.backgroundColor = "rgba(101, 101, 101, 0.27)";
|
| 3744 |
text2extra.style.cursor='not-allowed';
|
| 3745 |
text2extra.disabled="disabled";
|
| 3746 |
}
|
|
|
|
| 3760 |
/* code executed if confirm is clicked */
|
| 3761 |
overlayme.style.display = "none";
|
| 3762 |
console.log(document.getElementById("confirm").parentElement.parentElement.children[0].textContent)
|
| 3763 |
+
if (document.getElementById("confirm").parentElement.parentElement.children[0].textContent.startsWith('The'))
|
| 3764 |
{
|
| 3765 |
console.log('hereeeeeeeee')
|
| 3766 |
callrefreshDropbox();
|