retold-remote 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/docs/README.md +181 -0
  2. package/docs/_cover.md +14 -0
  3. package/docs/_sidebar.md +10 -0
  4. package/docs/_topbar.md +3 -0
  5. package/docs/audio-viewer.md +133 -0
  6. package/docs/ebook-reader.md +90 -0
  7. package/docs/image-viewer.md +90 -0
  8. package/docs/server-setup.md +262 -0
  9. package/docs/video-viewer.md +134 -0
  10. package/html/docs.html +59 -0
  11. package/package.json +21 -7
  12. package/source/Pict-Application-RetoldRemote.js +143 -2
  13. package/source/RetoldRemote-ExtensionMaps.js +33 -0
  14. package/source/cli/RetoldRemote-Server-Setup.js +82 -67
  15. package/source/cli/commands/RetoldRemote-Command-Serve.js +5 -26
  16. package/source/providers/Pict-Provider-CollectionManager.js +934 -0
  17. package/source/providers/Pict-Provider-FormattingUtilities.js +109 -0
  18. package/source/providers/Pict-Provider-GalleryFilterSort.js +2 -11
  19. package/source/providers/Pict-Provider-GalleryNavigation.js +270 -353
  20. package/source/providers/Pict-Provider-RetoldRemoteIcons.js +52 -0
  21. package/source/providers/Pict-Provider-ToastNotification.js +96 -0
  22. package/source/providers/keyboard-handlers/KeyHandler-AudioExplorer.js +88 -0
  23. package/source/providers/keyboard-handlers/KeyHandler-Gallery.js +190 -0
  24. package/source/providers/keyboard-handlers/KeyHandler-Sidebar.js +65 -0
  25. package/source/providers/keyboard-handlers/KeyHandler-VideoExplorer.js +57 -0
  26. package/source/providers/keyboard-handlers/KeyHandler-Viewer.js +197 -0
  27. package/source/server/RetoldRemote-ArchiveService.js +2 -12
  28. package/source/server/RetoldRemote-AudioWaveformService.js +7 -16
  29. package/source/server/RetoldRemote-CollectionService.js +684 -0
  30. package/source/server/RetoldRemote-EbookService.js +7 -16
  31. package/source/server/RetoldRemote-MediaService.js +3 -14
  32. package/source/server/RetoldRemote-ParimeCache.js +349 -0
  33. package/source/server/RetoldRemote-ThumbnailCache.js +52 -20
  34. package/source/server/RetoldRemote-VideoFrameService.js +7 -15
  35. package/source/views/PictView-Remote-AudioExplorer.js +10 -43
  36. package/source/views/PictView-Remote-CollectionsPanel.js +1087 -0
  37. package/source/views/PictView-Remote-Gallery.js +237 -44
  38. package/source/views/PictView-Remote-ImageViewer.js +1 -34
  39. package/source/views/PictView-Remote-Layout.js +410 -20
  40. package/source/views/PictView-Remote-MediaViewer.js +338 -51
  41. package/source/views/PictView-Remote-SettingsPanel.js +155 -138
  42. package/source/views/PictView-Remote-TopBar.js +615 -14
  43. package/source/views/PictView-Remote-VLCSetup.js +766 -0
  44. package/source/views/PictView-Remote-VideoExplorer.js +20 -54
  45. package/web-application/css/docuserve.css +73 -0
  46. package/web-application/docs/README.md +181 -0
  47. package/web-application/docs/_cover.md +14 -0
  48. package/web-application/docs/_sidebar.md +10 -0
  49. package/web-application/docs/_topbar.md +3 -0
  50. package/web-application/docs/audio-viewer.md +133 -0
  51. package/web-application/docs/ebook-reader.md +90 -0
  52. package/web-application/docs/image-viewer.md +90 -0
  53. package/web-application/docs/server-setup.md +262 -0
  54. package/web-application/docs/video-viewer.md +134 -0
  55. package/web-application/docs.html +59 -0
  56. package/web-application/js/pict-docuserve.min.js +58 -0
  57. package/web-application/js/pict.min.js +2 -2
  58. package/web-application/js/pict.min.js.map +1 -1
  59. package/web-application/retold-remote.js +2558 -439
  60. package/web-application/retold-remote.js.map +1 -1
  61. package/web-application/retold-remote.min.js +41 -11
  62. package/web-application/retold-remote.min.js.map +1 -1
  63. package/server.js +0 -43
@@ -381,6 +381,18 @@ class RetoldRemoteIconProvider extends libPictProvider
381
381
  + '</svg>';
