Update app.py
Browse files
app.py
CHANGED
@@ -172,11 +172,11 @@ def save_game(background_img,star_img,enemy_img,platform_img,dude_img):
|
|
172 |
pass
|
173 |
score_js="""
|
174 |
|
175 |
-
function(text_input
|
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
|
180 |
}
|
181 |
"""
|
182 |
|
@@ -210,14 +210,14 @@ with gr.Blocks() as app:
|
|
210 |
text_input=gr.Textbox()
|
211 |
url_params=gr.Textbox()
|
212 |
|
213 |
-
def return_score(text
|
214 |
'''if url_params.get('url') ==check_acc:
|
215 |
out = gr.update(visible=True)
|
216 |
else:
|
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 + ""
|
220 |
-
get_score.click(return_score,text_input,[text_input
|
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])
|
|
|
172 |
pass
|
173 |
score_js="""
|
174 |
|
175 |
+
function(text_input) {
|
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];
|
180 |
}
|
181 |
"""
|
182 |
|
|
|
210 |
text_input=gr.Textbox()
|
211 |
url_params=gr.Textbox()
|
212 |
|
213 |
+
def return_score(text):
|
214 |
'''if url_params.get('url') ==check_acc:
|
215 |
out = gr.update(visible=True)
|
216 |
else:
|
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 + ""]
|
220 |
+
get_score.click(return_score,text_input,[text_input],_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])
|