diff --git a/index.html b/index.html
index 224ec56..b989e86 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/manifest.json b/manifest.json
new file mode 100644
index 0000000..051e4d9
--- /dev/null
+++ b/manifest.json
@@ -0,0 +1,15 @@
+{
+ "name": "Pascar Text Editor",
+ "short_name": "Pascar",
+ "start_url": "index.html",
+ "display": "standalone",
+ "background_color": "#1c1c1c",
+ "theme_color": "#295991",
+ "icons": [
+ {
+ "src": "icon-192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/index.html b/src/index.html
index 2d46b62..b97709e 100644
--- a/src/index.html
+++ b/src/index.html
@@ -1324,6 +1324,15 @@
e.returnValue = '';
}
});
+
+ // -- Service Worker to make this application work offline
+ if ('serviceWorker' in navigator) {
+ window.addEventListener('load', () => {
+ navigator.serviceWorker.register('sw.js')
+ .then(reg => console.log('Service Worker Registered'))
+ .catch(err => console.log('Registration Failed', err));
+ });
+ }
})();
diff --git a/sw.js b/sw.js
new file mode 100644
index 0000000..e23f278
--- /dev/null
+++ b/sw.js
@@ -0,0 +1,21 @@
+const CACHE_NAME = 'pascar';
+const ASSETS = [
+ 'index.html',
+ 'manifest.json'
+];
+
+// Install: Cache the files
+self.addEventListener('install', (e) => {
+ e.waitUntil(
+ caches.open(CACHE_NAME).then((cache) => cache.addAll(ASSETS))
+ );
+});
+
+// Fetch: Serve from cache if offline
+self.addEventListener('fetch', (e) => {
+ e.respondWith(
+ caches.match(e.request).then((response) => {
+ return response || fetch(e.request);
+ })
+ );
+});
\ No newline at end of file