382
382
  },
383
383
 
384
+ 'sidebar': (pSize) =>
385
+ {
386
+ let c = tmpSelf._colors;
387
+ return '<svg width="' + pSize + '" height="' + pSize + '" viewBox="0 0 24 24" fill="none">'
388
+ + '<rect x="3" y="3" width="18" height="18" rx="2" stroke="' + c.Primary + '" stroke-width="1.8" fill="none" />'
389
+ + '<line x1="9" y1="3" x2="9" y2="21" stroke="' + c.Primary + '" stroke-width="1.8" />'
390
+ + '<line x1="5" y1="7.5" x2="7.5" y2="7.5" stroke="' + c.Muted + '" stroke-width="1.2" stroke-linecap="round" />'
391
+ + '<line x1="5" y1="10.5" x2="7.5" y2="10.5" stroke="' + c.Muted + '" stroke-width="1.2" stroke-linecap="round" />'
392
+ + '<line x1="5" y1="13.5" x2="7.5" y2="13.5" stroke="' + c.Muted + '" stroke-width="1.2" stroke-linecap="round" />'
393
+ + '</svg>';
394
+ },
395
+
384
396
  // ====================================================================
385
397
  // NEW MEDIA-SPECIFIC ICONS
386
398
  // Not in the filebrowser set — standalone shapes for viewer fallbacks.
@@ -429,6 +441,46 @@ class RetoldRemoteIconProvider extends libPictProvider
429
441
  + '<line x1="8.1" y1="16" x2="15.9" y2="16" stroke="' + c.Muted + '" stroke-width="1.2" stroke-linecap="round" />'
430
442
  + '<line x1="8.1" y1="19" x2="12" y2="19" stroke="' + c.Muted + '" stroke-width="1.2" stroke-linecap="round" />'
431
443
  + '</svg>';
444
+ },
445
+
446
+ // ---- Collection icons ----
447
+ 'bookmark': (pSize) =>
448
+ {
449
+ let c = tmpSelf._colors;
450
+ return '<svg width="' + pSize + '" height="' + pSize + '" viewBox="0 0 24 24" fill="none">'
451
+ + '<path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="' + c.Primary + '" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" />'
452
+ + '</svg>';
453
+ },
454
+
455
+ 'bookmark-filled': (pSize) =>
456
+ {
457
+ let c = tmpSelf._colors;
458
+ return '<svg width="' + pSize + '" height="' + pSize + '" viewBox="0 0 24 24" fill="none">'
459
+ + '<path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="' + c.Primary + '" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="' + c.Accent + '" />'
460
+ + '</svg>';
461
+ },
462
+
463
+ 'collection': (pSize) =>
464
+ {
465
+ let c = tmpSelf._colors;
466
+ return '<svg width="' + pSize + '" height="' + pSize + '" viewBox="0 0 24 24" fill="none">'
467
+ + '<rect x="4" y="8" width="16" height="12" rx="2" stroke="' + c.Primary + '" stroke-width="1.8" fill="' + c.Light + '" />'
468
+ + '<path d="M7 8V6C7 5.45 7.45 5 8 5H16C16.55 5 17 5.45 17 6V8" stroke="' + c.Primary + '" stroke-width="1.5" fill="none" />'
469
+ + '<path d="M9 5V3.5C9 3.22 9.22 3 9.5 3H14.5C14.78 3 15 3.22 15 3.5V5" stroke="' + c.Muted + '" stroke-width="1.2" fill="none" />'
470
+ + '</svg>';
471
+ },
472
+
473
+ 'drag-handle': (pSize) =>
474
+ {
475
+ let c = tmpSelf._colors;
476
+ return '<svg width="' + pSize + '" height="' + pSize + '" viewBox="0 0 24 24" fill="none">'
477
+ + '<circle cx="9" cy="7" r="1.5" fill="' + c.Muted + '" />'
478
+ + '<circle cx="15" cy="7" r="1.5" fill="' + c.Muted + '" />'
479
+ + '<circle cx="9" cy="12" r="1.5" fill="' + c.Muted + '" />'
480
+ + '<circle cx="15" cy="12" r="1.5" fill="' + c.Muted + '" />'
481
+ + '<circle cx="9" cy="17" r="1.5" fill="' + c.Muted + '" />'
482
+ + '<circle cx="15" cy="17" r="1.5" fill="' + c.Muted + '" />'
483
+ + '</svg>';
432
484
  }
433
485
  };
