Spaces:
Sleeping
Sleeping
Update templates/proposed-GUI.html
Browse files- templates/proposed-GUI.html +113 -66
templates/proposed-GUI.html
CHANGED
|
@@ -597,7 +597,7 @@ proj1.addEventListener('input',function(){
|
|
| 597 |
optn2.text= prjname1sec1[s];
|
| 598 |
optn2.value= prjname1sec1[s];
|
| 599 |
optn2.id= prjname1sec1[s]+s;
|
| 600 |
-
if(!(prjname1sec1[s].startsWith('1.0') || prjname1sec1[s].startsWith('3.2') || prjname1sec1[s].startsWith('2.2')))
|
| 601 |
{
|
| 602 |
optn2.style.color='#bdbcbc';
|
| 603 |
optn2.style.cursor='not-allowed';
|
|
@@ -613,7 +613,7 @@ proj1.addEventListener('input',function(){
|
|
| 613 |
optn2.text= prjname1sec2[s];
|
| 614 |
optn2.value= prjname1sec2[s];
|
| 615 |
optn2.id= prjname1sec2[s]+s;
|
| 616 |
-
if(!(prjname1sec2[s].startsWith('1.0') || prjname1sec2[s].startsWith('3.2') || prjname1sec2[s].startsWith('2.2')))
|
| 617 |
{
|
| 618 |
optn2.style.color='#555';
|
| 619 |
optn2.style.cursor='not-allowed';
|
|
@@ -629,7 +629,7 @@ proj1.addEventListener('input',function(){
|
|
| 629 |
optn2.text= prjname1sec3[s];
|
| 630 |
optn2.value= prjname1sec3[s];
|
| 631 |
optn2.id= prjname1sec3[s]+s;
|
| 632 |
-
if(!(prjname1sec3[s].startsWith('1.0') || prjname1sec3[s].startsWith('3.2')|| prjname1sec3[s].startsWith('2.2')))
|
| 633 |
{
|
| 634 |
optn2.style.color='#555';
|
| 635 |
optn2.style.cursor='not-allowed';
|
|
@@ -645,7 +645,7 @@ proj1.addEventListener('input',function(){
|
|
| 645 |
optn2.text= prjname1sec4[s];
|
| 646 |
optn2.value= prjname1sec4[s];
|
| 647 |
optn2.id= prjname1sec4[s]+s;
|
| 648 |
-
if(!(prjname1sec4[s].startsWith('1.0') || prjname1sec4[s].startsWith('3.2') || prjname1sec4[s].startsWith('2.2')))
|
| 649 |
{
|
| 650 |
optn2.style.color='#555';
|
| 651 |
optn2.style.cursor='not-allowed';
|
|
@@ -661,7 +661,7 @@ proj1.addEventListener('input',function(){
|
|
| 661 |
optn2.text= prjname2sec[s];
|
| 662 |
optn2.value= prjname2sec[s];
|
| 663 |
optn2.id= prjname2sec[s]+s;
|
| 664 |
-
if(!(prjname2sec[s].startsWith('1.0') || prjname2sec[s].startsWith('3.2') || prjname2sec[s].startsWith('2.2')))
|
| 665 |
{
|
| 666 |
optn2.style.color='#555';
|
| 667 |
optn2.style.cursor='not-allowed';
|
|
@@ -677,7 +677,7 @@ proj1.addEventListener('input',function(){
|
|
| 677 |
optn2.text= prjname3sec1[s];
|
| 678 |
optn2.value= prjname3sec1[s];
|
| 679 |
optn2.id= prjname3sec1[s]+s;
|
| 680 |
-
if(!(prjname3sec1[s].startsWith('1.0') || prjname3sec1[s].startsWith('3.2') || prjname3sec1[s].startsWith('2.2')))
|
| 681 |
{
|
| 682 |
optn2.style.color='#555';
|
| 683 |
optn2.style.cursor='not-allowed';
|
|
@@ -693,7 +693,7 @@ proj1.addEventListener('input',function(){
|
|
| 693 |
optn2.text= prjname3sec2[s];
|
| 694 |
optn2.value= prjname3sec2[s];
|
| 695 |
optn2.id= prjname3sec2[s]+s;
|
| 696 |
-
if(!(prjname3sec2[s].startsWith('1.0') || prjname3sec2[s].startsWith('3.2') || prjname3sec2[s].startsWith('2.2')))
|
| 697 |
{
|
| 698 |
optn2.style.color='#555';
|
| 699 |
optn2.style.cursor='not-allowed';
|
|
@@ -709,7 +709,7 @@ proj1.addEventListener('input',function(){
|
|
| 709 |
optn2.text= prjname3sec3[s];
|
| 710 |
optn2.value= prjname3sec3[s];
|
| 711 |
optn2.id= prjname3sec3[s]+s;
|
| 712 |
-
if(!(prjname3sec3[s].startsWith('1.0') || prjname3sec3[s].startsWith('3.2') || prjname3sec3[s].startsWith('2.2')))
|
| 713 |
{
|
| 714 |
optn2.style.color='#555';
|
| 715 |
optn2.style.cursor='not-allowed';
|
|
@@ -986,7 +986,8 @@ function getData(form) {
|
|
| 986 |
document.getElementById('measureADRbutton').style.boxShadow = 'none';
|
| 987 |
document.getElementById('measureADRbutton').style.color = 'white';
|
| 988 |
document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)";
|
| 989 |
-
|
|
|
|
| 990 |
var formData = new FormData(form);
|
| 991 |
clearInterval(interval)
|
| 992 |
|
|
@@ -1017,10 +1018,11 @@ function getData(form) {
|
|
| 1017 |
if (canvasimg){
|
| 1018 |
buf=canvasimg.split("data:image/png;base64,")
|
| 1019 |
answers.push(tomeasureproj, 220,allcolors , ratio1, ratio2 ,pdfpath,buf[1]);
|
| 1020 |
-
} else
|
| 1021 |
-
|
| 1022 |
-
|
| 1023 |
-
|
|
|
|
| 1024 |
type: "POST",
|
| 1025 |
url: "/savebase64Img/",
|
| 1026 |
|
|
@@ -1083,6 +1085,16 @@ function getData(form) {
|
|
| 1083 |
//spreadsheetURL=data[3]
|
| 1084 |
|
| 1085 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1086 |
}
|
| 1087 |
else{
|
| 1088 |
SimilarAreaDictionary=data[1];
|
|
@@ -1101,8 +1113,7 @@ function getData(form) {
|
|
| 1101 |
imgcanvas.id='imgcanvas';
|
| 1102 |
imgcanvas.alt="Larry";
|
| 1103 |
imgcanvas.style.zIndex=999;
|
| 1104 |
-
|
| 1105 |
-
var underimg=document.getElementById('underimgbuttons');
|
| 1106 |
|
| 1107 |
backimg.style.backgroundColor="transparent";
|
| 1108 |
backimg.style.opacity="1";
|
|
@@ -1151,7 +1162,75 @@ function getData(form) {
|
|
| 1151 |
rightside.append(imgcanvas);
|
| 1152 |
rightside.insertBefore(imgcanvas,underimg);
|
| 1153 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1154 |
|
|
|
|
|
|
|
| 1155 |
if (ratio1 ==0)
|
| 1156 |
|
| 1157 |
|
|
@@ -2117,6 +2196,7 @@ function colors(){
|
|
| 2117 |
|
| 2118 |
var ry = [[]];
|
| 2119 |
var canvas = document.querySelector("#myCanvas");
|
|
|
|
| 2120 |
// let w = (canvas.width = 450);
|
| 2121 |
// let h = (canvas.height = 280);
|
| 2122 |
|
|
@@ -2141,40 +2221,13 @@ myCanvas.addEventListener("click", e => {
|
|
| 2141 |
|
| 2142 |
|
| 2143 |
ry[ry.length - 1].push({ x: x, y: y, color:hex2rgb(color) });
|
| 2144 |
-
// delete everything
|
| 2145 |
-
// ctx.clearRect(0, 0, w, h);
|
| 2146 |
-
// draw everything
|
| 2147 |
-
// drawGrid();
|
| 2148 |
-
// console.log(canvaswindow.parentElement.document)
|
| 2149 |
-
// canvaswindow.window.oncontextmenu = function (e) {
|
| 2150 |
-
// e.preventDefault()
|
| 2151 |
-
// alert('Right Click')
|
| 2152 |
-
// }
|
| 2153 |
-
|
| 2154 |
drawChart();
|
| 2155 |
|
| 2156 |
});
|
| 2157 |
|
| 2158 |
-
|
| 2159 |
-
// NewShapeButtonId.addEventListener("click", e => {
|
| 2160 |
-
// //when NewShapeButtonId is clicked, a new array is pushed into the ry
|
| 2161 |
-
|
| 2162 |
-
// //
|
| 2163 |
-
|
| 2164 |
-
|
| 2165 |
-
// drp= generatecolorPickers()
|
| 2166 |
-
// console.log('drppp',drp)
|
| 2167 |
-
// canvaswindow.childNodes[7].onchange = change; //canvas color element --> child 7
|
| 2168 |
-
// ry.push([]);
|
| 2169 |
-
// // ry.push({x: x, y: y, strokecolor:color});
|
| 2170 |
-
// });
|
| 2171 |
-
|
| 2172 |
function drawChart() {
|
| 2173 |
-
|
| 2174 |
-
|
| 2175 |
-
|
| 2176 |
ctx.lineWidth = 15;
|
| 2177 |
-
|
| 2178 |
// for every array in the ry array
|
| 2179 |
for (let index = 0; index < ry.length; index++) {
|
| 2180 |
// for every point in the ry[index]
|
|
@@ -2228,6 +2281,7 @@ var levelsin = document.getElementById('levelcheckbox');
|
|
| 2228 |
var canvaswindow= document.getElementById('canvaswindow');
|
| 2229 |
var undoButtonId=document.getElementById('undoButtonId');
|
| 2230 |
NewShapeButtonId=document.getElementById('NewShapeButtonId');
|
|
|
|
| 2231 |
var savecanvas=document.getElementById('savecanvas');
|
| 2232 |
|
| 2233 |
levelsin.addEventListener('click',function(){
|
|
@@ -2235,8 +2289,9 @@ levelsin.addEventListener('click',function(){
|
|
| 2235 |
{
|
| 2236 |
// console.log(proj.value, proj1.value , projsec.value, pdfname)
|
| 2237 |
$.get( '/canvaspdftoimgBackground/'+pdfname).then (function(data){
|
|
|
|
| 2238 |
var popup = window.open('');
|
| 2239 |
-
|
| 2240 |
var element = popup.document.createElement('div');
|
| 2241 |
element.setAttribute('id', 'mydiv');
|
| 2242 |
canvaswindow.childNodes[1].height=data[1]; //canvas -->child 3
|
|
@@ -2249,11 +2304,11 @@ levelsin.addEventListener('click',function(){
|
|
| 2249 |
imgDrawon.src = 'data:image/gif;base64,' +data[0];
|
| 2250 |
imgDrawon.width=data[2];
|
| 2251 |
imgDrawon.id='imgcanvas';
|
| 2252 |
-
imgDrawon.alt="Larry";
|
| 2253 |
-
|
| 2254 |
|
| 2255 |
imgDrawon.onload = function(){
|
| 2256 |
-
|
| 2257 |
}
|
| 2258 |
|
| 2259 |
|
|
@@ -2292,14 +2347,6 @@ levelsin.addEventListener('click',function(){
|
|
| 2292 |
drp.childNodes[1].onchange=change;
|
| 2293 |
|
| 2294 |
})
|
| 2295 |
-
// [drp.childNodes].forEach(function(elem){
|
| 2296 |
-
// elem.addEventListener('click',function(){
|
| 2297 |
-
// // elem.onchange=change;
|
| 2298 |
-
// console.log('hhahahahhahugaugkd')
|
| 2299 |
-
// })
|
| 2300 |
-
// })
|
| 2301 |
-
|
| 2302 |
-
|
| 2303 |
})
|
| 2304 |
|
| 2305 |
savecanvas.addEventListener('click',function(){
|
|
@@ -2307,10 +2354,10 @@ levelsin.addEventListener('click',function(){
|
|
| 2307 |
image.id = "pic";
|
| 2308 |
image.src = canvas.toDataURL("image/png");
|
| 2309 |
canvasimg=image.src;
|
| 2310 |
-
|
| 2311 |
-
|
| 2312 |
})
|
| 2313 |
|
|
|
|
|
|
|
| 2314 |
}
|
| 2315 |
})
|
| 2316 |
|
|
@@ -2448,7 +2495,7 @@ var createdTimeDiv= document.getElementById('createdTimeDiv');
|
|
| 2448 |
getlegendstoDirectory()
|
| 2449 |
function getlegendstoDirectory(){
|
| 2450 |
$.get( '/getdrivelinks/'+'0').then (function(data){
|
| 2451 |
-
|
| 2452 |
pathsarr=data
|
| 2453 |
if (!legendscontent.children[1]){
|
| 2454 |
var allprjdiv= document.createElement("div");
|
|
@@ -2609,7 +2656,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2609 |
newlabelsec.textContent=prjname1sec1[cc];
|
| 2610 |
newlabelsec.id='prjsec';
|
| 2611 |
newlabelsec.className='prjsecclass';
|
| 2612 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2613 |
{
|
| 2614 |
newlabelsec.style.color='lightgray';
|
| 2615 |
i.style.color='lightgray'
|
|
@@ -2641,7 +2688,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2641 |
newlabelsec.textContent=prjname1sec2[cc];
|
| 2642 |
newlabelsec.id='prjsec';
|
| 2643 |
newlabelsec.className='prjsecclass';
|
| 2644 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2645 |
{
|
| 2646 |
newlabelsec.style.color='lightgray';
|
| 2647 |
i.style.color='lightgray'
|
|
@@ -2674,7 +2721,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2674 |
newlabelsec.textContent=prjname1sec2[cc];
|
| 2675 |
newlabelsec.id='prjsec';
|
| 2676 |
newlabelsec.className='prjsecclass';
|
| 2677 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2678 |
{
|
| 2679 |
newlabelsec.style.color='lightgray';
|
| 2680 |
i.style.color='lightgray'
|
|
@@ -2707,7 +2754,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2707 |
newlabelsec.textContent=prjname1sec4[cc];
|
| 2708 |
newlabelsec.id='prjsec';
|
| 2709 |
newlabelsec.className='prjsecclass';
|
| 2710 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2711 |
{
|
| 2712 |
newlabelsec.style.color='lightgray';
|
| 2713 |
i.style.color='lightgray'
|
|
@@ -2740,7 +2787,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2740 |
newlabelsec.textContent=prjname2sec[cc];
|
| 2741 |
newlabelsec.id='prjsec';
|
| 2742 |
newlabelsec.className='prjsecclass';
|
| 2743 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2744 |
{
|
| 2745 |
newlabelsec.style.color='lightgray';
|
| 2746 |
i.style.color='lightgray'
|
|
@@ -2774,7 +2821,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2774 |
newlabelsec.textContent=prjname3sec1[cc];
|
| 2775 |
newlabelsec.id='prjsec';
|
| 2776 |
newlabelsec.className='prjsecclass';
|
| 2777 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2778 |
{
|
| 2779 |
newlabelsec.style.color='lightgray';
|
| 2780 |
i.style.color='lightgray'
|
|
@@ -2806,7 +2853,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2806 |
newlabelsec.textContent=prjname3sec2[cc];
|
| 2807 |
newlabelsec.id='prjsec';
|
| 2808 |
newlabelsec.className='prjsecclass';
|
| 2809 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2810 |
{
|
| 2811 |
newlabelsec.style.color='lightgray';
|
| 2812 |
i.style.color='lightgray'
|
|
@@ -2839,7 +2886,7 @@ legendscontent.querySelectorAll('label').forEach(function(elem){
|
|
| 2839 |
newlabelsec.textContent=prjname3sec3[cc];
|
| 2840 |
newlabelsec.id='prjsec';
|
| 2841 |
newlabelsec.className='prjsecclass';
|
| 2842 |
-
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') ))
|
| 2843 |
{
|
| 2844 |
newlabelsec.style.color='lightgray';
|
| 2845 |
i.style.color='lightgray'
|
|
|
|
| 597 |
optn2.text= prjname1sec1[s];
|
| 598 |
optn2.value= prjname1sec1[s];
|
| 599 |
optn2.id= prjname1sec1[s]+s;
|
| 600 |
+
if(!(prjname1sec1[s].startsWith('1.0') || prjname1sec1[s].startsWith('3.2') || prjname1sec1[s].startsWith('2.2') || prjname1sec1[s].startsWith('2.1')))
|
| 601 |
{
|
| 602 |
optn2.style.color='#bdbcbc';
|
| 603 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 613 |
optn2.text= prjname1sec2[s];
|
| 614 |
optn2.value= prjname1sec2[s];
|
| 615 |
optn2.id= prjname1sec2[s]+s;
|
| 616 |
+
if(!(prjname1sec2[s].startsWith('1.0') || prjname1sec2[s].startsWith('3.2') || prjname1sec2[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 617 |
{
|
| 618 |
optn2.style.color='#555';
|
| 619 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 629 |
optn2.text= prjname1sec3[s];
|
| 630 |
optn2.value= prjname1sec3[s];
|
| 631 |
optn2.id= prjname1sec3[s]+s;
|
| 632 |
+
if(!(prjname1sec3[s].startsWith('1.0') || prjname1sec3[s].startsWith('3.2')|| prjname1sec3[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 633 |
{
|
| 634 |
optn2.style.color='#555';
|
| 635 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 645 |
optn2.text= prjname1sec4[s];
|
| 646 |
optn2.value= prjname1sec4[s];
|
| 647 |
optn2.id= prjname1sec4[s]+s;
|
| 648 |
+
if(!(prjname1sec4[s].startsWith('1.0') || prjname1sec4[s].startsWith('3.2') || prjname1sec4[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 649 |
{
|
| 650 |
optn2.style.color='#555';
|
| 651 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 661 |
optn2.text= prjname2sec[s];
|
| 662 |
optn2.value= prjname2sec[s];
|
| 663 |
optn2.id= prjname2sec[s]+s;
|
| 664 |
+
if(!(prjname2sec[s].startsWith('1.0') || prjname2sec[s].startsWith('3.2') || prjname2sec[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 665 |
{
|
| 666 |
optn2.style.color='#555';
|
| 667 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 677 |
optn2.text= prjname3sec1[s];
|
| 678 |
optn2.value= prjname3sec1[s];
|
| 679 |
optn2.id= prjname3sec1[s]+s;
|
| 680 |
+
if(!(prjname3sec1[s].startsWith('1.0') || prjname3sec1[s].startsWith('3.2') || prjname3sec1[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 681 |
{
|
| 682 |
optn2.style.color='#555';
|
| 683 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 693 |
optn2.text= prjname3sec2[s];
|
| 694 |
optn2.value= prjname3sec2[s];
|
| 695 |
optn2.id= prjname3sec2[s]+s;
|
| 696 |
+
if(!(prjname3sec2[s].startsWith('1.0') || prjname3sec2[s].startsWith('3.2') || prjname3sec2[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 697 |
{
|
| 698 |
optn2.style.color='#555';
|
| 699 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 709 |
optn2.text= prjname3sec3[s];
|
| 710 |
optn2.value= prjname3sec3[s];
|
| 711 |
optn2.id= prjname3sec3[s]+s;
|
| 712 |
+
if(!(prjname3sec3[s].startsWith('1.0') || prjname3sec3[s].startsWith('3.2') || prjname3sec3[s].startsWith('2.2') || prjname1sec2[s].startsWith('2.1')))
|
| 713 |
{
|
| 714 |
optn2.style.color='#555';
|
| 715 |
optn2.style.cursor='not-allowed';
|
|
|
|
| 986 |
document.getElementById('measureADRbutton').style.boxShadow = 'none';
|
| 987 |
document.getElementById('measureADRbutton').style.color = 'white';
|
| 988 |
document.getElementById('measureADRbutton').style.backgroundColor="rgb(154,152,152)";
|
| 989 |
+
|
| 990 |
+
var underimg=document.getElementById('underimgbuttons');
|
| 991 |
var formData = new FormData(form);
|
| 992 |
clearInterval(interval)
|
| 993 |
|
|
|
|
| 1018 |
if (canvasimg){
|
| 1019 |
buf=canvasimg.split("data:image/png;base64,")
|
| 1020 |
answers.push(tomeasureproj, 220,allcolors , ratio1, ratio2 ,pdfpath,buf[1]);
|
| 1021 |
+
} else{
|
| 1022 |
+
answers.push(tomeasureproj, 0,[] , ratio1, ratio2 ,pdfpath);
|
| 1023 |
+
}
|
| 1024 |
+
if (!formvalues['selectprojs'].startsWith('2.1'))
|
| 1025 |
+
{ $.ajax({
|
| 1026 |
type: "POST",
|
| 1027 |
url: "/savebase64Img/",
|
| 1028 |
|
|
|
|
| 1085 |
//spreadsheetURL=data[3]
|
| 1086 |
|
| 1087 |
|
| 1088 |
+
}
|
| 1089 |
+
if (formvalues['selectprojs'].startsWith('2.1'))
|
| 1090 |
+
{
|
| 1091 |
+
//ignore data[0] --> img passed directly
|
| 1092 |
+
//dropboxLink=data[1]
|
| 1093 |
+
|
| 1094 |
+
//spreadsheetId=data[2]
|
| 1095 |
+
//spreadsheetURL=data[3]
|
| 1096 |
+
spreadsheetURL=data[0]
|
| 1097 |
+
|
| 1098 |
}
|
| 1099 |
else{
|
| 1100 |
SimilarAreaDictionary=data[1];
|
|
|
|
| 1113 |
imgcanvas.id='imgcanvas';
|
| 1114 |
imgcanvas.alt="Larry";
|
| 1115 |
imgcanvas.style.zIndex=999;
|
| 1116 |
+
|
|
|
|
| 1117 |
|
| 1118 |
backimg.style.backgroundColor="transparent";
|
| 1119 |
backimg.style.opacity="1";
|
|
|
|
| 1162 |
rightside.append(imgcanvas);
|
| 1163 |
rightside.insertBefore(imgcanvas,underimg);
|
| 1164 |
});
|
| 1165 |
+
}
|
| 1166 |
+
else{
|
| 1167 |
+
$.ajax({
|
| 1168 |
+
type: "POST",
|
| 1169 |
+
url: "/2.1Trial/",
|
| 1170 |
+
|
| 1171 |
+
// set content type header to use Flask response.get_json()
|
| 1172 |
+
contentType: "application/json",
|
| 1173 |
+
|
| 1174 |
+
// convert data/object to JSON to send
|
| 1175 |
+
data: JSON.stringify({allvalues:answers}),
|
| 1176 |
+
|
| 1177 |
+
// expect JSON data in return (e.g. Flask jsonify)
|
| 1178 |
+
dataType: "json",
|
| 1179 |
+
|
| 1180 |
+
// handle response
|
| 1181 |
+
success: function(response) {
|
| 1182 |
+
console.log(response);
|
| 1183 |
+
},
|
| 1184 |
+
error: function(err) {
|
| 1185 |
+
console.log(err);
|
| 1186 |
+
}
|
| 1187 |
+
}).done(function(data){
|
| 1188 |
+
spreadsheetURL=data[0];
|
| 1189 |
+
var backimg=document.getElementById('backgroundimg');
|
| 1190 |
+
var rightside=document.getElementById('rightside');
|
| 1191 |
+
document.getElementById("loading").hidden = true;
|
| 1192 |
+
|
| 1193 |
+
document.getElementById('duplicater').removeAttribute('hidden');
|
| 1194 |
+
document.getElementById('doneebackground').removeAttribute('hidden');
|
| 1195 |
+
|
| 1196 |
+
|
| 1197 |
+
// clearInterval()
|
| 1198 |
+
document.getElementById('measureADRbutton').removeAttribute('disabled');
|
| 1199 |
+
document.getElementById('measureADRbutton').style.cursor='pointer';
|
| 1200 |
+
document.getElementById('measureADRbutton').style.color = 'white';
|
| 1201 |
+
document.getElementById('measureADRbutton').style.backgroundColor="#16c72e";
|
| 1202 |
+
document.getElementById('measureADRbutton').addEventListener('mouseover',function(){
|
| 1203 |
+
document.getElementById('measureADRbutton').style.color='black';
|
| 1204 |
+
document.getElementById('measureADRbutton').style.boxShadow=' 0 0 8px 2px #16c72e';
|
| 1205 |
+
})
|
| 1206 |
+
|
| 1207 |
+
|
| 1208 |
+
document.getElementById('measureADRbutton').addEventListener('mouseout',function(){
|
| 1209 |
+
document.getElementById('measureADRbutton').style.color='white';
|
| 1210 |
+
document.getElementById('measureADRbutton').style.boxShadow='none';
|
| 1211 |
+
});
|
| 1212 |
+
|
| 1213 |
+
var legendbutton= document.createElement("button");
|
| 1214 |
+
legendbutton.id='measureADRbutton2';
|
| 1215 |
+
legendbutton.innerText='Legend and Data created';
|
| 1216 |
+
legendbutton.style.backgroundColor='rgb(5, 43, 235)';
|
| 1217 |
+
legendbutton.addEventListener('mouseover',function(){
|
| 1218 |
+
legendbutton.style.boxShadow='0 0 8px 2px rgb(5, 43, 235)';
|
| 1219 |
+
})
|
| 1220 |
+
legendbutton.addEventListener('mouseout',function(){
|
| 1221 |
+
legendbutton.style.boxShadow='none';
|
| 1222 |
+
})
|
| 1223 |
+
|
| 1224 |
+
|
| 1225 |
+
// legendbutton.margin.horizontal='0';
|
| 1226 |
+
legendbutton.addEventListener('click',function(){
|
| 1227 |
+
window.open( spreadsheetURL);
|
| 1228 |
+
|
| 1229 |
+
})
|
| 1230 |
+
underimg.append(legendbutton);
|
| 1231 |
|
| 1232 |
+
});
|
| 1233 |
+
}
|
| 1234 |
if (ratio1 ==0)
|
| 1235 |
|
| 1236 |
|
|
|
|
| 2196 |
|
| 2197 |
var ry = [[]];
|
| 2198 |
var canvas = document.querySelector("#myCanvas");
|
| 2199 |
+
|
| 2200 |
// let w = (canvas.width = 450);
|
| 2201 |
// let h = (canvas.height = 280);
|
| 2202 |
|
|
|
|
| 2221 |
|
| 2222 |
|
| 2223 |
ry[ry.length - 1].push({ x: x, y: y, color:hex2rgb(color) });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2224 |
drawChart();
|
| 2225 |
|
| 2226 |
});
|
| 2227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2228 |
function drawChart() {
|
|
|
|
|
|
|
|
|
|
| 2229 |
ctx.lineWidth = 15;
|
| 2230 |
+
|
| 2231 |
// for every array in the ry array
|
| 2232 |
for (let index = 0; index < ry.length; index++) {
|
| 2233 |
// for every point in the ry[index]
|
|
|
|
| 2281 |
var canvaswindow= document.getElementById('canvaswindow');
|
| 2282 |
var undoButtonId=document.getElementById('undoButtonId');
|
| 2283 |
NewShapeButtonId=document.getElementById('NewShapeButtonId');
|
| 2284 |
+
// NewShapeButtonId.style.color='blue';
|
| 2285 |
var savecanvas=document.getElementById('savecanvas');
|
| 2286 |
|
| 2287 |
levelsin.addEventListener('click',function(){
|
|
|
|
| 2289 |
{
|
| 2290 |
// console.log(proj.value, proj1.value , projsec.value, pdfname)
|
| 2291 |
$.get( '/canvaspdftoimgBackground/'+pdfname).then (function(data){
|
| 2292 |
+
|
| 2293 |
var popup = window.open('');
|
| 2294 |
+
// popup.document.body.style.zoom=0.4;
|
| 2295 |
var element = popup.document.createElement('div');
|
| 2296 |
element.setAttribute('id', 'mydiv');
|
| 2297 |
canvaswindow.childNodes[1].height=data[1]; //canvas -->child 3
|
|
|
|
| 2304 |
imgDrawon.src = 'data:image/gif;base64,' +data[0];
|
| 2305 |
imgDrawon.width=data[2];
|
| 2306 |
imgDrawon.id='imgcanvas';
|
| 2307 |
+
// imgDrawon.alt="Larry";
|
| 2308 |
+
|
| 2309 |
|
| 2310 |
imgDrawon.onload = function(){
|
| 2311 |
+
|
| 2312 |
}
|
| 2313 |
|
| 2314 |
|
|
|
|
| 2347 |
drp.childNodes[1].onchange=change;
|
| 2348 |
|
| 2349 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2350 |
})
|
| 2351 |
|
| 2352 |
savecanvas.addEventListener('click',function(){
|
|
|
|
| 2354 |
image.id = "pic";
|
| 2355 |
image.src = canvas.toDataURL("image/png");
|
| 2356 |
canvasimg=image.src;
|
|
|
|
|
|
|
| 2357 |
})
|
| 2358 |
|
| 2359 |
+
|
| 2360 |
+
|
| 2361 |
}
|
| 2362 |
})
|
| 2363 |
|
|
|
|
| 2495 |
getlegendstoDirectory()
|
| 2496 |
function getlegendstoDirectory(){
|
| 2497 |
$.get( '/getdrivelinks/'+'0').then (function(data){
|
| 2498 |
+
console.log(data)
|
| 2499 |
pathsarr=data
|
| 2500 |
if (!legendscontent.children[1]){
|
| 2501 |
var allprjdiv= document.createElement("div");
|
|
|
|
| 2656 |
newlabelsec.textContent=prjname1sec1[cc];
|
| 2657 |
newlabelsec.id='prjsec';
|
| 2658 |
newlabelsec.className='prjsecclass';
|
| 2659 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2660 |
{
|
| 2661 |
newlabelsec.style.color='lightgray';
|
| 2662 |
i.style.color='lightgray'
|
|
|
|
| 2688 |
newlabelsec.textContent=prjname1sec2[cc];
|
| 2689 |
newlabelsec.id='prjsec';
|
| 2690 |
newlabelsec.className='prjsecclass';
|
| 2691 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2692 |
{
|
| 2693 |
newlabelsec.style.color='lightgray';
|
| 2694 |
i.style.color='lightgray'
|
|
|
|
| 2721 |
newlabelsec.textContent=prjname1sec2[cc];
|
| 2722 |
newlabelsec.id='prjsec';
|
| 2723 |
newlabelsec.className='prjsecclass';
|
| 2724 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2725 |
{
|
| 2726 |
newlabelsec.style.color='lightgray';
|
| 2727 |
i.style.color='lightgray'
|
|
|
|
| 2754 |
newlabelsec.textContent=prjname1sec4[cc];
|
| 2755 |
newlabelsec.id='prjsec';
|
| 2756 |
newlabelsec.className='prjsecclass';
|
| 2757 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2758 |
{
|
| 2759 |
newlabelsec.style.color='lightgray';
|
| 2760 |
i.style.color='lightgray'
|
|
|
|
| 2787 |
newlabelsec.textContent=prjname2sec[cc];
|
| 2788 |
newlabelsec.id='prjsec';
|
| 2789 |
newlabelsec.className='prjsecclass';
|
| 2790 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2791 |
{
|
| 2792 |
newlabelsec.style.color='lightgray';
|
| 2793 |
i.style.color='lightgray'
|
|
|
|
| 2821 |
newlabelsec.textContent=prjname3sec1[cc];
|
| 2822 |
newlabelsec.id='prjsec';
|
| 2823 |
newlabelsec.className='prjsecclass';
|
| 2824 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2825 |
{
|
| 2826 |
newlabelsec.style.color='lightgray';
|
| 2827 |
i.style.color='lightgray'
|
|
|
|
| 2853 |
newlabelsec.textContent=prjname3sec2[cc];
|
| 2854 |
newlabelsec.id='prjsec';
|
| 2855 |
newlabelsec.className='prjsecclass';
|
| 2856 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2857 |
{
|
| 2858 |
newlabelsec.style.color='lightgray';
|
| 2859 |
i.style.color='lightgray'
|
|
|
|
| 2886 |
newlabelsec.textContent=prjname3sec3[cc];
|
| 2887 |
newlabelsec.id='prjsec';
|
| 2888 |
newlabelsec.className='prjsecclass';
|
| 2889 |
+
if (!(newlabelsec.textContent.toString().startsWith('1.0') || newlabelsec.textContent.startsWith('3.2') || newlabelsec.textContent.startsWith('2.2') || newlabelsec.textContent.startsWith('2.1')))
|
| 2890 |
{
|
| 2891 |
newlabelsec.style.color='lightgray';
|
| 2892 |
i.style.color='lightgray'
|