Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse files- deep_research.py +21 -0
deep_research.py
CHANGED
|
@@ -1502,16 +1502,37 @@ if __name__ == "__main__":
|
|
| 1502 |
gr.HTML("""
|
| 1503 |
<script>
|
| 1504 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
| 1505 |
const queryInput = document.querySelector('.chat-input textarea');
|
| 1506 |
const submitButton = document.getElementById('submit-button');
|
| 1507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1508 |
if (queryInput && submitButton) {
|
| 1509 |
queryInput.addEventListener('keydown', function(e) {
|
|
|
|
| 1510 |
if (e.key === 'Enter' && !e.shiftKey) {
|
|
|
|
| 1511 |
e.preventDefault(); // Prevent new line
|
| 1512 |
submitButton.click(); // Trigger the hidden submit button
|
|
|
|
|
|
|
|
|
|
| 1513 |
}
|
| 1514 |
});
|
|
|
|
|
|
|
|
|
|
| 1515 |
}
|
| 1516 |
});
|
| 1517 |
</script>
|
|
|
|
| 1502 |
gr.HTML("""
|
| 1503 |
<script>
|
| 1504 |
document.addEventListener('DOMContentLoaded', function() {
|
| 1505 |
+
console.log('DOM Content Loaded - Attempting to set up Enter key listener.');
|
| 1506 |
const queryInput = document.querySelector('.chat-input textarea');
|
| 1507 |
const submitButton = document.getElementById('submit-button');
|
| 1508 |
|
| 1509 |
+
if (queryInput) {
|
| 1510 |
+
console.log('queryInput found:', queryInput);
|
| 1511 |
+
} else {
|
| 1512 |
+
console.log('queryInput NOT found.');
|
| 1513 |
+
}
|
| 1514 |
+
|
| 1515 |
+
if (submitButton) {
|
| 1516 |
+
console.log('submitButton found:', submitButton);
|
| 1517 |
+
} else {
|
| 1518 |
+
console.log('submitButton NOT found.');
|
| 1519 |
+
}
|
| 1520 |
+
|
| 1521 |
if (queryInput && submitButton) {
|
| 1522 |
queryInput.addEventListener('keydown', function(e) {
|
| 1523 |
+
console.log('Keydown event:', e.key, 'Shift:', e.shiftKey);
|
| 1524 |
if (e.key === 'Enter' && !e.shiftKey) {
|
| 1525 |
+
console.log('Enter (without Shift) pressed. Preventing default and clicking submit button.');
|
| 1526 |
e.preventDefault(); // Prevent new line
|
| 1527 |
submitButton.click(); // Trigger the hidden submit button
|
| 1528 |
+
} else if (e.key === 'Enter' && e.shiftKey) {
|
| 1529 |
+
console.log('Shift+Enter pressed. Allowing new line.');
|
| 1530 |
+
// Allow default behavior for new line
|
| 1531 |
}
|
| 1532 |
});
|
| 1533 |
+
console.log('Keydown listener attached to queryInput.');
|
| 1534 |
+
} else {
|
| 1535 |
+
console.log('Could not attach keydown listener: queryInput or submitButton not found.');
|
| 1536 |
}
|
| 1537 |
});
|
| 1538 |
</script>
|