434
486
  }
@@ -0,0 +1,96 @@
1
+ const libPictProvider = require('pict-provider');
2
+
3
+ const _DefaultProviderConfiguration =
4
+ {
5
+ ProviderIdentifier: 'RetoldRemote-ToastNotification',
6
+ AutoInitialize: true,
7
+ AutoSolveWithApp: false
8
+ };
9
+
10
+ class ToastNotificationProvider extends libPictProvider
11
+ {
12
+ constructor(pFable, pOptions, pServiceHash)
13
+ {
14
+ super(pFable, pOptions, pServiceHash);
15
+ this.serviceType = 'RetoldRemoteProvider';
16
+
17
+ this._overlayTimeout = null;
18
+ }
19
+
20
+ /**
21
+ * Show a brief overlay indicator inside the viewer body.
22
+ *
23
+ * Reuses the #RetoldRemote-FitIndicator element, creating it if needed.
24
+ * Used for fit-mode labels, "Filters cleared", VLC status, etc.
25
+ *
26
+ * @param {string} pMessage - Text to display
27
+ * @param {number} pDuration - Milliseconds before fade-out (default 1500)
28
+ */
29
+ showOverlayIndicator(pMessage, pDuration)
30
+ {
31
+ let tmpDuration = pDuration || 1500;
32
+
33
+ let tmpIndicator = document.getElementById('RetoldRemote-FitIndicator');
34
+ if (!tmpIndicator)
35
+ {
36
+ tmpIndicator = document.createElement('div');
37
+ tmpIndicator.id = 'RetoldRemote-FitIndicator';
38
+ tmpIndicator.className = 'retold-remote-fit-indicator';
39
+
40
+ let tmpContainer = document.querySelector('.retold-remote-viewer-body');
41
+ if (tmpContainer)
42
+ {
43
+ tmpContainer.appendChild(tmpIndicator);
44
+ }
45
+ }
46
+
47
+ tmpIndicator.textContent = pMessage;
48
+ tmpIndicator.classList.add('visible');
49
+
50
+ if (this._overlayTimeout)
51
+ {
52
+ clearTimeout(this._overlayTimeout);
53
+ }
54
+
55
+ this._overlayTimeout = setTimeout(function ()
56
+ {
57
+ tmpIndicator.classList.remove('visible');
58
+ }, tmpDuration);
59
+ }
60
+
61
+ /**
62
+ * Show a page-level toast notification appended to document.body.
63
+ *
64
+ * Used for clipboard copy confirmations, setup status messages, etc.
65
+ *
66
+ * @param {string} pMessage - Text to display
67
+ * @param {number} pDuration - Milliseconds before removal (default 2000)
68
+ */
69
+ showToast(pMessage, pDuration)
70
+ {
71
+ let tmpDuration = pDuration || 2000;
72
+
73
+ let tmpExisting = document.querySelector('.retold-remote-toast');
74
+ if (tmpExisting)
75
+ {
76
+ tmpExisting.remove();
77
+ }
78
+
79
+ let tmpToast = document.createElement('div');
80
+ tmpToast.className = 'retold-remote-toast';
81
+ tmpToast.textContent = pMessage;
82
+ document.body.appendChild(tmpToast);
83
+
84
+ setTimeout(function ()
85
+ {
86
+ if (tmpToast.parentNode)
87
+ {
88
+ tmpToast.remove();
89
+ }
90
+ }, tmpDuration);
91
+ }
92
+ }
93
+
94
+ ToastNotificationProvider.default_configuration = _DefaultProviderConfiguration;
95
+
96
+ module.exports = ToastNotificationProvider;
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Audio explorer mode keyboard handler.
3
+ *
4
+ * @param {GalleryNavigationProvider} pGalleryNav - The provider instance
5
+ * @param {KeyboardEvent} pEvent - The keyboard event
6
+ */
7
+ function handleAudioExplorerKey(pGalleryNav, pEvent)
8
+ {
9
+ let tmpAEX = pGalleryNav.pict.views['RetoldRemote-AudioExplorer'];
10
+ if (!tmpAEX)
11
+ {
12
+ return;
13
+ }
14
+
15
+ switch (pEvent.key)
16
+ {
17
+ case 'Escape':
18
+ pEvent.preventDefault();
19
+ if (tmpAEX._selectionStart >= 0)
20
+ {
21
+ tmpAEX.clearSelection();
22
+ }
23
+ else
24
+ {
25
+ tmpAEX.goBack();
26
+ }
27
+ break;
28
+ case '+':
29
+ case '=':
30
+ pEvent.preventDefault();
31
+ tmpAEX.zoomIn();
32
+ break;
33
+ case '-':
34
+ case '_':
35
+ pEvent.preventDefault();
36
+ tmpAEX.zoomOut();
37
+ break;
38
+ case '0':
39
+ pEvent.preventDefault();
40
+ tmpAEX.zoomToFit();
41
+ break;
42
+ case 'z':
43
+ case 'Z':
44
+ pEvent.preventDefault();
45
+ tmpAEX.zoomToSelection();
46
+ break;
47
+ case ' ':
48
+ pEvent.preventDefault();
49
+ tmpAEX.playSelection();
50
+ break;
51
+
52
+ case 'a':
53
+ pEvent.preventDefault();
54
+ {
55
+ let tmpRemote = pGalleryNav.pict.AppData.RetoldRemote;
56
+ let tmpCollMgr = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
57
+ if (tmpCollMgr)
58
+ {
59
+ if (tmpRemote.LastUsedCollectionGUID)
60
+ {
61
+ tmpCollMgr.addAudioSnippetToCollection(tmpRemote.LastUsedCollectionGUID);
62
+ }
63
+ else
64
+ {
65
+ let tmpTopBar = pGalleryNav.pict.views['ContentEditor-TopBar'];
66
+ if (tmpTopBar && typeof tmpTopBar.showAddToCollectionDropdown === 'function')
67
+ {
68
+ tmpTopBar.showAddToCollectionDropdown();
69
+ }
70
+ }
71
+ }
72
+ }
73
+ break;
74
+
75
+ case 'b':
76
+ pEvent.preventDefault();
77
+ {
78
+ let tmpCollManager = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
79
+ if (tmpCollManager)
80
+ {
81
+ tmpCollManager.togglePanel();
82
+ }
83
+ }
84
+ break;
85
+ }
86
+ }
87
+
88
+ module.exports = handleAudioExplorerKey;
@@ -0,0 +1,190 @@
1
+ /**
2
+ * Gallery mode keyboard handler.
3
+ *
4
+ * @param {GalleryNavigationProvider} pGalleryNav - The provider instance
5
+ * @param {KeyboardEvent} pEvent - The keyboard event
6
+ */
7
+ function handleGalleryKey(pGalleryNav, pEvent)
8
+ {
9
+ let tmpRemote = pGalleryNav.pict.AppData.RetoldRemote;
10
+ let tmpItems = tmpRemote.GalleryItems || [];
11
+ let tmpIndex = tmpRemote.GalleryCursorIndex || 0;
12
+
13
+ switch (pEvent.key)
14
+ {
15
+ case 'ArrowRight':
16
+ pEvent.preventDefault();
17
+ pGalleryNav.moveCursor(Math.min(tmpIndex + 1, tmpItems.length - 1));
18
+ break;
19
+
20
+ case 'ArrowLeft':
21
+ pEvent.preventDefault();
22
+ pGalleryNav.moveCursor(Math.max(tmpIndex - 1, 0));
23
+ break;
24
+
25
+ case 'ArrowDown':
26
+ pEvent.preventDefault();
27
+ pGalleryNav.moveCursor(Math.min(tmpIndex + pGalleryNav._columnsPerRow, tmpItems.length - 1));
28
+ break;
29
+
30
+ case 'ArrowUp':
31
+ pEvent.preventDefault();
32
+ pGalleryNav.moveCursor(Math.max(tmpIndex - pGalleryNav._columnsPerRow, 0));
33
+ break;
34
+
35
+ case 'Enter':
36
+ pEvent.preventDefault();
37
+ pGalleryNav.openCurrent();
38
+ break;
39
+
40
+ case 'Escape':
41
+ pEvent.preventDefault();
42
+ pGalleryNav.navigateUp();
43
+ break;
44
+
45
+ case 'g':
46
+ pEvent.preventDefault();
47
+ pGalleryNav._toggleViewMode();
48
+ break;
49
+
50
+ case 'x':
51
+ pEvent.preventDefault();
52
+ pGalleryNav._clearAllFilters();
53
+ break;
54
+
55
+ case 'Home':
56
+ pEvent.preventDefault();
57
+ pGalleryNav.moveCursor(0);
58
+ break;
59
+
60
+ case 'End':
61
+ pEvent.preventDefault();
62
+ pGalleryNav.moveCursor(tmpItems.length - 1);
63
+ break;
64
+
65
+ case '1':
66
+ pEvent.preventDefault();
67
+ pGalleryNav.openCurrentAs('image');
68
+ break;
69
+
70
+ case '2':
71
+ pEvent.preventDefault();
72
+ pGalleryNav.openCurrentAs('video');
73
+ break;
74
+
75
+ case '3':
76
+ pEvent.preventDefault();
77
+ pGalleryNav.openCurrentAs('audio');
78
+ break;
79
+
80
+ case '4':
81
+ pEvent.preventDefault();
82
+ pGalleryNav.openCurrentAs('text');
83
+ break;
84
+
85
+ case 'f':
86
+ pEvent.preventDefault();
87
+ {
88
+ // Ensure the filter bar is visible first
89
+ pGalleryNav._showFilterBar();
90
+ let tmpGalleryView = pGalleryNav.pict.views['RetoldRemote-Gallery'];
91
+ if (tmpGalleryView)
92
+ {
93
+ tmpGalleryView.toggleFilterPanel();
94
+ }
95
+ }
96
+ break;
97
+
98
+ case 's':
99
+ pEvent.preventDefault();
100
+ {
101
+ // Ensure the filter bar is visible first
102
+ pGalleryNav._showFilterBar();
103
+ setTimeout(() =>
104
+ {
105
+ let tmpSortSelect = document.getElementById('RetoldRemote-Gallery-Sort');
106
+ if (tmpSortSelect)
107
+ {
108
+ tmpSortSelect.focus();
109
+ }
110
+ }, 50);
111
+ }
112
+ break;
113
+
114
+ case 'c':
115
+ pEvent.preventDefault();
116
+ pGalleryNav._toggleSettingsPanel();
117
+ break;
118
+
119
+ case 'a':
120
+ pEvent.preventDefault();
121
+ {
122
+ let tmpCollMgr = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
123
+ if (tmpCollMgr)
124
+ {
125
+ let tmpCursorItem = tmpItems[tmpIndex];
126
+ if (tmpCursorItem && tmpRemote.LastUsedCollectionGUID)
127
+ {
128
+ // Quick-add the highlighted gallery item to the last-used collection
129
+ let tmpAddItem =
130
+ {
131
+ Type: (tmpCursorItem.Type === 'folder' || tmpCursorItem.Type === 'archive') ? 'folder' : 'file',
132
+ Path: tmpCursorItem.Path || '',
133
+ Hash: tmpCursorItem.Hash || '',
134
+ Label: ''
135
+ };
136
+ tmpCollMgr.addItemsToCollection(tmpRemote.LastUsedCollectionGUID, [tmpAddItem]);
137
+ }
138
+ else
139
+ {
140
+ // No last-used collection or no item — open the topbar dropdown
141
+ let tmpTopBar = pGalleryNav.pict.views['ContentEditor-TopBar'];
142
+ if (tmpTopBar && typeof tmpTopBar.showAddToCollectionDropdown === 'function')
143
+ {
144
+ tmpTopBar.showAddToCollectionDropdown();
145
+ }
146
+ }
147
+ }
148
+ }
149
+ break;
150
+
151
+ case 'b':
152
+ pEvent.preventDefault();
153
+ {
154
+ let tmpCollManager = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
155
+ if (tmpCollManager)
156
+ {
157
+ tmpCollManager.togglePanel();
158
+ }
159
+ }
160
+ break;
161
+
162
+ case 'd':
163
+ pEvent.preventDefault();
164
+ pGalleryNav._toggleDistractionFree();
165
+ break;
166
+
167
+ case 'e':
168
+ pEvent.preventDefault();
169
+ {
170
+ let tmpItem = tmpItems[tmpIndex];
171
+ if (tmpItem && tmpItem.Type !== 'folder' && tmpItem.Type !== 'archive')
172
+ {
173
+ let tmpFilterSort = pGalleryNav.pict.providers['RetoldRemote-GalleryFilterSort'];
174
+ let tmpCat = tmpFilterSort ? tmpFilterSort.getCategory(tmpItem.Extension) : '';
175
+ if (tmpCat === 'video')
176
+ {
177
+ let tmpVEX = pGalleryNav.pict.views['RetoldRemote-VideoExplorer'];
178
+ if (tmpVEX)
179
+ {
180
+ tmpVEX.showExplorer(tmpItem.Path);
181
+ }
182
+ }
183
+ }
184
+ }
185
+ break;
186
+
187
+ }
188
+ }
189
+
190
+ module.exports = handleGalleryKey;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Sidebar file list keyboard handler.
3
+ *
4
+ * @param {GalleryNavigationProvider} pGalleryNav - The provider instance
5
+ * @param {KeyboardEvent} pEvent - The keyboard event
6
+ */
7
+ function handleSidebarKey(pGalleryNav, pEvent)
8
+ {
9
+ let tmpRows = document.querySelectorAll('#Pict-FileBrowser-DetailRows .pict-fb-detail-row');
10
+ let tmpCount = tmpRows.length;
11
+
12
+ if (tmpCount === 0)
13
+ {
14
+ // Nothing in the sidebar, bail back to gallery
15
+ pGalleryNav._blurSidebar();
16
+ return;
17
+ }
18
+
19
+ switch (pEvent.key)
20
+ {
21
+ case 'ArrowDown':
22
+ pEvent.preventDefault();
23
+ pGalleryNav._moveSidebarCursor(Math.min(pGalleryNav._sidebarCursorIndex + 1, tmpCount - 1));
24
+ break;
25
+
26
+ case 'ArrowUp':
27
+ pEvent.preventDefault();
28
+ pGalleryNav._moveSidebarCursor(Math.max(pGalleryNav._sidebarCursorIndex - 1, 0));
29
+ break;
30
+
31
+ case 'Home':
32
+ pEvent.preventDefault();
33
+ pGalleryNav._moveSidebarCursor(0);
34
+ break;
35
+
36
+ case 'End':
37
+ pEvent.preventDefault();
38
+ pGalleryNav._moveSidebarCursor(tmpCount - 1);
39
+ break;
40
+
41
+ case 'Enter':
42
+ pEvent.preventDefault();
43
+ {
44
+ // Click the focused row to open it (folder or file)
45
+ let tmpRow = tmpRows[pGalleryNav._sidebarCursorIndex];
46
+ if (tmpRow)
47
+ {
48
+ // Fire the dblclick handler which opens folders / selects files
49
+ let tmpDblClickHandler = tmpRow.getAttribute('ondblclick');
50
+ if (tmpDblClickHandler)
51
+ {
52
+ new Function(tmpDblClickHandler).call(tmpRow);
53
+ }
54
+ }
55
+ }
56
+ break;
57
+
58
+ case 'Escape':
59
+ pEvent.preventDefault();
60
+ pGalleryNav._blurSidebar();
61
+ break;
62
+ }
63
+ }
64
+
65
+ module.exports = handleSidebarKey;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Video explorer mode keyboard handler.
3
+ *
4
+ * @param {GalleryNavigationProvider} pGalleryNav - The provider instance
5
+ * @param {KeyboardEvent} pEvent - The keyboard event
6
+ */
7
+ function handleVideoExplorerKey(pGalleryNav, pEvent)
8
+ {
9
+ let tmpRemote = pGalleryNav.pict.AppData.RetoldRemote;
10
+
11
+ switch (pEvent.key)
12
+ {
13
+ case 'Escape':
14
+ pEvent.preventDefault();
15
+ let tmpVEX = pGalleryNav.pict.views['RetoldRemote-VideoExplorer'];
16
+ if (tmpVEX)
17
+ {
18
+ tmpVEX.goBack();
19
+ }
20
+ break;
21
+
22
+ case 'a':
23
+ pEvent.preventDefault();
24
+ {
25
+ let tmpCollMgr = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
26
+ if (tmpCollMgr)
27
+ {
28
+ if (tmpRemote.LastUsedCollectionGUID)
29
+ {
30
+ tmpCollMgr.addVideoFrameToCollection(tmpRemote.LastUsedCollectionGUID);
31
+ }
32
+ else
33
+ {
34
+ let tmpTopBar = pGalleryNav.pict.views['ContentEditor-TopBar'];
35
+ if (tmpTopBar && typeof tmpTopBar.showAddToCollectionDropdown === 'function')
36
+ {
37
+ tmpTopBar.showAddToCollectionDropdown();
38
+ }
39
+ }
40
+ }
41
+ }
42
+ break;
43
+
44
+ case 'b':
45
+ pEvent.preventDefault();
46
+ {
47
+ let tmpCollManager = pGalleryNav.pict.providers['RetoldRemote-CollectionManager'];
48
+ if (tmpCollManager)
49
+ {
50
+ tmpCollManager.togglePanel();
51
+ }
52
+ }
53
+ break;
54
+ }
55
+ }
56
+
57
+ module.exports = handleVideoExplorerKey;