Spaces:
Sleeping
Sleeping
Changed question to input and output to output. Changed javascript to only alert
Browse files
app.py
CHANGED
|
@@ -20,15 +20,15 @@ def process_message(message):
|
|
| 20 |
# JavaScript for message handling
|
| 21 |
js = """
|
| 22 |
function on_message(event) {
|
| 23 |
-
if (event.data && event.data.projectData) {
|
| 24 |
// Access the gradio elements through window.gradio
|
| 25 |
-
|
| 26 |
-
|
| 27 |
alert('test');
|
| 28 |
// Update the textboxes
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
}
|
| 32 |
}
|
| 33 |
window.addEventListener('message', on_message);
|
| 34 |
"""
|
|
@@ -56,7 +56,7 @@ with gr.Blocks(js=js) as demo:
|
|
| 56 |
update_btn = gr.Button("Update Values")
|
| 57 |
update_btn.click(
|
| 58 |
fn=update_values,
|
| 59 |
-
inputs=[project_data,
|
| 60 |
outputs=output
|
| 61 |
)
|
| 62 |
|
|
|
|
| 20 |
# JavaScript for message handling
|
| 21 |
js = """
|
| 22 |
function on_message(event) {
|
| 23 |
+
//if (event.data && event.data.projectData) {
|
| 24 |
// Access the gradio elements through window.gradio
|
| 25 |
+
// const projectData = event.data.projectData;
|
| 26 |
+
// const question = event.data.question;
|
| 27 |
alert('test');
|
| 28 |
// Update the textboxes
|
| 29 |
+
// document.querySelector('#project_data textarea').value = projectData;
|
| 30 |
+
// document.querySelector('#output textarea').value = question;
|
| 31 |
+
//}
|
| 32 |
}
|
| 33 |
window.addEventListener('message', on_message);
|
| 34 |
"""
|
|
|
|
| 56 |
update_btn = gr.Button("Update Values")
|
| 57 |
update_btn.click(
|
| 58 |
fn=update_values,
|
| 59 |
+
inputs=[project_data, question],
|
| 60 |
outputs=output
|
| 61 |
)
|
| 62 |
|