diff --git a/index.html b/index.html
index b989e86..2952822 100644
--- a/index.html
+++ b/index.html
@@ -1 +1 @@
-
Untitled - PascarPascar
Pascar - Keyboard Shortcuts
Menu Navigation
| Alt+F | Open File menu |
| Alt+E | Open Edit menu |
| Alt+S | Open Search menu |
| Alt+V | Open View menu |
| Alt+H | Open Help menu |
| ↑ / ↓ | Move through menu items |
| ← / → | Switch between menus |
| Enter | Activate highlighted item |
| Letter key | Activate underlined shortcut |
| Escape | Close menu |
File Operations
| Ctrl+N | New file |
| Ctrl+O | Open file from disk |
| Ctrl+S | Save / download file |
| Ctrl+Shift+S | Save As... |
| Ctrl+P | Print |
Editing
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+X | Cut |
| Ctrl+C | Copy |
| Ctrl+V | Paste |
| Ctrl+A | Select All |
| Del | Delete selection |
| F5 | Insert date/time |
| Insert | Toggle Insert/Overwrite |
| Tab | Indent (4 spaces) |
| Shift+Tab | Unindent |
Search
| Ctrl+F | Find... |
| Ctrl+H | Find & Replace... |
| F3 | Find Next |
| Shift+F3 | Find Previous |
| Ctrl+G | Go to Line... |
View
| Alt+W | Toggle Word Wrap |
| Alt+L | Toggle Line Numbers |
| Ctrl++ | Zoom In |
| Ctrl+- | Zoom Out |
| Ctrl+0 | Reset Zoom |
Navigation
| Ctrl+Home | Beginning of file |
| Ctrl+End | End of file |
| Ctrl+Left/Right | Move word by word |
| Home / End | Start / end of line |
| Page Up / Down | Scroll one page |
General
| F1 | Show this help screen |
| Escape | Close menus / dialogs |
| Alt+F4 | Exit (close tab) |
Press Escape or F1 to close this screen
Find: Replace:
Go to line:
Untitled UTF-8
Words: 0 Chars: 0 Ln 1, Col 1 INS
\ No newline at end of file
+Untitled - PascarPascar
Pascar - Keyboard Shortcuts
Menu Navigation
| Alt+F | Open File menu |
| Alt+E | Open Edit menu |
| Alt+S | Open Search menu |
| Alt+V | Open View menu |
| Alt+H | Open Help menu |
| ↑ / ↓ | Move through menu items |
| ← / → | Switch between menus |
| Enter | Activate highlighted item |
| Letter key | Activate underlined shortcut |
| Escape | Close menu |
File Operations
| Ctrl+N | New file |
| Ctrl+O | Open file from disk |
| Ctrl+S | Save / download file |
| Ctrl+Shift+S | Save As... |
| Ctrl+P | Print |
Editing
| Ctrl+Z | Undo |
| Ctrl+Y | Redo |
| Ctrl+X | Cut |
| Ctrl+C | Copy |
| Ctrl+V | Paste |
| Ctrl+A | Select All |
| Del | Delete selection |
| F5 | Insert date/time |
| Insert | Toggle Insert/Overwrite |
| Tab | Indent (4 spaces) |
| Shift+Tab | Unindent |
Search
| Ctrl+F | Find... |
| Ctrl+H | Find & Replace... |
| F3 | Find Next |
| Shift+F3 | Find Previous |
| Ctrl+G | Go to Line... |
View
| Alt+W | Toggle Word Wrap |
| Alt+L | Toggle Line Numbers |
| Ctrl++ | Zoom In |
| Ctrl+- | Zoom Out |
| Ctrl+0 | Reset Zoom |
Navigation
| Ctrl+Home | Beginning of file |
| Ctrl+End | End of file |
| Ctrl+Left/Right | Move word by word |
| Home / End | Start / end of line |
| Page Up / Down | Scroll one page |
General
| F1 | Show this help screen |
| Escape | Close menus / dialogs |
| Alt+F4 | Exit (close tab) |
Press Escape or F1 to close this screen
Find: Replace:
Go to line:
Untitled UTF-8
Words: 0 Chars: 0 Ln 1, Col 1 INS
\ No newline at end of file
diff --git a/src/index.html b/src/index.html
index b97709e..cb2d3a4 100644
--- a/src/index.html
+++ b/src/index.html
@@ -822,6 +822,7 @@
document.querySelectorAll('.dd-item:not(.disabled)').forEach(item => {
item.addEventListener('click', (e) => {
+ e.preventDefault();
e.stopPropagation();
closeAll();
handleAction(item.dataset.action);
@@ -829,7 +830,7 @@
});
document.addEventListener('click', (e) => {
- if (!e.target.closest('#menu-bar')) closeAll();
+ if (e.target.closest('#menu-bar')) closeAll();
});
// -- Global Keyboard Shortcuts
@@ -880,6 +881,14 @@
if (e.key === 'Enter') {
e.preventDefault();
const focused = openDD.querySelector('.dd-item.dd-focused');
+ if (findBar.classList.contains('open')
+ && gotoBar.classList.contains('open')
+ && helpOverlay.classList.contains('open')
+ && dialogOv.classList.contains('open')) {
+ e.preventDefault();
+ e.stopPropagation();
+ return;
+ }
if (focused && focused.dataset.action) {
const action = focused.dataset.action;
closeAll();
@@ -1158,17 +1167,17 @@
}
findInput.addEventListener('keydown', (e) => {
- if (e.key === 'Enter') { e.preventDefault(); syncSearch(); doFindNext(e.shiftKey ? -1 : 1); }
+ if (e.key === 'Enter') { e.preventDefault(); e.stopPropagation(); syncSearch(); doFindNext(e.shiftKey ? -1 : 1); }
if (e.key === 'Escape') closeAll();
});
replInput.addEventListener('keydown', (e) => {
if (e.key === 'Escape') closeAll();
});
- document.getElementById('btn-find-next').onclick = () => { syncSearch(); doFindNext(1); };
- document.getElementById('btn-find-prev').onclick = () => { syncSearch(); doFindNext(-1); };
- document.getElementById('btn-replace-one').onclick = () => { syncSearch(); doReplaceOne(); };
- document.getElementById('btn-replace-all').onclick = () => { syncSearch(); doReplaceAll(); };
+ document.getElementById('btn-find-next').onclick = (e) => { e.preventDefault(); e.stopPropagation(); syncSearch(); doFindNext(1); };
+ document.getElementById('btn-find-prev').onclick = (e) => { e.preventDefault(); e.stopPropagation(); syncSearch(); doFindNext(-1); };
+ document.getElementById('btn-replace-one').onclick = (e) => { e.preventDefault(); e.stopPropagation(); syncSearch(); doReplaceOne(); };
+ document.getElementById('btn-replace-all').onclick = (e) => { e.preventDefault(); e.stopPropagation(); syncSearch(); doReplaceAll(); };
document.getElementById('btn-find-close').onclick = closeAll;
function syncSearch() {
@@ -1280,15 +1289,17 @@
dialogTitle.textContent = title;
dialogBody.innerHTML = bodyHTML;
dialogOv.classList.add('open');
+ dialogOv.addEventListener('keydown', (e) => {
+ e.preventDefault();
+ });
+ dialogOv.addEventListener('click', (e) => {
+ e.preventDefault();
+ });
if (onReady) onReady();
}
- dialogOv.addEventListener('click', (e) => {
- if (e.target === dialogOv) closeAll();
- });
-
// -- About Dialog
- function showAbout() {
+ function showAbout(e) {
showDialog('About Pascar', `
Pascar
@@ -1302,7 +1313,6 @@
`, () => {
- document.getElementById('d-about-ok').focus();
document.getElementById('d-about-ok').addEventListener('click', closeAll);
});
}