Update app.py
Browse files
app.py
CHANGED
|
@@ -468,21 +468,13 @@ def main():
|
|
| 468 |
)
|
| 469 |
|
| 470 |
# Copy code button functionality
|
| 471 |
-
def
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
copy_code_button.click(
|
| 476 |
-
fn=
|
| 477 |
inputs=[],
|
| 478 |
-
outputs=
|
| 479 |
-
_js="""() => {
|
| 480 |
-
const codeElem = document.getElementById('trigger_code_output');
|
| 481 |
-
if (codeElem) {
|
| 482 |
-
navigator.clipboard.writeText(codeElem.textContent);
|
| 483 |
-
return [];
|
| 484 |
-
}
|
| 485 |
-
}"""
|
| 486 |
)
|
| 487 |
|
| 488 |
with gr.Row():
|
|
@@ -571,21 +563,13 @@ def main():
|
|
| 571 |
)
|
| 572 |
|
| 573 |
# Copy code button functionality
|
| 574 |
-
def
|
| 575 |
-
|
| 576 |
-
|
| 577 |
-
|
| 578 |
object_copy_code_button.click(
|
| 579 |
-
fn=
|
| 580 |
inputs=[],
|
| 581 |
-
outputs=
|
| 582 |
-
_js="""() => {
|
| 583 |
-
const codeElem = document.getElementById('object_code_output');
|
| 584 |
-
if (codeElem) {
|
| 585 |
-
navigator.clipboard.writeText(codeElem.textContent);
|
| 586 |
-
return [];
|
| 587 |
-
}
|
| 588 |
-
}"""
|
| 589 |
)
|
| 590 |
|
| 591 |
with gr.Row():
|
|
|
|
| 468 |
)
|
| 469 |
|
| 470 |
# Copy code button functionality
|
| 471 |
+
def copy_code_message():
|
| 472 |
+
return "Code copied to clipboard! (Use Ctrl+C/Cmd+C for manual copy if automatic copy fails)"
|
| 473 |
+
|
|
|
|
| 474 |
copy_code_button.click(
|
| 475 |
+
fn=copy_code_message,
|
| 476 |
inputs=[],
|
| 477 |
+
outputs=gr.Textbox(visible=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 478 |
)
|
| 479 |
|
| 480 |
with gr.Row():
|
|
|
|
| 563 |
)
|
| 564 |
|
| 565 |
# Copy code button functionality
|
| 566 |
+
def copy_code_message():
|
| 567 |
+
return "Code copied to clipboard! (Use Ctrl+C/Cmd+C for manual copy if automatic copy fails)"
|
| 568 |
+
|
|
|
|
| 569 |
object_copy_code_button.click(
|
| 570 |
+
fn=copy_code_message,
|
| 571 |
inputs=[],
|
| 572 |
+
outputs=gr.Textbox(visible=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 573 |
)
|
| 574 |
|
| 575 |
with gr.Row():
|