Spaces:
Sleeping
Sleeping
File size: 30,064 Bytes
5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 5dfece0 c074444 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 |
<!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>
<script src="https://cdn.plot.ly/plotly-latest.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="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="static/MenuStyle.css">
<link rel="stylesheet" href="static/LegendPageStyle.css">
<link rel="stylesheet" href="static/wordSearchCss.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">
<script src="https://cdn.anychart.com/releases/8.9.0/js/anychart-core.min.js"></script>
<script src="https://cdn.anychart.com/releases/8.9.0/js/anychart-sunburst.min.js"></script>
<script src="https://cdn.anychart.com/releases/8.9.0/js/anychart-data-adapter.min.js"></script>
</head>
<body >
<div id="all">
{% include 'loading.html' %}
</div>
<!--Main tab links-->
<div class="tab">
<div class="container" id="toggle">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<!-- Home (ADR Console) button comes first -->
<a class="tablinks" id="pagetitle" href="{{ url_for('measurementConsoleFn') }}">
ADR Console <i class="fa fa-home"></i>
</a>
<!-- Legends History button comes second -->
<button class="tablinks" id="LegendHist" onclick="openTab(event, 'legends')">
Legends History <i class="fa fa-caret-down"></i>
</button>
<!-- Info button (as before) -->
<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+P6upqZGVlBS1wIJo2bRpqamoMHg7gFtwGIEqX4HEATkmcP378iGPHjmHMmDGuC67S2LFjDUWQpwOOc3u6LfynAH6R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AAABJRU5ErkJggg=="></button>
</div>
<div id="mySidebar" class="slide-out">
<div id="menuOptions">
<li onclick="openTab(event, 'home')" >Measure Plans </li>
<li><a href="{{ url_for('searchDocument') }}">Search in Documents</a></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>
<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 class="dropdown-content">
<div id="userguidetext">
<div id="textfirstpage">
<label style="font-style: oblique;"> <br> Before using this tool, kindly read the following. </label>
<br><br>
<label style="font-style: oblique;" > Note : This algorithm is based on searching in pdfs only. </label>
<br><br>
The tool has two main tabs. File search - Folder Search.
<br><br>
<li id="userguideheadings"> File Search </li>
<br>The first dropdown available allows you to select the name of the project you wish to search in.
<br >
Write down the word you want to search for in the field labeled 'Keyword'.
You could choose one or more projects to search in from the "Documents to Measure" section. Additionally, you have the ability to view any relevant documents you might need in Dropbox.(optional)
<br> <br>
<li id="userguideheadings" > Folder Search </li>
<br>
Allows you to search in all pdfs found in a specific folder.
<br><br>
<label id="underlinedLables"> - Outputs: </label> <br>
Table: Contains a summary of the keyword used to search with, the name(s) of the document(s) search in, the number of occurences.
<br>
Image View of the pages in which the keyword was found.
<br> <br> <br>
</div>
</div>
</div>
<!-- POP-UP code -- to handle errors -->
<!-- Link to trigger modal -->
<!-- Modal popup box -->
<div id="mpopupBox" class="mpopup">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Error</h2>
</div>
<div class="modal-body">
<p id="modal-bodyText">
</p>
</div>
</div>
</div>
</body>
</html>
<script >
///////////////////////////////////////////////BEGIN JS CODE//////////////////////////////////////////////////
PrjNamesArray=[];
PrjPartsArray=[];
PrjSectionsArray=[];
var partsArrwithID=[];
var firstDpwnValue;
var prjids=[]
displayprjnames()
function displayprjnames(){
$.get('/getprojectnames/')
.success(function(data) {
document.getElementById("all").style.display = "none";
for (let i=0;i<data[0].length;i++)
{
PrjNamesArray.push(data[0][i]);
}
})
.error(function(jqXHR, textStatus, errorThrown) {
PopupElement.textContent='Error occured while retrieving the Project Names. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
ShowPopUp();
});
}
/*Menu bar icon mySidebar and Toggle*/
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()
}
});
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
/*Tab View of User Guide*/
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";
}
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
/*Toggle Tab View of Home and Legend along with the Menu bar icon*/
function openTab(evt, tabname) {
console.log(tabname)
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
// Get all elements with class="tablinks" and remove the class "active"
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
// Show the current tab, and add an "active" class to the button that opened the tab
document.getElementById(tabname).style.display = "block";
evt.currentTarget.className += " active";
var isOpen = $mySidebar.classList.contains('slide-in');
if ($mySidebar.classList.contains('slide-in'))
{
$mySidebar.setAttribute('class', isOpen ? 'slide-out' : 'slide-in');
document.getElementById("pagetitle").style.backgroundColor='rgb(0, 60, 255)';
$toggle.classList.toggle("change");
}
}
// Start with the first page (Home)
document.getElementById("LegendHist").click();
// document.getElementById("FileTabID").click();
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
// _________________________________________________________________________________
//___________________________________________________________________________________________________________
/*User Guide button toggle*/
function userguideclick(){
console.log('cghj')
var acc = document.getElementsByClassName("dropdown-content")[0];
var i;
acc.classList.toggle("active");
/* Toggle between hiding and showing the active panel */
if (acc.style.display === "block") {
acc.style.display = "none";
} else {
acc.style.display = "block";
acc.style.backgroundColor=(0, 153, 255);
}
}
//to be retrieved from python code
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
/////////////////////////////////////*LEGEND DIRECTORY*//////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
/*Get tables of Prj Names, parts , sections from API code */
table1={}
table2={}
table3={}
$.get('/getAPITables/')
.success(function(data){
table1=data[0]; //prj names table
table2=data[1]; //prj parts table
table3=data[2]; //prj sections table
})
.error(function(jqXHR, textStatus, errorThrown) {
PopupElement.textContent='Error occured. Refresh and try again. If the error continues, please contact the ADR team to fix it. ';
ShowPopUp();
});
var pathsarr={};
var legendscontent= document.getElementById('legends');
var createdTimeDiv= document.getElementById('createdTimeDiv');
//___________________________________________________________________________________________________________
//___________________________________________________________________________________________________________
/*Create divs for each prj and div for each part*/
getlegendstoDirectory()
function getlegendstoDirectory(){
console.log('here')
$.get( '/getdrivelinks/'+'0').then (function(data){
pathsarr=data
if (!legendscontent.children[1]){
var allprjdiv= document.createElement("div");
allprjdiv.id='allprjdiv';
}
else{
legendscontent.children[1].innerHTML='';
var allprjdiv=legendscontent.children[1];
allprjdiv.id='allprjdiv';
}
for (let proj=0; proj<PrjNamesArray.length ; proj++)
{
var labelprojdiv= document.createElement("div");
var newlabelproj = document.createElement("label")
var i = document.createElement("i");
var brk= document.createElement("br");
i.className="fa fa-folder"
newlabelproj.textContent=PrjNamesArray[proj];
newlabelproj.id='prjname';
newlabelproj.className='prjnameclass';
labelprojdiv.append(i)
labelprojdiv.append(newlabelproj)
labelprojdiv.append(brk)
allprjdiv.append(labelprojdiv)
}
legendscontent.append(allprjdiv)
legendscontent.querySelectorAll('label').forEach(function(elem){
elem.addEventListener('click',function(){
if (!elem.parentElement.children[3]){
var prjnameId;
var prjpartsforLgnd=[];
var prjpartId;
var prjSectionsforLgnd=[];
/*get prj clicked on */
for (item in table1.ProjectName)
{
if (table1.ProjectName[item] == elem.textContent.toString())
{
prjnameId = table1.ProjectId[item];
break;
}
}
/*get prj parts of this prj and its id*/
for (item in table2.ProjectId)
{
if (table2.ProjectId[item] == prjnameId.toString())
{
prjpartsforLgnd.push(table2.ProjectPart[item]);
prjpartId=table2.ProjectPartId[item] ;
}
}
var allpartsdiv= document.createElement("div");
for (let prjpart=0;prjpart<prjpartsforLgnd.length;prjpart++)
{
var labelpartdiv= document.createElement("div");
labelpartdiv.style.marginLeft='20px';
var newlabelpart = document.createElement("label")
var i = document.createElement("i");
var brk= document.createElement("br");
i.className="fa fa-folder"
newlabelpart.textContent=prjpartsforLgnd[prjpart];
newlabelpart.id='prjpart';
newlabelpart.className='prjpartclass';
labelpartdiv.append(i)
labelpartdiv.append(newlabelpart)
labelpartdiv.append(brk)
allpartsdiv.append(labelpartdiv)
}
elem.parentElement.append(allpartsdiv)
elem.parentElement.querySelector('i').className='fa fa-folder-open';
/*Sections divs*/
for (let c=0;c<elem.parentElement.children[3].children.length;c++) //Div of Part
{prjSectionsforLgnd=[]
elem.parentElement.children[3].children[0].children.innerHTML=''
elem.parentElement.children[3].children[c].children[1].addEventListener('click',function(){
var partlabelText= elem.parentElement.children[3].children[c].children[1].textContent;
for (item in table3.ProjectId)
{
if (table3.ProjectId[item] ==prjnameId && table3.ProjectPartId[item]==prjpartId )
{
prjSectionsforLgnd.push(table3.ProjectSection[item]);
}
}
if (! elem.parentElement.children[3].children[c].children[3]) {
console.log(elem.parentElement.children[3].children[c])
var labelsecdiv= document.createElement("div");
labelsecdiv.style.marginLeft='25px';
for (let cc=0;cc<prjSectionsforLgnd.length;cc++){
var seperateSecdiv = document.createElement("div")
var newlabelsec = document.createElement("label")
var i = document.createElement("i");
var brk= document.createElement("br");
i.className="fa fa-folder"
console.log('addingsection')
newlabelsec.textContent=prjSectionsforLgnd[cc];
newlabelsec.id='prjsec';
newlabelsec.className='prjsecclass';
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
{
newlabelsec.style.color='lightgray';
i.style.color='lightgray'
newlabelsec.style.cursor='default';
}
seperateSecdiv.append(i)
seperateSecdiv.append(newlabelsec)
seperateSecdiv.append(brk)
labelsecdiv.append(seperateSecdiv)
elem.parentElement.children[3].children[c].append(labelsecdiv)
// console.log(labelsecdiv)
}
elem.parentElement.children[3].children[c].children[0].className='fa fa-folder-open';
/*Get path to legends - project name , part , section*/
for (let k=0;k<elem.parentElement.children[3].children[c].children[3].children.length;k++)
{
elem.parentElement.children[3].children[c].children[3].children[k].children[1].addEventListener('click',function(){
legendpathh='/'+elem.textContent +'/' + partlabelText + '/' + elem.parentElement.children[3].children[c].children[3].children[k].children[1].textContent+'/'
if (!elem.parentElement.children[3].children[c].children[3].children[k].children[3])
{
for (let o=0; o<pathsarr.length;o++){
console.log(pathsarr[o])
if (JSON.stringify(pathsarr[o][1]) === JSON.stringify(legendpathh) ){
var legendsdiv= document.createElement("div");
legendsdiv.style.marginLeft='20px';
var seperateSecdiv = document.createElement("div")
var legendlabel = document.createElement("label")
var brk= document.createElement("br");
legendlabel.textContent=pathsarr[o][0]
legendlabel.id='legend';
legendlabel.className='legendclass';
var legendlabeldiv= document.createElement("div");
legendlabeldiv.id='legendtimediv'
var createdTimelbl = document.createElement("label")
var brk= document.createElement("br");
createdTimelbl.textContent=new Date(pathsarr[o][2].createdTime ).toUTCString()
createdTimelbl.id='legendtime';
createdTimelbl.className='legendclass';
var modifiedTimelbl = document.createElement("label")
var brk= document.createElement("br");
modifiedTimelbl.textContent=new Date(pathsarr[o][2].modifiedTime ).toUTCString()
modifiedTimelbl.id='legendmodtime';
modifiedTimelbl.className='legendclass';
console.log(pathsarr[o][2].createdTime,pathsarr[o][2].modifiedTime )
seperateSecdiv.append(legendlabel)
legendlabeldiv.append(createdTimelbl)
legendlabeldiv.append(modifiedTimelbl)
seperateSecdiv.style.display='flex';
seperateSecdiv.id='legendlbldivwhole'
seperateSecdiv.append(legendlabeldiv);
seperateSecdiv.append(brk);
legendsdiv.append(seperateSecdiv);
console.log(legendsdiv);
elem.parentElement.children[3].children[c].children[3].children[k].append(legendsdiv)
/*open legend link*/
seperateSecdiv.addEventListener('click',function(){
window.open('https://docs.google.com/spreadsheets/d/'+pathsarr[o][3])
})
if (elem.parentElement.children[3].children[c].children[3].children[k].children[0].className=='fa fa-folder')
elem.parentElement.children[3].children[c].children[3].children[k].children[0].className='fa fa-folder-open';
}
}
}
else{
for (let y =elem.parentElement.children[3].children[c].children[3].children[k].children.length; y>=0;y--)
{
if (elem.parentElement.children[3].children[c].children[3].children[k].children[y] instanceof HTMLDivElement)
elem.parentElement.children[3].children[c].children[3].children[k].removeChild(elem.parentElement.children[3].children[c].children[3].children[k].children[y]);
}
elem.parentElement.children[3].children[c].children[3].children[k].children[0].className='fa fa-folder';
}
})
}
}
else{
elem.parentElement.children[3].children[c].removeChild(elem.parentElement.children[3].children[c].children[3]);
elem.parentElement.children[3].children[c].children[0].className='fa fa-folder';
}
})
}
}
/*remove all parts along with sectionns of element (prj name)s*/
else{
elem.parentElement.removeChild(elem.parentElement.children[3]);
elem.parentElement.children[0].className='fa fa-folder';
}
})
})
})
}
function sortlegends(clicked_id){
var allarr=[]
for ( let u=0 ; u<document.getElementById('allprjdiv').children.length ; u++)
{
//Project names folder
if (document.getElementById('allprjdiv').children[u].children[3])
{
for (let uu=0 ; uu<document.getElementById('allprjdiv').children[u].children[3].children.length;uu++)
{//Project part folder
if(document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3])
{
var arr=[]
for (let uuu=0;uuu<document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children.length;uuu++)
{//NRM section folder - direct parent
for (let h=0;h<document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children.length;h++)
{
if (document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h] instanceof HTMLDivElement)
{
if (clicked_id == 'sortBtnCreateDesc' || clicked_id == 'sortBtnCreateAsc' )
arr.push([document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h], new Date(document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h].children[0].children[1].children[0].textContent)])
if (clicked_id == 'sortBtnEditDesc' || clicked_id == 'sortBtnEditAsc' )
arr.push([document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h], new Date(document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h].children[0].children[1].children[1].textContent)])
// legends in this parent only
if (h==document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children.length-1)
{
if (clicked_id == 'sortBtnCreateDesc' || clicked_id == 'sortBtnEditDesc' )
x=arr.sort((a, b) => b[1]- a[1])
if (clicked_id=='sortBtnCreateAsc' || clicked_id == 'sortBtnEditAsc' )
x=arr.sort((a, b) => a[1]- b[1])
if (document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].children[h] instanceof HTMLDivElement)
{
console.log(document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu] )
for (let k =0; k <x.length; k++)
document.getElementById('allprjdiv').children[u].children[3].children[uu].children[3].children[uuu].appendChild(x[k][0])
}
}
}
}
}
allarr.push(arr);
}
}
}
}
}
</script>
|