|
|
<!DOCTYPE html> |
|
|
<html lang="en" dir="ltr"> |
|
|
<head> |
|
|
|
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> |
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet"/> |
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> |
|
|
|
|
|
<link rel="stylesheet" href="https://use.typekit.net/zos0ars.css"> |
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |
|
|
<link rel="stylesheet" href="static/style.css"> |
|
|
<link rel="stylesheet" href="static/MenuStyle.css"> |
|
|
<link rel="stylesheet" href="static/LegendPageStyle.css"> |
|
|
<link rel="stylesheet" href="static/popups.css"> |
|
|
<link rel="stylesheet" href="static/IMG-Larger.css"> |
|
|
<link rel="stylesheet" href="static/searchButton.css"> |
|
|
<meta charset="utf-8"> |
|
|
<title>ADR Console</title> |
|
|
<link rel = "icon" type = "image/png" sizes = "180x154" href = "static/images/TSAlogoCropped180x154.png"> |
|
|
<link rel = "icon" type = "image/png" sizes = "32x27" href = "static/images/TSAlogoCropped32x27.png"> |
|
|
<link rel = "icon" type = "image/png" sizes = "16x14" href = "static/images/TSAlogoCropped16x14.png"> |
|
|
<link rel = "mask-icon" href = "static/images/TSAlogoCropped180x154.png"> |
|
|
<link rel = "shortcut icon" href = "static/images/TSAlogoCropped180x154.png"> |
|
|
|
|
|
|
|
|
|
|
|
</head> |
|
|
<body > |
|
|
<div id="pdf-container"></div> |
|
|
|
|
|
<div id="all"> |
|
|
|
|
|
{% include 'loading.html' %} |
|
|
</div> |
|
|
|
|
|
<div class="tab" > |
|
|
<div class="container" id="toggle"> |
|
|
<div class="bar1"></div> |
|
|
<div class="bar2"></div> |
|
|
<div class="bar3"></div> |
|
|
</div> |
|
|
|
|
|
<button class="tablinks" id="pagetitle" onclick="openTab(event, 'home')">ADR Console <i class="fa fa-home" > </i></button> |
|
|
|
|
|
<a class="tablinks" id="LegendHist" href="{{ url_for('legendDirectory') }}"> |
|
|
Legends History <i class="fa fa-caret-down"></i> |
|
|
</a> |
|
|
|
|
|
|
|
|
<div id="dynamicTabs" class="dynamicdropdownclass"> |
|
|
|
|
|
|
|
|
</div> |
|
|
<button class="dropbtn" onclick="userguideclick()"><img id="infoImg" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAHz0lEQVR4nNVbW0xVVxC9SAEfNPGRCJICGoWKRkUUNfEVFUnsn0ZjfARfAWmq8UNLfSUmxkLxCzDS6kcrDx8/xkeiaFujJia1ifFDRPyw0Fi0xjeliKi4mnU49+bcfeZwufeefaErmYQczt2zZ/bsPbNn5ng8mgFgAoDNAA4B+BnAnwBaYUer+b/L5rv8TYbn/wYA0QCWAKgG8DfCx2NzLI4Z7emvAJAEoNScsC5w7O8AjPL0FwBIAfA9gLeIHDoAHAaQ3JeCxwLYDaA90GyfPn2KM2fOoKSkBOvXr0dOTg6mT5+OjIwMg/g3n23YsMF45+zZs3j27FlvFPEvgG8AxERa+GwAjT3NrL6+HkVFRZg8eTKioqLAnwVD/M2UKVOwc+dO3L17N5AiGgBkRUr4AgCd0izev3+P6upqZGVlBS1wIJo2bRpqamoMHg7gFtwGIEqX4HEATkmcP378iGPHjmHMmDGuC67S2LFjDUWQpwOOc3u6LfynAH6RuN25cwezZ8/WLrhK8+bN62lrMN6Id1P43yUuR44cQVxcXMSF9xJ5l5WVOSnht7CVgG6z/1Ud+c2bN1i+fHmfCa7SypUrjTkJuBzydgAQJe35V69eYc6cOdqEiY2NRXx8fNC/mzVrFp4/fy4poTZUBWxTR3r58qXhmnSZc0VFBdrb231ny9SpU4MaIzMz01ggAV+F4uc7VbOfO3eutpU/dcruYJqbm4M+Y2gJXiUqLjIrmAivUR1B557nSjshWCvwngkOwVLgiBHd4a0faJq6hCcVFDC2ksEAKJQxKysrpeGKAgmfqsb23Iu6Xd2WLVtE4Z88eYKYmJiQxhw4cKAUJ/Du8FlPCvjB+jajrfnz52sVnsQLkRTirl27NqxxeWYJEWNFT/f5t9Y3Gd7qFt5LvAm2tbUZfOnOeGt0Y9za2lpVAQwYEiUFlFrf+vDhA8aNGxcxBZBo7qNHjw7Z7J3uDoJ1lajCf6Kmr6qqqiIqvE46fpz3Iz888kuvAfhCfUPHldaJoqOjkZycjKSkpJByB4GICRcBuVYF1Fj/w9MzEoJPmjTJsDRr9NbY2Ijx48e7zkvwCD9ZY34/82cmR6fgEydOxIULFxzv9Eyfuc1z925bePPIq4AM9T9cGR2C07x37dqFzk4xoeTDtWvXXOfNLS3gcyqg0PqELmjAgAGuT2DQoEHGyvYG5eXlrvOnTEKitcBjVmF8YEbWbeaDBw/GlStX/DjT/Lu6ukQFrFixQosFnj9/XmVV5jGTBj4UFxe7ynTIkCG4evWq35X64MGDxon/+vVrm/D02cOGDdOigNJSv1CHqKMCmq1P1q1b56rZX79+3Rj33r17KCwsNBTiDX8l3LhxQ4vwpI0bN6rs/qACuuNPE4sWLXKNIX37yZMnkZuba/PvO3bsEBWwd+9ebQpg8UVBKxXg54uys7O1TcBKXstQwaBFF8+ZM2eq7LqoAD/QNHULzz0u3f5YQtPhgbw0YQIr9f7w9IUCVq1aJa4+Cx46+TopoCvSW+DEiROiAtasWaOVr9MWaNN1CDpdfKT0NWOCkSNHauXtdAg2W5+4lYjoKUsj4datW9otb9OmTaIbvGx9wvq8zkkcOHBAVACf61YAAzApEDqkOxS20s2bN0UF6Kw5BAqFN0fiMkQaOnSokWpT0dra6moaLIjLUL54HWZXh45JLF26VFz906dPa1991hcEpHlzAsyR+cC2FB2TOHyYfU12sDCiWwF79uxR2bZYU2Lsw/OhoaFByyTu378vKiA1NVW7AphqU/CjVQFsQnSlJOVEw4cPF1NgTU1N2oVncCcgR+3ufKwzLF2yxKZjA0xZ61YAb6Sq+du6TtHdgekDT+u0tDTXJrFv3z5RAVu3brW9m5CQgP379yMvLy9svizuCJ7nW6kyNMrswPSBLW9uKeDixYuiAhYvXux7h+nwo0ePoqOjw8gWuREbCKvP0liCU32w0vom9+yCBQtcUcCDBw9EBfCsWbZsGerq6nw5wpaWFldcMTvJhHOnTBSeYO+tWUL2gQUFlprDmQizQVxVCepzeqCUlJSwheecmYZT8A+LwJ6egO7eWz/Qf4czmREjRqA3YJbIrYQoW/gEbO9ReEuLDNtJ/MC2k1AnwzD33bt3joLTTFkLcCscXr16tcSmvtdN1QCy1F4BNklxT4U6KV6yJDx8+BALFy50RXASGzqE7cYHmb0S3gsAtr4VFjHZihbKxBITE42Dji6J+cDbt28jPz/f1fYbzk2qNQD40hMK0N14bFNCOJbAWkG4h6rTyjsIXxWS8JbzgI3HULdDOGeC28Q97+BlLoX9MQWAeLPx2K7aqiqj7tdXgtOStDZLK0rwS51Z44RIdJKpxABN8PPWlXdHeGU72M4ErxtjN1YkmqrS09Ol8NbPMLV+QwQgz4ynbeAJz9udjvLWjBkzjHqClFKzfjKjTXAhTrAFS1bQPNmWwl7fUHKM/A27OpjJEZIZUpATnJ8PFwBiAHyt3h0kMNF67tw5oz7PEjVvgExSeD+b4+ryGfP2fIfZ2xcvXqAXYGy/PeKfzVnB3lsztS5uC00gr/KAF5tIAkAi6ypqgtVlMJNT7Hif7w9Ad3otl3145oTDxV9MYDJ30q8/nvY4gK1o5seWjFjon5sASDEruyX5vzrz3XwA6bon+B8RXxEBPsptqAAAAABJRU5ErkJggg=="></button> |
|
|
|
|
|
</div> |
|
|
<div id="FramestabsDropdown"> </div> |
|
|
<div id="mySidebar" class="slide-out"> |
|
|
<div id="menuOptions"> |
|
|
<li><a href="{{ url_for('measurementConsoleFn') }}">Measure Plans </a></li> |
|
|
<li><a href="{{ url_for('searchDocument') }}">Search in Documents</a></li> |
|
|
<li><a href="{{ url_for('TableDetection') }}">Table Detection</a></li> |
|
|
<li><a href="{{ url_for('FindInitialMarkups') }}">Markup Specification</a></li> |
|
|
<li onclick=redirectTestingMeasurement()>Testing Measurement</li> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id="home" class="tabcontent" > |
|
|
|
|
|
<div id="loading" hidden> </div> |
|
|
|
|
|
<div id="canvaswindow" hidden="until-found"> |
|
|
<canvas id="myCanvas"></canvas> |
|
|
<br> |
|
|
<input type="button" value="Draw New Shape" id="NewShapeButtonId" /> |
|
|
<input type="button" value="Undo" id="undoButtonId" /> |
|
|
<div id="colorpickers"> |
|
|
<input type="color" id="color" value="#2FFFFF" > |
|
|
</div> |
|
|
<input type="button" value="Save" id="savecanvas" /> |
|
|
</div> |
|
|
|
|
|
<div id="rightside" hidden="until-found"> |
|
|
|
|
|
<div id="backgroundimg" > |
|
|
<div id="imgs"> |
|
|
|
|
|
</div> |
|
|
<div id="underimgbuttons"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="myModal" class="modal" > |
|
|
<span class="close">×</span> |
|
|
<img class="modal-contentImgLarger" id="img01"> |
|
|
<div id="caption"></div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div id="ErrorModalid" class="ErrorModalClass" name="tobeclosed"> |
|
|
|
|
|
|
|
|
<div class="Errormodal-content"> |
|
|
<div class="errorModal-header"> |
|
|
<button type="button" class="closeModal" data-dismiss="modal">×</button> |
|
|
<h2 id="TopTextModal">Error ⚠️</h2> |
|
|
</div> |
|
|
<p id="errorTextContent"></p> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<form method="post" id="myForm" enctype="multipart/form-data"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<input type="button" id="refreshAPIbutton" title="Refresh data retrieved from MC" value="Refresh data retrieved from MC "> |
|
|
<div id =""> |
|
|
<input type="text" id="projlinkTesting" name="projlinkTesting" required placeholder="Document Link"> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id ="projectsection"> |
|
|
<select name="selectprojs" class="selectionsProjs" placeholder="Choose Section" onchange=getproj() required> </select> |
|
|
</div> |
|
|
|
|
|
<div id ="" > |
|
|
<input type="text" id="projlinkTestingSchedule" name="projlinkTestingSchedule" hidden placeholder="Schedule Link"> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id ="tomeasurediv" > |
|
|
<div> |
|
|
<label id="measureLabel">Document To Measure</label > |
|
|
<input type="search" oninput="handleKey(event, this.id)" id="tomeasureSearchInput"> |
|
|
|
|
|
<i hidden class="fa fa-dropbox fa-lg" id="refreshDropboxButtonID"> |
|
|
<span class="dropboxtip">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.</span> </i> |
|
|
|
|
|
</div> |
|
|
<div id="measureCheckbox"> |
|
|
|
|
|
<div id="measureContainer" hidden required></div> |
|
|
<div id="dxfdiv" hidden="until-found"> |
|
|
<input type="button" id="pdftodxfFileButton" onclick="document.getElementById('pdftodxfFile').click();" value="Upload DXF File" > |
|
|
<input type="file" id="pdftodxfFile" name="pdftodxfFilename" > |
|
|
</div> |
|
|
<select id='selectunitA' hidden> |
|
|
<option id="m2" value="m2" >m² </option> |
|
|
<option id="mm2" value="mm2" >mm² </option> |
|
|
</select> |
|
|
<select id='selectunitP' hidden> |
|
|
<option id="m" value="m" >m </option> |
|
|
<option id="mm"value="mm" >mm </option> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id ="relvDocdiv" > |
|
|
<label id="relvDocLabel">Other Relevant Documents</label hidden> |
|
|
<input type="search" onkeydown="handleKey(event, this.id)" id="relevantSearchInput"> |
|
|
<br> |
|
|
<div id="relvdiv" style="position: relative; max-height: 300px;"> |
|
|
<div id="relvselectid" class="scrollable-container" hidden></div> |
|
|
<div id="relvoverlay" class="disable-overlay"></div> |
|
|
|
|
|
<iframe id="pdfFrame" hidden></iframe> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div id="ratios"> </div> |
|
|
|
|
|
<div id="radiosColors" hidden="until-found"> |
|
|
|
|
|
<div id="checkboxLine"> |
|
|
<input type="checkbox" id="levelcheckbox"> |
|
|
<label id="nLevels" name="levelsnamelabel">Leveled Plan</label> |
|
|
<i class="fa fa-info-circle" id="infotool"> |
|
|
<span class="tooltiptext"> |
|
|
Choose whether this project contains levels or not. Leave the checkbox unchecked if you want to measure the entirety of the plan. |
|
|
<br> Please check the box on this line if you want to measure certain areas of the plan or have the plan divided into levels. Once the checkbox is ticked, a window will appear that will allow you to draw on the PDF. Click the save button at the bottom of the page when you are done. |
|
|
</span> |
|
|
</i> |
|
|
</div> |
|
|
|
|
|
<div class="button-container"> |
|
|
<input type="button" id="popupforextratext" title="Add Key Information" value="Add Key Information"> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
<div id ="saveOPdiv"> |
|
|
<button id="measureADRbutton" hidden >Measure using ADR</button> |
|
|
<button id="Newtablebutton" hidden >Table Detect</button> |
|
|
|
|
|
<input type="button" value="Download Tables" id="downloadbutton" hidden style="display: none;" /> |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js"></script> |
|
|
<lord-icon |
|
|
src="https://cdn.lordicon.com/ynwbvguu.json" |
|
|
trigger="hover" colors="primary:black" id="addicon" style="display: none;" onclick="duplicate()" > |
|
|
</lord-icon> |
|
|
</div> |
|
|
<audio id="myAudio" autoplay></audio> |
|
|
</form> |
|
|
<div id="progressBar" hidden> |
|
|
<div id="progress">0%</div> |
|
|
</div> |
|
|
|
|
|
<div id ="duplicater" class="duplicaterclass" hidden="until-found"> |
|
|
<label id="labelArrayId" hidden="until-found"> </label> |
|
|
<select name="measurementscripts" class="measurementselections" id="measurementselectionsid" > </select> |
|
|
|
|
|
<select name="select" class="selections" id="selectionsid" > |
|
|
</select> |
|
|
<select name="measureitem" class="measureitems" id="measureitemsid"> </select> |
|
|
<br> |
|
|
<div id="repeatforloop" class="repeatforloopclass00" name="repeatforloopname " > |
|
|
<select type="text" id="text0" name="text1name" placeholder="GB-1" class=gb> </select> |
|
|
<input type="text" id="text1" name="text2name" placeholder="A" class=a> |
|
|
<input type="text" id="text2" name="text3name" placeholder="Depth" class=depth> |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script> |
|
|
<lord-icon |
|
|
onclick="addmctnameicon()" |
|
|
src="https://cdn.lordicon.com/mecwbjnp.json" |
|
|
trigger="hover" |
|
|
class="addmctnameclass" |
|
|
id="addmctnameid" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<button hidden id="doneebackground" onclick="getSecondData()" > Export Summary </button> |
|
|
<button hidden id="summarytoXML" onclick=summary_to_XML() > Summary to XML</button> |
|
|
<div hidden id ="duplicaterhidden" class="duplicaterclasshidden"> |
|
|
<label id="labelArrayId" hidden="until-found"> </label> |
|
|
<select name="measurementscripts" class="measurementselections" id="measurementselectionsid" > |
|
|
<option value="" disabled selected hidden>Select</option> |
|
|
</select> |
|
|
<select name="select" class="selections" id="selectionsid"> </select> |
|
|
<select type="text" name="measureitem" class="measureitems" id="measureitemsid"> </select> |
|
|
|
|
|
<br> |
|
|
<div id="repeatforloophidden" class="repeatforloopclasshidden" name="repeatforloopnamehidden " > |
|
|
|
|
|
|
|
|
<select type="text" id="text0" name="text1name" placeholder="GB-1" class=gb> </select> |
|
|
<input type="text" id="text1" name="text2name" placeholder="A" class=a> |
|
|
<input type="text" id="text2" name="text3name" placeholder="Depth" class=depth> |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script> |
|
|
<lord-icon |
|
|
onclick="addmctnameicon()" |
|
|
src="https://cdn.lordicon.com/mecwbjnp.json" |
|
|
trigger="hover" |
|
|
class="addmctnameclass" |
|
|
id="addmctnameid" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js"></script> |
|
|
<lord-icon |
|
|
onclick="deletemctnameicon()" |
|
|
src="https://cdn.lordicon.com/rivoakkk.json" |
|
|
trigger="hover" |
|
|
class="deletemctnameclass" |
|
|
id="deletemctnameid" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div id="legends" class="tabcontent"> |
|
|
<ul class="graynavbarLegend" > |
|
|
<label class="label1">Project Name / Project Part / NRM Section /</label> <label class="label2">Legend</label> |
|
|
<div class="legendtime"> |
|
|
<div style="display: inline-flex;"> |
|
|
<label class="CreatedTime"> Created Time </label> |
|
|
<button id="sortBtnCreateDesc" class="sortbutton" onclick="sortlegends(this.id)"><i id="CreatesortDesc" class="fa fa-sort-amount-desc" aria-hidden="true" ></i> </button> |
|
|
<button id="sortBtnCreateAsc" class="sortbutton" onclick="sortlegends(this.id)"><i id="CreatesortAsc" class="fa fa-sort-amount-asc" aria-hidden="true" ></i></button> |
|
|
</div> |
|
|
<div style="display: inline-flex;"> |
|
|
<label class="EditTime"> Last Edited Time </label> |
|
|
<button id="sortBtnEditDesc" class="sortbutton" onclick="sortlegends(this.id)"><i id="EditsortDesc" class="fa fa-sort-amount-desc" aria-hidden="true" ></i></button> |
|
|
<button id="sortBtnEditAsc"class="sortbutton" onclick="sortlegends(this.id)"><i id="EditsortAsc" class="fa fa-sort-amount-asc" aria-hidden="true" ></i> </button> |
|
|
</div> |
|
|
</div> |
|
|
</ul> |
|
|
|
|
|
</div> |
|
|
<div id="consoleContent"></div> |
|
|
<div class="dropdown-content" id="dropdown-contentUserguideId" name="tobeclosed"> |
|
|
<div id="userguidetext" > |
|
|
<div id="UserguideRibbon"> |
|
|
<label id="UserGuideHeader"> User Guide Text: Before using this tool, kindly read the following carefully. </label> |
|
|
<button id="homeguidebutton" style="background-color: transparent; border: none;" onclick="ShowSectionUserguide(this)"> |
|
|
<i class="fa fa-home fa-lg" id="userguideHome"></i> |
|
|
</button> |
|
|
|
|
|
<div class="Userguidecontainer" id="UserGuidetoggle" onclick="userguidetoggleFunction()"> |
|
|
<div class="UserGuidebar1"></div> |
|
|
<div class="UserGuidebar2"></div> |
|
|
<div class="UserGuidebar3"></div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<button type="button" class="closeModal" id="userguideClose" data-dismiss="modal">×</button> |
|
|
<button style="background-color: transparent; border: none;" id="userguideTableMaya" onclick="userguideMayaTableClick()"> |
|
|
<i class="fa fa-th fa-lg" aria-hidden="true"></i> |
|
|
</button> |
|
|
<div id="UserGuideSideBar"> |
|
|
<div id="UserGuidemenuOptions"> |
|
|
<li onclick="ShowSectionUserguide(this)">1.0 Substructure</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.1 Frames</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.2 Upper Floor</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.3 Roof</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.4 Stairs</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.5 External Walls</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.6 External Openings</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.7 Internal Walls</li> |
|
|
<li onclick="ShowSectionUserguide(this)">2.8 Internal Openings</li> |
|
|
<li onclick="ShowSectionUserguide(this)">3.1 Wall Finishes</li> |
|
|
<li onclick="ShowSectionUserguide(this)">3.2 Floor Finishes</li> |
|
|
<li onclick="ShowSectionUserguide(this)">3.3 Ceiling Finishes</li> |
|
|
<li onclick="ShowSectionUserguide(this)">4.0 Fittings, Furnishings and Equipments</li> |
|
|
<li onclick="ShowSectionUserguide(this)">5.0 Services</li> |
|
|
<li onclick="ShowSectionUserguide(this)">5.1 Sanitary</li> |
|
|
<li onclick="ShowSectionUserguide(this)">7.0 Works to existing buildings</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.1 Site Preparation Works</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.2 Roads, Paths, Pavings</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.3 Soft Landscaping</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.4 Fencing, Railing, Walls</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.5 External Fixtures</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.6 External Drainage</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.7 External Services</li> |
|
|
<li onclick="ShowSectionUserguide(this)">8.8 Minor Buildings</li> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div id="textfirstpage"> |
|
|
<label style="font-weight: bold;"> |
|
|
After reading this user guide, if you still encounter any issues or have suggestions for improving the system, please don't hesitate to contact the ADR team. |
|
|
</label> |
|
|
<br> |
|
|
<label style="font-style: italic;"> |
|
|
This page provides general guidance on using the console. For details on a specific section, refer to the menu and select the desired section by clicking the '<i class="fa fa-bars" aria-hidden="true"></i>' icon. |
|
|
<br> |
|
|
In the top right corner, you will find this icon '<i class="fa fa-th fa-lg" aria-hidden="true"></i>', which, when clicked, takes you to a Google Spreadsheet containing a summarized table of the main AI features implemented and |
|
|
planned for the ADR console, along with the sections where they are applied. |
|
|
</label> |
|
|
|
|
|
|
|
|
<br> |
|
|
The tool is divided into two main parts: |
|
|
<br><br> |
|
|
<i class="fa fa-circle" aria-hidden="true"> </i> <label id="userguideheadings"> First Part </label> |
|
|
<br> |
|
|
<div style="margin-left: 40px;"> |
|
|
The system automatically refreshes all data retrieved every 5 minutes from the MC including project names, parts, sections, and MC-T names every. However, if you notice missing information, click this button |
|
|
<span style="background-color: blue; color: white; padding: 2px 8px; border-radius: 4px; font-style: italic; margin-top: 5px;">Refresh data received from MC</span> to retrieve the latest MC updates. |
|
|
|
|
|
<br> |
|
|
<label id="underlinedLables">Inputs: </label> |
|
|
<br> |
|
|
|
|
|
<li> |
|
|
Use the three dropdown menus to select the project name, part, and section to measure. |
|
|
<br> |
|
|
<img src="static/images/Dropdowns_3.png" alt="Dropdown menus example" style="margin-top: 10px; width:240px;"> |
|
|
<label style="font-style: italic; margin-left: -10px; margin-top: 50px;color: #2e83c7;"> Ensure the correct 'Project Section' is selected, as it affects the applied code. </label> |
|
|
<br> |
|
|
</li> |
|
|
<li> |
|
|
<label style="font-size: 15px;"> Document To Measure: </label> |
|
|
<br> |
|
|
Clicking a document's name opens a PDF preview in a separate tab attached to the black ribbon inside the console. Checking the box next to the document selects it as the document to measure. |
|
|
|
|
|
<br> |
|
|
<li> |
|
|
When retrieving documents for measurement, if multiple files share the same name on Dropbox, a popup may appear. In such cases, please rename the files in Dropbox, then return to the console and click the following icon: |
|
|
<i hidden class="fa fa-dropbox" style="color:white; background-color: #2e83c7; border-radius: 4px;"></i> to retrieve the updated documents. You can then select the desired document for measurement. Please note that this process will refresh all documents in the selected project folder. |
|
|
</li> |
|
|
<br> |
|
|
<label style="font-style: italic;"> Pixel-to-Metric conversion important notes:</label> |
|
|
<br> |
|
|
Upon selecting a plan, the console automatically downloads the PDF with a colored rectangle. Open it in Foxit Reader, Adobe, or Bluebeam to measure its area and perimeter in the desired metric unit. |
|
|
Enter these values in the provided textboxes. A dropdown next to each textbox lets you choose between meters (m) or millimeters (mm) for accurate scaling. |
|
|
<br> |
|
|
This rectangle serves as a scale check for Bluebeam. Refer to the relevant section for further details. |
|
|
<br> |
|
|
<li> |
|
|
Click <span style="background-color: #b216c7; color: white; padding: 2px 8px; border-radius: 4px; font-style: italic;">Add Key Information</span> button to open a popup where you can input additional details to assist in the detection process. |
|
|
</li> |
|
|
</li> |
|
|
<label id="underlinedLables">Outputs: </label> <br> |
|
|
The right panel displays results in three sections: |
|
|
<li>A preview of the measured plan, which you can click to expand.</li> |
|
|
<li>Three buttons: |
|
|
<li> <label style="font-weight: bold;" >"Legend and Data Created" </label> – Access the Google Sheet legend.</li> |
|
|
<li> <label style="font-weight: bold;" >"Click to View as PDF" </label>– Opens the marked-up PDF in Dropbox. <label>(Do not download for this feature.) </label></li> |
|
|
<li> This icon <i class='fa fa-refresh' style="color:white; padding: 3px 3px;background-color: rgb(255,0,255); border-radius: 4px;"></i> button allows you to get the deleted markups (in case you deleted any from the pdf on dropbox).</li> |
|
|
</li> |
|
|
|
|
|
<br> |
|
|
<label style="font-weight: bold;" > ONLY IN DROPBOX VIEW. DO NOT DOWNLOAD THE PDF FOR THIS FEATURE. </label> |
|
|
<br> |
|
|
<label style="font-style: oblique;" > |
|
|
Note : The algorithm is based on detecting shapes and colors from the plan. Some shapes such as tables and textboxes carrying plan-related information, may also be viewed as shapes and so added to the algorithm. |
|
|
</label> |
|
|
Any markup that you deem unnecessary in the pdf can be removed. After deleting any markup, the console will notify you with a message asking whether you would like to delete it from legend or not and the legend will be updated accordingly. |
|
|
</div> |
|
|
<br> |
|
|
<i class="fa fa-circle" aria-hidden="true"> </i> |
|
|
<label id="userguideheadings"> Second Part </label> |
|
|
<br> |
|
|
<div style="margin-left: 40px;"> |
|
|
To open the Google sheet with the created legend, first click the button labeled "Legend and Data created." Names of each shape should go in the first column of the sheet labeled ‘Guess’. |
|
|
<br>Ex. GB-1. |
|
|
<br>Then, return to this page, the ADR Console, to finish entering the remaining data after you have finished entering the guessed names in the legend. |
|
|
<br>Three dropdown menus are present. |
|
|
|
|
|
<li> |
|
|
You can select the type of the shape from the first dropdown: |
|
|
<br>    e.g. (1.0 Substructure) Ground Beam or Pile Cap. Refer to the relevant section for more details. |
|
|
</li> |
|
|
<li > |
|
|
In the second dropdown, you will find a list of MC-T Names. Choose Accordingly. |
|
|
</li> |
|
|
<li> |
|
|
The third dropdown menu has the unit of the MC-T Name you have chosen. |
|
|
</li> |
|
|
|
|
|
<br><b>Note:</b> If the unit was (m), choose whether you wish to extract perimeter or length data from the third selection. |
|
|
<br>The following row contains a dropdown and two text boxes: |
|
|
<br><b>First field:</b> A dropdown that allows you to choose a guessed name from the ones you wrote in the Google sheet legend (first column) |
|
|
<br><b>Second field:</b> Text field: Enter Specification |
|
|
<br><b>Third field:</b> Text field: Enter depth |
|
|
<br><br>You can add/ subtract rows by using the + and - button. |
|
|
|
|
|
<br><label style="font-style: italic;">Notes - Regarding the MC-T naming process:</label> |
|
|
<br>Entries within the same block correspond to the chosen MC-T name. |
|
|
<br>You can add another block and repeat the process for another item by clicking the button next to "Measure using ADR". |
|
|
<br>Rows in the same block having the same depth will be grouped together. (E.g. Guessed_Name_1 + Guessed_Name_2 , Specification, Depth) |
|
|
</div> |
|
|
</div> |
|
|
<div id="1_0textUserGuide" hidden class="othesectionsuserguide"> |
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Inputs </label> |
|
|
<br><br> |
|
|
<div style="margin-left: 40px;"> |
|
|
Please measure both the <b>area</b> and <b>perimeter</b> accurately for this section, as the system relies on both values. |
|
|
<br> |
|
|
You can measure multiple levels independently using the checkbox labeled <b>"Leveled plan"</b> under the <b>"Scale document"</b> heading. |
|
|
|
|
|
<br><u><b>How to Use It:</b></u> |
|
|
|
|
|
<li>Check the <b>"Leveled plan"</b> checkbox. This will open a new tab displaying a preview image of the selected PDF.</li> |
|
|
<li>Draw any irregular shape (linear only) around the items you want to define as a separate level. Click to add points and outline the shape.</li> |
|
|
<li>You can change the drawing color using the color palette located below the image.</li> |
|
|
<li>Click the <b>"Draw New Shape"</b> button to start drawing a new shape.</li> |
|
|
<li>Use the <b>"Undo"</b> button to remove the last line or shape you drew.</li> |
|
|
<li>All shapes drawn in the same color indicate that the items inside belong to the same level. Different colors represent different levels.</li> |
|
|
<li>Leave the checkbox unchecked if you want to measure the entire plan. Check it only if you want to measure specific areas or if the plan is divided into levels.</li> |
|
|
<li>When you're done, click the <b>Save</b> button at the bottom of the page to save your drawing with the defined levels.</li> |
|
|
|
|
|
|
|
|
<br>Return to the console and click the green <b>"Measure using ADR"</b> button. |
|
|
</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
<div id="2_1textUserGuide" hidden class="othesectionsuserguide"> |
|
|
User guide in progress... |
|
|
|
|
|
</div> |
|
|
<div id="2_6textUserGuide" hidden class="othesectionsuserguide"> |
|
|
User guide in progress... |
|
|
|
|
|
</div> |
|
|
<div id="2_7textUserGuide" hidden class="othesectionsuserguide"> |
|
|
User guide in progress... |
|
|
|
|
|
</div> |
|
|
<div id="2_8textUserGuide" hidden class="othesectionsuserguide"> |
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Overview </label> |
|
|
<br><br> |
|
|
<div style="margin-left: 40px;"> |
|
|
This algorithm is designed to retrieve door information from schedule files and map it onto the corresponding plan. The extracted data includes: |
|
|
<ul class="custom-ul" style="list-style-type:decimal;"> |
|
|
<li>Door ID/Number</li> |
|
|
<li>Door Type</li> |
|
|
<li>Structural Opening (Width × Height)</li> |
|
|
</ul> |
|
|
</div> |
|
|
|
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Features </label> |
|
|
<br><br> |
|
|
<div style="margin-left: 40px;"> |
|
|
This version of the algorithm offers the following capabilities: |
|
|
<ol> |
|
|
<li> |
|
|
<b>Grouping Similar Door Types</b> |
|
|
<ul class="custom-ul" style="list-style-type:lower-alpha;"> |
|
|
<li>Identifies and groups similar door types.</li> |
|
|
<li>Assigns a unique color to each group for better visualization.</li> |
|
|
<li>Exports grouped doors to Bluebeam as count-type annotations.</li> |
|
|
</ul> |
|
|
</li> |
|
|
<li> |
|
|
<b>Adding Annotations to Bluebeam’s Author Column</b><br> |
|
|
Automatically fills Bluebeam’s Author column with the width and height in the format:<br> |
|
|
<i>"X mm wide × Y mm high"</i> (e.g., 900 mm wide × 2100 mm high). |
|
|
</li> |
|
|
<li> |
|
|
<b>Detecting Repeated Door IDs</b><br> |
|
|
Reports any duplicate Door IDs found in the schedule. |
|
|
</li> |
|
|
<li> |
|
|
<b>Verifying Door Presence on the Plan</b><br> |
|
|
Reports doors listed in the schedule but not found on the plan. |
|
|
</li> |
|
|
</ol> |
|
|
</div> |
|
|
|
|
|
<br> |
|
|
|
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Usage Instructions </label> |
|
|
<br><br> |
|
|
<div style="margin-left: 40px;"> |
|
|
<ol> |
|
|
<li> |
|
|
<b>Input the Plan File</b> |
|
|
<ul class="custom-ul" style="list-style-type:lower-alpha;"> |
|
|
<li>Project</li> |
|
|
<li>Project Parts</li> |
|
|
<li>Sections</li> |
|
|
<li>Document to Measure</li> |
|
|
</ul> |
|
|
</li> |
|
|
<li> |
|
|
<b>Load the Schedule File</b><br> |
|
|
Select the schedule file from <i>"Other Relevant Documents"</i>. |
|
|
</li> |
|
|
<li> |
|
|
<b>Add Key Information</b><br> |
|
|
Enter the desired column names in the following order: |
|
|
<ul class="custom-ul" style="list-style-type:lower-alpha;"> |
|
|
<li>Door ID</li> |
|
|
<li>Door Type</li> |
|
|
<li> |
|
|
Structural Opening |
|
|
<ul class="custom-ul" style="list-style-type:lower-roman;"> |
|
|
<li>If the structural opening is in a single column, enter the full column name.</li> |
|
|
<li>If it's split into two sub-columns, enter them separately: |
|
|
<ul class="custom-ul" style="list-style-type:decimal;"> |
|
|
<li>Width</li> |
|
|
<li>Height</li> |
|
|
</ul> |
|
|
</li> |
|
|
</ul> |
|
|
</li> |
|
|
</ul> |
|
|
</li> |
|
|
<li><b>Run the Algorithm</b><br>Click the <b>"Measure Using ADR"</b> button to begin execution.</li> |
|
|
<li><b>Review the Output</b><br>A preview of the output will appear on the same page.</li> |
|
|
<li><b>Export Results</b><br>Download the output PDF.</li> |
|
|
</ol> |
|
|
</div> |
|
|
|
|
|
<br> |
|
|
|
|
|
<label id="userguideheadings"> |
|
|
<a href="https://docs.google.com/document/d/1UWWduUQd9niLu97oJekJnU3c1qqccWvwJ8eZpdJFTcQ/edit?tab=t.0" target="_blank" style="text-decoration: none; color: inherit;"> |
|
|
<label style="font-style: italic; color:blue; cursor: pointerS;"><u>Reference and Examples </u> </label> |
|
|
</a> |
|
|
</label> |
|
|
|
|
|
|
|
|
</div> |
|
|
<div id="3_2textUserGuide" hidden class="othesectionsuserguide"> |
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Floor Finishes Measurement </label> |
|
|
<br> |
|
|
<div style="margin-left: 40px;"> |
|
|
<p> |
|
|
This algorithm is designed to measure floor finishes on floor plans by detecting each shape individually and calculating its area and perimeter. |
|
|
</p> |
|
|
|
|
|
<b>Steps to Use:</b> |
|
|
<ol class="custom-ul"> |
|
|
<li>Open AutoCAD and import the PDF that was automatically downloaded when you checked the <i>"Document to be measured"</i> checkbox.</li> |
|
|
<li> |
|
|
When the pop-up window appears in AutoCAD, make sure the following options are selected: |
|
|
<ul class="custom-ul"> |
|
|
<li><b>PDF Data to Import:</b></li> |
|
|
<ul class="custom-ul"> |
|
|
<li>Vector geometry (Solid Fills)</li> |
|
|
<li>TrueType text</li> |
|
|
</ul> |
|
|
<li><b>Layers:</b> Use PDF Layers</li> |
|
|
<li><b>Import Options:</b></li> |
|
|
<ul class="custom-ul"> |
|
|
<li>Convert solid fills to hatches</li> |
|
|
<li>Apply line weight properties</li> |
|
|
</ul> |
|
|
</ul> |
|
|
</li> |
|
|
<li>Upload the generated DXF file to the console.</li> |
|
|
<li>Input only the measured perimeter. Area is not required in this section.</li> |
|
|
</ol> |
|
|
|
|
|
<b>Output Notes</b> |
|
|
<ul class="custom-ul"> |
|
|
<li>Download the output PDF file using the blue download icon located below the image preview.</li> |
|
|
<li>Open the downloaded PDF in Bluebeam.</li> |
|
|
<li>Set the scale in Bluebeam by navigating to <b>Tools → Measure → Set Scale</b>.</li> |
|
|
<li>Once the scale is set, all annotations will appear and automatically update in the measurement column, along with their corresponding labels.</li> |
|
|
<li><b>Important:</b> This section only works properly if the PDF was originally created in AutoCAD.</li> |
|
|
<li>Double-check that all required options are selected in AutoCAD’s import pop-up. If something is missing, markups may appear as X shapes.</li> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
<div id="3_3textUserGuide" hidden class="othesectionsuserguide"> |
|
|
<i class="fa fa-circle" aria-hidden="true"></i> |
|
|
<label id="userguideheadings"> Ceiling Finishes Measurement </label> |
|
|
<br> |
|
|
<div style="margin-left: 40px;"> |
|
|
<p> |
|
|
This algorithm is designed to measure ceiling finishes in ceiling plans by detecting each shape individually and calculating its area and perimeter. |
|
|
</p> |
|
|
|
|
|
<b>Steps to Use:</b> |
|
|
<ol class="custom-ul"> |
|
|
<li>Open AutoCAD and import the PDF that was automatically downloaded when the <i>"Document to be measured"</i> checkbox was selected.</li> |
|
|
<li> |
|
|
When the pop-up window appears in AutoCAD, ensure the following options are selected: |
|
|
<ul class="custom-ul"> |
|
|
<li><b>PDF Data to Import:</b></li> |
|
|
<ul class="custom-ul"> |
|
|
<li>Vector geometry (Solid Fills)</li> |
|
|
<li>TrueType text</li> |
|
|
</ul> |
|
|
<li><b>Layers:</b> Use PDF Layers</li> |
|
|
<li><b>Import Options:</b></li> |
|
|
<ul class="custom-ul"> |
|
|
<li>Convert solid fills to hatches</li> |
|
|
<li>Apply line weight properties</li> |
|
|
</ul> |
|
|
</ul> |
|
|
</li> |
|
|
<li>Upload the generated DXF file to the console.</li> |
|
|
<li>Enter only the measured perimeter. Area input is not required in this section.</li> |
|
|
</ol> |
|
|
|
|
|
<br> |
|
|
|
|
|
<b>Output Notes for Section 3.3 Measurement:</b> |
|
|
<ul class="custom-ul"> |
|
|
<li>Download the output PDF by clicking the blue download icon located below the image preview.</li> |
|
|
<li>Open the PDF in Bluebeam.</li> |
|
|
<li>Set the scale in Bluebeam by navigating to <b>Tools → Measure → Set Scale</b>.</li> |
|
|
<li>Once the scale is set, all annotations will appear and dynamically update in the measurement column along with their corresponding labels.</li> |
|
|
<li><b>Important:</b> This section functions correctly only if the original PDF was created in AutoCAD.</li> |
|
|
<li>Double-check that all required options are selected in AutoCAD's import pop-up. If anything is missing, markups might appear as X shapes.</li> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="mpopupBox" class="mpopup" name="tobeclosed"> |
|
|
|
|
|
<div class="modal-content"> |
|
|
<div class="modal-header"> |
|
|
<button type="button" class="closeModal" data-dismiss="modal">×</button> |
|
|
<h2 id="TopTextModal">Error</h2> |
|
|
</div> |
|
|
<div class="modal-body"> |
|
|
<p id="modal-bodyText"> |
|
|
</p> |
|
|
<br> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="dialog-container" class="overlay" name="tobeclosed"> |
|
|
|
|
|
<div class="modal-content"> |
|
|
<div class="modal-header"> |
|
|
<button type="button" class="closeModal" >×</button> |
|
|
<h2 id="TopTextModalWarning">Warning!</h2> |
|
|
</div> |
|
|
|
|
|
<div class="modal-body"> |
|
|
<p id="modal-bodyTextp">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. |
|
|
</p> |
|
|
|
|
|
<div id="Thickness2.7" hidden="until-found"> |
|
|
<label id="modalColumn">Maximum Thickness of Walls</label> |
|
|
<br> |
|
|
<input type="number" id="text002extra" name="text003name" placeholder="Eg: 3" min="0"> |
|
|
</div> |
|
|
|
|
|
<div id="duplicaterExtra" hidden="until-found"> |
|
|
<div id="repeatforloopExtra" class="repeatforloopclassExtra0" name="repeatforloopExtraname " > |
|
|
<label id="modalColumn">Type</label> <label id="modalGray">(from drawing)</label> |
|
|
<i class="fa fa-info-circle smallFaIcon" id="infotoolModal"> |
|
|
<span class="tooltiptext" id="modaltooltips"> |
|
|
Enter the title for the column as it will be shown in Bluebeam columns. This helps organize and categorize extracted information. |
|
|
For the first entry (first row), please add the Door Type in here. |
|
|
</span> |
|
|
</i> |
|
|
<label id="modalKeyword">Specification</label> <label id="modalGray">(from drawing)</label> |
|
|
<i class="fa fa-info-circle smallFaIcon" id="infotoolModal"> |
|
|
<span class="tooltiptext" id="modaltooltips"> |
|
|
Provide a word or phrase from the data you want to help detect relevant information in the drawing. |
|
|
</span> |
|
|
</i> |
|
|
<label id="modalCharacter">Count</label> |
|
|
<i class="fa fa-info-circle smallFaIcon" id="infotoolModal"> |
|
|
<span class="tooltiptext" id="modaltooltips"> |
|
|
Set the number of characters that is expected to be captured. This helps refine the extraction by limiting or expanding the detected text. |
|
|
</span> |
|
|
</i> |
|
|
<br> |
|
|
|
|
|
<input type="text" id="text0extra" name="text1name" placeholder="Eg: Door Type" > |
|
|
<input type="text" id="text1extra" name="text2name" placeholder="Eg:NBS K10/" > |
|
|
<input type="number" id="text2extra" name="text3name" placeholder="Eg: 3" min="0"> |
|
|
|
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script> |
|
|
<lord-icon |
|
|
onclick="addmctnameiconPopup()" |
|
|
src="https://cdn.lordicon.com/mecwbjnp.json" |
|
|
trigger="hover" |
|
|
class="addmctnameclassExtra" |
|
|
id="addmctnameidExtra" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
</div> |
|
|
</div> |
|
|
<div hidden="until-found" id="duplicaterExtraHidden" > |
|
|
<div id="repeatforloopExtrahidden" class="repeatforloopclassExtrahidden" name="repeatforloopnameExtrahidden " > |
|
|
<input type="text" id="text0extra" name="text1name" placeholder="Eg: Column Name" > |
|
|
<input type="text" id="text1extra" name="text2name" placeholder="Eg:NBS K10/" > |
|
|
<input type="number" id="text2extra" name="text3name" placeholder="Eg: 3" > |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js" ></script> |
|
|
<lord-icon |
|
|
onclick="addmctnameiconPopup()" |
|
|
src="https://cdn.lordicon.com/mecwbjnp.json" |
|
|
trigger="hover" |
|
|
class="addmctnameclassExtra" |
|
|
id="addmctnameidExtra" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
<script src="https://cdn.lordicon.com/bhenfmcm.js"></script> |
|
|
<lord-icon |
|
|
onclick="deletemctnameiconPopup()" |
|
|
src="https://cdn.lordicon.com/rivoakkk.json" |
|
|
trigger="hover" |
|
|
class="deletemctnameclassExtra" |
|
|
id="deletemctnameidExtra" |
|
|
colors="primary:black,secondary:black"> |
|
|
</lord-icon> |
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<br> |
|
|
<div class="text-right"> |
|
|
<button class="dialog-btn btn-primary" id="confirm">Ok</button> |
|
|
<button class="dialog-btn btn-cancel" id="cancel">Cancel</button> |
|
|
</div> |
|
|
<br> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
</body> |
|
|
</html> |
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.14.305/pdf.min.js"></script> |
|
|
<script > |
|
|
|
|
|
|
|
|
ErrorPopup=document.getElementById('errorTextContent'); |
|
|
|
|
|
var Errormodalmpopup = document.getElementById('ErrorModalid'); |
|
|
function showErrorPopup(){ |
|
|
|
|
|
Errormodalmpopup.style.display = "block"; |
|
|
} |
|
|
|
|
|
window.onclick = function(event) { |
|
|
if (event.target == mpopup) { |
|
|
Errormodalmpopup.style.display = "none"; |
|
|
} |
|
|
}; |
|
|
var closeButtons = document.querySelectorAll(".closeModal"); |
|
|
var allCloseDivs = document.getElementsByName("tobeclosed"); |
|
|
|
|
|
closeButtons.forEach(function(button) { |
|
|
button.addEventListener("click", function() { |
|
|
allCloseDivs.forEach(function(div) { |
|
|
div.style.display = "none"; |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
var ActiveSections=['2.1','2.6','2.7','2.8','3.2','3.3','4.0'] |
|
|
|
|
|
var menuItems = document.querySelectorAll("#UserGuidemenuOptions li"); |
|
|
|
|
|
menuItems.forEach(function (item) { |
|
|
|
|
|
var sectionNumber = item.textContent.trim().split(" ")[0]; |
|
|
|
|
|
|
|
|
if (!ActiveSections.includes(sectionNumber)) { |
|
|
item.id = "disabledSection"; |
|
|
item.style.color = "#bdbcbc"; |
|
|
item.style.cursor = "not-allowed"; |
|
|
item.onclick = null; |
|
|
} |
|
|
}); |
|
|
|
|
|
function updateProgressBar(value) { |
|
|
const progressBar = document.getElementById('progress'); |
|
|
progressBar.style.width = value + '%'; |
|
|
progressBar.innerText = Math.round(value) + '%'; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getURLParams() { |
|
|
const urlParams = new URLSearchParams(window.location.search); |
|
|
return { |
|
|
pdfLink: urlParams.get('pdfLink'), |
|
|
keyword: JSON.parse(decodeURIComponent(urlParams.get('keyword') || "[]")), |
|
|
pageNumber: parseInt(urlParams.get('page')) || 1, |
|
|
zoomRect: urlParams.get('zoom') |
|
|
}; |
|
|
} |
|
|
function processPdf() { |
|
|
|
|
|
|
|
|
const { pdfLink, keyword, pageNumber, zoomRect } = getURLParams(); |
|
|
|
|
|
const formData = new FormData(); |
|
|
formData.append('pdf_link', pdfLink); |
|
|
formData.append('keyword', JSON.stringify(keyword)); |
|
|
|
|
|
fetch('/api/process-data', { |
|
|
method: 'POST', |
|
|
body: formData, |
|
|
}) |
|
|
.then(response => response.json()) |
|
|
.then(data => { |
|
|
if (data.download_link) { |
|
|
|
|
|
console.log('Done!') |
|
|
} else { |
|
|
alert('Error: ' + data.error); |
|
|
} |
|
|
}) |
|
|
.catch(error => { |
|
|
console.error('Error:', error); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PopupElement=document.getElementById('modal-bodyText'); |
|
|
|
|
|
sectionSelect=document.getElementById('section-select'); |
|
|
$(sectionSelect).select2({ |
|
|
closeOnSelect: true, |
|
|
width:'20ch' |
|
|
|
|
|
}); |
|
|
|
|
|
thirddropdown=document.getElementsByClassName('selectionsProjs')[0]; |
|
|
$(thirddropdown).select2({ |
|
|
placeholder:'Sections', |
|
|
closeOnSelect: true, |
|
|
width:'51ch' |
|
|
}); |
|
|
var measSelect = document.getElementById("measureselectid"); |
|
|
|
|
|
var relvSelect = document.getElementById("relvselectid"); |
|
|
document.getElementById("all").style.display = "block"; |
|
|
|
|
|
|
|
|
PrjSectionsArray=[]; |
|
|
var partsArrwithID=[]; |
|
|
var firstDpwnValue; |
|
|
var prjids=[] |
|
|
function isValueNotInDropdown(dropdown, value) { |
|
|
|
|
|
const values = Array.from(dropdown.options).map(option => option.value); |
|
|
return !values.includes(value); |
|
|
} |
|
|
|
|
|
displayprojsections() |
|
|
function displayprojsections(){ |
|
|
|
|
|
document.getElementById("all").style.display = "block"; |
|
|
thirddropdown.innerHTML = ''; |
|
|
|
|
|
let placeholderOption = document.createElement("option"); |
|
|
placeholderOption.text = "-- Select Section --"; |
|
|
placeholderOption.value = ""; |
|
|
placeholderOption.disabled = true; |
|
|
placeholderOption.selected = true; |
|
|
placeholderOption.hidden = true; |
|
|
thirddropdown.appendChild(placeholderOption); |
|
|
$.get('/getprojectsections/' + JSON.stringify(['testing'])) |
|
|
.done(function(data) { |
|
|
document.getElementById("all").style.display = "none"; |
|
|
|
|
|
for (let i = 0; i < data.length; i++) { |
|
|
let valueDoesNotExist = isValueNotInDropdown(thirddropdown, data[i]); |
|
|
|
|
|
if (valueDoesNotExist) { |
|
|
let opt = document.createElement("option"); |
|
|
opt.value = data[i]; |
|
|
opt.text = data[i]; |
|
|
|
|
|
let isActive = false; |
|
|
for (let d = 0; d < ActiveSections.length; d++) { |
|
|
if (data[i].startsWith(ActiveSections[d])) { |
|
|
isActive = true; |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
if (!isActive) { |
|
|
opt.style.color = '#bdbcbc'; |
|
|
opt.style.cursor = 'not-allowed'; |
|
|
opt.setAttribute('disabled', true); |
|
|
} |
|
|
|
|
|
thirddropdown.append(opt); |
|
|
PrjSectionsArray.push(data[i]); |
|
|
} |
|
|
} |
|
|
}) |
|
|
.fail(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Error occured while retrieving the Project Sections. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var $mySidebar = document.getElementById('mySidebar'); |
|
|
var $toggle = document.getElementById('toggle'); |
|
|
$toggle.addEventListener('click', function() { |
|
|
|
|
|
var isOpen = $mySidebar.classList.contains('slide-in'); |
|
|
w3_open(); |
|
|
$mySidebar.setAttribute('class', isOpen ? 'slide-out' : 'slide-in'); |
|
|
$toggle.classList.toggle("change"); |
|
|
|
|
|
|
|
|
if ($mySidebar.classList.contains('slide-out')){ |
|
|
w3_close() |
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
MCTNames={} |
|
|
var workerMCT = new Worker('../static/MC_T_API_Worker.js'); |
|
|
|
|
|
workerMCT.onmessage= function(event){ |
|
|
console.log('refreshed') |
|
|
if (thirddropdown.value){ |
|
|
sectionNumber=thirddropdown.value; |
|
|
|
|
|
MCTNames=event.data; |
|
|
MCTNames=MCTNames[sectionNumber.toString().toLowerCase()] |
|
|
|
|
|
} |
|
|
console.log('MCtname::',MCTNames) |
|
|
} |
|
|
|
|
|
var val='' |
|
|
var worker = new Worker('../static/API_Refresh_workerJS.js'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mctnameEmpty=false; |
|
|
var sectionNumber; |
|
|
function getALLMCTNAMES(){ |
|
|
MCTNames={} |
|
|
document.getElementById("all").style.display = "block"; |
|
|
$.get( '/RetrieveMCTNames/') |
|
|
.success (function(data){ |
|
|
|
|
|
console.log(data) |
|
|
MCTNames=data; |
|
|
sectionNumber = projsec.value.split(" ")[0]; |
|
|
console.log(sectionNumber); |
|
|
|
|
|
|
|
|
let matchedKey = Object.keys(MCTNames).find(key => key.toLowerCase().startsWith(sectionNumber.toLowerCase())); |
|
|
|
|
|
if (matchedKey) { |
|
|
console.log(matchedKey); |
|
|
let matchedValue = MCTNames[matchedKey]; |
|
|
|
|
|
console.log('MCTname::', matchedValue); |
|
|
|
|
|
if (matchedValue && matchedValue.length ==0) { |
|
|
mctnameEmpty = true; |
|
|
} else { |
|
|
mctnameEmpty = false; |
|
|
} |
|
|
} else { |
|
|
console.log("No matching key found in MCTNames"); |
|
|
mctnameEmpty = false; |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
.error(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Error occured while retrieving the MC-T Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('duplicater').childNodes[1].value=[0,0] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function w3_open() { |
|
|
document.getElementById("home").style.marginLeft = "25%"; |
|
|
document.getElementById("legends").style.marginLeft = "25%"; |
|
|
|
|
|
document.getElementById("home").style.transition= '0.8s'; |
|
|
document.getElementById("legends").style.transition= '0.8s'; |
|
|
|
|
|
document.getElementById("mySidebar").style.width = "25%"; |
|
|
document.getElementById("mySidebar").style.display = "block"; |
|
|
} |
|
|
|
|
|
function w3_close() { |
|
|
document.getElementById("home").style.marginLeft = "0%"; |
|
|
document.getElementById("legends").style.marginLeft = "0%"; |
|
|
document.getElementById("home").style.transition= '1.5s' |
|
|
document.getElementById("legends").style.transition= '1.5s' |
|
|
document.getElementById("mySidebar").style.display = "none"; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('measureADRbutton').addEventListener('click',function(){ |
|
|
|
|
|
|
|
|
if (document.getElementById('imgContainer')) { |
|
|
document.getElementById('imgContainer').innerHTML = ''; |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function openTab(evt, tabname) { |
|
|
var i, tabcontent, tablinks; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tabcontent = document.getElementsByClassName("tabcontent"); |
|
|
for (i = 0; i < tabcontent.length; i++) { |
|
|
tabcontent[i].style.display = "none"; |
|
|
} |
|
|
|
|
|
|
|
|
tablinks = document.getElementsByClassName("tablinks"); |
|
|
for (i = 0; i < tablinks.length; i++) { |
|
|
tablinks[i].className = tablinks[i].className.replace(" active", ""); |
|
|
} |
|
|
|
|
|
|
|
|
var tab = document.getElementById(tabname); |
|
|
if (tab) { |
|
|
tab.style.display = "block"; |
|
|
tab.className += " active"; |
|
|
|
|
|
} else { |
|
|
console.error('Tab content with ID ' + tabname + ' not found.'); |
|
|
} |
|
|
} |
|
|
|
|
|
function redirectTestingMeasurement(){ |
|
|
$toggle.classList.toggle("change"); |
|
|
var isOpen = $mySidebar.classList.contains('slide-out'); |
|
|
$mySidebar.setAttribute('class', isOpen ? 'slide-in' : 'slide-out'); |
|
|
w3_close() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
document.getElementById("pagetitle").click(); |
|
|
|
|
|
|
|
|
function addIframeTab(title, url) { |
|
|
var tabId = "tab_" + Date.now(); |
|
|
|
|
|
|
|
|
var newTab = document.createElement("button"); |
|
|
newTab.className = "tablinks"; |
|
|
newTab.innerHTML = title + ' <i class="fa fa-times" onclick="removeTab(event, \'' + tabId + '\')"></i>'; |
|
|
newTab.onclick = function (event) { |
|
|
|
|
|
setTimeout(function() { |
|
|
openTab(event, tabId); |
|
|
}, 10); |
|
|
}; |
|
|
|
|
|
|
|
|
var tabnameDrpdwn = document.createElement("label"); |
|
|
tabnameDrpdwn.className = "tabslabel"; |
|
|
tabnameDrpdwn.innerHTML = title |
|
|
|
|
|
document.getElementById("dynamicTabs").appendChild(newTab); |
|
|
document.getElementById("FramestabsDropdown").appendChild(tabnameDrpdwn); |
|
|
tabnameDrpdwn.addEventListener('click',function(){ |
|
|
openTab('click',tabId) |
|
|
}) |
|
|
|
|
|
|
|
|
document.getElementById("dynamicTabs").addEventListener('mouseover', function() { |
|
|
|
|
|
const labels = document.getElementById("FramestabsDropdown").children; |
|
|
if (labels.length > 0) { |
|
|
document.getElementById("FramestabsDropdown").style.display = 'block'; |
|
|
} |
|
|
}); |
|
|
|
|
|
document.getElementById("FramestabsDropdown").addEventListener('mouseover', function() { |
|
|
|
|
|
document.getElementById("FramestabsDropdown").style.display = 'block'; |
|
|
}); |
|
|
|
|
|
document.addEventListener('click', function(event) { |
|
|
const dropdown = document.getElementById("FramestabsDropdown"); |
|
|
|
|
|
if (!dropdown.contains(event.target)) { |
|
|
dropdown.style.display = 'none'; |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
document.querySelectorAll("iframe").forEach((iframe) => { |
|
|
iframe.contentWindow?.addEventListener("mousedown", function () { |
|
|
document.getElementById("FramestabsDropdown").style.display = "none"; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var iframeContainer = document.createElement("div"); |
|
|
iframeContainer.id = tabId; |
|
|
iframeContainer.className = "tabcontent"; |
|
|
iframeContainer.style.display = "none"; |
|
|
|
|
|
|
|
|
var iframe = document.createElement("iframe"); |
|
|
iframe.src = url; |
|
|
iframe.style.width = "100%"; |
|
|
iframe.style.height = "100vh"; |
|
|
|
|
|
iframeContainer.appendChild(iframe); |
|
|
|
|
|
|
|
|
document.getElementById("consoleContent").appendChild(iframeContainer); |
|
|
|
|
|
|
|
|
setTimeout(function() { |
|
|
newTab.click(); |
|
|
}, 10); |
|
|
} |
|
|
|
|
|
|
|
|
function removeTab(event, tabId) { |
|
|
event.stopPropagation(); |
|
|
|
|
|
var tabButton = event.target.parentElement; |
|
|
var tabContent = document.getElementById(tabId); |
|
|
|
|
|
if (tabButton) tabButton.remove(); |
|
|
if (tabContent) tabContent.remove(); |
|
|
|
|
|
|
|
|
document.getElementById("pagetitle").click(); |
|
|
} |
|
|
function downloadPdf(pdfname,downloadPDFName) { |
|
|
console.log('pdfname===',pdfname) |
|
|
|
|
|
fetch('/get-pdf/'+JSON.stringify(pdfname)) |
|
|
.then(response => response.blob()) |
|
|
.then(blob => { |
|
|
const url = URL.createObjectURL(blob); |
|
|
var link = document.createElement('a'); |
|
|
link.href = url; |
|
|
link.download = downloadPDFName; |
|
|
link.dispatchEvent(new MouseEvent('click')); |
|
|
}) |
|
|
.catch(error => console.error('Error fetching PDF:', error)); |
|
|
} |
|
|
|
|
|
function downloadExcel(blob,downloadPDFName) { |
|
|
|
|
|
const url = URL.createObjectURL(blob); |
|
|
const a = document.createElement('a'); |
|
|
a.style.display = 'none'; |
|
|
a.href = url; |
|
|
a.download = downloadPDFName; |
|
|
document.body.appendChild(a); |
|
|
a.click(); |
|
|
document.body.removeChild(a); |
|
|
URL.revokeObjectURL(url); |
|
|
|
|
|
} |
|
|
function downloadPDFfromLink(pdfLinksent, downloadPDFName) { |
|
|
const encodedURL = encodeURIComponent(pdfLinksent); |
|
|
if (document.getElementById('downloadPdfbutton')){ |
|
|
document.getElementById('downloadPdfbutton').setAttribute('disabled',true) |
|
|
document.getElementById('downloadPdfbutton').style.cursor='not-allowed'; |
|
|
document.getElementById('downloadPdfbutton').style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
} |
|
|
fetch(`/downloadPDFfromLink?url=${encodedURL}`) |
|
|
.then(response => response.blob()) |
|
|
.then(blob => { |
|
|
const url = URL.createObjectURL(blob); |
|
|
const link = document.createElement('a'); |
|
|
link.href = url; |
|
|
link.download = downloadPDFName; |
|
|
link.dispatchEvent(new MouseEvent('click')); |
|
|
|
|
|
if (document.getElementById('downloadPdfbutton')){ |
|
|
document.getElementById('downloadPdfbutton').removeAttribute('disabled'); |
|
|
document.getElementById('downloadPdfbutton').style.cursor='pointer'; |
|
|
document.getElementById('downloadPdfbutton').style.color = 'white'; |
|
|
document.getElementById('downloadPdfbutton').style.backgroundColor="rgb(47, 131, 198)"; |
|
|
|
|
|
document.getElementById('downloadPdfbutton').addEventListener('mouseover',function(){ |
|
|
document.getElementById('downloadPdfbutton').style.color='black'; |
|
|
document.getElementById('downloadPdfbutton').style.boxShadow=' 0 0 8px 2px rgb(47, 131, 198)'; |
|
|
}) |
|
|
document.getElementById('downloadPdfbutton').addEventListener('mouseout',function(){ |
|
|
document.getElementById('downloadPdfbutton').style.color='white'; |
|
|
document.getElementById('downloadPdfbutton').style.boxShadow='none'; |
|
|
}); |
|
|
} |
|
|
}) |
|
|
.catch(error => console.error('Error fetching PDF:', error)); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dupliateiExtra = 0; |
|
|
var clonedDivIdExtra=0; |
|
|
var originalExtra = document.getElementById('duplicaterhidden'); |
|
|
var addciconvalExtra=0; |
|
|
var jjExtra=0; |
|
|
|
|
|
var dupliatei = 0; |
|
|
var clonedDivId=0; |
|
|
var original = document.getElementById('duplicaterhidden'); |
|
|
var addciconval=0; |
|
|
var jj=0; |
|
|
|
|
|
const vals = []; |
|
|
var canvasimg; |
|
|
var ry = [[]]; |
|
|
var section = document.getElementsByClassName("selectionsProjs")[0] |
|
|
function duplicate() { |
|
|
|
|
|
|
|
|
addciconval+=1; |
|
|
jj=0; |
|
|
var clone = original.cloneNode(true); |
|
|
console.log('clonee',clone.children) |
|
|
clone.id = 'duplicater' + ++dupliatei; |
|
|
clonedDivId=clone.id; |
|
|
clone.children[0].value=[addciconval,jj] |
|
|
clone.children[5].style.marginLeft='5px'; |
|
|
|
|
|
clone.children[5].children[4].id='addmctnameid'+dupliatei |
|
|
clone.children[5].children[6].style.display='none' |
|
|
clone.children[5].style.marginTop='8px'; |
|
|
console.log('ayhaga', clone.children[5]) |
|
|
clone.removeAttribute("hidden"); |
|
|
clone.setAttribute('class','duplicaterclass'+dupliatei); |
|
|
clone.getElementsByClassName('measurementselections')[0].setAttribute('name', 'measurementscripts'+dupliatei); |
|
|
clone.getElementsByClassName('measurementselections')[0].setAttribute('class', 'measurementselections'+dupliatei); |
|
|
clone.getElementsByClassName('measureitems')[0].setAttribute('name', 'measureitem'+dupliatei); |
|
|
clone.getElementsByClassName('measureitems')[0].setAttribute('class', 'measureitems'+dupliatei); |
|
|
clone.getElementsByClassName('selections')[0].setAttribute('name', 'select'+dupliatei); |
|
|
clone.getElementsByClassName('selections')[0].setAttribute('class', 'selections'+dupliatei); |
|
|
clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('id', 'repeatforloop'+addciconval+'0'); |
|
|
clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('name', 'repeatforloopname'+addciconval+'0'); |
|
|
clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('class', 'repeatforloopclass'+addciconval+'0'); |
|
|
if (thirddropdown.value.startsWith('3.2') || thirddropdown.value.startsWith('3.3')) |
|
|
{ |
|
|
|
|
|
clone.children[5].children[1].setAttribute('disabled','True') |
|
|
clone.children[5].children[2].setAttribute('disabled','True') |
|
|
|
|
|
clone.children[5].children [1].style.cursor='not-allowed'; |
|
|
clone.children[5].children[2].style.cursor='not-allowed'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
original.parentNode.appendChild(clone); |
|
|
clone.parentElement.insertBefore(clone, document.getElementById('doneebackground')); |
|
|
|
|
|
|
|
|
if (addciconval>0){ |
|
|
var inputs1 = document.getElementsByClassName("measurementselections"+dupliatei)[0]; |
|
|
var selections1 = document.getElementsByClassName("selections"+dupliatei)[0]; |
|
|
var measitem1 = document.getElementsByClassName("measureitems"+dupliatei)[0]; |
|
|
|
|
|
$(inputs1).select2({ |
|
|
placeholder:'Select', |
|
|
closeOnSelect: true, |
|
|
width:'15ch' |
|
|
|
|
|
}); |
|
|
$(selections1).select2({ |
|
|
placeholder:'Select MC-T Name', |
|
|
closeOnSelect: true, |
|
|
width:'23ch' |
|
|
}); |
|
|
$(measitem1).select2({ |
|
|
placeholder:'Select unit', |
|
|
closeOnSelect: true, |
|
|
width:'11ch' |
|
|
}); |
|
|
$(inputs1).on("change", function (e) { |
|
|
get3rddropdown(); |
|
|
}); |
|
|
$(selections1).on("change", function (e) { |
|
|
get3rddropdown(); |
|
|
}) |
|
|
|
|
|
if (section.value.startsWith('1.0')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs1.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Ground Beams'; |
|
|
optn.value= "ground beams"; |
|
|
inputs1.add(optn); |
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Pile Caps'; |
|
|
optn1.value= "pile caps"; |
|
|
inputs1.add(optn1); |
|
|
} |
|
|
if (section.value.startsWith('3.2')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs1.add(opt); |
|
|
|
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Floor'; |
|
|
optn.value= "Floor"; |
|
|
inputs1.add(optn); |
|
|
|
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Wall'; |
|
|
optn1.value= "Wall"; |
|
|
inputs1.add(optn1); |
|
|
|
|
|
var optn2 = document.createElement("OPTION"); |
|
|
optn2.text= 'Internal Doors'; |
|
|
optn2.value= "Internal Doors"; |
|
|
inputs1.add(optn2); |
|
|
} |
|
|
|
|
|
if (section.value.startsWith('2.7')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs1.add(opt); |
|
|
|
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Internal Walls'; |
|
|
optn.value= "Internal Walls"; |
|
|
inputs1.add(optn); |
|
|
|
|
|
} |
|
|
if (section.value.startsWith('2.8') || section.value.startsWith('2.6')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs1.add(opt); |
|
|
|
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Single Door'; |
|
|
optn.value= "Single Door"; |
|
|
inputs1.add(optn); |
|
|
|
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Double Door'; |
|
|
optn1.value= "Double Door"; |
|
|
inputs1.add(optn1); |
|
|
|
|
|
} |
|
|
if (section.value.startsWith('2.1')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs1.add(opt); |
|
|
|
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Column'; |
|
|
optn.value= "Column"; |
|
|
inputs1.add(optn); |
|
|
|
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Wall'; |
|
|
optn1.value= "Wall"; |
|
|
inputs1.add(optn1); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
function userguidetoggleFunction() { |
|
|
var dropdownContentUserguideId = document.getElementById("dropdown-contentUserguideId"); |
|
|
var UserGuideSideBar = document.getElementById('UserGuideSideBar'); |
|
|
var UserGuidetoggle = document.getElementById('UserGuidetoggle'); |
|
|
|
|
|
var isOpen = UserGuideSideBar.style.display === "block"; |
|
|
|
|
|
|
|
|
dropdownContentUserguideId.classList.remove("active"); |
|
|
|
|
|
|
|
|
if (isOpen) { |
|
|
UserGuideSideBar.style.display = "none"; |
|
|
UserGuideSideBar.classList.remove('UserGuideslide-in'); |
|
|
UserGuideSideBar.classList.add('UserGuideslide-out'); |
|
|
UserGuidetoggle.classList.remove("change"); |
|
|
} else { |
|
|
UserGuideSideBar.style.display = "block"; |
|
|
UserGuideSideBar.style.width = "25%"; |
|
|
UserGuideSideBar.classList.add('UserGuideslide-in'); |
|
|
UserGuideSideBar.classList.remove('UserGuideslide-out'); |
|
|
UserGuidetoggle.classList.add("change"); |
|
|
} |
|
|
} |
|
|
|
|
|
function ShowSectionUserguide(element) { |
|
|
var textFirstPage = document.getElementById('textfirstpage'); |
|
|
var UserGuideSideBar = document.getElementById('UserGuideSideBar'); |
|
|
var UserGuidetoggle = document.getElementById('UserGuidetoggle'); |
|
|
var isOpen = UserGuideSideBar.style.display === "block"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (element.id === 'homeguidebutton' || element.parentElement?.id === 'homeguidebutton') { |
|
|
if (textFirstPage.style.display === 'block') { |
|
|
return; |
|
|
} |
|
|
hideAllSections(); |
|
|
textFirstPage.style.display = 'block'; |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
if (element.tagName === 'LI') { |
|
|
hideAllSections(); |
|
|
|
|
|
if (isOpen) { |
|
|
UserGuideSideBar.style.display = "none"; |
|
|
UserGuideSideBar.classList.remove('UserGuideslide-in'); |
|
|
UserGuideSideBar.classList.add('UserGuideslide-out'); |
|
|
UserGuidetoggle.classList.remove("change"); |
|
|
} else { |
|
|
UserGuideSideBar.style.display = "block"; |
|
|
UserGuideSideBar.style.width = "25%"; |
|
|
UserGuideSideBar.classList.add('UserGuideslide-in'); |
|
|
UserGuideSideBar.classList.remove('UserGuideslide-out'); |
|
|
UserGuidetoggle.classList.add("change"); |
|
|
} |
|
|
|
|
|
if (element.textContent.startsWith('1.0')) { |
|
|
document.getElementById('1_0textUserGuide').style.display = 'block'; |
|
|
document.getElementById('1_0textUserGuide').removeAttribute('hidden'); |
|
|
|
|
|
} |
|
|
else if (element.textContent.startsWith('2.1')) { |
|
|
document.getElementById('2_1textUserGuide').style.display = 'block'; |
|
|
document.getElementById('2_1textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
|
|
|
else if (element.textContent.startsWith('2.6')) { |
|
|
document.getElementById('2_6textUserGuide').style.display = 'block'; |
|
|
document.getElementById('2_6textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
else if (element.textContent.startsWith('2.7')) { |
|
|
document.getElementById('2_7textUserGuide').style.display = 'block'; |
|
|
document.getElementById('2_7textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
else if (element.textContent.startsWith('2.8')) { |
|
|
document.getElementById('2_8textUserGuide').style.display = 'block'; |
|
|
document.getElementById('2_8textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
else if (element.textContent.startsWith('3.2')) { |
|
|
document.getElementById('3_2textUserGuide').style.display = 'block'; |
|
|
document.getElementById('3_2textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
else if (element.textContent.startsWith('3.3')) { |
|
|
document.getElementById('3_3textUserGuide').style.display = 'block'; |
|
|
document.getElementById('3_3textUserGuide').removeAttribute('hidden'); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function hideAllSections() { |
|
|
document.getElementById('textfirstpage').style.display = 'none'; |
|
|
document.getElementById('1_0textUserGuide').style.display = 'none'; |
|
|
document.getElementById('2_1textUserGuide').style.display = 'none'; |
|
|
document.getElementById('2_7textUserGuide').style.display = 'none'; |
|
|
document.getElementById('2_8textUserGuide').style.display = 'none'; |
|
|
document.getElementById('3_2textUserGuide').style.display = 'none'; |
|
|
document.getElementById('3_3textUserGuide').style.display = 'none'; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function userguideclick(){ |
|
|
document.getElementById('textfirstpage').style.display='block' |
|
|
var acc = document.getElementsByClassName("dropdown-content")[0]; |
|
|
var userguideClose=document.getElementById("userguideClose") |
|
|
var i; |
|
|
acc.classList.toggle("active"); |
|
|
|
|
|
|
|
|
if (acc.style.display === "block") { |
|
|
acc.style.display = "none"; |
|
|
|
|
|
} else { |
|
|
acc.style.display = "block"; |
|
|
acc.style.backgroundColor=(0, 153, 255); |
|
|
} |
|
|
|
|
|
close.onclick = function() { |
|
|
acc.style.display = "none"; |
|
|
}; |
|
|
|
|
|
} |
|
|
function userguideMayaTableClick(){ |
|
|
var userguideTableMaya=document.getElementById('userguideTableMaya') |
|
|
window.open('https://docs.google.com/spreadsheets/d/10TjB8EbSiDHybo9YsDDzekxi8iQECpprXdqptHCZzec/edit?gid=875423041#gid=875423041'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var areainpixels=0; |
|
|
var prminpixels=0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var proj = document.getElementsByClassName("selectionsProj")[0]; |
|
|
var proj1 = document.getElementsByClassName("selectionsProjp")[0]; |
|
|
var projsec = document.getElementsByClassName("selectionsProjs")[0]; |
|
|
var pdfname; |
|
|
|
|
|
projsec.addEventListener('input',function(){ |
|
|
projsec.style.boxShadow=( '2px 2px 2px gray') |
|
|
}) |
|
|
|
|
|
var ratioAunit=1; |
|
|
var ratioPunit=1; |
|
|
var pdfnames=''; |
|
|
|
|
|
|
|
|
|
|
|
function getSelectValues(select) { |
|
|
var result = []; |
|
|
var options = select && select.options; |
|
|
var opt; |
|
|
|
|
|
for (var i=0, iLen=options.length; i<iLen; i++) { |
|
|
opt = options[i]; |
|
|
|
|
|
|
|
|
if (opt.selected) { |
|
|
result.push(opt.value || opt.text); |
|
|
} |
|
|
} |
|
|
console.log('selectedddddd',result) |
|
|
return result; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var doorSchedulePDF; |
|
|
function getproj(){ |
|
|
getALLMCTNAMES(); |
|
|
|
|
|
var proj = document.getElementById("projlinkTesting"); |
|
|
var projectVal=proj.value.toString() |
|
|
|
|
|
var sections = document.getElementsByClassName("selectionsProjs")[0]; |
|
|
chooseFirstdrpdwn(); |
|
|
|
|
|
|
|
|
document.getElementById('refreshDropboxButtonID').style.display = "block"; |
|
|
document.getElementById("all").style.display = "none"; |
|
|
|
|
|
if (sections.value.startsWith('4.0') ){ |
|
|
document.getElementById('Newtablebutton').removeAttribute('hidden'); |
|
|
|
|
|
} |
|
|
else{ |
|
|
document.getElementById('measureADRbutton').removeAttribute('hidden'); |
|
|
if (sections.value.startsWith('3.2') || sections.value.startsWith('3.3') || sections.value.startsWith('2.7') ){ |
|
|
document.getElementById('dxfdiv').removeAttribute('hidden'); |
|
|
document.getElementById('pdftodxfFile').setAttribute('required',true) |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else{ |
|
|
document.getElementById('dxfdiv').setAttribute('hidden',true) |
|
|
if (sections.value.startsWith('2.6') ||sections.value.startsWith('2.8')){ |
|
|
document.getElementById('projlinkTestingSchedule').removeAttribute('hidden'); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var projname = document.getElementById("projlinkTesting"); |
|
|
|
|
|
var projsec = document.getElementsByClassName("selectionsProjs")[0]; |
|
|
var levelcheckbox= document.getElementById("levelcheckbox"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.7')) { |
|
|
|
|
|
downloadPDFfromLink(projname.value,'DXF_File') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
canvasimg=''; |
|
|
ry=[[]]; |
|
|
levelcheckbox.checked=false; |
|
|
console.log(projsec.value) |
|
|
if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) { |
|
|
document.getElementById("all").style.display = "block"; |
|
|
|
|
|
var eventSource = new EventSource(`/pixeltestingimg?url=${encodeURIComponent(JSON.stringify(projname.value))}`); |
|
|
document.getElementById('progressBar').removeAttribute('hidden') |
|
|
document.getElementById('progressBar').style.display='block'; |
|
|
eventSource.onmessage = function (event) { |
|
|
var progress = parseInt(event.data); |
|
|
if (progress <= 100) { |
|
|
console.log(progress); |
|
|
document.getElementById('progress').style.width = progress + '%'; |
|
|
document.getElementById('progress').textContent = progress + '%'; |
|
|
} else { |
|
|
var data = JSON.parse(event.data); |
|
|
eventSource.close(); |
|
|
|
|
|
document.getElementById('progressBar').setAttribute('hidden',true) |
|
|
document.getElementById('progressBar').style.display='none'; |
|
|
document.getElementById('progress').style.width = '0%'; |
|
|
document.getElementById('progress').textContent = '0%'; |
|
|
document.getElementById("all").style.display = "none"; |
|
|
|
|
|
|
|
|
downloadPDFfromLink(data[2],'Pixel_Conversion_File') |
|
|
document.getElementById("all").style.display = "none"; |
|
|
|
|
|
document.getElementById('measureADRbutton').onclick= function() |
|
|
{ |
|
|
if (!areaRatio.value){ |
|
|
if (!(projsec.value.startsWith('3.2')) & !(projsec.value.startsWith('2.8')) & !(projsec.value.startsWith('2.6')) & !(projsec.value.startsWith('3.3')) & !(projsec.value.startsWith('2.7')) ) |
|
|
areaRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)'; |
|
|
} |
|
|
if (!prmRatio.value) { |
|
|
if (!(projsec.value.startsWith('2.6') || projsec.value.startsWith('2.8'))) { |
|
|
prmRatio.style.boxShadow = '0 0 8px 2px rgb(255, 0, 0)'; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
document.getElementById('radiosColors').removeAttribute('hidden'); |
|
|
var scalelbl= document.createElement("label"); |
|
|
scalelbl.innerText='Scale Document'; |
|
|
scalelbl.id='measureLabel'; |
|
|
var br1= document.createElement("br"); |
|
|
var areadiv=document.createElement("div"); |
|
|
areadiv.id='areadiv' |
|
|
var areaRatiolbl= document.createElement("label"); |
|
|
areaRatiolbl.innerText='Area:' |
|
|
areaRatiolbl.id='radiolbl'; |
|
|
|
|
|
var areaRatio= document.createElement("input"); |
|
|
areaRatio.type='number'; |
|
|
areaRatio.id='arealvlinput'; |
|
|
areaRatio.className='lvlinput'; |
|
|
areaRatio.name='areaRatio'; |
|
|
areaRatio.style.marginLeft='78px'; |
|
|
areaRatio.style.textAlign='right'; |
|
|
areaRatio.step=".0000001"; |
|
|
areaRatio.min = "0"; |
|
|
if( projsec.value.startsWith('3.2') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.1') || projsec.value.startsWith('2.7')){ |
|
|
areaRatio.setAttribute('disabled',true) |
|
|
areaRatio.style.cursor='not-allowed'; |
|
|
areaRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
document.getElementById('selectunitA').setAttribute('disabled',true) |
|
|
document.getElementById('selectunitA').style.cursor='not-allowed'; |
|
|
document.getElementById('selectunitA').style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
} |
|
|
|
|
|
else{ |
|
|
areaRatio.removeAttribute('disabled') |
|
|
areaRatio.style.cursor='pointer'; |
|
|
document.getElementById('selectunitA').removeAttribute('disabled') |
|
|
document.getElementById('selectunitA').style.cursor='pointer'; |
|
|
} |
|
|
areaRatio.addEventListener('change',function(){ |
|
|
areaRatio.value=(Number(areaRatio.value)).toFixed(7) |
|
|
areaRatio.style.boxShadow='none'; |
|
|
}) |
|
|
areaRatio.required=true; |
|
|
selectunitA=document.getElementById('selectunitA') |
|
|
selectunitA.removeAttribute('hidden') |
|
|
|
|
|
areadiv.append(areaRatiolbl,areaRatio,selectunitA) |
|
|
var br2= document.createElement("br"); |
|
|
var br3= document.createElement("br"); |
|
|
var prmdiv=document.createElement("div"); |
|
|
prmdiv.id='prmdiv' |
|
|
var prmRatiolbl= document.createElement("label"); |
|
|
prmRatiolbl.innerText='Perimeter:' |
|
|
prmRatiolbl.id='radiolbl'; |
|
|
|
|
|
var prmRatio= document.createElement("input"); |
|
|
prmRatio.type='number'; |
|
|
prmRatio.id='perimlvlinput'; |
|
|
prmRatio.className='lvlinput'; |
|
|
prmRatio.name='prmRatio'; |
|
|
prmRatio.style.textAlign='right'; |
|
|
prmRatio.style.marginLeft='49px'; |
|
|
prmRatio.step=".0000001"; |
|
|
prmRatio.min = "0"; |
|
|
prmRatio.addEventListener('change',function(){ |
|
|
prmRatio.value=(Number(prmRatio.value)).toFixed(7) |
|
|
prmRatio.style.boxShadow='none'; |
|
|
}) |
|
|
prmRatio.required=true; |
|
|
selectunitP=document.getElementById('selectunitP') |
|
|
selectunitP.removeAttribute('hidden') |
|
|
|
|
|
prmdiv.append(prmRatiolbl, prmRatio,selectunitP) |
|
|
var ratiosdiv= document.getElementById("ratios"); |
|
|
ratiosdiv.innerHTML=''; |
|
|
ratiosdiv.append(scalelbl); |
|
|
ratiosdiv.append(br1); |
|
|
ratiosdiv.append(areadiv) |
|
|
ratiosdiv.append(prmdiv) |
|
|
areainpixels=data[0]; |
|
|
prminpixels=data[1]; |
|
|
|
|
|
|
|
|
if( projsec.value.startsWith('2.8') || projsec.value.startsWith('2.6')) { |
|
|
areaRatio.setAttribute('disabled',true) |
|
|
areaRatio.style.cursor='not-allowed'; |
|
|
areaRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
document.getElementById('selectunitA').setAttribute('disabled',true) |
|
|
document.getElementById('selectunitA').style.cursor='not-allowed'; |
|
|
document.getElementById('selectunitA').style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
|
|
|
prmRatio.setAttribute('disabled',true) |
|
|
prmRatio.style.cursor='not-allowed'; |
|
|
prmRatio.style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
document.getElementById('selectunitP').setAttribute('disabled',true) |
|
|
document.getElementById('selectunitP').style.cursor='not-allowed'; |
|
|
document.getElementById('selectunitP').style.backgroundColor='rgba(101, 101, 101, 0.27)' |
|
|
} |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
eventSource.onerror = function (error) { |
|
|
console.error('Error occurred:', error); |
|
|
eventSource.close(); |
|
|
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. '; |
|
|
ShowPopUp(); |
|
|
}; |
|
|
|
|
|
selectunitA.addEventListener('change',function(){ |
|
|
value=document.getElementById('selectunitA').value |
|
|
if (value=='mm2') |
|
|
ratioAunit=1000000; |
|
|
else |
|
|
ratioAunit=1; |
|
|
}) |
|
|
selectunitP.addEventListener('change',function(){ |
|
|
value=document.getElementById('selectunitP').value |
|
|
if (value=='mm'){ |
|
|
ratioPunit=1000; |
|
|
} |
|
|
else |
|
|
ratioPunit=1; |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
else{ |
|
|
document.getElementById('radiosColors').removeAttribute('hidden') |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
document.addEventListener("click", function(event) { |
|
|
const iframe = document.getElementById("pdfFrame"); |
|
|
if (!iframe.contains(event.target)) { |
|
|
const iframe = document.getElementById("pdfFrame"); |
|
|
iframe.style.display = "none"; |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
if (document.getElementById('arealvlinput')){ |
|
|
if( projsec.value.startsWith('3.2') || projsec.value.startsWith('2.8') || projsec.value.startsWith('2.6') || projsec.value.startsWith('3.3') || projsec.value.startsWith('2.1') || projsec.value.startsWith('2.7')){ |
|
|
document.getElementById('arealvlinput').setAttribute('disabled',true) |
|
|
document.getElementById('selectunitA').setAttribute('disabled',true) |
|
|
} |
|
|
else{ |
|
|
document.getElementById('arealvlinput').removeAttribute('disabled') |
|
|
document.getElementById('selectunitA').removeAttribute('disabled') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!(thirddropdown.value.startsWith('2.8')||thirddropdown.value.startsWith('2.6')) ) { |
|
|
document.getElementById("relvselectid").classList.add("disabled"); |
|
|
document.getElementById("relvoverlay").style.display = "block"; |
|
|
} else { |
|
|
document.getElementById("relvselectid").classList.remove("disabled"); |
|
|
document.getElementById("relvoverlay").style.display = "none"; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function ImgLarger(id, src){ |
|
|
|
|
|
var modal = document.getElementById('myModal'); |
|
|
|
|
|
|
|
|
var img = document.getElementById(id); |
|
|
var modalImg = document.getElementById('img01'); |
|
|
var captionText = document.getElementById("caption"); |
|
|
modal.style.display = "block"; |
|
|
modalImg.src = src; |
|
|
captionText.innerHTML = 'Preview'; |
|
|
|
|
|
|
|
|
|
|
|
var span = document.getElementsByClassName("close")[0]; |
|
|
|
|
|
|
|
|
span.onclick = function() { |
|
|
modal.style.display = "none"; |
|
|
} |
|
|
} |
|
|
|
|
|
var spreadsheetId=''; |
|
|
var spreadsheetURL=''; |
|
|
var colorsUsed=''; |
|
|
var list1=''; |
|
|
var SimilarAreaDictionary=''; |
|
|
var tomeasureproj='' |
|
|
var pdfpath=[]; |
|
|
var interval = null; |
|
|
var namepathArr='' |
|
|
|
|
|
var allcolors=['#2FFFFF']; |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('pdftodxfFile').addEventListener('input',function(){ |
|
|
console.log('hghjk') |
|
|
const files = document.getElementById("pdftodxfFile"); |
|
|
dxffile=files.files[0]; |
|
|
console.log(dxffile) |
|
|
}); |
|
|
function ImgSide(imgdata, spreadsheetLink, pdfLink,pdfname) { |
|
|
var backimg = document.getElementById('backgroundimg'); |
|
|
backimg.innerHTML='' |
|
|
|
|
|
|
|
|
var imgContainer = document.createElement('div'); |
|
|
imgContainer.className = 'imgContainer'; |
|
|
|
|
|
var imgcanvas = document.createElement("img"); |
|
|
imgcanvas.src = 'data:image/gif;base64,' + imgdata; |
|
|
imgcanvas.height = 600; |
|
|
imgcanvas.id = 'imgcanvas'; |
|
|
imgcanvas.alt = "Larry"; |
|
|
imgcanvas.style.zIndex = 999; |
|
|
|
|
|
imgcanvas.addEventListener('click', function () { |
|
|
ImgLarger(imgcanvas.id, imgcanvas.src); |
|
|
}); |
|
|
|
|
|
var buttonContainer = document.createElement('div'); |
|
|
buttonContainer.style.display = 'flex'; |
|
|
buttonContainer.style.marginTop = '10px'; |
|
|
|
|
|
var legendbutton = document.createElement("button"); |
|
|
legendbutton.className = 'measureADRbutton2'; |
|
|
legendbutton.innerText = 'Legend and Data created'; |
|
|
legendbutton.style.backgroundColor = 'rgb(5, 43, 235)'; |
|
|
|
|
|
|
|
|
|
|
|
if ( projsec.value.startsWith('2.8') || projsec.value.startsWith('2.6')){ |
|
|
legendbutton.setAttribute('disabled',true); |
|
|
legendbutton.style.cursor='not-allowed'; |
|
|
legendbutton.style.boxShadow = 'none'; |
|
|
legendbutton.style.color = 'white'; |
|
|
legendbutton.style.backgroundColor="rgb(154,152,152)"; |
|
|
} |
|
|
else{ |
|
|
legendbutton.addEventListener('mouseover', function () { |
|
|
legendbutton.style.boxShadow = '0 0 8px 2px rgb(5, 43, 235)'; |
|
|
}); |
|
|
legendbutton.addEventListener('mouseout', function () { |
|
|
legendbutton.style.boxShadow = 'none'; |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
legendbutton.addEventListener('click', function () { |
|
|
window.open(spreadsheetLink); |
|
|
}); |
|
|
} |
|
|
|
|
|
var imgbutton = document.createElement("button"); |
|
|
imgbutton.className = 'measureADRbutton2'; |
|
|
imgbutton.innerText = 'Click to view as PDF'; |
|
|
imgbutton.id='clickpdfurldp' |
|
|
imgbutton.style.backgroundColor = 'rgb(255,0,255)'; |
|
|
|
|
|
imgbutton.addEventListener('mouseover', function () { |
|
|
imgbutton.style.boxShadow = '0 0 8px 2px rgb(255,0,255)'; |
|
|
}); |
|
|
imgbutton.addEventListener('mouseout', function () { |
|
|
imgbutton.style.boxShadow = 'none'; |
|
|
}); |
|
|
|
|
|
imgbutton.addEventListener('click', function () { |
|
|
window.open(pdfLink); |
|
|
}); |
|
|
|
|
|
var refreshpdfmarkups = document.createElement("button"); |
|
|
refreshpdfmarkups.className = 'measureADRbutton2'; |
|
|
refreshpdfmarkups.id='refreshpdfmarkups' |
|
|
refreshpdfmarkups.style.backgroundColor = 'rgb(255, 89, 0)'; |
|
|
refreshpdfmarkups.style.padding = '10px 20px'; |
|
|
|
|
|
|
|
|
const icon = document.createElement('i'); |
|
|
icon.className = 'fa fa-refresh'; |
|
|
icon.setAttribute('aria-hidden', 'true'); |
|
|
|
|
|
|
|
|
|
|
|
refreshpdfmarkups.prepend(icon); |
|
|
|
|
|
refreshpdfmarkups.addEventListener('mouseover', function () { |
|
|
refreshpdfmarkups.style.boxShadow = '0 0 8px 2px rgb(255, 89, 0)'; |
|
|
}); |
|
|
refreshpdfmarkups.addEventListener('mouseout', function () { |
|
|
refreshpdfmarkups.style.boxShadow = 'none'; |
|
|
}); |
|
|
|
|
|
|
|
|
var downloadPdfbutton = document.createElement("button"); |
|
|
downloadPdfbutton.className = 'measureADRbutton2'; |
|
|
downloadPdfbutton.id='downloadPdfbutton' |
|
|
downloadPdfbutton.style.backgroundColor = 'rgb(47, 131, 198)'; |
|
|
downloadPdfbutton.style.padding = '10px 20px'; |
|
|
const icon1 = document.createElement('i'); |
|
|
icon1.className = 'fa fa-download'; |
|
|
icon1.setAttribute('aria-hidden', 'true'); |
|
|
|
|
|
|
|
|
|
|
|
downloadPdfbutton.prepend(icon1); |
|
|
downloadPdfbutton.onclick=function(){ |
|
|
|
|
|
const pathname = new URL(pdfname).pathname; |
|
|
const filename = pathname.substring(pathname.lastIndexOf('/') + 1); |
|
|
console.log(filename); |
|
|
downloadname='Measured_PDF_'+filename; |
|
|
const encodedURL = encodeURIComponent(JSON.stringify(pdfLink)) |
|
|
downloadPDFfromLink(pdfLink,downloadname) |
|
|
} |
|
|
downloadPdfbutton.addEventListener('mouseover', function () { |
|
|
document.getElementById('downloadPdfbutton').style.color='black'; |
|
|
downloadPdfbutton.style.boxShadow = '0 0 8px 2px rgb(47, 131, 198)'; |
|
|
}); |
|
|
|
|
|
|
|
|
downloadPdfbutton.addEventListener('mouseout', function () { |
|
|
document.getElementById('downloadPdfbutton').style.color='white'; |
|
|
downloadPdfbutton.style.boxShadow = 'none'; |
|
|
}); |
|
|
|
|
|
|
|
|
buttonContainer.appendChild(legendbutton); |
|
|
buttonContainer.appendChild(imgbutton); |
|
|
buttonContainer.appendChild(downloadPdfbutton); |
|
|
buttonContainer.appendChild(refreshpdfmarkups); |
|
|
|
|
|
|
|
|
imgContainer.appendChild(imgcanvas); |
|
|
imgContainer.appendChild(buttonContainer); |
|
|
|
|
|
backimg.appendChild(imgContainer); |
|
|
} |
|
|
function updatepreview(pdfname){ |
|
|
console.log('pdfpath',pdfname) |
|
|
|
|
|
$.get( '/updatepreviewimg/'+ JSON.stringify(pdfname)) |
|
|
.success( function(data) { |
|
|
document.getElementById("loading").hidden = true; |
|
|
ImgSide(data,spreadsheetURL,dropboxLink,pdfname) |
|
|
|
|
|
}) |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateDropdown(options) { |
|
|
const dropdowns = document.getElementsByName('text1name'); |
|
|
|
|
|
dropdowns.forEach((dropdown) => { |
|
|
|
|
|
const selectedValue = dropdown.value; |
|
|
|
|
|
|
|
|
dropdown.innerHTML = ''; |
|
|
|
|
|
|
|
|
options.forEach((value) => { |
|
|
const option = document.createElement('option'); |
|
|
option.value = value; |
|
|
option.textContent = value; |
|
|
dropdown.appendChild(option); |
|
|
}); |
|
|
|
|
|
|
|
|
if (options.includes(selectedValue)) { |
|
|
dropdown.value = selectedValue; |
|
|
} |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getData(form) { |
|
|
|
|
|
document.getElementById("loading").hidden = false; |
|
|
|
|
|
|
|
|
var formData = new FormData(form); |
|
|
|
|
|
clearInterval(interval) |
|
|
val=0; |
|
|
answers=[]; |
|
|
var ratio1=0; |
|
|
var ratio2=0; |
|
|
tomeasureproj=''; |
|
|
pdfpath=[]; |
|
|
formvalues=Object.fromEntries(formData); |
|
|
|
|
|
console.log(formData,formvalues) |
|
|
|
|
|
tomeasureproj=formvalues['projlinkTesting']; |
|
|
|
|
|
if( formvalues['selectprojs'].startsWith('4.0') ){ |
|
|
document.getElementById('Newtablebutton').setAttribute('disabled',true); |
|
|
document.getElementById('Newtablebutton').style.cursor='not-allowed'; |
|
|
document.getElementById('Newtablebutton').style.boxShadow = 'none'; |
|
|
document.getElementById('Newtablebutton').style.color = 'white'; |
|
|
document.getElementById('Newtablebutton').style.backgroundColor="rgb(154,152,152)"; |
|
|
} |
|
|
else{ |
|
|
document.getElementById('measureADRbutton').setAttribute('disabled',true); |
|
|
document.getElementById('measureADRbutton').style.cursor='not-allowed'; |
|
|
document.getElementById('measureADRbutton').style.boxShadow = 'none'; |
|
|
document.getElementById('measureADRbutton').style.color = 'white'; |
|
|
document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)"; |
|
|
} |
|
|
if( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ){ |
|
|
ratio1=1 |
|
|
ratio2=prminpixels/(formvalues['prmRatio']/ratioPunit); |
|
|
console.log(ratio2, prminpixels,formvalues['prmRatio'],ratioPunit) |
|
|
} |
|
|
else if (formvalues['selectprojs'].startsWith('1.0') ){ |
|
|
ratio1=(formvalues['areaRatio']/ratioAunit)/areainpixels; |
|
|
ratio2=(formvalues['prmRatio']/ratioPunit)/prminpixels; |
|
|
console.log('ratioss',ratio1,ratio2) |
|
|
} |
|
|
else if (formvalues['selectprojs'].startsWith('2.8') ||formvalues['selectprojs'].startsWith('2.6') || formvalues['selectprojs'].startsWith('2.1') ){ |
|
|
ratio1=1; |
|
|
ratio2=(formvalues['prmRatio']/ratioPunit)/prminpixels; |
|
|
console.log('ratioss',ratio1,ratio2) |
|
|
} |
|
|
if (canvasimg){ |
|
|
console.log('canvasimg') |
|
|
buf=canvasimg.split("data:image/png;base64,") |
|
|
answers.push(tomeasureproj, 220,allcolors , ratio1, ratio2 ,formvalues['selectprojs'],buf[1]); |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
|
|
|
else{ |
|
|
console.log('else') |
|
|
|
|
|
if ( formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') ) |
|
|
{ |
|
|
console.log('elseif') |
|
|
answers.push(tomeasureproj, 0,[], ratio1, ratio2 ,formvalues['selectprojs']); |
|
|
formData.append('file',dxffile) |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
|
|
|
else if ( formvalues['selectprojs'].startsWith('2.7')) |
|
|
{ |
|
|
var Thickness= document.getElementById("text002extra").value |
|
|
console.log(Thickness) |
|
|
answers.push(tomeasureproj, 0,[], ratio1, ratio2 ,formvalues['selectprojs'],groupedValues,Thickness); |
|
|
formData.append('file',dxffile) |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
|
|
|
else if (formvalues['selectprojs'].startsWith('1.0')) |
|
|
{ |
|
|
console.log('whyyyy hereeee') |
|
|
file='' |
|
|
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,formvalues['selectprojs']); |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
else if (formvalues['selectprojs'].startsWith('2.1')) |
|
|
{ |
|
|
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,formvalues['selectprojs']); |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
else if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') ) |
|
|
{ |
|
|
answers.push(tomeasureproj, 0,[] , 0,0, formvalues['selectprojs'] , formvalues['projlinkTestingSchedule'] ,groupedValues); |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
} |
|
|
} |
|
|
|
|
|
if (formvalues['selectprojs'].startsWith('1.0') || formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ) |
|
|
{ |
|
|
|
|
|
$.ajax({ |
|
|
type: "POST", |
|
|
url: "/savebase64Img/", |
|
|
contentType: "application/json", |
|
|
data: formData, |
|
|
processData: false, |
|
|
contentType: false, |
|
|
success: function(response) { |
|
|
console.log(response); |
|
|
}, |
|
|
error: function(err) { |
|
|
let TopTextModal = document.getElementById("TopTextModal"); |
|
|
TopTextModal.textContent = "Error"; |
|
|
PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
|
|
|
} |
|
|
}) |
|
|
.done(function(data){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("loading").hidden = true; |
|
|
document.getElementById("rightside").hidden = false; |
|
|
document.getElementById('duplicater').removeAttribute('hidden'); |
|
|
if (formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') ) |
|
|
{ |
|
|
document.getElementById('duplicater').children[8].children[1].setAttribute('disabled','True') |
|
|
document.getElementById('duplicater').children[8].children[2].setAttribute('disabled','True') |
|
|
|
|
|
document.getElementById('duplicater').children[8].children[1].style.cursor='not-allowed'; |
|
|
document.getElementById('duplicater').children[8].children[2].style.cursor='not-allowed'; |
|
|
|
|
|
} |
|
|
document.getElementById('addicon').style.display='inline-block'; |
|
|
document.getElementById('doneebackground').removeAttribute('hidden'); |
|
|
document.getElementById('summarytoXML').removeAttribute('hidden'); |
|
|
if (mctnameEmpty){ |
|
|
document.getElementById('doneebackground').setAttribute('disabled','True') |
|
|
document.getElementById('doneebackground').style.cursor='not-allowed'; |
|
|
document.getElementById('doneebackground').style.boxShadow = 'none'; |
|
|
document.getElementById('doneebackground').style.color = 'white'; |
|
|
document.getElementById('doneebackground').style.backgroundColor="rgb(154,152,152)"; |
|
|
|
|
|
document.getElementById('summarytoXML').setAttribute('disabled','True') |
|
|
document.getElementById('summarytoXML').style.cursor='not-allowed'; |
|
|
document.getElementById('summarytoXML').style.boxShadow = 'none'; |
|
|
document.getElementById('summarytoXML').style.color = 'white'; |
|
|
document.getElementById('summarytoXML').style.backgroundColor="rgb(154,152,152)"; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('measureADRbutton').removeAttribute('disabled'); |
|
|
document.getElementById('measureADRbutton').style.cursor='pointer'; |
|
|
document.getElementById('measureADRbutton').style.color = 'white'; |
|
|
document.getElementById('measureADRbutton').style.backgroundColor="#16c72e"; |
|
|
document.getElementById('measureADRbutton').style.padding='10px 102px'; |
|
|
document.getElementById('measureADRbutton').addEventListener('mouseover',function(){ |
|
|
document.getElementById('measureADRbutton').style.color='black'; |
|
|
document.getElementById('measureADRbutton').style.boxShadow=' 0 0 8px 2px #16c72e'; |
|
|
}) |
|
|
document.getElementById('measureADRbutton').addEventListener('mouseout',function(){ |
|
|
document.getElementById('measureADRbutton').style.color='white'; |
|
|
document.getElementById('measureADRbutton').style.boxShadow='none'; |
|
|
}); |
|
|
|
|
|
if (formvalues['selectprojs'].startsWith('3.2') || formvalues['selectprojs'].startsWith('3.3') || formvalues['selectprojs'].startsWith('2.7') ) |
|
|
{ |
|
|
|
|
|
|
|
|
SimilarAreaDictionary=data[1]; |
|
|
spreadsheetURL=data[2]; |
|
|
spreadsheetId=data[3]; |
|
|
|
|
|
list1= data[5]; |
|
|
|
|
|
dropboxLink=data[6]; |
|
|
console.log(data[7]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
if (formvalues['selectprojs'].startsWith('2.8') ||formvalues['selectprojs'].startsWith('2.6')) |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
console.log('2.8Daata',data) |
|
|
dropboxLink=data[1]; |
|
|
list1= data[2] |
|
|
Repeated_Labels2_8=data[3] |
|
|
Not_Found2_8=data[4] |
|
|
console.log(Repeated_Labels2_8,Not_Found2_8) |
|
|
} |
|
|
if (formvalues['selectprojs'].startsWith('2.2')) |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
if (formvalues['selectprojs'].startsWith('2.1')) |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spreadsheetURL=data[0] |
|
|
|
|
|
} |
|
|
if (formvalues['selectprojs'].startsWith('1.0')) |
|
|
{ |
|
|
console.log('?') |
|
|
SimilarAreaDictionary=data[1]; |
|
|
spreadsheetURL= data[2]; |
|
|
spreadsheetId= data[3]; |
|
|
colorsUsed = data[4]; |
|
|
list1 = data[5]; |
|
|
dropboxLink=data[6]; |
|
|
namepathArr=data[8]; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ImgSide(data[0],spreadsheetURL,dropboxLink,tomeasureproj) |
|
|
if (formvalues['selectprojs'].startsWith('2.8') || formvalues['selectprojs'].startsWith('2.6')) { |
|
|
let messages = []; |
|
|
if (Repeated_Labels2_8) |
|
|
if (Repeated_Labels2_8.length > 0) { |
|
|
messages.push('The following label(s) are represented on multiple doors: ' + Repeated_Labels2_8); |
|
|
} |
|
|
|
|
|
if (Not_Found2_8.length > 0) { |
|
|
messages.push('The following label(s) not found on the plan: ' + Not_Found2_8); |
|
|
} |
|
|
|
|
|
if (messages.length > 0) { |
|
|
var TopTextModal = document.getElementById("TopTextModal"); |
|
|
TopTextModal.textContent = 'Warning'; |
|
|
|
|
|
PopupElement.textContent = messages.join('\n'); |
|
|
ShowPopUp(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let delrows2 = { |
|
|
content : {}, |
|
|
id : {}, |
|
|
subject :{}, |
|
|
color:{} |
|
|
}; |
|
|
|
|
|
var delrows1=''; |
|
|
var flag=0; |
|
|
pdfpath=[]; |
|
|
pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
} |
|
|
if (formvalues['selectprojs'].startsWith('4.0')) |
|
|
{ |
|
|
tomeasureproj=formvalues['projlinkTesting']; |
|
|
answers.push(tomeasureproj); |
|
|
formData.append('answers',JSON.stringify(answers)) |
|
|
|
|
|
$.ajaxTransport("+binary", function(options, originalOptions, jqXHR) { |
|
|
if (window.FormData && ( |
|
|
(options.dataType && options.dataType === "binary") || |
|
|
(options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) || |
|
|
(window.Blob && options.data instanceof Blob))) |
|
|
)) { |
|
|
return { |
|
|
send: function(headers, callback) { |
|
|
const xhr = new XMLHttpRequest(); |
|
|
xhr.open(options.type, options.url, options.async ?? true, |
|
|
options.username, options.password); |
|
|
|
|
|
xhr.responseType = options.responseType || "blob"; |
|
|
if (options.xhrFields) { |
|
|
for (const field in options.xhrFields) { |
|
|
xhr[field] = options.xhrFields[field]; |
|
|
} |
|
|
} |
|
|
xhr.onload = function() { |
|
|
|
|
|
const data = {}; |
|
|
data[options.dataType] = xhr.response; |
|
|
callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders()); |
|
|
}; |
|
|
xhr.send(options.data || null); |
|
|
}, |
|
|
abort: function() { |
|
|
jqXHR.abort(); |
|
|
} |
|
|
}; |
|
|
} |
|
|
}); |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
url: "/savedetectedtables/", |
|
|
method: "POST", |
|
|
data: formData, |
|
|
processData: false, |
|
|
contentType: false, |
|
|
dataType: 'binary', |
|
|
responseType: 'blob', |
|
|
|
|
|
success: function(blob) { |
|
|
console.log(blob); |
|
|
|
|
|
console.log('typeof(blob) = ',typeof(blob)) |
|
|
|
|
|
if (!blob || blob.size === 0) { |
|
|
|
|
|
PopupElement.textContent = "No tables detected in the document."; |
|
|
ShowPopUp(); |
|
|
return; |
|
|
} |
|
|
else{ |
|
|
console.log("gowa el else") |
|
|
downloadExcel(blob,'detected_tables.xlsx') |
|
|
|
|
|
} |
|
|
}, |
|
|
error: function(err) { |
|
|
var TopTextModal = document.getElementById("TopTextModal"); |
|
|
TopTextModal.textContent='Error' |
|
|
PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
|
|
|
} |
|
|
}) |
|
|
.done(function(data){ |
|
|
console.log(data) |
|
|
document.getElementById("loading").hidden = true; |
|
|
document.getElementById('Newtablebutton').removeAttribute('disabled'); |
|
|
document.getElementById('Newtablebutton').style.cursor='pointer'; |
|
|
document.getElementById('Newtablebutton').style.color = 'white'; |
|
|
document.getElementById('Newtablebutton').style.backgroundColor="#16c72e"; |
|
|
document.getElementById('Newtablebutton').style.padding='10px 102px'; |
|
|
document.getElementById('Newtablebutton').addEventListener('mouseover',function(){ |
|
|
document.getElementById('Newtablebutton').style.color='black'; |
|
|
document.getElementById('Newtablebutton').style.boxShadow=' 0 0 8px 2px #16c72e'; |
|
|
}) |
|
|
document.getElementById('Newtablebutton').addEventListener('mouseout',function(){ |
|
|
document.getElementById('Newtablebutton').style.color='white'; |
|
|
document.getElementById('Newtablebutton').style.boxShadow='none'; |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('downloadbutton').style.display = 'inline-block'; |
|
|
|
|
|
const btn = document.getElementById('downloadbutton'); |
|
|
btn.addEventListener('click', () => { |
|
|
downloadExcel(data, 'detected_tables.xlsx'); |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
document.getElementById("myForm").addEventListener("submit", function (e) { |
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getData(e.target); |
|
|
}); |
|
|
|
|
|
var measitemVal=''; |
|
|
|
|
|
function get3rddropdown(){ |
|
|
|
|
|
|
|
|
var unit; |
|
|
if (addciconval>0){ |
|
|
|
|
|
for (let i =1 ; i <=addciconval ; i++){ |
|
|
var inputs1 = document.getElementsByClassName("measurementselections"+i)[0]; |
|
|
var selections1 = document.getElementsByClassName("selections"+i)[0]; |
|
|
var measitem1 = document.getElementsByClassName("measureitems"+i)[0]; |
|
|
|
|
|
|
|
|
measitemVal1=measitem1.value.toString() |
|
|
|
|
|
|
|
|
if(( (inputs1.value=='ground beams' ) || (inputs1.value=='pile caps' ) ) & (!selections1.value)) |
|
|
{ |
|
|
selections1.innerHTML=''; |
|
|
|
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections1.add(opt0); |
|
|
} |
|
|
console.log(section.value.toString()) |
|
|
|
|
|
} |
|
|
else if(( (inputs1.value=='Wall' ) || (inputs1.value=='Column' ) ) & (!selections1.value)) |
|
|
{ |
|
|
selections1.innerHTML=''; |
|
|
|
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections1.add(opt0); |
|
|
} |
|
|
console.log(section.value.toString()) |
|
|
|
|
|
} |
|
|
else if(( (inputs1.value=='Floor' ) || (inputs1.value=='Wall' ) ) & (!selections1.value)) |
|
|
{ |
|
|
selections1.innerHTML=''; |
|
|
|
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections1.add(opt0); |
|
|
} |
|
|
console.log(section.value.toString()) |
|
|
|
|
|
} |
|
|
else if(( (inputs1.value=='Ceiling' ) ) & (!selections1.value)) |
|
|
{ |
|
|
selections1.innerHTML=''; |
|
|
|
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections1.add(opt0); |
|
|
} |
|
|
console.log(section.value.toString()) |
|
|
|
|
|
} |
|
|
else if(( (inputs1.value=='Internal Walls' ) ) & (!selections1.value)) |
|
|
{ |
|
|
selections1.innerHTML=''; |
|
|
|
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections1.add(opt0); |
|
|
} |
|
|
console.log(section.value.toString()) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (selections1.value ) |
|
|
{ |
|
|
for(var l in MCTNames){ |
|
|
if(MCTNames[l][0] == selections1.value){ |
|
|
|
|
|
unit=MCTNames[l][1] |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (unit=='m2' ) |
|
|
{ measitem1.innerHTML=''; |
|
|
var opt10 = document.createElement("OPTION") ; |
|
|
opt10.text= 'Area:m2'; |
|
|
opt10.value= 'Area:m2'; |
|
|
opt10.id='Area:m2'; |
|
|
measitem1.add(opt10); |
|
|
} |
|
|
if (unit=='m' & !(measitem1.value=='Perimeter:m')) |
|
|
{ measitem1.innerHTML=''; |
|
|
|
|
|
|
|
|
|
|
|
var opt11 = document.createElement("OPTION") ; |
|
|
opt11.text= 'Length:m'; |
|
|
opt11.value= 'Length:m'; |
|
|
opt11.id='Length:m'; |
|
|
measitem1.add(opt11); |
|
|
|
|
|
var opt12 = document.createElement("OPTION") ; |
|
|
opt12.text= 'Perimeter:m'; |
|
|
opt12.value= 'Perimeter:m'; |
|
|
opt12.id='Perimeter:m'; |
|
|
measitem1.add(opt12); |
|
|
|
|
|
} |
|
|
if (unit=='nr') |
|
|
{ measitem1.innerHTML=''; |
|
|
var opt13 = document.createElement("OPTION") ; |
|
|
opt13.text= 'Count:Nr'; |
|
|
opt13.value= 'Count:Nr'; |
|
|
opt13.id='Count:Nr'; |
|
|
measitem1.add(opt13); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(( (inputs.value=='ground beams' ) || (inputs.value=='pile caps' ) ) & (!selections.value)) |
|
|
{ |
|
|
selections.innerHTML=''; |
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections.add(opt0); |
|
|
} |
|
|
|
|
|
} |
|
|
if(( (inputs.value=='Wall' ) || (inputs.value=='Column' ) ) & (!selections.value)) |
|
|
{ |
|
|
selections.innerHTML=''; |
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections.add(opt0); |
|
|
} |
|
|
|
|
|
} |
|
|
else if(( (inputs.value=='Floor' ) || (inputs.value=='Wall' ) ) & (!selections.value)) |
|
|
{ |
|
|
selections.innerHTML=''; |
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections.add(opt0); |
|
|
} |
|
|
|
|
|
} |
|
|
else if(( (inputs.value=='Ceiling' ) ) & (!selections.value)) |
|
|
{ |
|
|
selections.innerHTML=''; |
|
|
|
|
|
for (let m=0;m<MCTNames.length;m++) |
|
|
{ |
|
|
var opt0 = document.createElement("OPTION") ; |
|
|
opt0.text= MCTNames[m][0]; |
|
|
opt0.textContent= MCTNames[m][0]; |
|
|
opt0.value= MCTNames[m][0]; |
|
|
selections.add(opt0); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log(selections.value) |
|
|
if (selections.value) |
|
|
{ |
|
|
for(var l in MCTNames){ |
|
|
if(MCTNames[l][0] == selections.value){ |
|
|
|
|
|
unit=MCTNames[l][1] |
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (unit=='m2' ) |
|
|
{ measitem.innerHTML=''; |
|
|
var opt10 = document.createElement("OPTION") ; |
|
|
opt10.text= 'Area:m2'; |
|
|
opt10.value= 'Area:m2'; |
|
|
opt10.id='Area:m2'; |
|
|
measitem.add(opt10); |
|
|
} |
|
|
|
|
|
if (unit=='m' & !(measitem.value=='Perimeter:m')) |
|
|
{ |
|
|
measitem.innerHTML=''; |
|
|
var opt11 = document.createElement("OPTION") ; |
|
|
opt11.text= 'Length:m'; |
|
|
opt11.value= 'Length:m'; |
|
|
opt11.id='Length:m'; |
|
|
measitem.add(opt11); |
|
|
|
|
|
var opt12 = document.createElement("OPTION") ; |
|
|
opt12.text= 'Perimeter:m'; |
|
|
opt12.value= 'Perimeter:m'; |
|
|
opt12.id='Perimeter:m'; |
|
|
measitem.add(opt12); |
|
|
|
|
|
} |
|
|
if (unit=='nr' ) |
|
|
{ measitem.innerHTML=''; |
|
|
var opt13 = document.createElement("OPTION") ; |
|
|
opt13.text= 'Count:Nr'; |
|
|
opt13.value= 'Count:Nr'; |
|
|
opt13.id='Count:Nr'; |
|
|
measitem.add(opt13); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var repeatforloopI=0; |
|
|
var repeatforloopIextra=0; |
|
|
function getmctName(){ |
|
|
|
|
|
var listofnames=[]; |
|
|
var flag=0; |
|
|
arrallvalues=[]; |
|
|
arrmctNames=[]; |
|
|
arrFinalMCNames=[]; |
|
|
|
|
|
var allmcnamestext= document.querySelectorAll('input[name="text1name"]'); |
|
|
allmcnamestext.forEach(function(elem){ |
|
|
if (elem.value) |
|
|
arrallvalues.push(elem.value); |
|
|
}) |
|
|
|
|
|
for (ii=0 ; ii<=addciconval; ii++){ |
|
|
if (ii==0){ |
|
|
|
|
|
var divduplicater= document.getElementsByClassName('duplicaterclass')[0].children; |
|
|
var selections = divduplicater[3]; |
|
|
measitemVal=divduplicater[5].value; |
|
|
var div=divduplicater[8].children; |
|
|
var divValues=['text1'+div[0].value, div[1].value , div[2].value]; |
|
|
mctname=[selections.value ,divValues , measitemVal ]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
count=0; |
|
|
var ii0selections=''; |
|
|
for (let child =1;child <divduplicater.length;child++) |
|
|
{ |
|
|
console.log('here3') |
|
|
if( divduplicater[child] instanceof(HTMLDivElement) ) |
|
|
count++; |
|
|
console.log(divduplicater) |
|
|
ii0selections=divduplicater[3].value; |
|
|
measitemVal=divduplicater[5].value; |
|
|
console.log('gfd ',ii0selections,measitemVal) |
|
|
if (divduplicater[child].className.startsWith('repeatforloopclass') && child !=5) |
|
|
{ |
|
|
console.log('c',divduplicater[child].children) |
|
|
var divValues2=['text1'+divduplicater[child].children[0].value, divduplicater[child].children[1].value , divduplicater[child].children[2].value]; |
|
|
mctname1=[ii0selections ,divValues2 , measitemVal]; |
|
|
console.log('divValues2',mctname1) |
|
|
if(divduplicater[child].children[0].value && divduplicater[child].children[1].value && divduplicater[child].children[2].value) |
|
|
{ |
|
|
|
|
|
flag=1; |
|
|
arrmctNames.push(mctname1); |
|
|
} |
|
|
|
|
|
else if(divduplicater[child].children[0].value && !divduplicater[child].children[1].value && !divduplicater[child].children[2].value) { |
|
|
mctname1=[ii0selections ,[ 'text1'+divduplicater[child].children[0].value ], measitemVal ]; |
|
|
flag=1; |
|
|
arrmctNames.push( mctname1); |
|
|
} |
|
|
else if(divduplicater[child].children[0].value && divduplicater[child].children[1].value && !divduplicater[child].children[2].value) { |
|
|
mctname1=[ii0selections ,['text1'+divduplicater[child].children[0].value , divduplicater[child].children[1].value] , measitemVal]; |
|
|
flag=1; |
|
|
arrmctNames.push( mctname1); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ii>0 ) |
|
|
{ |
|
|
count=0; |
|
|
var ii0selections=''; |
|
|
var replicatedDivChildren=document.getElementsByClassName('duplicaterclass'+ii)[0].children; |
|
|
|
|
|
for (let o =0;o <=replicatedDivChildren.length;o++) |
|
|
{ |
|
|
if( replicatedDivChildren[o] instanceof(HTMLDivElement) ) |
|
|
{ count++; |
|
|
ii0selections=replicatedDivChildren[3].value; |
|
|
measitemVal=replicatedDivChildren[5].value; |
|
|
console.log('lkjhgf',replicatedDivChildren) |
|
|
} |
|
|
} |
|
|
|
|
|
for (child=0;child<replicatedDivChildren.length;child++) |
|
|
{ |
|
|
if (replicatedDivChildren[child].className.startsWith('repeatforloopclass') && child !=5) |
|
|
{ |
|
|
var divValues2=['text1'+replicatedDivChildren[child].children[0].value, replicatedDivChildren[child].children[1].value , replicatedDivChildren[child].children[2].value]; |
|
|
mctname1=[ii0selections ,divValues2 , measitemVal]; |
|
|
if(replicatedDivChildren[child].children[0].value && replicatedDivChildren[child].children[1].value && replicatedDivChildren[child].children[2].value) |
|
|
{ |
|
|
arrmctNames.push(mctname1); |
|
|
flag=1; |
|
|
} |
|
|
else if(replicatedDivChildren[child].children[0].value && !replicatedDivChildren[child].children[1].value && !replicatedDivChildren[child].children[2].value) |
|
|
{ |
|
|
mctname1=[ii0selections ,['text1'+replicatedDivChildren[child].children[0].value] , measitemVal]; |
|
|
arrmctNames.push(mctname1); |
|
|
flag=1; |
|
|
} |
|
|
else if(replicatedDivChildren[child].children[0].value && replicatedDivChildren[child].children[1].value && !replicatedDivChildren[child].children[2].value) |
|
|
{ |
|
|
mctname1=[ii0selections ,['text1'+replicatedDivChildren[child].children[0].value, replicatedDivChildren[child].children[1].value] , measitemVal]; |
|
|
arrmctNames.push(mctname1); |
|
|
flag=1; |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
arrFinalMCNames= arrmctNames.slice(); |
|
|
if(arrmctNames.length >1){ |
|
|
var name=[]; |
|
|
allnames=[]; |
|
|
arrFinalMCNames = arrmctNames.slice(); |
|
|
var newarr=[]; |
|
|
for (let i=0;i<arrmctNames.length; i++) |
|
|
{ str=''; |
|
|
newarr=[]; |
|
|
|
|
|
for (let j=i+1; j<arrmctNames.length; j++) |
|
|
{ |
|
|
if (arrmctNames[i][0] == arrmctNames[j][0] && arrmctNames[i][2] == arrmctNames[j][2] &&arrmctNames[i][1][1] == arrmctNames[j][1][1] && arrmctNames[i][1][2] == arrmctNames[j][1][2]) |
|
|
{ var selectionsname=arrmctNames[i][0] ; |
|
|
measitemVal=arrmctNames[i][2]; |
|
|
flag=1; |
|
|
console.log('foorrr',arrmctNames[i][0],arrmctNames[i]); |
|
|
|
|
|
if (allnames.includes(arrmctNames[i][1][0]) ) |
|
|
{ |
|
|
var index = allnames.indexOf(allnames[i] ); |
|
|
if (index !== -1) { |
|
|
allnames.splice(index, 1); |
|
|
} |
|
|
} |
|
|
if (!name.includes(arrmctNames[i][1][0] ) ){ |
|
|
|
|
|
name.push(arrmctNames[i][1][0]); |
|
|
newarr.push(arrmctNames[i][1][0]); |
|
|
var index = arrFinalMCNames.indexOf(arrmctNames[i] ); |
|
|
if (index !== -1) { |
|
|
arrFinalMCNames.splice(index, 1); |
|
|
} |
|
|
} |
|
|
if (!name.includes(arrmctNames[j][1][0] ) ){ |
|
|
|
|
|
name.push(arrmctNames[j][1][0]); |
|
|
newarr.push(arrmctNames[j][1][0]); |
|
|
var index1 = arrFinalMCNames.indexOf(arrmctNames[j] ); |
|
|
if (index1 !== -1) { |
|
|
arrFinalMCNames.splice(index1, 1); |
|
|
} |
|
|
} |
|
|
if (!name.includes(arrmctNames[i][1][1] ) ||!name.includes(arrmctNames[i][1][2] ) ){ |
|
|
name.push( arrmctNames[i][1][1] , arrmctNames[i][1][2] ); |
|
|
newarr.push(arrmctNames[i][1][1] , arrmctNames[i][1][2] ); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if (newarr.length >0){ |
|
|
flag=1; |
|
|
arrFinalMCNames.push([selectionsname , newarr, measitemVal ]); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
arrFinalMCNames.push([spreadsheetId , pdfpath[2]]); |
|
|
console.log(arrFinalMCNames) |
|
|
} |
|
|
if (flag==1){ |
|
|
|
|
|
$.get( '/mctnametoGoogleSheet/'+ JSON.stringify(arrFinalMCNames)) |
|
|
.success( function(data) { |
|
|
console.log('dataaaaa',data) |
|
|
|
|
|
spreadsheetURL=spreadsheetURL+ '/edit#gid='+data[0].toString() |
|
|
console.log('spreadsheetURL',spreadsheetURL) |
|
|
document.getElementById('all').style.display='none'; |
|
|
window.open(spreadsheetURL.toString()) |
|
|
}) |
|
|
.error(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Error occured while exporting the summary. Check your connection, refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
}); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function addmctnameicon(){ |
|
|
|
|
|
repeatforloopI+=1 |
|
|
var dupDiv; |
|
|
if (clonedDivId==0){ |
|
|
var dupDiv=document.getElementById('duplicater'); |
|
|
} |
|
|
else{ |
|
|
var dupDiv=document.getElementById(clonedDivId); |
|
|
} |
|
|
|
|
|
var div=document.getElementById('repeatforloophidden') |
|
|
var clone = div.cloneNode(true); |
|
|
|
|
|
jj++; |
|
|
if (clonedDivId==0) |
|
|
clone.style.marginLeft='5px'; |
|
|
else |
|
|
clone.style.marginLeft='5px'; |
|
|
|
|
|
window.onclick = elem => { |
|
|
if (elem.target.tagName.startsWith('LORD-ICON') && elem.target.id.startsWith('addmctnameid')){ |
|
|
clone.id = 'repeatforloop'+ elem.target.parentElement.parentElement.childNodes[1].value[0] + ++elem.target.parentElement.parentElement.childNodes[1].value[1]; |
|
|
clone.setAttribute('class','repeatforloopclass'+elem.target.parentElement.parentElement.childNodes[1].value[0] + elem.target.parentElement.parentElement.childNodes[1].value[1]); |
|
|
clone.setAttribute('name','repeatforloopname'+elem.target.parentElement.parentElement.childNodes[1].value[0] + elem.target.parentElement.parentElement.childNodes[1].value[1]); |
|
|
clone.childNodes[11].id='addmctnameid'+elem.target.parentElement.parentElement.childNodes[1].value[0] + elem.target.parentElement.parentElement.childNodes[1].value[1]; |
|
|
clone.childNodes[15].id='deletemctnameid'+elem.target.parentElement.parentElement.childNodes[1].value[0] + elem.target.parentElement.parentElement.childNodes[1].value[1]; |
|
|
|
|
|
if (elem.target.parentElement.nextElementSibling) |
|
|
{ |
|
|
$("#"+elem.target.parentElement.parentElement.id).append(clone); |
|
|
} |
|
|
else |
|
|
{ |
|
|
$("#"+elem.target.parentElement.parentElement.id).append(clone); |
|
|
$("#"+elem.target.parentElement.id).insertBefore(clone,document.getElementById('doneebackground')); |
|
|
} |
|
|
|
|
|
if (thirddropdown.value.startsWith('3.2') || thirddropdown.value.startsWith('3.3')) |
|
|
{ |
|
|
document.getElementById( 'repeatforloop'+ elem.target.parentElement.parentElement.childNodes[1].value[0] +elem.target.parentElement.parentElement.childNodes[1].value[1]).children[1].setAttribute('disabled','True') |
|
|
document.getElementById( 'repeatforloop'+ elem.target.parentElement.parentElement.childNodes[1].value[0] +elem.target.parentElement.parentElement.childNodes[1].value[1]).children[2].setAttribute('disabled','True') |
|
|
document.getElementById( 'repeatforloop'+ elem.target.parentElement.parentElement.childNodes[1].value[0] +elem.target.parentElement.parentElement.childNodes[1].value[1]).children[1].style.cursor='not-allowed'; |
|
|
document.getElementById( 'repeatforloop'+ elem.target.parentElement.parentElement.childNodes[1].value[0] +elem.target.parentElement.parentElement.childNodes[1].value[1]).children[2].style.cursor='not-allowed'; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function deletemctnameicon(){ |
|
|
window.onclick = elem => { |
|
|
if (elem.target.tagName.startsWith('LORD-ICON') && elem.target.id.startsWith('deletemctnameid')) |
|
|
{ |
|
|
var numb = elem.target.parentElement.id.match(/\d/g); |
|
|
if (numb==null) |
|
|
numb=''; |
|
|
else |
|
|
numb = numb.join(""); |
|
|
var deletethisdiv= document.getElementById('repeatforloop'+ numb); |
|
|
deletethisdiv.parentNode.removeChild(deletethisdiv); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
function addmctnameiconPopup(){ |
|
|
|
|
|
repeatforloopIextra+=1 |
|
|
var dupDivExtra; |
|
|
if (clonedDivIdExtra==0){ |
|
|
var dupDivExtra=document.getElementById('duplicaterExtra'); |
|
|
} |
|
|
else{ |
|
|
var dupDivExtra=document.getElementById(clonedDivIdExtra); |
|
|
} |
|
|
|
|
|
var divExtra=document.getElementById('repeatforloopExtrahidden') |
|
|
var cloneExtra = divExtra.cloneNode(true); |
|
|
jjExtra++; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.onclick = elem => { |
|
|
if (elem.target.tagName.startsWith('LORD-ICON') && elem.target.id.startsWith('addmctnameidExtra')){ |
|
|
|
|
|
cloneExtra.id = 'repeatforloopExtra'+ jjExtra; |
|
|
cloneExtra.setAttribute('class','repeatforloopclassExtra'+jjExtra); |
|
|
cloneExtra.setAttribute('name','repeatforloopnameExtra'+jjExtra); |
|
|
cloneExtra.childNodes[11].id='addmctnameidExtra'+jjExtra; |
|
|
cloneExtra.childNodes[15].id='deletemctnameidExtra'+jjExtra; |
|
|
|
|
|
if (elem.target.parentElement.nextElementSibling) |
|
|
{ |
|
|
$("#"+elem.target.parentElement.parentElement.id).append(cloneExtra); |
|
|
} |
|
|
else |
|
|
{ |
|
|
$("#"+elem.target.parentElement.parentElement.id).append(cloneExtra); |
|
|
$("#"+elem.target.parentElement.id).insertBefore(cloneExtra,document.getElementById('doneebackground')); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
if (sectionNumber.startsWith('2.8') || sectionNumber.startsWith('2.6')) |
|
|
{ |
|
|
text1extra= cloneExtra.children[1] |
|
|
text1extra.style.backgroundColor ="rgba(101, 101, 101, 0.27)"; |
|
|
text1extra.style.cursor='not-allowed'; |
|
|
text1extra.disabled="disabled"; |
|
|
|
|
|
text2extra= cloneExtra.children[2] |
|
|
text2extra.style.backgroundColor ="rgba(101, 101, 101, 0.27)"; |
|
|
text2extra.style.cursor='not-allowed'; |
|
|
text2extra.disabled="disabled"; |
|
|
} |
|
|
} |
|
|
|
|
|
function deletemctnameiconPopup(){ |
|
|
window.onclick = elem => { |
|
|
|
|
|
if (elem.target.tagName.startsWith('LORD-ICON') && elem.target.id.startsWith('deletemctnameidExtra')) |
|
|
{ |
|
|
var numb = elem.target.parentElement.id.match(/\d/g); |
|
|
if (numb==null) |
|
|
numb=''; |
|
|
else |
|
|
numb = numb.join(""); |
|
|
var deletethisdivExtra= document.getElementById('repeatforloopExtra'+ numb); |
|
|
deletethisdivExtra.parentNode.removeChild(deletethisdivExtra); |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function colors(){ |
|
|
var ele = document.getElementsByName('fullimage'); |
|
|
var levels = document.getElementsByName('levelsnamelabel')[0]; |
|
|
var levelsin = document.getElementsByName('levelsnameinput')[0]; |
|
|
var drp = document.getElementById("colorpickers"); |
|
|
for (i = 0; i < ele.length; i++) { |
|
|
if (ele[i].checked) |
|
|
if (ele[i].value==220){ |
|
|
console.log(ele[i].value); |
|
|
levels.style.visibility='visible'; |
|
|
levelsin.style.visibility='visible'; |
|
|
} |
|
|
else |
|
|
{ |
|
|
levels.style.visibility='hidden'; |
|
|
levelsin.style.visibility='hidden'; |
|
|
drp.innerHTML=''; |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var canvas = document.querySelector("#myCanvas"); |
|
|
var ctx = canvas.getContext("2d"); |
|
|
var drp; |
|
|
var color = 'rgb(47,255,255)'; |
|
|
|
|
|
|
|
|
function change(e){ |
|
|
color = this.value; |
|
|
allcolors.push( color); |
|
|
} |
|
|
|
|
|
|
|
|
let hex2rgb= c=> `rgb(${c.match(/\w\w/g).map(x=>+`0x${x}`)})`; |
|
|
|
|
|
myCanvas.addEventListener("click", e => { |
|
|
|
|
|
var offset = canvas.getBoundingClientRect(); |
|
|
var x = e.clientX - offset.left; |
|
|
var y = e.clientY - offset.top; |
|
|
|
|
|
ry[ry.length - 1].push({ x: x, y: y, color:hex2rgb(color) }); |
|
|
drawChart(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function drawChart() { |
|
|
ctx.lineWidth = 5; |
|
|
|
|
|
|
|
|
for (let index = 0; index < ry.length; index++) { |
|
|
|
|
|
for (let i = 0; i < ry[index].length; i++) { |
|
|
firstcircle=[] |
|
|
let l = ry[index][i]; |
|
|
|
|
|
if (i==0){ |
|
|
drawCircle(l.x, l.y); |
|
|
firstcircle=[l.x,l.y] |
|
|
} |
|
|
|
|
|
if (i > 0) { |
|
|
|
|
|
let last = ry[index][i - 1]; |
|
|
ctx.beginPath(); |
|
|
ctx.moveTo(last.x, last.y); |
|
|
ctx.lineTo(l.x, l.y); |
|
|
ctx.strokeStyle = l.color; |
|
|
ctx.stroke(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function drawCircle(x, y) { |
|
|
ctx.beginPath(); |
|
|
ctx.arc(x, y,1, 0, Math.PI *2); |
|
|
ctx.strokeStyle = 'rgb(47,255,255)'; |
|
|
ctx.stroke(); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var levelsin = document.getElementById('levelcheckbox'); |
|
|
var canvaswindow= document.getElementById('canvaswindow'); |
|
|
var undoButtonId=document.getElementById('undoButtonId'); |
|
|
NewShapeButtonId=document.getElementById('NewShapeButtonId'); |
|
|
var savecanvas=document.getElementById('savecanvas'); |
|
|
|
|
|
levelsin.addEventListener('click',function(){ |
|
|
if (document.getElementsByClassName("selectionsProjs")[0].value.startsWith('1.0')) |
|
|
{ |
|
|
document.getElementById("all").style.display = "block"; |
|
|
if( document.getElementById('levelcheckbox').checked) |
|
|
{ |
|
|
$.get( '/canvaspdftoimgBackground/'+pdfname) |
|
|
.success (function(data){ |
|
|
document.getElementById("all").style.display = "none"; |
|
|
var popup = window.open(''); |
|
|
console.log(popup) |
|
|
popup.document.write('<html><head><title>ADR Console:Draw on PDF tool</title><link rel="stylesheet" href="static/style.css"></head><body>'); |
|
|
|
|
|
var element = popup.document.createElement('div'); |
|
|
element.setAttribute('id', 'mydiv'); |
|
|
canvaswindow.childNodes[1].height=data[1]; |
|
|
canvaswindow.childNodes[1].width=data[2]; |
|
|
canvaswindow.childNodes[1].style.width= 0.5*screen.width +'px' |
|
|
|
|
|
HeightStyleratio= canvaswindow.childNodes[1].height * 0.5*screen.width / canvaswindow.childNodes[1].width ; |
|
|
canvaswindow.childNodes[1].style.height= HeightStyleratio.toString() + 'px'; |
|
|
element.append(canvaswindow); |
|
|
console.log(canvaswindow.childNodes) |
|
|
|
|
|
canvaswindow.removeAttribute('hidden'); |
|
|
var imgDrawon =document.createElement("img"); |
|
|
imgDrawon.src = 'data:image/gif;base64,' +data[0]; |
|
|
console.log('srcc'+imgDrawon.src) |
|
|
imgDrawon.width=data[2]; |
|
|
imgDrawon.style.width='700px'; |
|
|
imgDrawon.id='imgcanvas'; |
|
|
imgDrawon.alt="Larry"; |
|
|
|
|
|
imgDrawon.onload = function(){ |
|
|
ctx.drawImage(imgDrawon,0,0); |
|
|
var scale = data[2] / canvaswindow.childNodes[1].style.width.slice(0,-2) ; |
|
|
ctx.setTransform(scale,0,0,scale,0,0); |
|
|
} |
|
|
undoButtonId.addEventListener("click", e => { |
|
|
|
|
|
if (ry[ry.length - 1].length > 0) |
|
|
{ |
|
|
ry[ry.length - 1].pop(); |
|
|
} |
|
|
else { |
|
|
|
|
|
ry.pop(); |
|
|
|
|
|
ry[ry.length - 1].pop(); |
|
|
} |
|
|
|
|
|
|
|
|
ctx.clearRect(0,0, canvas.width, canvas.height); |
|
|
|
|
|
ctx.drawImage(imgDrawon,0,0,canvaswindow.childNodes[1].style.width.slice(0, -2),canvaswindow.childNodes[1].style.height.slice(0, -2)); |
|
|
drawChart(); |
|
|
}); |
|
|
|
|
|
var win = popup.document.body; |
|
|
win.appendChild(element); |
|
|
var drp=popup.document.body.childNodes[0].childNodes[0].childNodes[9]; |
|
|
NewShapeButtonId.addEventListener('click',function(){ |
|
|
ry.push([]); |
|
|
}); |
|
|
drp.childNodes[1].addEventListener('click',function(){ |
|
|
drp.childNodes[1].onchange=change; |
|
|
}) |
|
|
}) |
|
|
.error(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Levels are not supported in this Section. '; |
|
|
ShowPopUp(); |
|
|
document.getElementById('levelcheckbox').checked=false; |
|
|
}); |
|
|
|
|
|
savecanvas.addEventListener('click',function(){ |
|
|
var image = new Image(); |
|
|
image.id = "pic"; |
|
|
image.src = canvas.toDataURL("image/png"); |
|
|
canvasimg=image.src; |
|
|
}) |
|
|
} |
|
|
} |
|
|
else{ |
|
|
PopupElement.textContent='Levels are not supported in this Section. '; |
|
|
ShowPopUp(); |
|
|
document.getElementById('levelcheckbox').checked=false; |
|
|
} |
|
|
}) |
|
|
|
|
|
function getSecondData(){ |
|
|
document.getElementById('all').style.display='block'; |
|
|
|
|
|
getmctName() |
|
|
} |
|
|
|
|
|
var section = document.getElementsByClassName("selectionsProjs")[0] |
|
|
var inputs= document.getElementById('measurementselectionsid'); |
|
|
var selections= document.getElementById('selectionsid'); |
|
|
var measitem= document.getElementById('measureitemsid'); |
|
|
|
|
|
|
|
|
function chooseFirstdrpdwn() |
|
|
{ |
|
|
|
|
|
inputs.innerHTML=''; |
|
|
selections.innerHTML=''; |
|
|
measitem.innerHTML=''; |
|
|
|
|
|
if (section.value.startsWith('1.0')) |
|
|
{ |
|
|
|
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Ground Beams'; |
|
|
optn.value= "ground beams"; |
|
|
inputs.add(optn); |
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Pile Caps'; |
|
|
optn1.value= "pile caps"; |
|
|
inputs.add(optn1); |
|
|
} |
|
|
if (section.value.startsWith('3.2')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Floor'; |
|
|
optn.value= "Floor"; |
|
|
inputs.add(optn); |
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Wall'; |
|
|
optn1.value= "Wall"; |
|
|
inputs.add(optn1); |
|
|
var optn2 = document.createElement("OPTION"); |
|
|
optn2.text= 'Internal Doors'; |
|
|
optn2.value= "Internal Doors"; |
|
|
inputs.add(optn2); |
|
|
} |
|
|
if (section.value.startsWith('3.3')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Ceiling'; |
|
|
optn.value= "Ceiling"; |
|
|
inputs.add(optn); |
|
|
} |
|
|
if (section.value.startsWith('2.7')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Internal Walls'; |
|
|
optn.value= "Internal Walls"; |
|
|
inputs.add(optn); |
|
|
} |
|
|
if (section.value.startsWith('2.8') || section.value.startsWith('2.6')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Single Door'; |
|
|
optn.value= "Single Door"; |
|
|
inputs.add(optn); |
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Double Door'; |
|
|
optn1.value= "Double Door"; |
|
|
inputs.add(optn1); |
|
|
} |
|
|
if (section.value.startsWith('2.1')) |
|
|
{ |
|
|
var opt = document.createElement("OPTION"); |
|
|
opt.text= 'Select'; |
|
|
opt.value= ""; |
|
|
opt.hidden=true; |
|
|
inputs.add(opt); |
|
|
var optn = document.createElement("OPTION"); |
|
|
optn.text= 'Column'; |
|
|
optn.value= "Column"; |
|
|
inputs.add(optn); |
|
|
var optn1 = document.createElement("OPTION"); |
|
|
optn1.text= 'Wall'; |
|
|
optn1.value= "Wall"; |
|
|
inputs.add(optn1); |
|
|
} |
|
|
|
|
|
$(inputs).select2({ |
|
|
|
|
|
placeholder:'Select', |
|
|
closeOnSelect: true, |
|
|
width:'15ch' |
|
|
}); |
|
|
$(selections).select2({ |
|
|
placeholder:'Select MC-T Name', |
|
|
closeOnSelect: true, |
|
|
width:'23ch' |
|
|
}); |
|
|
$(measitem).select2({ |
|
|
placeholder:'Select unit', |
|
|
closeOnSelect: true, |
|
|
width:'11ch' |
|
|
}); |
|
|
} |
|
|
$(inputs).on("change", function (e) { |
|
|
get3rddropdown(); |
|
|
}) |
|
|
|
|
|
$(selections).on("change", function (e) { |
|
|
get3rddropdown(); |
|
|
}) |
|
|
$(inputs).css('width', '50px'); |
|
|
|
|
|
|
|
|
|
|
|
function summary_to_XML(){ |
|
|
console.log(pdfpath) |
|
|
$.get('/summarytoXML/'+JSON.stringify([pdfpath,tomeasureproj])) |
|
|
.success(function(xmllink){ |
|
|
console.log(xmllink) |
|
|
window.open(xmllink) |
|
|
}) |
|
|
.error(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Error occured while exporting summary to XML. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var mpopup = document.getElementById('mpopupBox'); |
|
|
|
|
|
|
|
|
function ShowPopUp(){ |
|
|
|
|
|
mpopup.style.display = "block"; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.onclick = function(event) { |
|
|
if (event.target == mpopup) { |
|
|
mpopup.style.display = "none"; |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dialog_container = document.getElementById('dialog-container'); |
|
|
|
|
|
|
|
|
function ShowPopUpWarning(){ |
|
|
|
|
|
dialog_container.style.display = "block"; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.onclick = function(event) { |
|
|
if (event.target == dialog_container) { |
|
|
dialog_container.style.display = "none"; |
|
|
} |
|
|
}; |
|
|
|
|
|
function handleKey(event, id) { |
|
|
const ignoredKeys = [ |
|
|
'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', |
|
|
'Shift', 'Control', 'Alt', 'Meta', 'Escape', 'Tab' |
|
|
]; |
|
|
|
|
|
if (!ignoredKeys.includes(event.key)) { |
|
|
filterFunction(id); |
|
|
} |
|
|
} |
|
|
|
|
|
function filterFunction(id) { |
|
|
const nameCount = {}; |
|
|
let flagnameset = false; |
|
|
|
|
|
const input = document.getElementById(id); |
|
|
const filter = input.value.toUpperCase(); |
|
|
|
|
|
let items; |
|
|
if (id.toString().startsWith('tomeasure')) |
|
|
items = document.querySelectorAll("#measureContainer .measure-item"); |
|
|
else |
|
|
items = document.querySelectorAll("#relvselectid .relv-item"); |
|
|
|
|
|
|
|
|
items.forEach(item => { |
|
|
const txtValue = item.textContent || item.innerText; |
|
|
const name = item.children[1].textContent; |
|
|
|
|
|
if (txtValue.toUpperCase().includes(filter)) { |
|
|
nameCount[name] = (nameCount[name] || 0) + 1; |
|
|
item.style.display = ""; |
|
|
} else { |
|
|
item.style.display = "none"; |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
items.forEach(item => { |
|
|
const txtValue = item.textContent || item.innerText; |
|
|
const name = item.children[1].textContent; |
|
|
|
|
|
if (txtValue.toUpperCase().includes(filter)) { |
|
|
if (nameCount[name] > 1) { |
|
|
item.style.color = "red"; |
|
|
flagnameset = true; |
|
|
} else { |
|
|
item.style.color = ""; |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
if (flagnameset) { |
|
|
document.getElementById("TopTextModal").textContent = 'Error: Duplicates Error'; |
|
|
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.'; |
|
|
ShowPopUp(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var duplicaterExtra = document.getElementById("duplicaterExtra"); |
|
|
var overlaymeText = document.getElementById("modal-bodyTextp"); |
|
|
var overlayme = document.getElementById("dialog-container"); |
|
|
document.getElementById("refreshDropboxButtonID").disabled=false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("refreshDropboxButtonID").onclick = function() |
|
|
{ |
|
|
TopTextModal.textContent='Warning: Dropbox Refresh'; |
|
|
if (document.getElementById("refreshDropboxButtonID").disabled==false) |
|
|
overlayme.style.display = "block"; |
|
|
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.'; |
|
|
duplicaterExtra.setAttribute('hidden',true) |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var TopTextModal = document.getElementById("TopTextModalWarning"); |
|
|
|
|
|
document.getElementById("refreshAPIbutton").disabled=false; |
|
|
document.getElementById("refreshAPIbutton").onclick = function() |
|
|
{ |
|
|
TopTextModal.textContent='Warning: MC Refresh'; |
|
|
if (document.getElementById("refreshAPIbutton").disabled==false) |
|
|
{ |
|
|
console.log(overlaymeText.textContent) |
|
|
overlaymeText.textContent='This is not a mandatory button. The system already runs at half-hour intervals to update the dropdowns and MC-Templates from the MC. Using this would manually refresh the data retrieved, disregarding the 30-minute interval.'; |
|
|
overlayme.style.display = "block"; |
|
|
duplicaterExtra.setAttribute('hidden',true) |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("popupforextratext").disabled=false; |
|
|
document.getElementById("popupforextratext").onclick = function(){ |
|
|
|
|
|
if(sectionNumber.startsWith('2.7') ){ |
|
|
document.getElementById("Thickness2.7").removeAttribute("hidden") |
|
|
} |
|
|
|
|
|
if (sectionNumber.startsWith('2.8') || sectionNumber.startsWith('2.6')) |
|
|
{ |
|
|
text1extra= document.getElementById("text1extra") |
|
|
text1extra.style.backgroundColor = "rgba(101, 101, 101, 0.27)"; |
|
|
text1extra.style.cursor='not-allowed'; |
|
|
text1extra.disabled="disabled"; |
|
|
|
|
|
text2extra= document.getElementById("text2extra") |
|
|
text2extra.style.backgroundColor = "rgba(101, 101, 101, 0.27)"; |
|
|
text2extra.style.cursor='not-allowed'; |
|
|
text2extra.disabled="disabled"; |
|
|
} |
|
|
duplicaterExtra.removeAttribute('hidden'); |
|
|
TopTextModal.textContent='Define Information to Extract from Drawing' |
|
|
if (document.getElementById("popupforextratext").disabled==false) |
|
|
{ |
|
|
overlaymeText.textContent=''; |
|
|
overlayme.style.display = "block"; |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("confirm").onclick = function(){confirmDialogR()}; |
|
|
function confirmDialogR() { |
|
|
|
|
|
overlayme.style.display = "none"; |
|
|
console.log(document.getElementById("confirm").parentElement.parentElement.children[0].textContent) |
|
|
if (document.getElementById("confirm").parentElement.parentElement.children[0].textContent.startsWith('The')) |
|
|
{ |
|
|
console.log('hereeeeeeeee') |
|
|
callrefreshDropbox(); |
|
|
} |
|
|
else if(document.getElementById("confirm").parentElement.parentElement.children[0].textContent.startsWith('This')){ |
|
|
|
|
|
callrefreshAPI(); |
|
|
} |
|
|
else{ |
|
|
getpopuptext(); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
document.getElementById("cancel").onclick = function(){cancelDialog()}; |
|
|
function cancelDialog() { |
|
|
overlayme.style.display = "none"; |
|
|
} |
|
|
|
|
|
var extracted_path; |
|
|
function callrefreshDropbox(){ |
|
|
console.log('ldropboxx' , extracted_path) |
|
|
document.getElementById("refreshDropboxButtonID").style.backgroundColor = "gray"; |
|
|
document.getElementById("refreshDropboxButtonID").style.cursor='not-allowed'; |
|
|
document.getElementById("refreshDropboxButtonID").disabled="disabled"; |
|
|
|
|
|
TopTextModal=document.getElementById("TopTextModal"); |
|
|
$.get('/postdropboxprojects/' + encodeURIComponent(JSON.stringify(extracted_path))) |
|
|
|
|
|
.success(function(stringReturned) { |
|
|
if (stringReturned.startsWith('Updated')) |
|
|
{ |
|
|
console.log('DONEEEE') |
|
|
|
|
|
TopTextModal.textContent= "Success!"; |
|
|
TopTextModal.style.color='green'; |
|
|
PopupElement.textContent=stringReturned; |
|
|
} |
|
|
else{ |
|
|
PopupElement.textContent=stringReturned; |
|
|
} |
|
|
ShowPopUp(); |
|
|
document.getElementById("refreshDropboxButtonID").style.cursor='pointer'; |
|
|
document.getElementById("refreshDropboxButtonID").style.backgroundColor = "#1680c7"; |
|
|
document.getElementById("refreshDropboxButtonID").disabled = false; |
|
|
}) |
|
|
.error(function(jqXHR, textStatus, errorThrown) { |
|
|
PopupElement.textContent='Error occured while retrieving projects from the dropbox. Refresh and try again. If the error continues, please contact the ADR team to fix it. '; |
|
|
ShowPopUp(); |
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var groupedValues = []; |
|
|
function getpopuptext() { |
|
|
groupedValues = []; |
|
|
|
|
|
const inputs = document.querySelectorAll('#duplicaterExtra input[type="text"], #duplicaterExtra input[type="number"]'); |
|
|
const values = []; |
|
|
|
|
|
|
|
|
inputs.forEach(input => { |
|
|
values.push(input.value.trim()); |
|
|
}); |
|
|
|
|
|
console.log("Collected input values:", values); |
|
|
if (projsec.value.startsWith('2.7')) |
|
|
lengthofitems=3 |
|
|
else if (projsec.value.startsWith('2.8') || projsec.value.startsWith('2.6')) |
|
|
lengthofitems=1 |
|
|
|
|
|
for (let i = 0; i < values.length; i += lengthofitems) { |
|
|
const group = values.slice(i, i + lengthofitems); |
|
|
if (group.some(val => val !== '')) { |
|
|
groupedValues.push(group); |
|
|
} |
|
|
} |
|
|
|
|
|
console.log("Grouped input values:", groupedValues); |
|
|
return groupedValues; |
|
|
} |
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|