Implements directory browser dialog, part 2: path navigator
No files matched your search
@@ -0,0 +1,3 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M20 6L9 17L4 12" stroke="#0F9D58" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 174 B |
@@ -0,0 +1,4 @@
|
||||
<svg width="24" height="24" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path style="fill:#009BFC;fill-opacity:1;stroke:none"
|
||||
d="m22.27 4l-18.27 18.27v5.73h5.73c0 0 18.269-18.269 18.27-18.27zm-2.865 4.299l4.297 4.297-11.701 11.703v-2.299h-4v-2.299zm-12.404 12.402v2.299h4v2.299l-1.701 1.701h-2l-2.297-2.297v-2z" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 363 B |
|
After Width: | Height: | Size: 321 B |
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 543 B |
@@ -0,0 +1,17 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">
|
||||
<defs>
|
||||
<linearGradient id="starGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#039bfc;stop-opacity:0.7" />
|
||||
<stop offset="100%" style="stop-color:#027aba;stop-opacity:0.7" />
|
||||
</linearGradient>
|
||||
<filter id="innerShadow" x="-20%" y="-20%" width="140%" height="140%">
|
||||
<feGaussianBlur in="SourceAlpha" stdDeviation="3" result="blur"/>
|
||||
<feOffset dx="2" dy="2"/>
|
||||
<feComposite in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowDiff"/>
|
||||
<feFlood flood-color="#000000" flood-opacity="0.75"/>
|
||||
<feComposite in2="shadowDiff" operator="in"/>
|
||||
<feComposite in2="SourceGraphic" operator="over"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<path stroke-width="0" stroke-linecap="round" stroke-linejoin="round" d="M86.016,24.091H49.313c-1.979-2.37-4.013-4.865-4.541-5.624c-0.511-1.071-1.607-1.808-2.875-1.808H27.367 c-0.964,0-1.875,0.435-2.479,1.185l-5.021,6.247h-5.884c-3.021,0-5.484,2.46-5.484,5.484v48.284c0,3.024,2.463,5.482,5.484,5.482 h72.032c3.021,0,5.484-2.458,5.484-5.482V29.575C91.5,26.55,89.036,24.091,86.016,24.091z M81.543,63.286 c0,0.182-0.074,0.346-0.195,0.465c-0.119,0.12-0.283,0.194-0.464,0.194h-8.779v8.78c0,0.174-0.07,0.341-0.193,0.466 c-0.124,0.122-0.291,0.193-0.465,0.193h-6.15c-0.175,0-0.342-0.07-0.466-0.193c-0.124-0.125-0.192-0.292-0.192-0.466v-8.78h-8.78 c-0.174,0-0.342-0.07-0.465-0.194c-0.124-0.123-0.193-0.29-0.193-0.465v-6.149c0.001-0.351,0.309-0.659,0.658-0.659l8.779,0l0-8.78 c0-0.363,0.294-0.658,0.659-0.658l6.15,0.001c0.364,0,0.659,0.293,0.659,0.658v8.778h8.78c0.364,0,0.659,0.294,0.659,0.659 L81.543,63.286z" fill="url(#starGradient)" filter="url(#innerShadow)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 257 B |
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="64" height="64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#039bfc;
|
||||
}
|
||||
</style>
|
||||
|
||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
||||
<feFuncA type="table" tableValues="0 0.5 1"/>
|
||||
</feComponentTransfer>
|
||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur"/>
|
||||
<feFlood flood-color="#039bfc" result="color"/>
|
||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="softGlowColored"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
|
||||
<linearGradient id="b" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -723.44 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b-3" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -753.02 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linearGradient1299" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0"/>
|
||||
<stop stop-color="#039bfc" offset=".225"/>
|
||||
<stop stop-color="#039bfc" offset=".5"/>
|
||||
<stop stop-color="#039bfc" offset=".775"/>
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<circle cx="134.94" cy="32.044" r="0" fill="url(#b)" stroke-width="1.5715"/>
|
||||
<circle cx="105.36" cy="32.044" r="0" fill="url(#b-3)" stroke-width="1.5715"/>
|
||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient1299)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
<g stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="9.5" y="9.5" width="45" height="45" ry="5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
</g>
|
||||
<g transform="translate(8,8) scale(2)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M14.3307 7.16929C13.5873 7.05887 12.806 7 12 7C7.02944 7 3 9.23858 3 12C3 13.4401 4.09589 14.738 5.84963 15.6504L8.21192 13.2881C8.07452 12.8839 8 12.4506 8 12C8 9.79086 9.79086 8 12 8C12.4506 8 12.8839 8.07452 13.2881 8.21192L14.3307 7.16929Z" class="ColorScheme-Text" filter="url(#glow)"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M11.2308 15.9261C11.4797 15.9746 11.7369 16 12 16C14.2091 16 16 14.2091 16 12C16 11.7369 15.9746 11.4797 15.9261 11.2308L18.5726 8.58427C20.0782 9.47809 21 10.6792 21 12C21 14.7614 16.9706 17 12 17C11.4016 17 10.8169 16.9676 10.2512 16.9057L11.2308" class="ColorScheme-Text" filter="url(#glow)"/>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M17.7929 5.20711C18.1834 4.81658 18.8166 4.81658 19.2071 5.20711C19.5976 5.59763 19.5976 6.2308 19.2071 6.62132L6.47919 19.3492C6.08866 19.7398 5.4555 19.7398 5.06497 19.3492C4.67445 18.9587 4.67445 18.3256 5.06497 17.935L17.7929 5.20711Z" class="ColorScheme-Text" filter="url(#glow)"/>
|
||||
</g>
|
||||
</svg>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="64" height="64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#039bfc;
|
||||
}
|
||||
</style>
|
||||
|
||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
||||
<feFuncA type="table" tableValues="0 0.5 1"/>
|
||||
</feComponentTransfer>
|
||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur"/>
|
||||
<feFlood flood-color="#039bfc" result="color"/>
|
||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="softGlowColored"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
|
||||
<linearGradient id="b" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -723.44 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b-3" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -753.02 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linearGradient1299" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0"/>
|
||||
<stop stop-color="#039bfc" offset=".225"/>
|
||||
<stop stop-color="#039bfc" offset=".5"/>
|
||||
<stop stop-color="#039bfc" offset=".775"/>
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<circle cx="134.94" cy="32.044" r="0" fill="url(#b)" stroke-width="1.5715"/>
|
||||
<circle cx="105.36" cy="32.044" r="0" fill="url(#b-3)" stroke-width="1.5715"/>
|
||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient1299)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
<g stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="9.5" y="9.5" width="45" height="45" ry="5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
</g>
|
||||
<g transform="translate(5,5) scale(0.7)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 20,17L 44.25,17L 56,28.75L 56,59L 20,59L 20,17 Z M 24,21L 24,55L 52,55L 52,34L 39,34L 39,21L 24,21 Z M 43,22.25L 43,30L 50.75,30L 43,22.25 Z M 27,47.5L 30,50.5L 42.5,38L 47.5,43L 51,39L 51,54L 25,54L 25,50L 27,47.5 Z M 33,22C 33,26.3723 29.3723,30 25,30L 25,22L 33,22 Z " class="ColorScheme-Text" filter="url(#glow)"/>
|
||||
</g>
|
||||
</svg>
|
||||
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="64" height="64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#039bfc;
|
||||
}
|
||||
</style>
|
||||
|
||||
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%">
|
||||
<feComponentTransfer in="SourceAlpha" result="adjustedAlpha">
|
||||
<feFuncA type="table" tableValues="0 0.5 1"/>
|
||||
</feComponentTransfer>
|
||||
<feGaussianBlur in="adjustedAlpha" stdDeviation="2" result="blur"/>
|
||||
<feFlood flood-color="#039bfc" result="color"/>
|
||||
<feComposite in="color" in2="blur" operator="in" result="softGlowColored"/>
|
||||
<feMerge>
|
||||
<feMergeNode in="softGlowColored"/>
|
||||
<feMergeNode in="SourceGraphic"/>
|
||||
</feMerge>
|
||||
</filter>
|
||||
|
||||
<linearGradient id="b" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -723.44 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b-3" x1="399.57" x2="399.57" y1="545.8" y2="517.8" gradientTransform="matrix(2.1429 0 0 2.1429 -753.02 -1107.5)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#3889e9" offset="0"/>
|
||||
<stop stop-color="#5ea5fb" offset="1"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="linearGradient1299" x1="5" x2="195" y1="174.76" y2="174.76" gradientTransform="matrix(.32632 0 0 .095367 -.63187 42.834)" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="0"/>
|
||||
<stop stop-color="#039bfc" offset=".225"/>
|
||||
<stop stop-color="#039bfc" offset=".5"/>
|
||||
<stop stop-color="#039bfc" offset=".775"/>
|
||||
<stop stop-color="#039bfc" stop-opacity="0" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<circle cx="134.94" cy="32.044" r="0" fill="url(#b)" stroke-width="1.5715"/>
|
||||
<circle cx="105.36" cy="32.044" r="0" fill="url(#b-3)" stroke-width="1.5715"/>
|
||||
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient1299)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
<g stroke-linecap="round" stroke-linejoin="round">
|
||||
<rect x="9.5" y="9.5" width="45" height="45" ry="5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)"/>
|
||||
</g>
|
||||
<g transform="translate(8,8) scale(1.5)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 4 4 L 4 14 L 9 14 L 9 23 L 18 23 L 18 28 L 28 28 L 28 18 L 18 18 L 18 22 L 10 22 L 10 14 L 14 14 L 14 9 L 18 9 L 18 14 L 28 14 L 28 4 L 18 4 L 18 8 L 14 8 L 14 4 L 4 4 z M 5 5 L 13 5 L 13 13 L 5 13 L 5 5 z M 19 5 L 27 5 L 27 13 L 19 13 L 19 5 z" id="path6" class="ColorScheme-Text" filter="url(#glow)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.0 KiB |
@@ -1,25 +1,110 @@
|
||||
/**
|
||||
* Adjusts the height of a dropdown identified by `comboboxId` to fit in the available space.
|
||||
* @param {string} comboboxId The ID of the combobox whose dropdown should be adjusted.
|
||||
* @param {string} comboboxId The Id of the combobox whose dropdown should be adjusted.
|
||||
*/
|
||||
function adjustDropdownHeight(comboboxId) {
|
||||
const combobox = document.getElementById(comboboxId);
|
||||
const dropdown = combobox.querySelector('.enlightenment-dropdown');
|
||||
// get the bounds of the combobox and the height of the viewport
|
||||
const comboboxRect = combobox.getBoundingClientRect();
|
||||
const viewportHeight = window.innerHeight;
|
||||
// calculate the space available between the combobox and the bottom of the viewport, with a 10px margin
|
||||
const dropdownTopPosition = comboboxRect.top + comboboxRect.height;
|
||||
const availableSpace = viewportHeight - dropdownTopPosition - 10; // 10px margin
|
||||
dropdown.style.maxHeight = `${availableSpace}px`;
|
||||
function adjustDropdownHeight(comboboxId = null) {
|
||||
const comboboxes = comboboxId
|
||||
? [document.getElementById(comboboxId)] // if comboboxId is provided, use only that element
|
||||
: document.querySelectorAll('[id^="combobox_"]:not([id^="combobox_checkbox_"])'); // otherwise, select all dropdowns
|
||||
if (comboboxes) {
|
||||
comboboxes.forEach(combobox => {
|
||||
if (!combobox) return; // skip if no element is found
|
||||
const dropdown = combobox.querySelector('.enlightenment-dropdown');
|
||||
if (!dropdown) return; // skip if there's no dropdown inside
|
||||
// get the bounds of the combobox and the height of the viewport
|
||||
const comboboxRect = combobox.getBoundingClientRect();
|
||||
const viewportHeight = window.innerHeight;
|
||||
// calculate the space available between the combobox and the bottom of the viewport, with a 10px margin
|
||||
const dropdownTopPosition = comboboxRect.top + comboboxRect.height;
|
||||
const availableSpace = viewportHeight - dropdownTopPosition - 10; // 10px margin
|
||||
// adjust the dropdown height
|
||||
dropdown.style.maxHeight = `${availableSpace}px`;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.showDirectoryPicker = async () => {
|
||||
try {
|
||||
const dirHandle = await window.showDirectoryPicker().ConfigureAwait(false);
|
||||
return dirHandle.name;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return null;
|
||||
/**
|
||||
* Gets the position and size of an element relative to the viewport.
|
||||
*
|
||||
* @param {string} id - The ID of the element to get the offset for.
|
||||
* @returns {Object} An object with the top, left, width, and height of the element.
|
||||
*/
|
||||
function getElementOffset(id) {
|
||||
const element = document.getElementById(id);
|
||||
if (element) {
|
||||
const rect = element.getBoundingClientRect();
|
||||
return {
|
||||
top: rect.top + window.scrollY,
|
||||
left: rect.left + window.scrollX,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
};
|
||||
}
|
||||
};
|
||||
return {
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: 0,
|
||||
height: 0
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the position and height of the dropdown relative to the specified path segment.
|
||||
*
|
||||
* @param {string} pathSegmentId - The ID of the path segment element to position the dropdown relative to.
|
||||
*/
|
||||
function updateDropdownPosition(pathSegmentId) {
|
||||
const element = document.getElementById(pathSegmentId);
|
||||
const dropdown = document.getElementById('navigatorDropdown');
|
||||
if (element && dropdown) {
|
||||
const rect = getElementOffset(pathSegmentId);
|
||||
dropdown.style.top = `${rect.top + rect.height}px`;
|
||||
dropdown.style.left = `${rect.left}px`;
|
||||
// calculate the available height between the dropdown and the bottom of the viewport
|
||||
const viewportHeight = window.innerHeight;
|
||||
const availableHeight = viewportHeight - (rect.top + rect.height) - 10; // 10 px margin
|
||||
// set the dropdown's max height, ensuring it doesn't exceed the available height
|
||||
dropdown.style.maxHeight = `${availableHeight}px`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unchecks all checkboxes except the one with the specified ID.
|
||||
*
|
||||
* @param {string} id - The Id of the checkbox to leave checked.
|
||||
*/
|
||||
function uncheckAllExcept(id) {
|
||||
const checkboxes = document.querySelectorAll('.navigator-toggle-checkbox');
|
||||
checkboxes.forEach((checkbox) => {
|
||||
if (checkbox.id !== id) {
|
||||
checkbox.checked = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables horizontal scrolling for the address bar using the mouse wheel.
|
||||
*/
|
||||
function makeAddressBarHorizontallyScrollable() {
|
||||
const addressBar = document.getElementById('navigator-address-bar');
|
||||
if (addressBar) {
|
||||
addressBar.addEventListener('wheel', function (event) {
|
||||
event.preventDefault();
|
||||
this.scrollLeft += (event.deltaY > 0 ? 1 : -1) * 80;
|
||||
}, { passive: false });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the window resize event.
|
||||
*/
|
||||
window.addEventListener('resize', function () {
|
||||
adjustDropdownHeight();
|
||||
// update all dropdowns' positions on resize
|
||||
const dropdown = document.getElementById('navigatorDropdown');
|
||||
if (dropdown) {
|
||||
const pathSegmentId = dropdown.getAttribute('data-path-segment-id');
|
||||
if (pathSegmentId)
|
||||
updateDropdownPosition(pathSegmentId);
|
||||
}
|
||||
});
|
||||