Omnibus commited on
Commit
1798a3e
1 Parent(s): 52420d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -174,15 +174,8 @@ score_js="""
174
 
175
  function(text_input,url_params) {
176
  console.log(text_input, url_params);
177
- const iframe = document.getElementById("myIframe").contentWindow.document.getElementById('my_score');
178
- const iframe2 = document.getElementById("myIframe").contentWindow.document.getElementById('my_score').innerHTML;
179
- words=iframe2.innerText;
180
  console.log(iframe);
181
- console.log(iframe2);
182
- console.log("words"+words);
183
-
184
- text_input = words;
185
- console.log(text_input);
186
  return [iframe,iframe];
187
  }
188
  """
@@ -224,7 +217,7 @@ with gr.Blocks() as app:
224
  out=gr.update(visible=False)
225
  #out=gr.HTML.update("""<head><meta http-equiv="refresh" content="0;URL='https://huggingface.co/spaces"></head>""")'''
226
  return ["" + text + "", url_params]
227
- get_score.click(return_score,text_input,text_input,_js=score_js)
228
  save_btn.click(save_game,[out_im_sky,out_im_star,out_im_enemy,out_im_enemy,out_im_enemy],None)
229
  update_game.click(game_fn,[out_sky_url,out_star_url,out_enemy_url],html_game)
230
  btn_sky.click(sky_fn,prompt_sky,[out_im_sky,out_sky_url])
 
174
 
175
  function(text_input,url_params) {
176
  console.log(text_input, url_params);
177
+ const iframe = document.getElementById("myIframe").contentWindow.document.getElementById('my_score').innerHTML;
 
 
178
  console.log(iframe);
 
 
 
 
 
179
  return [iframe,iframe];
180
  }
181
  """
 
217
  out=gr.update(visible=False)
218
  #out=gr.HTML.update("""<head><meta http-equiv="refresh" content="0;URL='https://huggingface.co/spaces"></head>""")'''
219
  return ["" + text + "", url_params]
220
+ get_score.click(return_score,text_input,[text_input,url_params],_js=score_js)
221
  save_btn.click(save_game,[out_im_sky,out_im_star,out_im_enemy,out_im_enemy,out_im_enemy],None)
222
  update_game.click(game_fn,[out_sky_url,out_star_url,out_enemy_url],html_game)
223
  btn_sky.click(sky_fn,prompt_sky,[out_im_sky,out_sky_url])