Marthee commited on
Commit
da9061e
·
1 Parent(s): 3a7f872

Delete templates

Browse files
templates/home.html DELETED
@@ -1,68 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" dir="ltr">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Flask Tutorial</title>
6
-
7
- </head>
8
- <body>
9
-
10
- <button onclick="duplicate()">Forwaaard</button>
11
- <form action="/forward/" method="post">
12
-
13
- <div id ="duplicater">
14
-
15
- <select name="select" class="selections">
16
- <option value="" disabled selected hidden>Choose value</option>
17
- <option value="hi">hi </option>
18
- <option value="11aaa"> 11</option>
19
- </select>
20
-
21
- </div>
22
-
23
- <button name="forwardBtn" type="submit">donee</button>
24
-
25
-
26
-
27
- </form>
28
-
29
-
30
- </body>
31
-
32
- </html>
33
-
34
-
35
- <script >
36
- var i = 0;
37
- var original = document.getElementById('duplicater');
38
-
39
- const vals = [];
40
- function duplicate() {
41
-
42
- var clone = original.cloneNode(true); // "deep" clone
43
-
44
- // or clone.id = ""; if the divs don't need an ID
45
- clone.id = 'duplicater' + ++i;
46
-
47
- clone.getElementsByClassName('selections')[0].setAttribute('name', 'select'+i);
48
- original.parentNode.appendChild(clone);
49
-
50
- // var value = clone.id;
51
- console.log( original.parentNode)
52
- console.log( clone )
53
- var sel0 = document.getElementById('duplicater').getElementsByClassName('selections')[0];
54
- var sel = document.getElementById(clone.id).getElementsByClassName('selections')[0].tagName;
55
- //var value = sel.textContent[sel.selectedIndex].text;
56
- //var text = sel.options[sel.selectedIndex].text;
57
- //vals.push(text)
58
-
59
- console.log(sel0.value)
60
- console.log(sel)
61
- //console.log(value)
62
- //console.log(text)
63
- //var index=original.selectedIndex
64
- //console.log(original.options[index].text)
65
- }
66
-
67
-
68
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/launch.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "type": "node",
6
- "request": "launch",
7
- "outputCapture": "std"
8
-
9
- }
10
- ]
11
- }
12
-
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/legendDirectory.html DELETED
@@ -1,95 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en" dir="ltr">
3
- <head>
4
- <link rel="stylesheet" href="https://use.typekit.net/zos0ars.css">
5
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
6
- <link rel="stylesheet" href="static/style.css">
7
- <meta charset="utf-8">
8
- <title>ADR Console - V2</title>
9
-
10
- </head>
11
- <body>
12
- <div class="navbar">
13
- <label id="pagetitle">ADR Console</label>
14
- <div class="dropdown">
15
- <a href="/templates/legendDirectory.html" target="_self">legends created</a>
16
-
17
- <i class="fa fa-caret-down"></i>
18
- <div class="dropbtnLinks-content">
19
-
20
- </div>
21
-
22
- <button class="dropbtn"> <i class="fa fa-info" aria-hidden="true"></i>
23
- <i class="fa fa-caret-down"></i>
24
- </button>
25
-
26
- <div class="dropdown-content">
27
- <div id="userguidetext">
28
- <div id="textfirstpage">
29
- <label style="font-style: oblique;"> <br>
30
- Please read the following before you use this tool. </label>
31
- <br><br>
32
- <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 containing information about the plan may be seen as shapes as well, therefore inserted into the algorithm as well.
33
- To avoid this, please clean up the plan before you choose to measure it
34
- by erasing them or by drawing a white rectangle above them using any external tool. </label>
35
- <br>
36
-
37
- <br>
38
- The tool is divided into two main parts:
39
- <br>
40
- <li id="userguideheadings"> First Part </li>
41
- <br> You will find three dropdowns. Choose the name of the project you want to measure, along with the project part, and the project section.
42
- <br > <br>
43
- <label style="font-style: italic;"> Please double check the project section chosen as this chooses the code that will be applied to the plan. </label>
44
- <br>
45
- <br>
46
- Mark the project you wish to meaure from the section labeled 'To measure'. You could also choose any relevant documents you wish to see (optional).
47
- <br> <label style="font-style: italic;">Pixel to Metric conversion important notes : </label>When you choose to measure a specific plan, you will be provided with a pdf that has
48
- a white rectangle drawn in it. Please open this pdf in Bluebeam and measure its area and perimeter and insert them in the textboxes that will be shown below.
49
- When measuring this rectangle, you could consider it as the scale check done on Bluebeam.
50
- <br> <br> <label style="font-style: italic;">Notes when measuring secion 1.0: </label>
51
- <label id=info >Choose whether this project contains levels or not. If you wish to measure all of the plan, let the number of plans equal to one. If you wish to measure certain regions of the plan or have the plan divided into levels,
52
- please type in a number greater than 1 (number of levels). </label>
53
- <br> If you choose Measure specific regions, please draw shapes around the desired regions on Bluebeam or any external tool before choosing to measure this plan.
54
- <br> You should also insert the colors of the levels in rgb format (Red-Green-Blue).
55
-
56
- <br>
57
-
58
- <i id="secondpage" class="fa fa-arrow-right" aria-hidden="true"></i>
59
- <br>
60
- </div>
61
- <div id="textsecondpage" hidden=until-found>
62
- <br>
63
- <li id="userguideheadings" > Second part </li>
64
- <br>
65
- First, please open the google sheets link labeled 'Legend' and fill in the names of each shape.
66
- <br>Ex. The first row shows the measurement of GB-1 , in the first column type in GB-1.
67
- <br> After you are done with filling in the legend, go back to the ADR Console.
68
- You will find three dropdowns and three textboxes.
69
-
70
- <li style="list-style-type:square;"> The first dropdown will allow you to choose whether the shape is a ground beam or a pile cap. </li>
71
- <li style="list-style-type:square;"> The second dropdown is the choice of (Area-perimeter-Length-Count).</li>
72
- <li style="list-style-type:square;"> The third dropdown gives you the first part of the MC-T Name.</li>
73
- <br> Then fill in the rows below the dropdowns with the corresponding detail and depth.
74
- The plus button allows you to add more rows within this block.
75
- <br>
76
- There is another button above the dropdowns (to the right) that allows you to add another block and repeat the process for another item (Ground Beam or Pile Cap) or (Area-perimeter-Length-Count).
77
- <br><br>
78
- <i id="firstpage" class="fa fa-arrow-left" aria-hidden="true"></i>
79
- <br>
80
-
81
- </div>
82
-
83
- </div>
84
- </div>
85
- <!-- <button class="dropbtnLinks">aa
86
- <i class="fa fa-caret-down"></i>
87
- </button> -->
88
- </div>
89
-
90
- </div>
91
-
92
-
93
- </body>
94
-
95
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/proposed-GUI.html DELETED
@@ -1,1757 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <html lang="en" dir="ltr">
4
- <head>
5
- <link rel="stylesheet" href="https://use.typekit.net/zos0ars.css">
6
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
7
- <link rel="stylesheet" href="static/style.css">
8
- <meta charset="utf-8">
9
- <title>ADR Console - V2</title>
10
-
11
- </head>
12
- <body>
13
- <!-- <ul>
14
-
15
- <button class="accordion" >User Guide</button>
16
-
17
- </ul> -->
18
- <div class="navbar">
19
- <label id="pagetitle">ADR Console</label>
20
- <div class="dropdown">
21
- <p class="dropdownLinks"><a href="/templates/legendDirectory.html" target="_self">Legends History</a> </p>
22
-
23
- <i class="fa fa-caret-down"></i>
24
- <div class="dropbtnLinks-content">
25
-
26
- </div>
27
-
28
- <button class="dropbtn"> <i class="fa fa-info" aria-hidden="true"></i>
29
- <i class="fa fa-caret-down"></i>
30
- </button>
31
-
32
- <div class="dropdown-content">
33
- <div id="userguidetext">
34
- <div id="textfirstpage">
35
- <label style="font-style: oblique;"> <br>
36
- Please read the following before you use this tool. </label>
37
- <br><br>
38
- <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 containing information about the plan may be seen as shapes as well, therefore inserted into the algorithm as well.
39
- To avoid this, please clean up the plan before you choose to measure it
40
- by erasing them or by drawing a white rectangle above them using any external tool. </label>
41
- <br>
42
-
43
- <br>
44
- The tool is divided into two main parts:
45
- <br>
46
- <li id="userguideheadings"> First Part </li>
47
- <br> You will find three dropdowns. Choose the name of the project you want to measure, along with the project part, and the project section.
48
- <br > <br>
49
- <label style="font-style: italic;"> Please double check the project section chosen as this chooses the code that will be applied to the plan. </label>
50
- <br>
51
- <br>
52
- Mark the project you wish to meaure from the section labeled 'To measure'. You could also choose any relevant documents you wish to see (optional).
53
- <br> <label style="font-style: italic;">Pixel to Metric conversion important notes : </label>When you choose to measure a specific plan, you will be provided with a pdf that has
54
- a white rectangle drawn in it. Please open this pdf in Bluebeam and measure its area and perimeter and insert them in the textboxes that will be shown below.
55
- When measuring this rectangle, you could consider it as the scale check done on Bluebeam.
56
- <br> <br> <label style="font-style: italic;">Notes when measuring secion 1.0: </label>
57
- <label id=info >Choose whether this project contains levels or not. If you wish to measure all of the plan, let the number of plans equal to one. If you wish to measure certain regions of the plan or have the plan divided into levels,
58
- please type in a number greater than 1 (number of levels). </label>
59
- <br> If you choose Measure specific regions, please draw shapes around the desired regions on Bluebeam or any external tool before choosing to measure this plan.
60
- <br> You should also insert the colors of the levels in rgb format (Red-Green-Blue).
61
-
62
- <br>
63
-
64
- <i id="secondpage" class="fa fa-arrow-right" aria-hidden="true"></i>
65
- <br>
66
- </div>
67
- <div id="textsecondpage" hidden=until-found>
68
- <br>
69
- <li id="userguideheadings" > Second part </li>
70
- <br>
71
- First, please open the google sheets link labeled 'Legend' and fill in the names of each shape.
72
- <br>Ex. The first row shows the measurement of GB-1 , in the first column type in GB-1.
73
- <br> After you are done with filling in the legend, go back to the ADR Console.
74
- You will find three dropdowns and three textboxes.
75
-
76
- <li style="list-style-type:square;"> The first dropdown will allow you to choose whether the shape is a ground beam or a pile cap. </li>
77
- <li style="list-style-type:square;"> The second dropdown is the choice of (Area-perimeter-Length-Count).</li>
78
- <li style="list-style-type:square;"> The third dropdown gives you the first part of the MC-T Name.</li>
79
- <br> Then fill in the rows below the dropdowns with the corresponding detail and depth.
80
- The plus button allows you to add more rows within this block.
81
- <br>
82
- There is another button above the dropdowns (to the right) that allows you to add another block and repeat the process for another item (Ground Beam or Pile Cap) or (Area-perimeter-Length-Count).
83
- <br><br>
84
- <i id="firstpage" class="fa fa-arrow-left" aria-hidden="true"></i>
85
- <br>
86
-
87
- </div>
88
-
89
- </div>
90
- </div>
91
- <!-- <button class="dropbtnLinks">aa
92
- <i class="fa fa-caret-down"></i>
93
- </button> -->
94
- </div>
95
-
96
- </div>
97
-
98
- <label hidden class=infotip >Choose whether this project contains levels or not. If you wish to measure all of the plan, let the number of plans equal to one. If you wish to measure certain regions of the plan or have the plan divided into levels,
99
- please type in a number greater than 1 (number of levels). </label>
100
- <div id="loading" hidden>
101
-
102
- </div>
103
- <div id="rightside">
104
- <div id="backgroundimg" >
105
-
106
- <!-- <iframe id="pdfiframeid0" src="https://research.google.com/pubs/archive/44678.pdf" style=" visibility:hidden; width:700px; height: 400px;"> </iframe>
107
- -->
108
- </div>
109
- <div id="underimgbuttons"> </div>
110
-
111
- </div>
112
-
113
- <form method="post" onsubmit=getData() id="myForm" >
114
- <div id ="">
115
- <select name="selectproj" class="selectionsProj" required >
116
-
117
- <!-- </select>onchange="getproj()" > -->
118
- <option value="" disabled selected hidden >Project</option>
119
- <option value="2340 United Living Low Rise Building">2340 United Living Low Rise Building</option>
120
- <option value="2341 Bouygues-Cotswold">2341 Bouygues-Cotswold</option>
121
- <option value="2342 GF Tomlinson - Hardingstone Primary School">2342 GF Tomlinson - Hardingstone Primary School</option>
122
-
123
-
124
- <!--
125
- <option value="BMW job1">BMW job1</option>
126
- <option value="BMW job2">BMW job2</option> -->
127
- </select>
128
- </div>
129
-
130
- <div id ="projectpart">
131
- <select name="selectprojp" class="selectionsProjp" id="selectionsProjpid" required>
132
- <option value="" disabled selected hidden >Project Part</option>
133
-
134
- </select>
135
- </div>
136
-
137
- <div id ="projectsection">
138
- <select name="selectprojs" class="selectionsProjs" onchange=getproj() required>
139
- <option value="" disabled selected hidden>Section</option>
140
- <!-- <option value="NRM Section-A">NRM Section-A </option>
141
- <option value="NRM Section-B">NRM Section-B</option> -->
142
- </select>
143
- </div>
144
-
145
-
146
- <div id ="tomeasurediv">
147
- <label id="measureLabel">Document To Measure</label> <br>
148
- <div id="measureCheckbox">
149
- <select style="margin-left: -1%;" hidden name="measureselectname" id="measureselectid" required multiple size="5">
150
- <!-- <option value="" disabled selected hidden>Measure this Document</option> -->
151
- </select>
152
- </div>
153
- </div>
154
-
155
- <div id ="relvDocdiv">
156
- <label id="relvDocLabel">Other Relevant Documents</label> <br>
157
- <div id ="relvdiv">
158
- <select style="margin-left: -1%;" hidden name="relvselectname" id="relvselectid" multiple size="5">
159
-
160
- </select>
161
- </div>
162
- </div>
163
-
164
- <div id="ratios">
165
-
166
- </div>
167
- <br>
168
- <div id="radiosColors" >
169
- <label id=nLevels name="levelsnamelabel" >Number of levels: </label>
170
-
171
- <input id=lvlinput type="number" name="levelsnameinput" oninput="generatecolorPickers()" value="1"> <i class="fa fa-info-circle" id="infotool" > <span class="tooltiptext">Choose whether this project contains levels or not. If you wish to measure all of the plan, let the number of plans equal to one. If you wish to measure certain regions of the plan or have the plan divided into levels,
172
- please type in a number greater than 1 (number of levels). </span> </i>
173
-
174
- <div id="colorpickers">
175
- <!-- -->
176
- </div>
177
-
178
- </div>
179
- <br>
180
-
181
- <div id ="saveOPdiv">
182
- <button id="measureADRbutton">Measure using ADR</button>
183
-
184
- </div>
185
- <audio id="myAudio" autoplay></audio>
186
- <br>
187
- </form>
188
- <script src="https://cdn.lordicon.com/bhenfmcm.js"></script>
189
- <lord-icon
190
- src="https://cdn.lordicon.com/ynwbvguu.json"
191
- trigger="hover" colors="primary:black" id="addicon" onclick="duplicate({{mylist}})">
192
- </lord-icon>
193
-
194
- <!-- <form action="/forward/" method="post"> -->
195
- <!-- <form method="post" id="myFormsecond" > -->
196
- <div id ="duplicater" class="duplicaterclass">
197
- <select name="measurementscripts" class="measurementselections" id="measurementselectionsid" oninput=get3rddropdown()>
198
- <option value="" disabled selected hidden>Select </option>
199
- <option value="ground beams" >Ground Beams </option>
200
- <option value="pile caps"> Pile Caps</option>
201
- </select>
202
-
203
- <select name="select" class="selections" id="selectionsid" oninput=get3rddropdown()>
204
-
205
- </select>
206
- <select name="measureitem" class="measureitems" id="measureitemsid">
207
-
208
- </select>
209
-
210
- <br>
211
- <div id="repeatforloop" class="repeatforloopclass00" name="repeatforloopname " > <!-- onchange="getmctName()"> -->
212
-
213
-
214
- <input type="text" id="text0" name="text1name" placeholder="GB-1" class=gb>
215
- <input type="text" id="text1" name="text2name" placeholder="A" class=a>
216
- <input type="text" id="text2" name="text3name" placeholder="Depth" class=depth>
217
- <script src="https://cdn.lordicon.com/bhenfmcm.js" ></script>
218
- <lord-icon
219
- onclick="addmctnameicon()"
220
- src="https://cdn.lordicon.com/mecwbjnp.json"
221
- trigger="hover"
222
- id="addmctnameid"
223
- colors="primary:black,secondary:black">
224
- </lord-icon>
225
-
226
- </div>
227
-
228
-
229
- </div>
230
-
231
- <button id="doneebackground" onclick="getSecondData()" > See Summary
232
- <!-- <script src="https://cdn.lordicon.com/bhenfmcm.js"></script>
233
- <lord-icon
234
- src="https://cdn.lordicon.com/egiwmiit.json"
235
- trigger="hover"
236
- colors="primary:black"
237
- onclick="getSecondData()"
238
- id="donebutton" >
239
- </lord-icon> -->
240
- </button>
241
-
242
- <!-- </form> -->
243
-
244
- <div hidden id ="duplicaterhidden" class="duplicaterclasshidden">
245
- <select name="measurementscripts" class="measurementselections" id="measurementselectionsid" oninput="get3rddropdown()">
246
- <option value="" disabled selected hidden>Select</option>
247
- <option value="ground beams" >Ground Beams </option>
248
- <option value="pile caps"> Pile Caps</option>
249
- </select>
250
-
251
- <select name="select" class="selections" id="selectionsid" oninput=get3rddropdown()>
252
-
253
- </select>
254
- <select name="measureitem" class="measureitems" id="measureitemsid">
255
- <!-- <option value="" disabled selected hidden>Area</option> -->
256
- <!-- <option value="area" >Area </option>
257
- <option value="perimeter"> Perimeter</option>
258
- <option value="length" disabled> Length</option>
259
- <option value="count" disabled> Count</option> -->
260
- </select>
261
-
262
- <br>
263
- <div id="repeatforloophidden" class="repeatforloopclasshidden" name="repeatforloopnamehidden " > <!-- onchange="getmctName()"> -->
264
-
265
-
266
- <input type="text" id="text0" name="text1name" placeholder="GB-1" class=gb>
267
- <input type="text" id="text1" name="text2name" placeholder="A" class=a>
268
- <input type="text" id="text2" name="text3name" placeholder="Depth" class=depth>
269
- <script src="https://cdn.lordicon.com/bhenfmcm.js" ></script>
270
- <lord-icon
271
- onclick="addmctnameicon()"
272
- src="https://cdn.lordicon.com/mecwbjnp.json"
273
- trigger="hover"
274
- id="addmctnameid"
275
- colors="primary:black,secondary:black">
276
- </lord-icon>
277
-
278
- </div>
279
-
280
-
281
- </div>
282
-
283
-
284
-
285
- </body>
286
-
287
- </html>
288
- <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
289
- <script >
290
- ////////////////////////////////////////////////////////////////////////////////
291
- /* link to dropbox to view pdfs */
292
- ////////////////////////////////////////////////////////////////////////////////
293
- document.getElementById('secondpage').addEventListener('click',function(){
294
- document.getElementById('textsecondpage').removeAttribute('hidden');
295
- document.getElementById('textfirstpage').setAttribute('hidden',true)
296
-
297
- });
298
- document.getElementById('firstpage').addEventListener('click',function(){
299
- document.getElementById('textfirstpage').removeAttribute('hidden');
300
- document.getElementById('textsecondpage').setAttribute('hidden',true)
301
-
302
- });
303
- document.getElementById('measureADRbutton').addEventListener('click',function(){
304
- if (!document.getElementsByClassName('selectionsProj')[0].value)
305
- document.getElementsByClassName('selectionsProj')[0].style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
306
- if (!document.getElementsByClassName('selectionsProjp')[0].value)
307
- document.getElementsByClassName('selectionsProjp')[0].style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
308
- if (!document.getElementsByClassName('selectionsProjs')[0].value)
309
- document.getElementsByClassName('selectionsProjs')[0].style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
310
- // if (!document.getElementById('measureselectid').value)
311
- // document.getElementById('measureselectid').style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
312
-
313
- // document.getElementById("loading").hidden = false;
314
- var rightside=document.getElementById('rightside');
315
- var rightchidren= rightside.children
316
- for (let ch=0;ch<rightchidren.length; ch++)
317
- {
318
- if (rightchidren[ch].id == 'imgcanvas')
319
- {
320
- rightside.removeChild(rightchidren[ch])
321
- document.getElementById('underimgbuttons').innerHTML=''
322
- clearInterval()
323
- clearTimeout()
324
-
325
- }
326
-
327
- }
328
-
329
-
330
- });
331
-
332
-
333
-
334
-
335
- ////////////////////////////////////////////////////////////////////////////////
336
-
337
- var listoftitles=[];
338
- var listofids=[];
339
- // let interval0= setInterval( function() {
340
- // const delay = ms => new Promise(res => setTimeout(res, ms));
341
- function retrieveLinks(){
342
- var linkscontent= document.getElementsByClassName('dropbtnLinks-content')[0]
343
-
344
- $.get( '/getdrivelinks/'+'0').then (function(data){
345
- for (let iter=0 ; iter <data[0].length ; iter++)
346
- {
347
-
348
- var optn = document.createElement("a")
349
- console.log(data[1][iter])
350
- optn.href= 'https://docs.google.com/spreadsheets/d/'+data[1][iter]
351
- optn.target="_blank"
352
-
353
- optn.textContent=data[0][iter]
354
-
355
- if (listoftitles.includes(data[0][iter] )){
356
- console.log('mwgod')
357
- }
358
- else{
359
- linkscontent.append(optn)
360
- listoftitles.push(data[0][iter])
361
- }
362
- }
363
- });
364
- }
365
- // retrieveLinks()
366
- // }, 500)
367
- ////////////////////////////////////////////////////////////////////////////////
368
- var dupliatei = 0; // i
369
- var clonedDivId=0;
370
- var original = document.getElementById('duplicaterhidden');
371
- var addciconval=0; //div duplicate
372
- var jj=0;
373
- const vals = [];
374
- function duplicate(mylist) {
375
- addciconval+=1;
376
- jj=0;
377
- var clone = original.cloneNode(true); // "deep" clone
378
-
379
- // or clone.id = ""; if the divs don't need an ID
380
- clone.id = 'duplicater' + ++dupliatei;
381
- clonedDivId=clone.id;
382
- // clone.style.marginLeft='3px';
383
-
384
- // console.log(clone.children)
385
- clone.children[4].style.marginLeft='2px';
386
- clone.children[0].style.marginBottom='10px';
387
-
388
- clone.removeAttribute("hidden");
389
- clone.setAttribute('class','duplicaterclass'+dupliatei);
390
-
391
- clone.getElementsByClassName('measurementselections')[0].setAttribute('name', 'measurementscripts'+dupliatei);
392
- clone.getElementsByClassName('measurementselections')[0].setAttribute('class', 'measurementselections'+dupliatei);
393
- // clone.getElementsByClassName('area')[0].setAttribute('name', 'area'+i);
394
- // clone.getElementsByClassName('pattern')[0].setAttribute('name', 'pattern'+i);
395
- // clone.getElementsByClassName('border')[0].setAttribute('name', 'border'+i);
396
- // clone.getElementsByClassName('length')[0].setAttribute('name', 'length'+i);
397
- // clone.getElementsByClassName('match')[0].setAttribute('name', 'match'+i);
398
- clone.getElementsByClassName('measureitems')[0].setAttribute('name', 'measureitem'+dupliatei);
399
- clone.getElementsByClassName('measureitems')[0].setAttribute('class', 'measureitems'+dupliatei);
400
-
401
- // for (let i = 0; i < mylist.length; i++) {
402
- // clone.getElementsByClassName('gb')[0].setAttribute('name', 'gb'+dupliatei);
403
- // clone.getElementsByClassName('a')[0].setAttribute('name', 'a'+dupliatei);
404
- // clone.getElementsByClassName('depth')[0].setAttribute('name', 'depth'+dupliatei);
405
- // }
406
-
407
- clone.getElementsByClassName('selections')[0].setAttribute('name', 'select'+dupliatei);
408
- clone.getElementsByClassName('selections')[0].setAttribute('class', 'selections'+dupliatei);
409
-
410
- clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('id', 'repeatforloop'+addciconval+'0');
411
- clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('name', 'repeatforloopname'+addciconval+'0');
412
- clone.getElementsByClassName('repeatforloopclasshidden')[0].setAttribute('class', 'repeatforloopclass'+addciconval+'0');
413
-
414
- original.parentNode.appendChild(clone).insertBefore(document.getElementById('doneebackground'),null);
415
- console.log( original.parentNode)
416
-
417
-
418
- }
419
- //accordion funv
420
- var acc = document.getElementsByClassName("dropbtn")[0];
421
- var i;
422
-
423
- // for (i = 0; i < acc.length; i++) {
424
- acc.addEventListener("click", function() {
425
- /* Toggle between adding and removing the "active" class,
426
- to highlight the button that controls the panel */
427
- this.classList.toggle("active");
428
-
429
- /* Toggle between hiding and showing the active panel */
430
- var panel = this.nextElementSibling;
431
- if (panel.style.display === "block") {
432
- panel.style.display = "none";
433
-
434
- } else {
435
- panel.style.display = "block";
436
- acc.style.backgroundColor=(0, 153, 255);
437
- }
438
- });
439
-
440
-
441
- var acc1 = document.getElementsByClassName("dropbtnLinks")[0];
442
-
443
-
444
- // for (i = 0; i < acc.length; i++) {
445
- acc1.addEventListener("click", function() {
446
- /* Toggle between adding and removing the "active" class,
447
- to highlight the button that controls the panel */
448
- this.classList.toggle("active");
449
-
450
- /* Toggle between hiding and showing the active panel */
451
- var panel1 = document.getElementsByClassName('dropbtnLinks-content')[0]
452
- if (panel1.style.display === "block") {
453
- panel1.style.display = "none";
454
-
455
- } else {
456
- panel1.style.display = "block";
457
- acc1.style.backgroundColor=(0, 153, 255);
458
- }
459
- });
460
- // }
461
-
462
- var areainpixels=0;
463
- var prminpixels=0;
464
-
465
- ///////////////
466
- prjname1=['2340 United Living Low Rise Building','2341 Bouygues-Cotswold','2342 GF Tomlinson - Hardingstone Primary School']
467
- prjname1parts=['Block O Pumphouse','Hawthorn','Ling','Red Oak']
468
- prjname2parts=['Block B','Block G']
469
- prjname1sec1=['1.0 Substructure','5.1 Sanitary','8.2 Roads, Paths, Pavings','8.4 Fencing, Railing, Walls','8.5 External Fixtures','8.6 External Drainage','8.7 External Services','8.8 Minor Buildings']
470
- prjname1sec2=['1.0 Substructure','2.1 Frames','2.3 Roof','2.4 Stairs','2.5 External Walls','2.6 External Openings','2.7 Internal Walls','2.8 Internal Openings','3.1 Wall Finishes','3.2 Floor Finishes','3.3 Ceiling Finishes','4.0 Fittings, Furnishings and Equipments','7.0 Works to exisitng buildings','8.1 Site Preparation Works','8.2 Roads, Paths, Pavings','8.3 Soft Landscaping','8.5 External Fixtures','8.6 External Drainage','8.7 External Services','8.8 Minor Buildings']
471
- prjname1sec3=['1.0 Substructure','2.3 Roof','2.4 Stairs','2.5 External Walls','2.6 External Openings','2.7 Internal Walls','3.1 Wall Finishes','3.2 Floor Finishes','3.3 Ceiling Finishes', '4.0 Fittings, Furnishings and Equipments','7.0 Works to existing buildings','8.1 Site Preparation Works','8.2 Roads, Paths, Pavings','8.3 Soft Landscaping','8.5 External Fixtures','8.6 External Drainage']
472
- prjname1sec4=['1.0 Substructure','2.3 Roof','2.4 Stairs','2.5 External Walls','2.6 External Openings','2.7 Internal Walls','3.1 Wall Finishes','3.2 Floor Finishes','3.3 Ceiling Finishes', '4.0 Fittings, Furnishings and Equipments','7.0 Works to existing buildings','8.1 Site Preparation Works','8.2 Roads, Paths, Pavings','8.3 Soft Landscaping','8.5 External Fixtures','8.6 External Drainage']
473
- prjname2parts=['Block B','Block G']
474
- prjname2sec=['3.3 Ceiling Finishes']
475
- prjname3parts=['Community Center building','External Works','Primary School']
476
- prjname3sec1=['1.0 Substructure','2.3 Roof','3.1 Wall Finishes','3.2 Floor Finishes','3.3 Ceiling Finishes','4.0 Fittings, Furnishings and Equipments','5.1 Sanitary']
477
- prjname3sec2=['8.1 Site Preparation Works','8.4 Fencing, Railing, Walls','8.5 External Fixtures', ' 8.6 External Drainage']
478
- prjname3sec3=['1.0 Substructure','2.3 Roof','2.4 Stairs','3.2 Floor Finishes','3.3 Ceiling Finishes','4.0 Fittings, Furnishings and Equipments','5.1 Sanitary']
479
-
480
-
481
- var proj = document.getElementsByClassName("selectionsProj")[0];
482
- var proj1 = document.getElementsByClassName("selectionsProjp")[0];
483
- var projsec = document.getElementsByClassName("selectionsProjs")[0];
484
-
485
- proj.addEventListener('input',function(){
486
- proj.style.boxShadow=( '2px 2px 2px gray')
487
- proj1.innerHTML='';
488
- projsec.innerHTML='';
489
- var optn = document.createElement("OPTION");
490
- optn.text= 'Project Part';
491
- optn.value= "";
492
- optn.hidden=true;
493
- proj1.add(optn);
494
- var opt = document.createElement("OPTION");
495
- opt.text= 'Section';
496
- opt.value= "";
497
- opt.hidden=true;
498
- projsec.add(opt);
499
- if (proj.value==prjname1[0]){
500
- for (let p=0 ; p<prjname1parts.length;p++)
501
- {
502
- var optn1 = document.createElement("OPTION");
503
- optn1.text= prjname1parts[p];
504
- optn1.value= prjname1parts[p];
505
- optn1.id= prjname1parts[p]+p;
506
- proj1.add(optn1);
507
-
508
- }
509
- }
510
- if (proj.value==prjname1[1]){
511
- for (let p=0 ; p<prjname2parts.length;p++)
512
- {
513
- var optn1 = document.createElement("OPTION");
514
- optn1.text= prjname2parts[p];
515
- optn1.value= prjname2parts[p];
516
- optn1.id= prjname2parts[p]+p;
517
- proj1.add(optn1);
518
-
519
- }
520
- }
521
- if (proj.value==prjname1[2]){
522
- for (let p=0 ; p<prjname3parts.length;p++)
523
- {
524
- var optn1 = document.createElement("OPTION");
525
- optn1.text= prjname3parts[p];
526
- optn1.value= prjname3parts[p];
527
- optn1.id= prjname3parts[p]+p;
528
- proj1.add(optn1);
529
-
530
- }
531
- }
532
- })
533
- proj1.addEventListener('input',function(){
534
- proj1.style.boxShadow=( '2px 2px 2px gray')
535
- projsec.innerHTML='';
536
- var optn = document.createElement("OPTION");
537
- optn.text= 'Section';
538
- optn.value= "";
539
- optn.hidden=true;
540
- projsec.add(optn);
541
- console.log(proj1.value,prjname1parts[0])
542
-
543
- if (proj1.value==prjname1parts[0].toString())
544
- {
545
- for (let s=0;s<prjname1sec1.length;s++){
546
- var optn2 = document.createElement("OPTION");
547
- optn2.text= prjname1sec1[s];
548
- optn2.value= prjname1sec1[s];
549
- optn2.id= prjname1sec1[s]+s;
550
- projsec.add(optn2);
551
- }
552
- }
553
- else if (proj1.value==prjname1parts[1])
554
- {
555
- for (let s=0;s<prjname1sec2.length;s++){
556
- var optn2 = document.createElement("OPTION");
557
- optn2.text= prjname1sec2[s];
558
- optn2.value= prjname1sec2[s];
559
- optn2.id= prjname1sec2[s]+s;
560
- projsec.add(optn2);
561
- }
562
- }
563
- else if (proj1.value==prjname1parts[2])
564
- {
565
- for (let s=0;s<prjname1sec3.length;s++){
566
- var optn2 = document.createElement("OPTION");
567
- optn2.text= prjname1sec3[s];
568
- optn2.value= prjname1sec3[s];
569
- optn2.id= prjname1sec3[s]+s;
570
- projsec.add(optn2);
571
- }
572
- }
573
- else if (proj1.value==prjname1parts[3])
574
- {
575
- for (let s=0;s<prjname1sec4.length;s++){
576
- var optn2 = document.createElement("OPTION");
577
- optn2.text= prjname1sec4[s];
578
- optn2.value= prjname1sec4[s];
579
- optn2.id= prjname1sec4[s]+s;
580
- projsec.add(optn2);
581
- }
582
- }
583
- else if (proj1.value==prjname2parts[0] || proj1.value==prjname2parts[1])
584
- {
585
- for (let s=0;s<prjname2sec.length;s++){
586
- var optn2 = document.createElement("OPTION");
587
- optn2.text= prjname2sec[s];
588
- optn2.value= prjname2sec[s];
589
- optn2.id= prjname2sec[s]+s;
590
- projsec.add(optn2);
591
- }
592
- }
593
- else if (proj1.value==prjname3parts[0])
594
- {
595
- for (let s=0;s<prjname3sec1.length;s++){
596
- var optn2 = document.createElement("OPTION");
597
- optn2.text= prjname3sec1[s];
598
- optn2.value= prjname3sec1[s];
599
- optn2.id= prjname3sec1[s]+s;
600
- projsec.add(optn2);
601
- }
602
- }
603
- else if (proj1.value==prjname3parts[1])
604
- {
605
- for (let s=0;s<prjname3sec2.length;s++){
606
- var optn2 = document.createElement("OPTION");
607
- optn2.text= prjname3sec2[s];
608
- optn2.value= prjname3sec2[s];
609
- optn2.id= prjname3sec2[s]+s;
610
- projsec.add(optn2);
611
- }
612
- }
613
- else if (proj1.value==prjname3parts[2])
614
- {
615
- for (let s=0;s<prjname3sec3.length;s++){
616
- var optn2 = document.createElement("OPTION");
617
- optn2.text= prjname3sec3[s];
618
- optn2.value= prjname3sec3[s];
619
- optn2.id= prjname3sec3[s]+s;
620
- projsec.add(optn2);
621
- }
622
- }
623
-
624
- // for (let p=0 ; p<=prjname1parts.length;p++)
625
- // {
626
- // var optn1 = document.createElement("OPTION");
627
- // optn1.text= prjname1parts[p];
628
- // optn1.value= prjname1parts[p];
629
- // optn1.id= prjname1parts[p]+p;
630
- // proj1.add(optn1);
631
- // }
632
-
633
- })
634
-
635
- projsec.addEventListener('input',function(){
636
- projsec.style.boxShadow=( '2px 2px 2px gray')
637
- })
638
-
639
-
640
-
641
- function getproj(){
642
-
643
- // var audio = new Audio('templates/x.mp3');
644
-
645
- // audio.loop = false;
646
- // audio.play();
647
- // console.log('clicked')
648
- var proj = document.getElementsByClassName("selectionsProj")[0];
649
- var projectVal=proj.value.toString() //selected project
650
-
651
- var inputs = document.getElementsByTagName("select")[1]; //second dropdown(project part)
652
- var p=document.getElementById("selectionsProjpid") //project part
653
-
654
- var sections = document.getElementsByClassName("selectionsProjs")[0];
655
- // remove old dropdown options
656
- // var i, L = inputs.options.length - 1;
657
- // for(i = L; i >= 0; i--) {
658
- // inputs.remove(i);
659
- // }
660
-
661
- //send project name to python flask
662
- // if(sections.value.startsWith('1.0'))
663
- console.log(sections.value)
664
- $.get( '/getmethod/'+sections.value).then (function(data){
665
-
666
-
667
- console.log('daaaaaaaa ', data);
668
-
669
-
670
- var projectsfromname=data; // [0] name , [1] parts (array)
671
-
672
- var projname = document.getElementsByClassName("selectionsProj")[0];
673
- var projpart = document.getElementsByClassName("selectionsProjp")[0];
674
- var projsec = document.getElementsByClassName("selectionsProjs")[0];
675
-
676
-
677
- // var drp = document.getElementById("selectionsProjpid");
678
- //add a hidden option (not to be selected)
679
-
680
-
681
- var meas = document.getElementById("measureCheckbox") ;
682
- var relv = document.getElementById("relvdiv") ;
683
- const measids=[];
684
- const relvids=[];
685
- const measoptns=[];
686
- //add dropdown options== array
687
- // meas.innerHTML='';
688
- // relv.innerHTML='';
689
- var measSelect = document.getElementById("measureselectid");
690
-
691
- var relvSelect = document.getElementById("relvselectid");
692
- console.log(relvSelect)
693
-
694
- measSelect.removeAttribute("hidden");
695
- relvSelect.removeAttribute("hidden");
696
- measSelect.innerHTML='';
697
- var optn2 = document.createElement("OPTION");
698
- optn2.text= 'Select project to measure';
699
- optn2.value=''
700
- optn2.hidden=true;
701
- optn2.id='hidden';
702
-
703
- measSelect.add(optn2);
704
- document.getElementById("hidden").required = true;
705
- // console.log(measSelect)
706
-
707
- relvSelect.innerHTML='';
708
- for (i = 0; i < projectsfromname.length; i++) {
709
-
710
- //relevant documents
711
- var optn1 = document.createElement("OPTION");
712
- optn1.text= projectsfromname[i];
713
- optn1.value= projectsfromname[i] ;
714
- optn1.id=data[0] + i
715
- relvSelect.add(optn1);
716
-
717
- //to measure documents
718
- var optn2 = document.createElement("OPTION");
719
-
720
- optn2.text= projectsfromname[i];
721
- optn2.value= projectsfromname[i] ;
722
- optn2.id=data[0] ;
723
- measSelect.add(optn2);
724
- measoptns.push(optn2);
725
-
726
- }
727
-
728
-
729
- // console.log(measChecklbl);
730
- relvids.push(relvSelect) ;
731
- measids.push(measSelect);
732
- //to open pdf in a new tab (relevant documents)
733
- relvids.forEach(function(elem){
734
- elem.addEventListener("change", function() {
735
-
736
- console.log(projname.value, projpart.value,projsec.value, elem.value)
737
- var pdfpatharr=[]
738
- pdfpatharr.push(projname.value, projpart.value,projsec.value, elem.value)
739
- $.get( '/getdropboxurl/'+JSON.stringify(pdfpatharr)).then (function(data){
740
- console.log(data)
741
- window.open( data)
742
- });
743
- // window.open( 'https://arxiv.org/pdf/2102.13468v1.pdf')
744
- });
745
- });
746
-
747
-
748
- document.getElementById('measureADRbutton').onclick= function()
749
- {
750
- if (!measSelect.value)
751
- measSelect.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
752
-
753
- }
754
- measids.forEach(function(elem) {
755
- elem.addEventListener("change", function() {
756
-
757
- console.log(elem.value);
758
- measSelect.style.boxShadow='none';
759
- pixelArr=[elem.value,projsec.value]
760
- $.get( '/pixelimg/'+JSON.stringify(pixelArr)) .then( function(data) {
761
- alert('Measure the white square drawn in the pdf on Bluebeam, then enter its area and perimeter in ur desired scale.');
762
-
763
- document.getElementById('measureADRbutton').onclick= function()
764
- {
765
- if (!areaRatio.value)
766
- areaRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
767
- if (!prmRatio.value)
768
- prmRatio.style.boxShadow='0 0 8px 2px rgb(255, 0, 0)';
769
-
770
- }
771
-
772
- var scalelbl= document.createElement("label");
773
- scalelbl.innerText='Scale Document';
774
- scalelbl.id='measureLabel';
775
- var br1= document.createElement("br");
776
- var areaRatiolbl= document.createElement("label");
777
- areaRatiolbl.innerText='Area:'
778
- areaRatiolbl.id='radiolbl';
779
-
780
-
781
- var areaRatio= document.createElement("input");
782
- areaRatio.type='number';
783
- areaRatio.id='lvlinput';
784
- areaRatio.name='areaRatio';
785
- areaRatio.style.marginLeft='78px';
786
- areaRatio.style.textAlign='right';
787
- areaRatio.step=".0000001";
788
- areaRatio.addEventListener('change',function(){
789
- areaRatio.value=(Number(areaRatio.value)).toFixed(7)
790
- areaRatio.style.boxShadow='none';
791
- })
792
- areaRatio.required=true;
793
-
794
- var br2= document.createElement("br");
795
- var br3= document.createElement("br");
796
- var prmRatiolbl= document.createElement("label");
797
- prmRatiolbl.innerText='Perimeter:'
798
- prmRatiolbl.id='radiolbl';
799
-
800
- var prmRatio= document.createElement("input");
801
- prmRatio.type='number';
802
- prmRatio.id='lvlinput';
803
- prmRatio.name='prmRatio';
804
- prmRatio.style.textAlign='right';
805
- // prmRatio.onchange=setNumberDecimal();
806
- prmRatio.style.marginLeft='49px';
807
- prmRatio.step=".0000001";
808
- prmRatio.addEventListener('change',function(){
809
- prmRatio.value=(Number(prmRatio.value)).toFixed(7)
810
- prmRatio.style.boxShadow='none';
811
- })
812
- prmRatio.required=true;
813
-
814
- var ratiosdiv= document.getElementById("ratios");
815
- ratiosdiv.innerHTML='';
816
- ratiosdiv.append(scalelbl);
817
- ratiosdiv.append(br1);
818
- ratiosdiv.append(areaRatiolbl);
819
- ratiosdiv.append(areaRatio);
820
- ratiosdiv.append(br2);
821
- ratiosdiv.append(br3);
822
-
823
- ratiosdiv.append(prmRatiolbl);
824
- ratiosdiv.append(prmRatio);
825
-
826
- areainpixels=data[0];
827
- prminpixels=data[1];
828
- console.log(data)
829
-
830
-
831
-
832
- });
833
- // console.log(elem)
834
- // });
835
-
836
- });
837
-
838
- });
839
-
840
- });
841
- }
842
-
843
- var spreadsheetId='';
844
- var spreadsheetURL='';
845
- var colorsUsed='';
846
- var list1='';
847
- var SimilarAreaDictionary='';
848
- var tomeasureproj=''
849
- var pdfpath=[];
850
- var interval = null;
851
- function getData(form) {
852
- document.getElementById("loading").hidden = false;
853
-
854
- document.getElementById('measureADRbutton').setAttribute('disabled',true);
855
- document.getElementById('measureADRbutton').style.cursor='not-allowed';
856
- document.getElementById('measureADRbutton').style.boxShadow = 'none';
857
- document.getElementById('measureADRbutton').style.color = 'white';
858
- document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)";
859
-
860
- var formData = new FormData(form);
861
- clearInterval(interval)
862
-
863
-
864
- colorsarr=[];
865
- val=0;
866
- answers=[];
867
- var ratio1=0;
868
- var ratio2=0;
869
- tomeasureproj='';
870
- pdfpath=[];
871
- formvalues=Object.fromEntries(formData);
872
- console.log(formvalues);
873
- // iterate through entries...
874
- for (var pair of formData.entries()) {
875
-
876
- if (pair[0].startsWith('color')){
877
- colorsarr.push(pair[1].substring(1));
878
- }
879
- }
880
- tomeasureproj=formvalues['measureselectname']; //proj name
881
- ratio1=formvalues['areaRatio']/areainpixels;
882
-
883
- ratio2=formvalues['prmRatio']/prminpixels;
884
- pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
885
-
886
- if (colorsarr.length>0)
887
- answers.push(tomeasureproj, 220,colorsarr , ratio1, ratio2 ,pdfpath);
888
- else
889
- answers.push(tomeasureproj, 0,colorsarr , ratio1, ratio2 ,pdfpath);
890
- if (ratio1 >0)
891
- $.get('/projecttomeasure/'+ JSON.stringify(answers)).then( function(data) {
892
- var mp3_url = 'https://media.geeksforgeeks.org/wp-content/uploads/20190531135120/beep.mp3';
893
- (new Audio(mp3_url)).play()
894
- retrieveLinks()
895
- var backimg=document.getElementById('backgroundimg');
896
- var rightside=document.getElementById('rightside');
897
- document.getElementById("loading").hidden = true;
898
- // rightside.removeChild(0);
899
- // clearInterval()
900
- document.getElementById('measureADRbutton').removeAttribute('disabled');
901
- document.getElementById('measureADRbutton').style.cursor='pointer';
902
- document.getElementById('measureADRbutton').style.color = 'white';
903
- document.getElementById('measureADRbutton').style.backgroundColor="#16c72e";
904
- document.getElementById('measureADRbutton').addEventListener('mouseover',function(){
905
- document.getElementById('measureADRbutton').style.color='black';
906
- document.getElementById('measureADRbutton').style.boxShadow=' 0 0 8px 2px #16c72e';
907
- })
908
-
909
-
910
- document.getElementById('measureADRbutton').addEventListener('mouseout',function(){
911
- document.getElementById('measureADRbutton').style.color='white';
912
- document.getElementById('measureADRbutton').style.boxShadow='none';
913
- });
914
-
915
- SimilarAreaDictionary=data[1]
916
- spreadsheetURL= data[2];
917
- spreadsheetId= data[3];
918
- colorsUsed = data[4];
919
- list1 = data[5];
920
-
921
- var imgcanvas= document.createElement("img");
922
-
923
- imgcanvas.src= 'data:image/gif;base64,' +data[0];
924
- // imgcanvas.width=700;
925
- imgcanvas.height=600;
926
- console.log(imgcanvas.width)
927
- imgcanvas.id='imgcanvas';
928
- imgcanvas.alt="Larry";
929
- imgcanvas.style.zIndex=999;
930
-
931
- var underimg=document.getElementById('underimgbuttons');
932
-
933
-
934
- backimg.style.backgroundColor="transparent";
935
- backimg.style.opacity="1";
936
-
937
- // backimg.append(imgcanvas);
938
- var legendbutton= document.createElement("button");
939
- legendbutton.id='measureADRbutton2';
940
- legendbutton.innerText='Legend and Data created';
941
- legendbutton.style.backgroundColor='rgb(5, 43, 235)';
942
- legendbutton.addEventListener('mouseover',function(){
943
- legendbutton.style.boxShadow='0 0 8px 2px rgb(5, 43, 235)';
944
- })
945
- legendbutton.addEventListener('mouseout',function(){
946
- legendbutton.style.boxShadow='none';
947
- })
948
-
949
-
950
- // legendbutton.margin.horizontal='0';
951
- legendbutton.addEventListener('click',function(){
952
- window.open( data[2].toString());
953
-
954
- })
955
-
956
- // legendbutton.style.display='flex';
957
-
958
- var imgbutton= document.createElement("button");
959
- imgbutton.id='measureADRbutton2';
960
- imgbutton.innerText='Click to view as PDF';
961
- imgbutton.style.backgroundColor='rgb(255,0,255)';
962
-
963
-
964
- imgbutton.addEventListener('mouseover',function(){
965
- imgbutton.style.boxShadow='0 0 8px 2px rgb(255,0,255)';
966
- })
967
- imgbutton.addEventListener('mouseout',function(){
968
- imgbutton.style.boxShadow='none';
969
- })
970
-
971
- imgbutton.addEventListener('click',function(){
972
- console.log('clickedsdd')
973
- window.open( data[6].toString());
974
- // $.get('/uploadtodropboxPath/'+ 'pp').then( function(data) {
975
-
976
- // //
977
- // // console.log(data)
978
- // });
979
- })
980
-
981
- underimg.append(legendbutton);
982
- underimg.append(imgbutton);
983
- underimg.style.display='flex';
984
- rightside.append(imgcanvas);
985
- rightside.insertBefore(imgcanvas,underimg);
986
-
987
- let delrows2 = {
988
- content : {},
989
- id : {},
990
- subject :{}
991
- };
992
-
993
- var delrows1='';
994
- var flag=0;
995
- pdfpath=[];
996
- pdfpath.push(formvalues['selectproj'],formvalues['selectprojp'] ,formvalues['selectprojs'])
997
- var rightsideids=[];
998
- interval= setInterval( function() {
999
-
1000
- const delay = ms => new Promise(res => setTimeout(res, ms));
1001
- delay(2000)
1002
- $.getJSON('/_submission', {
1003
-
1004
- // dict: JSON.stringify(SimilarAreaDictionary),
1005
- dict1: JSON.stringify(list1),
1006
- spreadsheetId:spreadsheetId,
1007
- pdfpathpath:JSON.stringify(pdfpath),
1008
- path:Object.fromEntries(formData)['measureselectname'],
1009
-
1010
- },function(data1){
1011
-
1012
- if(data1.length >0){
1013
- delrows1=data1[0];
1014
- console.log(data1, delrows1,delrows2)
1015
- console.log(typeof delrows1)
1016
- console.log(typeof delrows2)
1017
- if (JSON.stringify(delrows1)=== JSON.stringify(delrows2))
1018
- {
1019
- console.log('same')
1020
- }
1021
- else{
1022
- // if (data1[0]==1){
1023
- // return data1[0];
1024
- flag=1
1025
- if (confirm("Changes have been made in the markups. Would you like to save and view them in the legend?")) {
1026
-
1027
-
1028
- $.getJSON('/deletemarkupsroute', {
1029
- dict: JSON.stringify(SimilarAreaDictionary),
1030
- deletedrows: JSON.stringify(delrows1),
1031
- path:Object.fromEntries(formData)['measureselectname'],
1032
- spreadsheetId:spreadsheetId,
1033
- areaPermArr: JSON.stringify(data[7]),
1034
-
1035
-
1036
-
1037
- }, function(data2){
1038
- console.log(data2)
1039
- })
1040
- }
1041
- }
1042
- }
1043
- });
1044
-
1045
- delay(6000);
1046
- $.getJSON('/_submission', {
1047
- // dict: JSON.stringify(SimilarAreaDictionary),
1048
- dict1: JSON.stringify(list1),
1049
- spreadsheetId:spreadsheetId,
1050
- pdfpathpath:JSON.stringify(pdfpath),
1051
- path:Object.fromEntries(formData)['measureselectname'],
1052
- },function(data11){
1053
- delrows2=data11[0];
1054
-
1055
- })
1056
- },9000)
1057
-
1058
-
1059
-
1060
- /////////////////////////
1061
- })
1062
- }
1063
- document.getElementById("myForm").addEventListener("submit", function (e) {
1064
- e.preventDefault();
1065
- getData(e.target);
1066
- });
1067
-
1068
- // document.getElementById("myFormsecond").addEventListener("submit", function (e) {
1069
- // e.preventDefault();
1070
- // getSecondData(e.target);
1071
- // });
1072
-
1073
- ////////////////////////////////////////////
1074
- var measitemVal=''
1075
-
1076
- function get3rddropdown(){
1077
-
1078
-
1079
-
1080
- var divduplicater= document.getElementsByClassName('duplicaterclass')[0].children;
1081
- console.log(divduplicater)
1082
- var inputs =divduplicater[0];// document.getElementsByClassName("measurementselections")[0]; //groundbeams
1083
- console.log(inputs.value);
1084
-
1085
- var measitem = divduplicater[2];//document.getElementsByClassName("measureitems")[0]; //area
1086
- measitemVal=measitem.value.toString() //selected project
1087
- console.log(measitemVal);
1088
-
1089
- var selections = divduplicater[1]; //document.getElementsByClassName("selections")[0]; //second dropdown(project part)
1090
-
1091
-
1092
- if (addciconval>0){
1093
-
1094
- for (let i =1 ; i <=addciconval ; i++){
1095
- var inputs1 = document.getElementsByClassName("measurementselections"+i)[0]; //groundbeams
1096
- console.log(inputs1.value);
1097
-
1098
- // 17:59 21/06/202317:59 21/06/2023//area
1099
-
1100
- var measitem1 = document.getElementsByClassName("measureitems"+i)[0]; //groundbeams
1101
- measitemVal1=measitem1.value.toString() //selected project
1102
- console.log(measitemVal1);
1103
-
1104
- var selections1 = document.getElementsByClassName("selections"+i)[0]; //second dropdown(project part)
1105
-
1106
- // remove old dropdown options
1107
-
1108
- ////////////////////////////////////////
1109
- inputs1.addEventListener('click',function(){
1110
- if (inputs1.value=='ground beams'){
1111
-
1112
- selections1.innerHTML=''
1113
- // if (measitemVal=='area'){
1114
-
1115
- var opt0 = document.createElement("OPTION") ;
1116
- opt0.text= 'Ground Beams:m2';
1117
- opt0.value= 'Ground Beams:m2';
1118
- opt0.id='gbA' ;
1119
- selections1.add(opt0);
1120
- // }
1121
- // else if (measitemVal=='perimeter') {
1122
- var opt1 = document.createElement("OPTION") ;
1123
- opt1.text= 'Ground Beams:m';
1124
- opt1.value= 'Ground Beams:m';
1125
- opt1.id='gbP';
1126
- selections1.add(opt1);
1127
-
1128
-
1129
- }
1130
- if (selections1.value=='Ground Beams:m'){
1131
- measitem1.innerHTML='';
1132
- var opt2= document.createElement("option");
1133
- opt2.text= 'Length';
1134
- opt2.value= 'Length';
1135
- opt2.id= 'Length';
1136
- measitem1.add(opt2);
1137
-
1138
- var opt3= document.createElement("option");
1139
- opt3.text= 'Perimeter';
1140
- opt3.value= 'Perimeter';
1141
- opt3.id= 'Perimeter';
1142
- measitem1.add(opt3);
1143
- }
1144
-
1145
- if (selections1.value=='Ground Beams:m2'){
1146
- measitem1.innerHTML='';
1147
- var opt4= document.createElement("option");
1148
- opt4.text= 'Area';
1149
- opt4.value= 'Area';
1150
- opt4.id= 'Area';
1151
- measitem1.add(opt4);
1152
-
1153
- }
1154
-
1155
- });
1156
- if (selections1.value=='Ground Beams:m'){
1157
- measitem1.innerHTML='';
1158
- var opt2= document.createElement("option");
1159
- opt2.text= 'Length';
1160
- opt2.value= 'Length';
1161
- opt2.id= 'Length';
1162
- measitem1.add(opt2);
1163
-
1164
- var opt3= document.createElement("option");
1165
- opt3.text= 'Perimeter';
1166
- opt3.value= 'Perimeter';
1167
- opt3.id= 'Perimeter';
1168
- measitem1.add(opt3);
1169
- }
1170
-
1171
- if (selections1.value=='Ground Beams:m2'){
1172
- measitem1.innerHTML='';
1173
- var opt4= document.createElement("option");
1174
- opt4.text= 'Area';
1175
- opt4.value= 'Area';
1176
- opt4.id= 'Area';
1177
- measitem1.add(opt4);
1178
-
1179
- }
1180
- inputs1.addEventListener('click',function(){
1181
- if (inputs1.value=='pile caps'){
1182
- selections1.innerHTML='';
1183
- var opt5 = document.createElement("OPTION") ;
1184
- opt5.text= 'Pile Caps:m2';
1185
- opt5.value= 'Pile Caps:m2';
1186
- opt5.id='pcA' ;
1187
- selections1.add(opt5);
1188
-
1189
-
1190
- var opt6 = document.createElement("OPTION") ;
1191
- opt6.text= 'Pile Caps:m';
1192
- opt6.value= 'Pile Caps:m';
1193
- opt6.id='pcP';
1194
- selections1.add(opt6);
1195
-
1196
- }
1197
- if (selections1.value=='Pile Caps:m'){
1198
- measitem1.innerHTML='';
1199
- var opt7= document.createElement("option");
1200
- opt7.text= 'Length';
1201
- opt7.value= 'Length';
1202
- opt7.id= 'Length';
1203
- measitem1.add(opt7);
1204
-
1205
- var opt8= document.createElement("option");
1206
- opt8.text= 'Perimeter';
1207
- opt8.value= 'Perimeter';
1208
- opt8.id= 'Perimeter';
1209
- measitem1.add(opt8);
1210
- }
1211
-
1212
- if (selections1.value=='Pile Caps:m2'){
1213
- measitem1.innerHTML='';
1214
- var opt9= document.createElement("option");
1215
- opt9.text= 'Area';
1216
- opt9.value= 'Area';
1217
- opt9.id= 'Area';
1218
- measitem1.add(opt9);
1219
-
1220
- }
1221
-
1222
- });
1223
- if (selections1.value=='Pile Caps:m'){
1224
- measitem1.innerHTML='';
1225
- var opt7= document.createElement("option");
1226
- opt7.text= 'Length';
1227
- opt7.value= 'Length';
1228
- opt7.id= 'Length';
1229
- measitem1.add(opt7);
1230
-
1231
- var opt8= document.createElement("option");
1232
- opt8.text= 'Perimeter';
1233
- opt8.value= 'Perimeter';
1234
- opt8.id= 'Perimeter';
1235
- measitem1.add(opt8);
1236
- }
1237
-
1238
- if (selections1.value=='Pile Caps:m2'){
1239
- measitem1.innerHTML='';
1240
- var opt9= document.createElement("option");
1241
- opt9.text= 'Area';
1242
- opt9.value= 'Area';
1243
- opt9.id= 'Area';
1244
- measitem1.add(opt9);
1245
-
1246
- }
1247
-
1248
-
1249
- }
1250
- }
1251
- inputs.addEventListener('click',function(){
1252
-
1253
- if (inputs.value=='ground beams'){
1254
- selections.innerHTML='';
1255
- // if (measitemVal=='area'){
1256
-
1257
-
1258
- var optn = document.createElement("OPTION") ;
1259
- optn.text= 'Ground Beams:m2';
1260
- optn.value= 'Ground Beams:m2';
1261
- optn.id='gbA' ;
1262
- selections.add(optn);
1263
- // }
1264
- // else if (measitemVal=='perimeter') {
1265
- var opt = document.createElement("OPTION") ;
1266
- opt.text= 'Ground Beams:m';
1267
- opt.value= 'Ground Beams:m';
1268
- opt.id='gbP';
1269
- selections.add(opt);
1270
-
1271
- }
1272
- if (selections.value=='Ground Beams:m'){
1273
- measitem.innerHTML='';
1274
- var op2= document.createElement("option");
1275
- op2.text= 'Length';
1276
- op2.value= 'Length';
1277
- op2.id= 'Length';
1278
- measitem.add(op2);
1279
-
1280
- var op3= document.createElement("option");
1281
- op3.text= 'Perimeter';
1282
- op3.value= 'Perimeter';
1283
- op3.id= 'Perimeter';
1284
- measitem.add(op3);
1285
- }
1286
-
1287
- if (selections.value=='Ground Beams:m2'){
1288
- measitem.innerHTML='';
1289
- var op4= document.createElement("option");
1290
- op4.text= 'Area';
1291
- op4.value= 'Area';
1292
- op4.id= 'Area';
1293
- measitem.add(op4);
1294
-
1295
- }
1296
-
1297
- });
1298
- if (selections.value=='Ground Beams:m'){
1299
- measitem.innerHTML='';
1300
- var op2= document.createElement("option");
1301
- op2.text= 'Length';
1302
- op2.value= 'Length';
1303
- op2.id= 'Length';
1304
- measitem.add(op2);
1305
-
1306
- var op3= document.createElement("option");
1307
- op3.text= 'Perimeter';
1308
- op3.value= 'Perimeter';
1309
- op3.id= 'Perimeter';
1310
- measitem.add(op3);
1311
- }
1312
-
1313
- if (selections.value=='Ground Beams:m2'){
1314
- measitem.innerHTML='';
1315
- var op4= document.createElement("option");
1316
- op4.text= 'Area';
1317
- op4.value= 'Area';
1318
- op4.id= 'Area';
1319
- measitem.add(op4);
1320
-
1321
- }
1322
- inputs.addEventListener('click',function(){
1323
-
1324
- if (inputs.value=='pile caps'){
1325
- selections.innerHTML='';
1326
- var optn = document.createElement("OPTION") ;
1327
- optn.text= 'Pile Caps:m2';
1328
- optn.value= 'Pile Caps:m2';
1329
- optn.id='pcA' ;
1330
- selections.add(optn);
1331
-
1332
- var opt = document.createElement("OPTION") ;
1333
- opt.text= 'Pile Caps:m';
1334
- opt.value= 'Pile Caps:m';
1335
- opt.id='pcP';
1336
- selections.add(opt);
1337
-
1338
- }
1339
- if (selections.value=='Pile Caps:m'){
1340
- measitem.innerHTML='';
1341
- var op2= document.createElement("option");
1342
- op2.text= 'Length';
1343
- op2.value= 'Length';
1344
- op2.id= 'Length';
1345
- measitem.add(op2);
1346
-
1347
- var op3= document.createElement("option");
1348
- op3.text= 'Perimeter';
1349
- op3.value= 'Perimeter';
1350
- op3.id= 'Perimeter';
1351
- measitem.add(op3);
1352
- }
1353
-
1354
- if (selections.value=='Pile Caps:m2'){
1355
- measitem.innerHTML='';
1356
- var op4= document.createElement("option");
1357
- op4.text= 'Area';
1358
- op4.value= 'Area';
1359
- op4.id= 'Area';
1360
- measitem.add(op4);
1361
-
1362
- }
1363
-
1364
- });
1365
- if (selections.value=='Pile Caps:m'){
1366
- measitem.innerHTML='';
1367
- var op2= document.createElement("option");
1368
- op2.text= 'Length';
1369
- op2.value= 'Length';
1370
- op2.id= 'Length';
1371
- measitem.add(op2);
1372
-
1373
- var op3= document.createElement("option");
1374
- op3.text= 'Perimeter';
1375
- op3.value= 'Perimeter';
1376
- op3.id= 'Perimeter';
1377
- measitem.add(op3);
1378
- }
1379
-
1380
- if (selections.value=='Pile Caps:m2'){
1381
- measitem.innerHTML='';
1382
- var op4= document.createElement("option");
1383
- op4.text= 'Area';
1384
- op4.value= 'Area';
1385
- op4.id= 'Area';
1386
- measitem.add(op4);
1387
-
1388
- }
1389
-
1390
- }
1391
-
1392
-
1393
- var repeatforloopI=0;
1394
-
1395
- function getmctName(){
1396
- var listofnames=[];
1397
- var flag=0;
1398
- arrallvalues=[];
1399
- arrmctNames=[];
1400
- arrFinalMCNames=[];
1401
-
1402
- var allmcnamestext= document.querySelectorAll('input[name="text1name"]');
1403
- allmcnamestext.forEach(function(elem){
1404
- if (elem.value)
1405
- arrallvalues.push(elem.value);
1406
- })
1407
-
1408
- for (ii=0 ; ii<=addciconval; ii++){
1409
-
1410
-
1411
- // arrFinalMCNames=[];
1412
- if (ii==0){
1413
- var divduplicater= document.getElementsByClassName('duplicaterclass')[0].children;
1414
- console.log('divv ',divduplicater); //addicon .children[4]
1415
-
1416
- var selections = divduplicater[1];//document.getElementsByClassName("selections")[0];
1417
- measitemVal=divduplicater[2].value;
1418
- var div=divduplicater[4].children;//document.getElementById('repeatforloop').children
1419
- var divValues=[div[0].value, div[1].value , div[2].value];
1420
- mctname=[selections.value ,divValues , measitemVal ];
1421
- console.log(mctname)
1422
- if(div[0].value && div[1].value && div[2].value)
1423
- {
1424
- flag=1;
1425
- arrmctNames.push( mctname);
1426
- }
1427
- }
1428
- else if (ii>0){
1429
- var divduplicater= document.getElementsByClassName('duplicaterclass'+ii)[0].children;
1430
- console.log('dddd',divduplicater);
1431
- selections = divduplicater[1];//document.getElementsByClassName("selections")[0];
1432
- measitemVal=divduplicater[2].value;
1433
- div=divduplicater[4].children;
1434
- var divValues=[div[0].value, div[1].value , div[2].value];
1435
- mctname=[selections.value ,divValues , measitemVal ];
1436
- console.log(mctname)
1437
- if(div[0].value && div[1].value && div[2].value)
1438
- {
1439
- flag=1;
1440
- arrmctNames.push( mctname);
1441
- }
1442
-
1443
- }
1444
- // console.log('divv ',divduplicater[5+repeatforloopI].children[4]); //addicon .children[4]
1445
-
1446
-
1447
- console.log(arrmctNames)
1448
- // if (repeatforloopI>0){
1449
- if (ii==0 ){
1450
-
1451
- count=0;
1452
- var ii0selections='';
1453
- var cc= (document.getElementsByClassName('repeatforloopclass'+ii.toString()+'0')[0]).parentNode.children;
1454
- console.log('jjj',cc)
1455
- for (let o =0;o <=cc.length;o++)
1456
- {
1457
- if( cc[o] instanceof(HTMLDivElement) )
1458
- count++;
1459
- ii0selections=cc[1].value;
1460
- measitemVal=cc[2].value;
1461
-
1462
- }
1463
- console.log(count);
1464
- for (let i =1 ; i <count ; i++){
1465
- console.log('inloop',ii.toString()+i.toString())
1466
-
1467
- var replicatedDivChildren=document.getElementsByClassName('repeatforloopclass'+ii.toString()+i.toString())[0].children;
1468
-
1469
- var divValues2=[replicatedDivChildren[0].value, replicatedDivChildren[1].value , replicatedDivChildren[2].value];
1470
- mctname1=[ii0selections ,divValues2 , measitemVal];
1471
- if(replicatedDivChildren[0].value && replicatedDivChildren[1].value && replicatedDivChildren[2].value)
1472
- {
1473
- // console.log(mctname1);
1474
- flag=1;
1475
- arrmctNames.push(mctname1);
1476
- }
1477
- }
1478
- // console.log(arrmctNames[0][1]);
1479
- }
1480
- else if (ii>0 && addciconval >0 && jj>0)
1481
- {
1482
- count=0;
1483
- var ii0selections='';
1484
- var cc= (document.getElementsByClassName('repeatforloopclass'+ii.toString()+'0')[0]).parentNode.children;
1485
-
1486
- for (let o =0;o <=cc.length;o++)
1487
- {
1488
- if( cc[o] instanceof(HTMLDivElement) )
1489
- { count++;
1490
- console.log('divvvv',cc[o])}
1491
- // var selectionsval= cc[o][1];
1492
- // console.log(cc[o].children[1]);
1493
- ii0selections=cc[1].value;
1494
- measitemVal=cc[2].value;
1495
- // count++;
1496
- // ii0selections=cc[3].value;
1497
- }
1498
- console.log(count);
1499
-
1500
- for (let i =1 ; i < count ; i++){
1501
- console.log('aaaanloop',addciconval.toString()+i.toString())
1502
-
1503
- var replicatedDivChildren=document.getElementsByClassName('repeatforloopclass'+ii.toString()+i.toString())[0].children;
1504
- // console.log(document.getElementsByClassName('repeatforloopclass'+ii.toString()+i.toString())[0].parentElement)
1505
-
1506
- var divValues2=[replicatedDivChildren[0].value, replicatedDivChildren[1].value , replicatedDivChildren[2].value];
1507
- mctname1=[ii0selections ,divValues2 , measitemVal];
1508
- if(replicatedDivChildren[0].value && replicatedDivChildren[1].value && replicatedDivChildren[2].value)
1509
- {
1510
- // if (!(arrmctNames.includes(mctname1))){
1511
- arrmctNames.push(mctname1);
1512
- flag=1;
1513
- // console.log(arrmctNames)
1514
- // }
1515
- }
1516
- }
1517
-
1518
- }
1519
-
1520
- // }
1521
-
1522
- // else
1523
- // {
1524
- //first entry only
1525
- arrFinalMCNames= arrmctNames.slice();
1526
- // }
1527
- console.log(arrmctNames)
1528
-
1529
- if(arrmctNames.length >1){
1530
- var name=[];
1531
- allnames=[];
1532
- arrFinalMCNames = arrmctNames.slice();
1533
- console.log('finalnameflawel',arrFinalMCNames)
1534
- var newarr=[];
1535
- for (let i=0;i<arrmctNames.length; i++)
1536
- { str='';
1537
- newarr=[];
1538
-
1539
- for (let j=i+1; j<arrmctNames.length; j++)
1540
- {
1541
-
1542
- // console.log('NAME = ' +name);
1543
- if (arrmctNames[i][1][1] == arrmctNames[j][1][1] && arrmctNames[i][1][2] == arrmctNames[j][1][2])
1544
- { var selectionsname=arrmctNames[i][0] ;
1545
- flag=1;
1546
- console.log('foorrr',arrmctNames[i][1][1])
1547
-
1548
- if (allnames.includes(arrmctNames[i][1][0]) )
1549
- {
1550
- var index = allnames.indexOf(allnames[i] );
1551
- if (index !== -1) {
1552
- allnames.splice(index, 1);
1553
- }
1554
- }
1555
- if (!name.includes(arrmctNames[i][1][0] ) ){
1556
- // console.log('msh mwgod');
1557
- name.push(arrmctNames[i][1][0]);
1558
- newarr.push(arrmctNames[i][1][0]);
1559
- var index = arrFinalMCNames.indexOf(arrmctNames[i] );
1560
- if (index !== -1) {
1561
- arrFinalMCNames.splice(index, 1);
1562
- }
1563
- }
1564
- if (!name.includes(arrmctNames[j][1][0] ) ){
1565
- // console.log('msh mwgodj')
1566
- name.push(arrmctNames[j][1][0]);
1567
- newarr.push(arrmctNames[j][1][0]);
1568
- var index1 = arrFinalMCNames.indexOf(arrmctNames[j] );
1569
- if (index1 !== -1) {
1570
- arrFinalMCNames.splice(index1, 1);
1571
- }
1572
- }
1573
- if (!name.includes(arrmctNames[i][1][1] ) ||!name.includes(arrmctNames[i][1][2] ) ){
1574
- name.push( arrmctNames[i][1][1] , arrmctNames[i][1][2] );
1575
- newarr.push(arrmctNames[i][1][1] , arrmctNames[i][1][2] );
1576
-
1577
- }
1578
-
1579
- }
1580
-
1581
- }
1582
- console.log(measitemVal)
1583
- // allnames.push(newarr );
1584
- if (newarr.length >0){
1585
- flag=1;
1586
- arrFinalMCNames.push([selectionsname , newarr, measitemVal ]);
1587
-
1588
-
1589
- }
1590
- }
1591
-
1592
- console.log('finals',arrFinalMCNames);
1593
- console.log('fl='+flag)
1594
-
1595
-
1596
- }
1597
-
1598
- arrFinalMCNames.push([spreadsheetId]);
1599
-
1600
- }
1601
-
1602
- if (flag==1){
1603
- console.log('inifffffff');
1604
- // $.get( '/mctnametoGoogleSheet/'+JSON.stringify(arrFinalMCNames)).then(function(){
1605
- $.get( '/mctnametoGoogleSheet/'+ JSON.stringify(arrFinalMCNames)).then( function(data) {
1606
- listofnames=data[1];
1607
-
1608
- var is_same = listofnames.length == arrallvalues.length && listofnames.every(function(element, index) {
1609
- //return element === array2[index];
1610
- if(arrallvalues.indexOf(element)>-1){
1611
- return element = arrallvalues[arrallvalues.indexOf(element)];
1612
- }
1613
- });
1614
- console.log(is_same);
1615
- if (is_same)
1616
- {
1617
-
1618
- spreadsheetURL=spreadsheetURL+ '/edit#gid='+data[0].toString()
1619
- console.log(spreadsheetURL);
1620
- window.open(spreadsheetURL.toString()) //sheetid
1621
-
1622
- }
1623
- else{
1624
- alert('Guessed names in the legend do not match the names in the ADR Console. Please revise the inputs.');
1625
-
1626
- }
1627
-
1628
- });
1629
- }
1630
-
1631
- }
1632
-
1633
-
1634
- function addmctnameicon(){
1635
-
1636
- repeatforloopI+=1
1637
-
1638
- if (clonedDivId==0){
1639
-
1640
- var dupDiv=document.getElementById('duplicater'); //pass kol div hna
1641
-
1642
- }
1643
- else{
1644
-
1645
- var dupDiv=document.getElementById(clonedDivId); //pass kol div hna //akher div et3mlt
1646
-
1647
- }
1648
- var div=document.getElementById('repeatforloophidden');
1649
- // console.log('vcc, ' ,dupDiv.children[5]);
1650
- var clone = div.cloneNode(true); // "deep" clone
1651
-
1652
- clone.id = 'repeatforloop'+ addciconval + ++jj;
1653
- clone.setAttribute('class','repeatforloopclass'+addciconval+jj);
1654
- clone.setAttribute('name','repeatforloopname'+addciconval+jj);
1655
- if (clonedDivId==0)
1656
- clone.style.marginLeft='5px';
1657
- else
1658
- clone.style.marginLeft='1px';
1659
-
1660
- dupDiv.appendChild(clone)
1661
- dupDiv.insertBefore(clone,document.getElementById('doneebackground'));
1662
-
1663
- console.log(dupDiv.children);
1664
-
1665
- }
1666
-
1667
- function colors(){
1668
- var ele = document.getElementsByName('fullimage');
1669
- var levels = document.getElementsByName('levelsnamelabel')[0];
1670
- var levelsin = document.getElementsByName('levelsnameinput')[0]; //number of colors -- color pickers
1671
- var drp = document.getElementById("colorpickers");
1672
-
1673
- for (i = 0; i < ele.length; i++) {
1674
- if (ele[i].checked)
1675
- if (ele[i].value==220){
1676
- console.log(ele[i].value);
1677
- levels.style.visibility='visible';
1678
- levelsin.style.visibility='visible';
1679
- }
1680
- else
1681
- {
1682
- levels.style.visibility='hidden';
1683
- levelsin.style.visibility='hidden';
1684
- drp.innerHTML='';
1685
- }
1686
-
1687
- }
1688
-
1689
- }
1690
- var levelsin = document.getElementsByName('levelsnameinput')[0]; //number of colors -- color pickers
1691
- console.log(levelsin.value)
1692
- function generatecolorPickers(){
1693
- var drp = document.getElementById("colorpickers");
1694
- console.log('wdithhh', typeof drp.offsetWidth)
1695
- if (levelsin.value>1)
1696
- {
1697
- drp.innerHTML = '';
1698
- console.log(levelsin.value)
1699
- for (let i=0 ; i<levelsin.value ; i++)
1700
- {
1701
- var color = document.createElement("input");
1702
- color.type='color';
1703
- color.value=getRandomColor();
1704
- color.id= 'color';
1705
- color.name='color'+i;
1706
- if ( (drp.offsetWidth) >250)
1707
- drp.style.display='block';
1708
-
1709
- drp.append(color);
1710
-
1711
- if (i==0)
1712
- color.style.marginLeft='1%';
1713
-
1714
- }
1715
- console.log(drp)
1716
- }
1717
- else{
1718
- drp.innerHTML = '';
1719
-
1720
- }
1721
- }
1722
- // var tooltipelem = document.getElementById("tooltip");
1723
- // console.log(tooltipelem)
1724
- // tooltipelem.addEventListener('mouseover',function(){
1725
- // tooltipelem.value='Choose whether this project contains levels or not. If you wish to measure all of the plan, let the number of plans equal to one. If you wish to measure certain regions of the plan or have the plan divided into levels, please type in a number greater than 1 (number of levels).'
1726
-
1727
- // })
1728
- // // tooltipelem.addEventListener('mouseout',function(){
1729
- // // tooltipelem.outerText='';
1730
-
1731
-
1732
- // // })
1733
- function getRandomColor() {
1734
- var letters = '0123456789ABCDEF';
1735
- var color = '#';
1736
- for (var i = 0; i < 6; i++) {
1737
- color += letters[Math.floor(Math.random() * 16)];
1738
- }
1739
- return color;
1740
- }
1741
- function getSecondData(){
1742
- // var formData = new FormData(form);
1743
- // colorsarr=[];
1744
- // val=0;
1745
- // answers=[];
1746
- // var ratio1=0;
1747
- // var ratio2=0;
1748
- // var tomeasureproj=''
1749
- // // iterate through entries...
1750
- // for (var pair of formData.entries()) {
1751
- // console.log(pair[0] + ": " + pair[1]);
1752
- // }
1753
- getmctName()
1754
-
1755
- }
1756
- </script>
1757
-