retold-remote 0.0.1
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.
- package/LICENSE +21 -0
- package/css/retold-remote.css +83 -0
- package/html/codejar.js +511 -0
- package/html/index.html +23 -0
- package/package.json +68 -0
- package/server.js +43 -0
- package/source/Pict-Application-RetoldRemote-Configuration.json +7 -0
- package/source/Pict-Application-RetoldRemote.js +622 -0
- package/source/Pict-RetoldRemote-Bundle.js +14 -0
- package/source/cli/RetoldRemote-CLI-Program.js +15 -0
- package/source/cli/RetoldRemote-CLI-Run.js +3 -0
- package/source/cli/RetoldRemote-Server-Setup.js +257 -0
- package/source/cli/commands/RetoldRemote-Command-Serve.js +87 -0
- package/source/providers/Pict-Provider-GalleryFilterSort.js +597 -0
- package/source/providers/Pict-Provider-GalleryNavigation.js +819 -0
- package/source/providers/Pict-Provider-RetoldRemote.js +273 -0
- package/source/providers/Pict-Provider-RetoldRemoteIcons.js +640 -0
- package/source/providers/Pict-Provider-RetoldRemoteTheme.js +879 -0
- package/source/server/RetoldRemote-MediaService.js +536 -0
- package/source/server/RetoldRemote-PathRegistry.js +121 -0
- package/source/server/RetoldRemote-ThumbnailCache.js +89 -0
- package/source/server/RetoldRemote-ToolDetector.js +78 -0
- package/source/views/PictView-Remote-Gallery.js +1437 -0
- package/source/views/PictView-Remote-ImageViewer.js +363 -0
- package/source/views/PictView-Remote-Layout.js +420 -0
- package/source/views/PictView-Remote-MediaViewer.js +530 -0
- package/source/views/PictView-Remote-SettingsPanel.js +318 -0
- package/source/views/PictView-Remote-TopBar.js +206 -0
- package/web-application/codejar.js +511 -0
- package/web-application/css/retold-remote.css +83 -0
- package/web-application/index.html +23 -0
- package/web-application/js/pict.min.js +12 -0
- package/web-application/js/pict.min.js.map +1 -0
- package/web-application/retold-remote.compatible.js +5764 -0
- package/web-application/retold-remote.compatible.js.map +1 -0
- package/web-application/retold-remote.compatible.min.js +120 -0
- package/web-application/retold-remote.compatible.min.js.map +1 -0
- package/web-application/retold-remote.js +5763 -0
- package/web-application/retold-remote.js.map +1 -0
- package/web-application/retold-remote.min.js +120 -0
- package/web-application/retold-remote.min.js.map +1 -0
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _ViewConfiguration =
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: "RetoldRemote-SettingsPanel",
|
|
6
|
+
DefaultRenderable: "RetoldRemote-SettingsPanel",
|
|
7
|
+
DefaultDestinationAddress: "#RetoldRemote-Settings-Container",
|
|
8
|
+
AutoRender: false,
|
|
9
|
+
|
|
10
|
+
CSS: /*css*/`
|
|
11
|
+
.retold-remote-settings
|
|
12
|
+
{
|
|
13
|
+
padding: 12px;
|
|
14
|
+
}
|
|
15
|
+
.retold-remote-settings-section
|
|
16
|
+
{
|
|
17
|
+
margin-bottom: 16px;
|
|
18
|
+
}
|
|
19
|
+
.retold-remote-settings-section-title
|
|
20
|
+
{
|
|
21
|
+
font-size: 0.7rem;
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
text-transform: uppercase;
|
|
24
|
+
letter-spacing: 0.5px;
|
|
25
|
+
color: var(--retold-text-dim);
|
|
26
|
+
margin-bottom: 8px;
|
|
27
|
+
}
|
|
28
|
+
.retold-remote-settings-row
|
|
29
|
+
{
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
padding: 4px 0;
|
|
34
|
+
}
|
|
35
|
+
.retold-remote-settings-label
|
|
36
|
+
{
|
|
37
|
+
font-size: 0.78rem;
|
|
38
|
+
color: var(--retold-text-secondary);
|
|
39
|
+
}
|
|
40
|
+
.retold-remote-settings-select
|
|
41
|
+
{
|
|
42
|
+
padding: 3px 8px;
|
|
43
|
+
border: 1px solid var(--retold-border);
|
|
44
|
+
border-radius: 3px;
|
|
45
|
+
background: var(--retold-bg-tertiary);
|
|
46
|
+
color: var(--retold-text-secondary);
|
|
47
|
+
font-size: 0.75rem;
|
|
48
|
+
font-family: inherit;
|
|
49
|
+
}
|
|
50
|
+
.retold-remote-settings-checkbox
|
|
51
|
+
{
|
|
52
|
+
accent-color: var(--retold-accent);
|
|
53
|
+
}
|
|
54
|
+
.retold-remote-settings-capabilities
|
|
55
|
+
{
|
|
56
|
+
margin-top: 12px;
|
|
57
|
+
padding: 8px;
|
|
58
|
+
background: var(--retold-bg-secondary);
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
font-size: 0.72rem;
|
|
61
|
+
}
|
|
62
|
+
.retold-remote-settings-cap-row
|
|
63
|
+
{
|
|
64
|
+
display: flex;
|
|
65
|
+
justify-content: space-between;
|
|
66
|
+
padding: 2px 0;
|
|
67
|
+
}
|
|
68
|
+
.retold-remote-settings-cap-label
|
|
69
|
+
{
|
|
70
|
+
color: var(--retold-text-dim);
|
|
71
|
+
}
|
|
72
|
+
.retold-remote-settings-cap-yes
|
|
73
|
+
{
|
|
74
|
+
color: var(--retold-accent);
|
|
75
|
+
}
|
|
76
|
+
.retold-remote-settings-cap-no
|
|
77
|
+
{
|
|
78
|
+
color: var(--retold-danger-muted);
|
|
79
|
+
}
|
|
80
|
+
`
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
class RetoldRemoteSettingsPanelView extends libPictView
|
|
84
|
+
{
|
|
85
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
86
|
+
{
|
|
87
|
+
super(pFable, pOptions, pServiceHash);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
onAfterRender()
|
|
91
|
+
{
|
|
92
|
+
super.onAfterRender();
|
|
93
|
+
this._renderSettingsContent();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
_renderSettingsContent()
|
|
97
|
+
{
|
|
98
|
+
let tmpContainer = document.getElementById('RetoldRemote-Settings-Container');
|
|
99
|
+
if (!tmpContainer)
|
|
100
|
+
{
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
105
|
+
let tmpCapabilities = tmpRemote.ServerCapabilities || {};
|
|
106
|
+
|
|
107
|
+
let tmpHTML = '<div class="retold-remote-settings">';
|
|
108
|
+
|
|
109
|
+
// Appearance section (theme dropdown)
|
|
110
|
+
tmpHTML += '<div class="retold-remote-settings-section">';
|
|
111
|
+
tmpHTML += '<div class="retold-remote-settings-section-title">Appearance</div>';
|
|
112
|
+
|
|
113
|
+
tmpHTML += '<div class="retold-remote-settings-row">';
|
|
114
|
+
tmpHTML += '<span class="retold-remote-settings-label">Theme</span>';
|
|
115
|
+
tmpHTML += '<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';
|
|
116
|
+
|
|
117
|
+
let tmpThemeProvider = this.pict.providers['RetoldRemote-Theme'];
|
|
118
|
+
if (tmpThemeProvider)
|
|
119
|
+
{
|
|
120
|
+
let tmpThemes = tmpThemeProvider.getThemeList();
|
|
121
|
+
let tmpCurrentTheme = tmpThemeProvider.getCurrentTheme();
|
|
122
|
+
let tmpCurrentCategory = '';
|
|
123
|
+
|
|
124
|
+
for (let i = 0; i < tmpThemes.length; i++)
|
|
125
|
+
{
|
|
126
|
+
let tmpTheme = tmpThemes[i];
|
|
127
|
+
if (tmpTheme.category !== tmpCurrentCategory)
|
|
128
|
+
{
|
|
129
|
+
if (tmpCurrentCategory)
|
|
130
|
+
{
|
|
131
|
+
tmpHTML += '</optgroup>';
|
|
132
|
+
}
|
|
133
|
+
tmpHTML += '<optgroup label="' + tmpTheme.category + '">';
|
|
134
|
+
tmpCurrentCategory = tmpTheme.category;
|
|
135
|
+
}
|
|
136
|
+
tmpHTML += '<option value="' + tmpTheme.key + '"'
|
|
137
|
+
+ (tmpTheme.key === tmpCurrentTheme ? ' selected' : '')
|
|
138
|
+
+ '>' + tmpTheme.name + '</option>';
|
|
139
|
+
}
|
|
140
|
+
if (tmpCurrentCategory)
|
|
141
|
+
{
|
|
142
|
+
tmpHTML += '</optgroup>';
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
tmpHTML += '</select>';
|
|
147
|
+
tmpHTML += '</div>';
|
|
148
|
+
tmpHTML += '</div>'; // end appearance section
|
|
149
|
+
|
|
150
|
+
// Gallery section
|
|
151
|
+
tmpHTML += '<div class="retold-remote-settings-section">';
|
|
152
|
+
tmpHTML += '<div class="retold-remote-settings-section-title">Gallery</div>';
|
|
153
|
+
|
|
154
|
+
// Thumbnail size
|
|
155
|
+
tmpHTML += '<div class="retold-remote-settings-row">';
|
|
156
|
+
tmpHTML += '<span class="retold-remote-settings-label">Thumbnail size</span>';
|
|
157
|
+
tmpHTML += '<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSetting(\'ThumbnailSize\', this.value)">';
|
|
158
|
+
tmpHTML += '<option value="small"' + (tmpRemote.ThumbnailSize === 'small' ? ' selected' : '') + '>Small</option>';
|
|
159
|
+
tmpHTML += '<option value="medium"' + (tmpRemote.ThumbnailSize === 'medium' ? ' selected' : '') + '>Medium</option>';
|
|
160
|
+
tmpHTML += '<option value="large"' + (tmpRemote.ThumbnailSize === 'large' ? ' selected' : '') + '>Large</option>';
|
|
161
|
+
tmpHTML += '</select>';
|
|
162
|
+
tmpHTML += '</div>';
|
|
163
|
+
|
|
164
|
+
// Default view mode
|
|
165
|
+
tmpHTML += '<div class="retold-remote-settings-row">';
|
|
166
|
+
tmpHTML += '<span class="retold-remote-settings-label">Default view</span>';
|
|
167
|
+
tmpHTML += '<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSetting(\'ViewMode\', this.value)">';
|
|
168
|
+
tmpHTML += '<option value="gallery"' + (tmpRemote.ViewMode === 'gallery' ? ' selected' : '') + '>Gallery</option>';
|
|
169
|
+
tmpHTML += '<option value="list"' + (tmpRemote.ViewMode === 'list' ? ' selected' : '') + '>List</option>';
|
|
170
|
+
tmpHTML += '</select>';
|
|
171
|
+
tmpHTML += '</div>';
|
|
172
|
+
|
|
173
|
+
// Show hidden files
|
|
174
|
+
tmpHTML += '<div class="retold-remote-settings-row">';
|
|
175
|
+
tmpHTML += '<span class="retold-remote-settings-label">Show hidden files</span>';
|
|
176
|
+
tmpHTML += '<input type="checkbox" class="retold-remote-settings-checkbox"'
|
|
177
|
+
+ (tmpRemote.ShowHiddenFiles ? ' checked' : '')
|
|
178
|
+
+ ' onchange="pict.views[\'RetoldRemote-SettingsPanel\'].toggleHiddenFiles(this.checked)">';
|
|
179
|
+
tmpHTML += '</div>';
|
|
180
|
+
|
|
181
|
+
// Navigation bar in distraction-free
|
|
182
|
+
tmpHTML += '<div class="retold-remote-settings-row">';
|
|
183
|
+
tmpHTML += '<span class="retold-remote-settings-label">Nav bar in distraction-free</span>';
|
|
184
|
+
tmpHTML += '<input type="checkbox" class="retold-remote-settings-checkbox"'
|
|
185
|
+
+ (tmpRemote.DistractionFreeShowNav ? ' checked' : '')
|
|
186
|
+
+ ' onchange="pict.views[\'RetoldRemote-SettingsPanel\'].toggleDistractionFreeNav(this.checked)">';
|
|
187
|
+
tmpHTML += '</div>';
|
|
188
|
+
|
|
189
|
+
tmpHTML += '</div>'; // end gallery section
|
|
190
|
+
|
|
191
|
+
// Server capabilities
|
|
192
|
+
tmpHTML += '<div class="retold-remote-settings-section">';
|
|
193
|
+
tmpHTML += '<div class="retold-remote-settings-section-title">Server Capabilities</div>';
|
|
194
|
+
tmpHTML += '<div class="retold-remote-settings-capabilities">';
|
|
195
|
+
|
|
196
|
+
let tmpTools = [
|
|
197
|
+
{ key: 'sharp', label: 'Sharp (image thumbnails)' },
|
|
198
|
+
{ key: 'imagemagick', label: 'ImageMagick (image fallback)' },
|
|
199
|
+
{ key: 'ffmpeg', label: 'ffmpeg (video thumbnails)' },
|
|
200
|
+
{ key: 'ffprobe', label: 'ffprobe (media metadata)' }
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
for (let i = 0; i < tmpTools.length; i++)
|
|
204
|
+
{
|
|
205
|
+
let tmpTool = tmpTools[i];
|
|
206
|
+
let tmpAvailable = tmpCapabilities[tmpTool.key];
|
|
207
|
+
tmpHTML += '<div class="retold-remote-settings-cap-row">';
|
|
208
|
+
tmpHTML += '<span class="retold-remote-settings-cap-label">' + tmpTool.label + '</span>';
|
|
209
|
+
tmpHTML += '<span class="' + (tmpAvailable ? 'retold-remote-settings-cap-yes' : 'retold-remote-settings-cap-no') + '">'
|
|
210
|
+
+ (tmpAvailable ? 'Available' : 'Not found') + '</span>';
|
|
211
|
+
tmpHTML += '</div>';
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Hashed filenames status
|
|
215
|
+
tmpHTML += '<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">';
|
|
216
|
+
tmpHTML += '<span class="retold-remote-settings-cap-label">Hashed filenames</span>';
|
|
217
|
+
tmpHTML += '<span class="' + (tmpRemote.HashedFilenames ? 'retold-remote-settings-cap-yes' : 'retold-remote-settings-cap-no') + '">'
|
|
218
|
+
+ (tmpRemote.HashedFilenames ? 'Enabled' : 'Disabled') + '</span>';
|
|
219
|
+
tmpHTML += '</div>';
|
|
220
|
+
|
|
221
|
+
tmpHTML += '</div>';
|
|
222
|
+
tmpHTML += '</div>'; // end capabilities section
|
|
223
|
+
|
|
224
|
+
// Keyboard shortcuts
|
|
225
|
+
tmpHTML += '<div class="retold-remote-settings-section">';
|
|
226
|
+
tmpHTML += '<div class="retold-remote-settings-section-title">Keyboard Shortcuts</div>';
|
|
227
|
+
|
|
228
|
+
let tmpShortcuts = [
|
|
229
|
+
{ key: 'Arrow keys', desc: 'Navigate gallery' },
|
|
230
|
+
{ key: 'Enter', desc: 'Open item' },
|
|
231
|
+
{ key: 'Escape', desc: 'Back / close' },
|
|
232
|
+
{ key: 'j / k', desc: 'Next / prev in viewer' },
|
|
233
|
+
{ key: 'f', desc: 'Fullscreen' },
|
|
234
|
+
{ key: 'i', desc: 'File info' },
|
|
235
|
+
{ key: 'Space', desc: 'Play / pause' },
|
|
236
|
+
{ key: '+ / -', desc: 'Zoom in / out' },
|
|
237
|
+
{ key: '0', desc: 'Reset zoom' },
|
|
238
|
+
{ key: 'g', desc: 'Toggle grid / list' },
|
|
239
|
+
{ key: '/', desc: 'Focus search' }
|
|
240
|
+
];
|
|
241
|
+
|
|
242
|
+
for (let i = 0; i < tmpShortcuts.length; i++)
|
|
243
|
+
{
|
|
244
|
+
tmpHTML += '<div class="retold-remote-settings-cap-row">';
|
|
245
|
+
tmpHTML += '<span class="retold-remote-settings-cap-label">' + tmpShortcuts[i].desc + '</span>';
|
|
246
|
+
tmpHTML += '<span style="color: var(--retold-accent); font-family: var(--retold-font-mono, monospace);">' + tmpShortcuts[i].key + '</span>';
|
|
247
|
+
tmpHTML += '</div>';
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
tmpHTML += '</div>'; // end shortcuts section
|
|
251
|
+
|
|
252
|
+
tmpHTML += '</div>'; // end settings
|
|
253
|
+
|
|
254
|
+
tmpContainer.innerHTML = tmpHTML;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
changeTheme(pThemeKey)
|
|
258
|
+
{
|
|
259
|
+
let tmpThemeProvider = this.pict.providers['RetoldRemote-Theme'];
|
|
260
|
+
if (tmpThemeProvider)
|
|
261
|
+
{
|
|
262
|
+
tmpThemeProvider.applyTheme(pThemeKey);
|
|
263
|
+
this.pict.PictApplication.saveSettings();
|
|
264
|
+
|
|
265
|
+
// Re-render settings to update dropdown selection
|
|
266
|
+
this._renderSettingsContent();
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
changeSetting(pKey, pValue)
|
|
271
|
+
{
|
|
272
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
273
|
+
tmpRemote[pKey] = pValue;
|
|
274
|
+
this.pict.PictApplication.saveSettings();
|
|
275
|
+
|
|
276
|
+
// Re-render gallery if visible
|
|
277
|
+
if (tmpRemote.ActiveMode === 'gallery')
|
|
278
|
+
{
|
|
279
|
+
let tmpGalleryView = this.pict.views['RetoldRemote-Gallery'];
|
|
280
|
+
if (tmpGalleryView)
|
|
281
|
+
{
|
|
282
|
+
tmpGalleryView.renderGallery();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
toggleHiddenFiles(pChecked)
|
|
288
|
+
{
|
|
289
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
290
|
+
tmpRemote.ShowHiddenFiles = pChecked;
|
|
291
|
+
this.pict.PictApplication.saveSettings();
|
|
292
|
+
this.pict.PictApplication.syncHiddenFilesSetting(() =>
|
|
293
|
+
{
|
|
294
|
+
this.pict.PictApplication.loadFileList();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
toggleDistractionFreeNav(pChecked)
|
|
299
|
+
{
|
|
300
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
301
|
+
tmpRemote.DistractionFreeShowNav = pChecked;
|
|
302
|
+
this.pict.PictApplication.saveSettings();
|
|
303
|
+
|
|
304
|
+
// If currently in distraction-free mode, apply immediately
|
|
305
|
+
if (tmpRemote._distractionFreeMode)
|
|
306
|
+
{
|
|
307
|
+
let tmpViewerHeader = document.querySelector('.retold-remote-viewer-header');
|
|
308
|
+
if (tmpViewerHeader)
|
|
309
|
+
{
|
|
310
|
+
tmpViewerHeader.style.display = pChecked ? '' : 'none';
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
RetoldRemoteSettingsPanelView.default_configuration = _ViewConfiguration;
|
|
317
|
+
|
|
318
|
+
module.exports = RetoldRemoteSettingsPanelView;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
const libPictView = require('pict-view');
|
|
2
|
+
|
|
3
|
+
const _ViewConfiguration =
|
|
4
|
+
{
|
|
5
|
+
ViewIdentifier: "ContentEditor-TopBar",
|
|
6
|
+
|
|
7
|
+
DefaultRenderable: "RetoldRemote-TopBar",
|
|
8
|
+
DefaultDestinationAddress: "#ContentEditor-TopBar-Container",
|
|
9
|
+
|
|
10
|
+
AutoRender: false,
|
|
11
|
+
|
|
12
|
+
CSS: /*css*/`
|
|
13
|
+
.retold-remote-topbar
|
|
14
|
+
{
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
height: 40px;
|
|
18
|
+
padding: 0 16px;
|
|
19
|
+
background: var(--retold-bg-secondary);
|
|
20
|
+
border-bottom: 1px solid var(--retold-border);
|
|
21
|
+
gap: 16px;
|
|
22
|
+
}
|
|
23
|
+
.retold-remote-topbar-brand
|
|
24
|
+
{
|
|
25
|
+
font-size: 0.85rem;
|
|
26
|
+
font-weight: 700;
|
|
27
|
+
color: var(--retold-accent);
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
.retold-remote-topbar-location
|
|
31
|
+
{
|
|
32
|
+
flex: 1;
|
|
33
|
+
font-size: 0.82rem;
|
|
34
|
+
color: var(--retold-text-muted);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
text-overflow: ellipsis;
|
|
37
|
+
white-space: nowrap;
|
|
38
|
+
text-align: center;
|
|
39
|
+
}
|
|
40
|
+
.retold-remote-topbar-location-crumb
|
|
41
|
+
{
|
|
42
|
+
color: var(--retold-accent);
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
}
|
|
46
|
+
.retold-remote-topbar-location-crumb:hover
|
|
47
|
+
{
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
}
|
|
50
|
+
.retold-remote-topbar-sep
|
|
51
|
+
{
|
|
52
|
+
color: var(--retold-text-placeholder);
|
|
53
|
+
margin: 0 3px;
|
|
54
|
+
}
|
|
55
|
+
.retold-remote-topbar-info
|
|
56
|
+
{
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
font-size: 0.75rem;
|
|
59
|
+
color: var(--retold-text-dim);
|
|
60
|
+
}
|
|
61
|
+
.retold-remote-topbar-actions
|
|
62
|
+
{
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
}
|
|
67
|
+
.retold-remote-topbar-btn
|
|
68
|
+
{
|
|
69
|
+
padding: 4px 10px;
|
|
70
|
+
border: 1px solid var(--retold-border);
|
|
71
|
+
border-radius: 3px;
|
|
72
|
+
background: transparent;
|
|
73
|
+
color: var(--retold-text-muted);
|
|
74
|
+
font-size: 0.75rem;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transition: color 0.15s, border-color 0.15s;
|
|
77
|
+
font-family: inherit;
|
|
78
|
+
}
|
|
79
|
+
.retold-remote-topbar-btn:hover
|
|
80
|
+
{
|
|
81
|
+
color: var(--retold-text-primary);
|
|
82
|
+
border-color: var(--retold-accent);
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
|
|
86
|
+
Templates:
|
|
87
|
+
[
|
|
88
|
+
{
|
|
89
|
+
Hash: "RetoldRemote-TopBar",
|
|
90
|
+
Template: /*html*/`
|
|
91
|
+
<div class="retold-remote-topbar">
|
|
92
|
+
<div class="retold-remote-topbar-brand">Retold Remote</div>
|
|
93
|
+
<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>
|
|
94
|
+
<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>
|
|
95
|
+
<div class="retold-remote-topbar-actions">
|
|
96
|
+
<button class="retold-remote-topbar-btn" onclick="pict.views['ContentEditor-Layout'].toggleSidebar()" title="Toggle Sidebar">☰</button>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
`
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
|
|
103
|
+
Renderables:
|
|
104
|
+
[
|
|
105
|
+
{
|
|
106
|
+
RenderableHash: "RetoldRemote-TopBar",
|
|
107
|
+
TemplateHash: "RetoldRemote-TopBar",
|
|
108
|
+
DestinationAddress: "#ContentEditor-TopBar-Container"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
class RetoldRemoteTopBarView extends libPictView
|
|
114
|
+
{
|
|
115
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
116
|
+
{
|
|
117
|
+
super(pFable, pOptions, pServiceHash);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
onAfterRender()
|
|
121
|
+
{
|
|
122
|
+
super.onAfterRender();
|
|
123
|
+
this.updateLocation();
|
|
124
|
+
this.updateInfo();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Update the breadcrumb location display.
|
|
129
|
+
*/
|
|
130
|
+
updateLocation()
|
|
131
|
+
{
|
|
132
|
+
let tmpLocationEl = document.getElementById('RetoldRemote-TopBar-Location');
|
|
133
|
+
if (!tmpLocationEl)
|
|
134
|
+
{
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
139
|
+
let tmpCurrentLocation = (this.pict.AppData.PictFileBrowser && this.pict.AppData.PictFileBrowser.CurrentLocation) || '';
|
|
140
|
+
|
|
141
|
+
if (!tmpCurrentLocation)
|
|
142
|
+
{
|
|
143
|
+
tmpLocationEl.innerHTML = '<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\'\')">/</span>';
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let tmpParts = tmpCurrentLocation.split('/').filter((p) => p);
|
|
148
|
+
let tmpHTML = '<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\'\')">/</span>';
|
|
149
|
+
|
|
150
|
+
for (let i = 0; i < tmpParts.length; i++)
|
|
151
|
+
{
|
|
152
|
+
let tmpPath = tmpParts.slice(0, i + 1).join('/');
|
|
153
|
+
tmpHTML += '<span class="retold-remote-topbar-sep">/</span>';
|
|
154
|
+
tmpHTML += '<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\'' + tmpPath + '\')">' + tmpParts[i] + '</span>';
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
tmpLocationEl.innerHTML = tmpHTML;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Update the info display with folder summary.
|
|
162
|
+
*/
|
|
163
|
+
updateInfo()
|
|
164
|
+
{
|
|
165
|
+
let tmpInfoEl = document.getElementById('RetoldRemote-TopBar-Info');
|
|
166
|
+
if (!tmpInfoEl)
|
|
167
|
+
{
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let tmpRemote = this.pict.AppData.RetoldRemote;
|
|
172
|
+
let tmpSummary = tmpRemote.FolderSummary;
|
|
173
|
+
|
|
174
|
+
if (tmpRemote.ActiveMode === 'viewer')
|
|
175
|
+
{
|
|
176
|
+
let tmpItems = tmpRemote.GalleryItems || [];
|
|
177
|
+
let tmpIndex = tmpRemote.GalleryCursorIndex || 0;
|
|
178
|
+
let tmpItem = tmpItems[tmpIndex];
|
|
179
|
+
if (tmpItem)
|
|
180
|
+
{
|
|
181
|
+
tmpInfoEl.textContent = tmpItem.Name;
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (!tmpSummary)
|
|
187
|
+
{
|
|
188
|
+
tmpInfoEl.textContent = '';
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
let tmpParts = [];
|
|
193
|
+
if (tmpSummary.Folders > 0) tmpParts.push(tmpSummary.Folders + ' folders');
|
|
194
|
+
if (tmpSummary.Images > 0) tmpParts.push(tmpSummary.Images + ' images');
|
|
195
|
+
if (tmpSummary.Videos > 0) tmpParts.push(tmpSummary.Videos + ' videos');
|
|
196
|
+
if (tmpSummary.Audio > 0) tmpParts.push(tmpSummary.Audio + ' audio');
|
|
197
|
+
if (tmpSummary.Documents > 0) tmpParts.push(tmpSummary.Documents + ' docs');
|
|
198
|
+
if (tmpSummary.Other > 0) tmpParts.push(tmpSummary.Other + ' other');
|
|
199
|
+
|
|
200
|
+
tmpInfoEl.textContent = tmpParts.join(' \u00b7 ');
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
RetoldRemoteTopBarView.default_configuration = _ViewConfiguration;
|
|
205
|
+
|
|
206
|
+
module.exports = RetoldRemoteTopBarView;
|