Commit ·
5c9f8f5
1
Parent(s): 2ab3a0a
Redirect Ctrl+Q shortcut to Quran panel tab (not old modal)
Browse files- src/index.html +9 -2
src/index.html
CHANGED
|
@@ -1815,12 +1815,19 @@
|
|
| 1815 |
});
|
| 1816 |
}
|
| 1817 |
|
| 1818 |
-
// Ctrl+Q → Quran
|
| 1819 |
// Escape → Close Quran modal
|
| 1820 |
document.addEventListener('keydown', (e) => {
|
| 1821 |
if ((e.ctrlKey || e.metaKey) && e.code === 'KeyQ') {
|
| 1822 |
e.preventDefault();
|
| 1823 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1824 |
}
|
| 1825 |
if (e.key === 'Escape') {
|
| 1826 |
var modal = document.getElementById('quran-modal');
|
|
|
|
| 1815 |
});
|
| 1816 |
}
|
| 1817 |
|
| 1818 |
+
// Ctrl+Q → Quran panel shortcut (e.code works with any keyboard language)
|
| 1819 |
// Escape → Close Quran modal
|
| 1820 |
document.addEventListener('keydown', (e) => {
|
| 1821 |
if ((e.ctrlKey || e.metaKey) && e.code === 'KeyQ') {
|
| 1822 |
e.preventDefault();
|
| 1823 |
+
// Switch to Quran tab and copy selection if any
|
| 1824 |
+
var sel = window.getSelection();
|
| 1825 |
+
var text = sel ? sel.toString().trim() : '';
|
| 1826 |
+
switchTab('quran');
|
| 1827 |
+
if (text) {
|
| 1828 |
+
var ta = document.getElementById('quran-input');
|
| 1829 |
+
if (ta) ta.value = text;
|
| 1830 |
+
}
|
| 1831 |
}
|
| 1832 |
if (e.key === 'Escape') {
|
| 1833 |
var modal = document.getElementById('quran-modal');
|