freealise commited on
Commit
a1c1b95
1 Parent(s): 6daa581

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -449,7 +449,10 @@ with gr.Blocks(css=css) as demo:
449
  }
450
  }
451
  }catch(e){alert(e);}
452
- '>
 
 
 
453
  <defs>
454
  <linearGradient id='lg' x1='0%' x2='100%' y1='0%' y2='0%'>
455
  <stop offset='0%' stop-color='white'/>
@@ -457,11 +460,7 @@ with gr.Blocks(css=css) as demo:
457
  </linearGradient>
458
  </defs>
459
  <polyline id='pl' points='-3,0 0,15 255,15 258,0' stroke='url(#lg)' fill='none' stroke-width='3' stroke-linejoin='round'/>
460
- </svg><script>
461
- document.getElementById('image_edit').getElementsByTagName('canvas')[0].onclick = function(e) {
462
- alert((e.clientX-e.target.getBoundingClientRect().x)+' '+(e.clientY-e.target.getBoundingClientRect().y));
463
- }
464
- </script>""")
465
  average = gr.HTML(value="""<label for='average'>Average</label><input id='average' type='range' style='width:256px;height:1em;' value='1' min='1' max='15' step='2' onclick='
466
  var pts_a = document.getElementsByTagName(\"textarea\")[1].value.split(\" \");
467
  for (var i=0; i<256; i++) {
 
449
  }
450
  }
451
  }catch(e){alert(e);}
452
+ ' onload='
453
+ document.getElementById(\"image_edit\").getElementsByTagName(\"canvas\")[0].onclick = function(e) {
454
+ alert((e.clientX-e.target.getBoundingClientRect().x)+\" \"+(e.clientY-e.target.getBoundingClientRect().y));
455
+ }'>
456
  <defs>
457
  <linearGradient id='lg' x1='0%' x2='100%' y1='0%' y2='0%'>
458
  <stop offset='0%' stop-color='white'/>
 
460
  </linearGradient>
461
  </defs>
462
  <polyline id='pl' points='-3,0 0,15 255,15 258,0' stroke='url(#lg)' fill='none' stroke-width='3' stroke-linejoin='round'/>
463
+ </svg>""")
 
 
 
 
464
  average = gr.HTML(value="""<label for='average'>Average</label><input id='average' type='range' style='width:256px;height:1em;' value='1' min='1' max='15' step='2' onclick='
465
  var pts_a = document.getElementsByTagName(\"textarea\")[1].value.split(\" \");
466
  for (var i=0; i<256; i++) {