@jsenv/core 39.10.0 → 39.10.2
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/dist/html/directory.html +5 -6
- package/dist/html/html_404_and_ancestor_dir.html +6 -7
- package/dist/jsenv_core.js +53 -16
- package/package.json +1 -1
- package/src/helpers/event_emitter.js +2 -2
- package/src/kitchen/url_graph/references.js +9 -4
- package/src/plugins/autoreload/jsenv_plugin_autoreload_server.js +5 -0
- package/src/plugins/protocol_file/client/assets/directory.css +5 -5
- package/src/plugins/protocol_file/client/html_404_and_ancestor_dir.html +1 -1
- package/src/plugins/protocol_file/jsenv_plugin_fs_redirection.js +7 -2
- package/src/plugins/protocol_file/jsenv_plugin_protocol_file.js +30 -8
package/dist/html/directory.html
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.directory_nav {
|
|
18
|
+
gap: .3em;
|
|
18
19
|
margin: 20px 25px 15px;
|
|
19
20
|
font-size: 16px;
|
|
20
21
|
font-weight: bold;
|
|
@@ -26,12 +27,10 @@
|
|
|
26
27
|
position: relative;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.directory_separator:first-child {
|
|
34
|
-
margin-left: 0;
|
|
30
|
+
.directory_empty_message {
|
|
31
|
+
color: #bbb;
|
|
32
|
+
margin: 1em;
|
|
33
|
+
padding: .5em;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
.directory_content {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.directory_nav {
|
|
18
|
+
gap: .3em;
|
|
18
19
|
margin: 20px 25px 15px;
|
|
19
20
|
font-size: 16px;
|
|
20
21
|
font-weight: bold;
|
|
@@ -26,12 +27,10 @@
|
|
|
26
27
|
position: relative;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.directory_separator:first-child {
|
|
34
|
-
margin-left: 0;
|
|
30
|
+
.directory_empty_message {
|
|
31
|
+
color: #bbb;
|
|
32
|
+
margin: 1em;
|
|
33
|
+
padding: .5em;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
.directory_content {
|
|
@@ -195,7 +194,7 @@
|
|
|
195
194
|
No entry on the filesystem for <code>/${fileRelativeUrl}</code> (at
|
|
196
195
|
${fileUrl})
|
|
197
196
|
<br>
|
|
198
|
-
Content of
|
|
197
|
+
Content of first ancestor directory is listed below:
|
|
199
198
|
</span>
|
|
200
199
|
</p>
|
|
201
200
|
<h1 class="directory_nav">${ancestorDirectoryNav}</h1>
|
package/dist/jsenv_core.js
CHANGED
|
@@ -12648,9 +12648,9 @@ const createEventEmitter = () => {
|
|
|
12648
12648
|
callbackSet.delete(callback);
|
|
12649
12649
|
};
|
|
12650
12650
|
const emit = (...args) => {
|
|
12651
|
-
|
|
12651
|
+
for (const callback of callbackSet) {
|
|
12652
12652
|
callback(...args);
|
|
12653
|
-
}
|
|
12653
|
+
}
|
|
12654
12654
|
};
|
|
12655
12655
|
return { on, off, emit };
|
|
12656
12656
|
};
|
|
@@ -12817,7 +12817,7 @@ const createDependencies = (ownerUrlInfo) => {
|
|
|
12817
12817
|
|
|
12818
12818
|
const stopCollecting = () => {
|
|
12819
12819
|
for (const prevReferenceToOther of prevReferenceToOthersSet) {
|
|
12820
|
-
|
|
12820
|
+
checkForDependencyRemovalEffects(prevReferenceToOther);
|
|
12821
12821
|
}
|
|
12822
12822
|
prevReferenceToOthersSet.clear();
|
|
12823
12823
|
};
|
|
@@ -13322,7 +13322,7 @@ ${ownerUrlInfo.url}`,
|
|
|
13322
13322
|
implicitRef.remove();
|
|
13323
13323
|
}
|
|
13324
13324
|
ownerUrlInfo.referenceToOthersSet.delete(reference);
|
|
13325
|
-
return
|
|
13325
|
+
return checkForDependencyRemovalEffects(reference);
|
|
13326
13326
|
};
|
|
13327
13327
|
|
|
13328
13328
|
const canAddOrRemoveReference = (reference) => {
|
|
@@ -13351,7 +13351,7 @@ const canAddOrRemoveReference = (reference) => {
|
|
|
13351
13351
|
return false;
|
|
13352
13352
|
};
|
|
13353
13353
|
|
|
13354
|
-
const
|
|
13354
|
+
const checkForDependencyRemovalEffects = (reference) => {
|
|
13355
13355
|
const { ownerUrlInfo } = reference;
|
|
13356
13356
|
const { referenceToOthersSet } = ownerUrlInfo;
|
|
13357
13357
|
if (reference.isImplicit && !reference.isInline) {
|
|
@@ -13386,6 +13386,7 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
13386
13386
|
referencedUrlInfo.referenceFromOthersSet.delete(reference);
|
|
13387
13387
|
|
|
13388
13388
|
let firstReferenceFromOther;
|
|
13389
|
+
let wasInlined;
|
|
13389
13390
|
for (const referenceFromOther of referencedUrlInfo.referenceFromOthersSet) {
|
|
13390
13391
|
if (referenceFromOther.urlInfo !== referencedUrlInfo) {
|
|
13391
13392
|
continue;
|
|
@@ -13400,7 +13401,8 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
13400
13401
|
if (referenceFromOther.type === "http_request") {
|
|
13401
13402
|
continue;
|
|
13402
13403
|
}
|
|
13403
|
-
|
|
13404
|
+
wasInlined = referenceFromOther.gotInlined();
|
|
13405
|
+
if (wasInlined) {
|
|
13404
13406
|
// the url info was inlined, an other reference is required
|
|
13405
13407
|
// to consider the non-inlined urlInfo as used
|
|
13406
13408
|
continue;
|
|
@@ -13418,6 +13420,9 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
13418
13420
|
}
|
|
13419
13421
|
return false;
|
|
13420
13422
|
}
|
|
13423
|
+
if (wasInlined) {
|
|
13424
|
+
return false;
|
|
13425
|
+
}
|
|
13421
13426
|
// referencedUrlInfo.firstReference = null;
|
|
13422
13427
|
// referencedUrlInfo.lastReference = null;
|
|
13423
13428
|
referencedUrlInfo.onDereferenced(reference);
|
|
@@ -19176,6 +19181,7 @@ const jsenvPluginVersionSearchParam = () => {
|
|
|
19176
19181
|
};
|
|
19177
19182
|
|
|
19178
19183
|
const jsenvPluginFsRedirection = ({
|
|
19184
|
+
directoryContentMagicName,
|
|
19179
19185
|
magicExtensions = ["inherit", ".js"],
|
|
19180
19186
|
magicDirectoryIndex = true,
|
|
19181
19187
|
preserveSymlinks = false,
|
|
@@ -19198,10 +19204,14 @@ const jsenvPluginFsRedirection = ({
|
|
|
19198
19204
|
if (reference.subtype === "new_url_second_arg") {
|
|
19199
19205
|
return `ignore:${reference.url}`;
|
|
19200
19206
|
}
|
|
19201
|
-
if (
|
|
19207
|
+
if (
|
|
19208
|
+
reference.specifierPathname.endsWith(`/${directoryContentMagicName}`)
|
|
19209
|
+
) {
|
|
19202
19210
|
const { rootDirectoryUrl } = reference.ownerUrlInfo.context;
|
|
19203
19211
|
const directoryUrl = new URL(
|
|
19204
|
-
reference.specifierPathname
|
|
19212
|
+
reference.specifierPathname
|
|
19213
|
+
.replace(`/${directoryContentMagicName}`, "/")
|
|
19214
|
+
.slice(1),
|
|
19205
19215
|
rootDirectoryUrl,
|
|
19206
19216
|
).href;
|
|
19207
19217
|
return directoryUrl;
|
|
@@ -19312,6 +19322,7 @@ const htmlFileUrlForDirectory = new URL(
|
|
|
19312
19322
|
"./html/directory.html",
|
|
19313
19323
|
import.meta.url,
|
|
19314
19324
|
);
|
|
19325
|
+
const directoryContentMagicName = "...";
|
|
19315
19326
|
|
|
19316
19327
|
const jsenvPluginProtocolFile = ({
|
|
19317
19328
|
magicExtensions,
|
|
@@ -19321,6 +19332,7 @@ const jsenvPluginProtocolFile = ({
|
|
|
19321
19332
|
}) => {
|
|
19322
19333
|
return [
|
|
19323
19334
|
jsenvPluginFsRedirection({
|
|
19335
|
+
directoryContentMagicName,
|
|
19324
19336
|
magicExtensions,
|
|
19325
19337
|
magicDirectoryIndex,
|
|
19326
19338
|
preserveSymlinks,
|
|
@@ -19360,8 +19372,9 @@ const jsenvPluginProtocolFile = ({
|
|
|
19360
19372
|
if (reference.original) {
|
|
19361
19373
|
const originalSpecifierPathname =
|
|
19362
19374
|
reference.original.specifierPathname;
|
|
19363
|
-
|
|
19364
|
-
|
|
19375
|
+
if (
|
|
19376
|
+
originalSpecifierPathname.endsWith(`/${directoryContentMagicName}`)
|
|
19377
|
+
) {
|
|
19365
19378
|
return originalSpecifierPathname;
|
|
19366
19379
|
}
|
|
19367
19380
|
}
|
|
@@ -19517,14 +19530,31 @@ const generateDirectoryNav = (relativeUrl, rootDirectoryUrl) => {
|
|
|
19517
19530
|
const parts = isDir
|
|
19518
19531
|
? relativeUrlWithRoot.slice(0, -1).split("/")
|
|
19519
19532
|
: relativeUrlWithRoot.split("/");
|
|
19533
|
+
const items = [];
|
|
19534
|
+
items.push({
|
|
19535
|
+
href: "/",
|
|
19536
|
+
text: "/",
|
|
19537
|
+
});
|
|
19520
19538
|
let dirPartsHtml = "";
|
|
19521
19539
|
let i = 0;
|
|
19522
19540
|
while (i < parts.length) {
|
|
19523
19541
|
const part = parts[i];
|
|
19524
|
-
const href =
|
|
19542
|
+
const href =
|
|
19543
|
+
i === 0
|
|
19544
|
+
? `/${directoryContentMagicName}`
|
|
19545
|
+
: `/${parts.slice(1, i + 1).join("/")}/`;
|
|
19525
19546
|
const text = part;
|
|
19526
19547
|
const isLastPart = i === parts.length - 1;
|
|
19527
|
-
|
|
19548
|
+
items.push({
|
|
19549
|
+
href,
|
|
19550
|
+
text,
|
|
19551
|
+
isCurrent: isLastPart,
|
|
19552
|
+
});
|
|
19553
|
+
i++;
|
|
19554
|
+
}
|
|
19555
|
+
i = 0;
|
|
19556
|
+
for (const { href, text, isCurrent } of items) {
|
|
19557
|
+
if (isCurrent) {
|
|
19528
19558
|
dirPartsHtml += `
|
|
19529
19559
|
<span class="directory_nav_item" data-current>
|
|
19530
19560
|
${text}
|
|
@@ -19535,13 +19565,15 @@ const generateDirectoryNav = (relativeUrl, rootDirectoryUrl) => {
|
|
|
19535
19565
|
<a class="directory_nav_item" href="${href}">
|
|
19536
19566
|
${text}
|
|
19537
19567
|
</a>`;
|
|
19538
|
-
|
|
19539
|
-
|
|
19568
|
+
if (i > 0) {
|
|
19569
|
+
dirPartsHtml += `
|
|
19570
|
+
<span class="directory_separator">/</span>`;
|
|
19571
|
+
}
|
|
19540
19572
|
i++;
|
|
19541
19573
|
}
|
|
19542
19574
|
if (isDir) {
|
|
19543
19575
|
dirPartsHtml += `
|
|
19544
|
-
|
|
19576
|
+
<span class="directory_separator">/</span>`;
|
|
19545
19577
|
}
|
|
19546
19578
|
return dirPartsHtml;
|
|
19547
19579
|
};
|
|
@@ -19628,7 +19660,7 @@ const generateDirectoryContentItems = (directoryUrl, rootDirectoryUrl) => {
|
|
|
19628
19660
|
};
|
|
19629
19661
|
const generateDirectoryContent = (directoryContentItems) => {
|
|
19630
19662
|
if (directoryContentItems.length === 0) {
|
|
19631
|
-
return `<p>Directory is empty</p>`;
|
|
19663
|
+
return `<p class="directory_empty_message">Directory is empty</p>`;
|
|
19632
19664
|
}
|
|
19633
19665
|
let html = `<ul class="directory_content">`;
|
|
19634
19666
|
for (const directoryContentItem of directoryContentItems) {
|
|
@@ -20811,6 +20843,11 @@ const jsenvPluginAutoreloadServer = ({
|
|
|
20811
20843
|
// are lost and sourcemap is considered as pruned
|
|
20812
20844
|
continue;
|
|
20813
20845
|
}
|
|
20846
|
+
if (lastReferenceFromOther.type === "http_request") {
|
|
20847
|
+
// no need to tell client to reload when a http request is pruned
|
|
20848
|
+
// happens when reloading the current html page for instance
|
|
20849
|
+
continue;
|
|
20850
|
+
}
|
|
20814
20851
|
const { ownerUrlInfo } = lastReferenceFromOther;
|
|
20815
20852
|
if (!ownerUrlInfo.isUsed()) {
|
|
20816
20853
|
continue;
|
package/package.json
CHANGED
|
@@ -10,9 +10,9 @@ export const createEventEmitter = () => {
|
|
|
10
10
|
callbackSet.delete(callback);
|
|
11
11
|
};
|
|
12
12
|
const emit = (...args) => {
|
|
13
|
-
|
|
13
|
+
for (const callback of callbackSet) {
|
|
14
14
|
callback(...args);
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
};
|
|
17
17
|
return { on, off, emit };
|
|
18
18
|
};
|
|
@@ -22,7 +22,7 @@ export const createDependencies = (ownerUrlInfo) => {
|
|
|
22
22
|
|
|
23
23
|
const stopCollecting = () => {
|
|
24
24
|
for (const prevReferenceToOther of prevReferenceToOthersSet) {
|
|
25
|
-
|
|
25
|
+
checkForDependencyRemovalEffects(prevReferenceToOther);
|
|
26
26
|
}
|
|
27
27
|
prevReferenceToOthersSet.clear();
|
|
28
28
|
};
|
|
@@ -527,7 +527,7 @@ ${ownerUrlInfo.url}`,
|
|
|
527
527
|
implicitRef.remove();
|
|
528
528
|
}
|
|
529
529
|
ownerUrlInfo.referenceToOthersSet.delete(reference);
|
|
530
|
-
return
|
|
530
|
+
return checkForDependencyRemovalEffects(reference);
|
|
531
531
|
};
|
|
532
532
|
|
|
533
533
|
const canAddOrRemoveReference = (reference) => {
|
|
@@ -556,7 +556,7 @@ const canAddOrRemoveReference = (reference) => {
|
|
|
556
556
|
return false;
|
|
557
557
|
};
|
|
558
558
|
|
|
559
|
-
const
|
|
559
|
+
const checkForDependencyRemovalEffects = (reference) => {
|
|
560
560
|
const { ownerUrlInfo } = reference;
|
|
561
561
|
const { referenceToOthersSet } = ownerUrlInfo;
|
|
562
562
|
if (reference.isImplicit && !reference.isInline) {
|
|
@@ -591,6 +591,7 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
591
591
|
referencedUrlInfo.referenceFromOthersSet.delete(reference);
|
|
592
592
|
|
|
593
593
|
let firstReferenceFromOther;
|
|
594
|
+
let wasInlined;
|
|
594
595
|
for (const referenceFromOther of referencedUrlInfo.referenceFromOthersSet) {
|
|
595
596
|
if (referenceFromOther.urlInfo !== referencedUrlInfo) {
|
|
596
597
|
continue;
|
|
@@ -605,7 +606,8 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
605
606
|
if (referenceFromOther.type === "http_request") {
|
|
606
607
|
continue;
|
|
607
608
|
}
|
|
608
|
-
|
|
609
|
+
wasInlined = referenceFromOther.gotInlined();
|
|
610
|
+
if (wasInlined) {
|
|
609
611
|
// the url info was inlined, an other reference is required
|
|
610
612
|
// to consider the non-inlined urlInfo as used
|
|
611
613
|
continue;
|
|
@@ -623,6 +625,9 @@ const applyDependencyRemovalEffects = (reference) => {
|
|
|
623
625
|
}
|
|
624
626
|
return false;
|
|
625
627
|
}
|
|
628
|
+
if (wasInlined) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
626
631
|
// referencedUrlInfo.firstReference = null;
|
|
627
632
|
// referencedUrlInfo.lastReference = null;
|
|
628
633
|
referencedUrlInfo.onDereferenced(reference);
|
|
@@ -238,6 +238,11 @@ export const jsenvPluginAutoreloadServer = ({
|
|
|
238
238
|
// are lost and sourcemap is considered as pruned
|
|
239
239
|
continue;
|
|
240
240
|
}
|
|
241
|
+
if (lastReferenceFromOther.type === "http_request") {
|
|
242
|
+
// no need to tell client to reload when a http request is pruned
|
|
243
|
+
// happens when reloading the current html page for instance
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
241
246
|
const { ownerUrlInfo } = lastReferenceFromOther;
|
|
242
247
|
if (!ownerUrlInfo.isUsed()) {
|
|
243
248
|
continue;
|
|
@@ -20,16 +20,16 @@ button {
|
|
|
20
20
|
font-weight: bold;
|
|
21
21
|
margin: 20px 25px 15px 25px;
|
|
22
22
|
display: flex;
|
|
23
|
+
gap: 0.3em;
|
|
23
24
|
}
|
|
24
25
|
.directory_nav_item {
|
|
25
26
|
text-decoration: none;
|
|
26
27
|
position: relative;
|
|
27
28
|
}
|
|
28
|
-
.
|
|
29
|
-
margin:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
margin-left: 0;
|
|
29
|
+
.directory_empty_message {
|
|
30
|
+
margin: 1em;
|
|
31
|
+
padding: 0.5em;
|
|
32
|
+
color: #bbbbbb;
|
|
33
33
|
}
|
|
34
34
|
.directory_content {
|
|
35
35
|
margin: 10px 15px 10px 15px;
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
No entry on the filesystem for <code>/${fileRelativeUrl}</code> (at
|
|
46
46
|
${fileUrl})
|
|
47
47
|
<br />
|
|
48
|
-
Content of
|
|
48
|
+
Content of first ancestor directory is listed below:
|
|
49
49
|
</span>
|
|
50
50
|
</p>
|
|
51
51
|
<h1 class="directory_nav">${ancestorDirectoryNav}</h1>
|
|
@@ -8,6 +8,7 @@ import { realpathSync } from "node:fs";
|
|
|
8
8
|
import { pathToFileURL } from "node:url";
|
|
9
9
|
|
|
10
10
|
export const jsenvPluginFsRedirection = ({
|
|
11
|
+
directoryContentMagicName,
|
|
11
12
|
magicExtensions = ["inherit", ".js"],
|
|
12
13
|
magicDirectoryIndex = true,
|
|
13
14
|
preserveSymlinks = false,
|
|
@@ -30,10 +31,14 @@ export const jsenvPluginFsRedirection = ({
|
|
|
30
31
|
if (reference.subtype === "new_url_second_arg") {
|
|
31
32
|
return `ignore:${reference.url}`;
|
|
32
33
|
}
|
|
33
|
-
if (
|
|
34
|
+
if (
|
|
35
|
+
reference.specifierPathname.endsWith(`/${directoryContentMagicName}`)
|
|
36
|
+
) {
|
|
34
37
|
const { rootDirectoryUrl } = reference.ownerUrlInfo.context;
|
|
35
38
|
const directoryUrl = new URL(
|
|
36
|
-
reference.specifierPathname
|
|
39
|
+
reference.specifierPathname
|
|
40
|
+
.replace(`/${directoryContentMagicName}`, "/")
|
|
41
|
+
.slice(1),
|
|
37
42
|
rootDirectoryUrl,
|
|
38
43
|
).href;
|
|
39
44
|
return directoryUrl;
|
|
@@ -24,6 +24,7 @@ const htmlFileUrlForDirectory = new URL(
|
|
|
24
24
|
"./client/directory.html",
|
|
25
25
|
import.meta.url,
|
|
26
26
|
);
|
|
27
|
+
const directoryContentMagicName = "...";
|
|
27
28
|
|
|
28
29
|
export const jsenvPluginProtocolFile = ({
|
|
29
30
|
magicExtensions,
|
|
@@ -33,6 +34,7 @@ export const jsenvPluginProtocolFile = ({
|
|
|
33
34
|
}) => {
|
|
34
35
|
return [
|
|
35
36
|
jsenvPluginFsRedirection({
|
|
37
|
+
directoryContentMagicName,
|
|
36
38
|
magicExtensions,
|
|
37
39
|
magicDirectoryIndex,
|
|
38
40
|
preserveSymlinks,
|
|
@@ -72,8 +74,9 @@ export const jsenvPluginProtocolFile = ({
|
|
|
72
74
|
if (reference.original) {
|
|
73
75
|
const originalSpecifierPathname =
|
|
74
76
|
reference.original.specifierPathname;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
if (
|
|
78
|
+
originalSpecifierPathname.endsWith(`/${directoryContentMagicName}`)
|
|
79
|
+
) {
|
|
77
80
|
return originalSpecifierPathname;
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -229,14 +232,31 @@ const generateDirectoryNav = (relativeUrl, rootDirectoryUrl) => {
|
|
|
229
232
|
const parts = isDir
|
|
230
233
|
? relativeUrlWithRoot.slice(0, -1).split("/")
|
|
231
234
|
: relativeUrlWithRoot.split("/");
|
|
235
|
+
const items = [];
|
|
236
|
+
items.push({
|
|
237
|
+
href: "/",
|
|
238
|
+
text: "/",
|
|
239
|
+
});
|
|
232
240
|
let dirPartsHtml = "";
|
|
233
241
|
let i = 0;
|
|
234
242
|
while (i < parts.length) {
|
|
235
243
|
const part = parts[i];
|
|
236
|
-
const href =
|
|
244
|
+
const href =
|
|
245
|
+
i === 0
|
|
246
|
+
? `/${directoryContentMagicName}`
|
|
247
|
+
: `/${parts.slice(1, i + 1).join("/")}/`;
|
|
237
248
|
const text = part;
|
|
238
249
|
const isLastPart = i === parts.length - 1;
|
|
239
|
-
|
|
250
|
+
items.push({
|
|
251
|
+
href,
|
|
252
|
+
text,
|
|
253
|
+
isCurrent: isLastPart,
|
|
254
|
+
});
|
|
255
|
+
i++;
|
|
256
|
+
}
|
|
257
|
+
i = 0;
|
|
258
|
+
for (const { href, text, isCurrent } of items) {
|
|
259
|
+
if (isCurrent) {
|
|
240
260
|
dirPartsHtml += `
|
|
241
261
|
<span class="directory_nav_item" data-current>
|
|
242
262
|
${text}
|
|
@@ -247,13 +267,15 @@ const generateDirectoryNav = (relativeUrl, rootDirectoryUrl) => {
|
|
|
247
267
|
<a class="directory_nav_item" href="${href}">
|
|
248
268
|
${text}
|
|
249
269
|
</a>`;
|
|
250
|
-
|
|
251
|
-
|
|
270
|
+
if (i > 0) {
|
|
271
|
+
dirPartsHtml += `
|
|
272
|
+
<span class="directory_separator">/</span>`;
|
|
273
|
+
}
|
|
252
274
|
i++;
|
|
253
275
|
}
|
|
254
276
|
if (isDir) {
|
|
255
277
|
dirPartsHtml += `
|
|
256
|
-
|
|
278
|
+
<span class="directory_separator">/</span>`;
|
|
257
279
|
}
|
|
258
280
|
return dirPartsHtml;
|
|
259
281
|
};
|
|
@@ -340,7 +362,7 @@ const generateDirectoryContentItems = (directoryUrl, rootDirectoryUrl) => {
|
|
|
340
362
|
};
|
|
341
363
|
const generateDirectoryContent = (directoryContentItems) => {
|
|
342
364
|
if (directoryContentItems.length === 0) {
|
|
343
|
-
return `<p>Directory is empty</p>`;
|
|
365
|
+
return `<p class="directory_empty_message">Directory is empty</p>`;
|
|
344
366
|
}
|
|
345
367
|
let html = `<ul class="directory_content">`;
|
|
346
368
|
for (const directoryContentItem of directoryContentItems) {
|