Swiches Client Web app from Blazor to ASP.NET Core MVC

This commit is contained in:
BinaryAlley committed 2024-10-02 22:19:14 +03:00
1 parent cf94676666
commit 9a7d4c607d
35 files changed
+4066 -1853

No files matched your search

@@ -28,12 +28,12 @@ public class CustomProblemDetailsFactory : ProblemDetailsFactory
/// <summary>
/// Initializes a new instance of the <see cref="CustomProblemDetailsFactory"/> class.
/// </summary>
/// <param name="options">Injected service for retrieving <see cref="ApiBehaviorOptions"/>.</param>
/// <param name="apiBehaviorOptions">Injected service for retrieving <see cref="ApiBehaviorOptions"/>.</param>
/// <param name="problemDetailsOptions">Injected service for retrieving <see cref="ProblemDetailsOptions"/>.</param>
/// <exception cref="ArgumentNullException">Thrown when the value of options (if any) is <see langword="null"/>.</exception>
public CustomProblemDetailsFactory(IOptions<ApiBehaviorOptions> options, IOptions<ProblemDetailsOptions>? problemDetailsOptions = null)
public CustomProblemDetailsFactory(IOptions<ApiBehaviorOptions> apiBehaviorOptions, IOptions<ProblemDetailsOptions>? problemDetailsOptions = null)
{
_options = options?.Value ?? throw new ArgumentNullException(nameof(options));
_options = apiBehaviorOptions?.Value ?? throw new ArgumentNullException(nameof(apiBehaviorOptions));
_configure = problemDetailsOptions?.Value?.CustomizeProblemDetails;
}
#endregion
@@ -1,4 +1,4 @@
#region ========================================================================= USING =====================================================================================
#region ========================================================================= USING =====================================================================================
using Microsoft.AspNetCore.Mvc.ModelBinding;
using System;
using System.Threading.Tasks;
@@ -19,8 +19,7 @@ public class UrlStringBinder : IModelBinder
/// <returns>A task representing the bind operation.</returns>
public Task BindModelAsync(ModelBindingContext bindingContext)
{
if (bindingContext is null)
throw new ArgumentNullException(nameof(bindingContext));
ArgumentNullException.ThrowIfNull(bindingContext);
string modelName = bindingContext.ModelName;
// try to fetch the value of the argument by name
ValueProviderResult valueProviderResult = bindingContext.ValueProvider.GetValue(modelName);
@@ -38,4 +37,4 @@ public class UrlStringBinder : IModelBinder
return Task.CompletedTask;
}
#endregion
}
}
@@ -51,7 +51,7 @@ public class DirectoriesController : ApiController
ErrorOr<IEnumerable<FileSystemTreeNodeResponse>> result = await _mediator.Send(new GetDirectoryTreeQuery(path, includeFiles, includeHiddenElements), cancellationToken).ConfigureAwait(false);
if (!result.IsError && result.Value is not null)
{
foreach (FileSystemTreeNodeResponse treeNode in result.Value)
foreach (FileSystemTreeNodeResponse treeNode in result.Value ?? [])
{
if (cancellationToken.IsCancellationRequested)
yield break;
@@ -73,7 +73,7 @@ public class DirectoriesController : ApiController
ErrorOr<IEnumerable<FileSystemTreeNodeResponse>> result = await _mediator.Send(new GetTreeDirectoriesQuery(path,includeHiddenElements), cancellationToken).ConfigureAwait(false);
if (!result.IsError && result.Value is not null)
{
foreach (FileSystemTreeNodeResponse directory in result.Value)
foreach (FileSystemTreeNodeResponse directory in result.Value ?? [])
{
if (cancellationToken.IsCancellationRequested)
yield break;
@@ -95,7 +95,7 @@ public class DirectoriesController : ApiController
ErrorOr<IEnumerable<DirectoryResponse>> result = await _mediator.Send(new GetDirectoriesQuery(path, includeHiddenElements), cancellationToken).ConfigureAwait(false);
if (!result.IsError && result.Value is not null)
{
foreach (DirectoryResponse directory in result.Value)
foreach (DirectoryResponse directory in result.Value ?? [])
{
if (cancellationToken.IsCancellationRequested)
yield break;
@@ -5,7 +5,6 @@ using Lumina.Application.Core.FileManagement.Files.Queries.GetTreeFiles;
using Lumina.Contracts.Responses.FileManagement;
using Lumina.Presentation.Api.Common.ModelBinders;
using Lumina.Presentation.Api.Core.Controllers.Common;
using MapsterMapper;
using Mediator;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
@@ -49,7 +48,7 @@ public class FilesController : ApiController
[FromQuery] bool includeHiddenElements, [EnumeratorCancellation] CancellationToken cancellationToken)
{
ErrorOr<IEnumerable<FileSystemTreeNodeResponse>> result = await _mediator.Send(new GetTreeFilesQuery(path, includeHiddenElements), cancellationToken).ConfigureAwait(false);
foreach (FileSystemTreeNodeResponse file in result.Value)
foreach (FileSystemTreeNodeResponse file in result.Value ?? [])
{
if (cancellationToken.IsCancellationRequested)
yield break;
@@ -70,7 +69,7 @@ public class FilesController : ApiController
ErrorOr<IEnumerable<FileResponse>> result = await _mediator.Send(new GetFilesQuery(path, includeHiddenElements), cancellationToken).ConfigureAwait(false);
if (!result.IsError)
{
foreach (FileResponse file in result.Value)
foreach (FileResponse file in result.Value ?? [])
{
if (cancellationToken.IsCancellationRequested)
yield break;
@@ -1,6 +1,8 @@
#region ========================================================================= USING =====================================================================================
using FluentValidation;
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Exceptions;
using Lumina.Presentation.Web.Common.Filters;
using Lumina.Presentation.Web.Common.Services;
using Lumina.Presentation.Web.Core.Services.UI;
using Microsoft.Extensions.DependencyInjection;
@@ -11,6 +13,7 @@ using Polly.Wrap;
using System;
using System.Net;
using System.Net.Http;
using System.Text.Json.Serialization;
#endregion
namespace Lumina.Presentation.Web.Common.DependencyInjection;
@@ -28,25 +31,25 @@ public static class PresentationWebLayerServices
/// <returns>The updated <see cref="IServiceCollection"/>.</returns>
public static IServiceCollection AddPresentationWebLayerServices(this IServiceCollection services)
{
services.AddControllersWithViews();
services.AddControllersWithViews(options => options.Filters.Add(typeof(ApiExceptionFilter)))
.AddJsonOptions(options => options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()));
// scan the current assembly for validators and register them to the DI container
services.AddValidatorsFromAssemblyContaining<Program>(ServiceLifetime.Singleton);
// handle transient errors like network timeouts or intermittent failures
AsyncRetryPolicy<HttpResponseMessage> retryPolicy = Policy
AsyncRetryPolicy<HttpResponseMessage> retryPolicy = Policy<HttpResponseMessage>
.Handle<HttpRequestException>()
.OrResult<HttpResponseMessage>(r =>
!r.IsSuccessStatusCode &&
r.StatusCode != HttpStatusCode.Forbidden &&
r.StatusCode != HttpStatusCode.BadRequest)
.OrInner<ApiException>(ex =>
ex.HttpStatusCode != HttpStatusCode.BadRequest &&
ex.HttpStatusCode != HttpStatusCode.Forbidden)
.WaitAndRetryAsync(3, retryAttempt =>
TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));
// use a circuit breaker to prevent repeatedly calling a failing service
AsyncCircuitBreakerPolicy<HttpResponseMessage> circuitBreakerPolicy = Policy
AsyncCircuitBreakerPolicy<HttpResponseMessage> circuitBreakerPolicy = Policy<HttpResponseMessage>
.Handle<HttpRequestException>()
.OrResult<HttpResponseMessage>(r => r.StatusCode == HttpStatusCode.InternalServerError)
.OrInner<ApiException>(ex => ex.HttpStatusCode == HttpStatusCode.InternalServerError)
.CircuitBreakerAsync(3, TimeSpan.FromSeconds(30));
AsyncPolicyWrap<HttpResponseMessage> policy = Policy.WrapAsync(retryPolicy, circuitBreakerPolicy);
@@ -58,6 +61,7 @@ public static class PresentationWebLayerServices
services.AddSingleton<ComboboxService>();
services.AddScoped<INotificationService, NotificationService>();
services.AddScoped<ApiExceptionFilter>();
return services;
}
@@ -0,0 +1,107 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Exceptions;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Common.Filters;
/// <summary>
/// Filters API exceptions and provides centralized handling for API-related errors.
/// </summary>
public class ApiExceptionFilter : IExceptionFilter
{
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Called after an action has thrown an Exception.
/// </summary>
/// <param name="context">The <see cref="ExceptionContext"/>.</param>
public void OnException(ExceptionContext context)
{
// check if the exception is an ApiException
if (context.Exception is ApiException apiException)
{
// handle unauthorized errors by prompting the user to re-login
if (apiException.HttpStatusCode == HttpStatusCode.Unauthorized)
{
SignOutSynchronously(context.HttpContext);
string currentUrl = context.HttpContext.Request.GetDisplayUrl();
context.HttpContext.Response.Redirect(currentUrl); // force an entire refresh of the current location, so that header and footer are re-rendered too
}
else
{
StringBuilder errorMessage = new();
if (apiException.ProblemDetails is not null)
{
errorMessage.AppendLine($"HTTP {apiException.ProblemDetails.Status} {apiException.HttpStatusCode}<br>");
if (!string.IsNullOrEmpty(apiException.ProblemDetails.Detail))
errorMessage.AppendLine($"<b>{apiException.ProblemDetails.Detail}<b>");
else if (!string.IsNullOrEmpty(apiException.ProblemDetails.Title))
errorMessage.AppendLine($"<b>{apiException.ProblemDetails.Title}<b>");
if (apiException.ProblemDetails.Extensions is not null && apiException.ProblemDetails.Extensions.TryGetValue("errors", out JsonElement errorsObj))
{
if (errorsObj is JsonElement jsonElement && jsonElement.ValueKind == JsonValueKind.Object)
{
errorMessage.AppendLine("Validation Errors:");
foreach (JsonProperty error in jsonElement.EnumerateObject())
{
string fieldName = error.Name;
if (error.Value.ValueKind == JsonValueKind.Array)
foreach (JsonElement errorValue in error.Value.EnumerateArray())
errorMessage.AppendLine($"- {fieldName}: {errorValue}<br>");
}
}
}
if (apiException.ProblemDetails.Extensions is not null)
foreach (KeyValuePair<string, JsonElement> extension in apiException.ProblemDetails.Extensions)
if (extension.Key != "errors")
errorMessage.AppendLine($"{extension.Key}: {extension.Value}<br>");
}
else
{
errorMessage.AppendLine($"HTTP {apiException.HttpStatusCode}<br>");
errorMessage.AppendLine($"{apiException.Message}<br>");
}
// return a JSON result with the error details
context.Result = new JsonResult(new
{
success = false,
errorMessage = errorMessage.ToString()
});
}
}
else
{
// return a JSON result with the error details
context.Result = new JsonResult(new
{
success = false,
errorMessage = context.Exception.Message.ToString()
});
}
// mark the exception as handled to prevent propagation
context.ExceptionHandled = true;
}
/// <summary>
/// Signs out the user synchronously by deleting the authentication cookie and token.
/// </summary>
/// <param name="httpContext">The HttpContext for the current request.</param>
private static void SignOutSynchronously(HttpContext httpContext)
{
Task task = httpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
task.Wait(); // run the task synchronously
httpContext.Response.Cookies.Delete("Token");
}
#endregion
}
@@ -1,8 +1,13 @@
namespace Lumina.Presentation.Web.Common.Models.FileManagement;
#region ========================================================================= USING =====================================================================================
using System.Diagnostics;
#endregion
namespace Lumina.Presentation.Web.Common.Models.FileManagement;
/// <summary>
/// Represents a response containing a file system path.
/// </summary>
[DebuggerDisplay("{Path}")]
public class PathSegmentModel
{
#region ==================================================================== PROPERTIES =================================================================================
@@ -11,4 +16,4 @@ public class PathSegmentModel
/// </summary>
public string Path { get; set; } = null!;
#endregion
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,87 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Models.FileManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Controllers.FileManagement;
/// <summary>
/// Controller for managing file system directories.
/// </summary>
[Route("[controller]")]
public class DirectoriesController : Controller
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IApiHttpClient _apiHttpClient;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DirectoriesController"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public DirectoriesController(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the directories of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the directories.</param>
/// <param name="includeHiddenElements">Whether to include hidden file system elements or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-directories")]
public async IAsyncEnumerable<DirectoryModel?> GetDirectories([FromQuery] string path, [FromQuery] bool includeHiddenElements, [EnumeratorCancellation] CancellationToken cancellationToken)
{
IAsyncEnumerable<DirectoryModel?> response = _apiHttpClient.GetAsyncEnumerable<DirectoryModel>(
$"directories/get-directories?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken: cancellationToken);
await foreach (DirectoryModel? directory in response)
{
if (cancellationToken.IsCancellationRequested)
yield break;
yield return directory;
}
}
/// <summary>
/// Gets the directories of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the directories.</param>
/// <param name="includeHiddenElements">Whether to include hidden file system elements or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-tree-directories")]
public async IAsyncEnumerable<FileSystemTreeNodeModel?> GetTreeDirectories([FromQuery] string path, [FromQuery] bool includeHiddenElements, [EnumeratorCancellation] CancellationToken cancellationToken)
{
IAsyncEnumerable<FileSystemTreeNodeModel?> response = _apiHttpClient.GetAsyncEnumerable<FileSystemTreeNodeModel>(
$"directories/get-tree-directories?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken: cancellationToken);
await foreach (FileSystemTreeNodeModel? directory in response)
{
if (cancellationToken.IsCancellationRequested)
yield break;
yield return directory;
}
}
/// <summary>
/// Gets the tree of expanded directories leading up to <paramref name="path"/>, with the additional list of drives, and children of the last child directory.
/// </summary>
/// <param name="path">The path for which to get the directory tree.</param>
/// <param name="includeHiddenElements">Whether to include hidden file system elements or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-directory-tree")]
public async Task<IActionResult> GetDirectoryTree([FromQuery] string path, [FromQuery] bool includeFiles, [FromQuery] bool includeHiddenElements, CancellationToken cancellationToken)
{
FileSystemTreeNodeModel[] response = await _apiHttpClient.GetAsync<FileSystemTreeNodeModel[]>($"directories/get-directory-tree?path={Uri.EscapeDataString(path)}&includeFiles={includeFiles}&includeHiddenElements={includeHiddenElements}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { tree = response } });
}
#endregion
}
@@ -0,0 +1,44 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Models.FileManagement;
using Microsoft.AspNetCore.Mvc;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Controllers.FileManagement;
/// <summary>
/// Controller for managing file system drives.
/// </summary>
[Route("[controller]")]
public class DrivesController : Controller
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IApiHttpClient _apiHttpClient;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="DrivesController"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public DrivesController(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Controller action for getting the list of all file system drives.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-drives")]
public async Task<IActionResult> GetDrives(CancellationToken cancellationToken)
{
FileSystemTreeNodeModel[] response = await _apiHttpClient.GetAsync<FileSystemTreeNodeModel[]>($"drives/get-drives", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { drives = response } });
}
#endregion
}
@@ -0,0 +1,44 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Models.FileManagement;
using Microsoft.AspNetCore.Mvc;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Controllers.FileManagement;
/// <summary>
/// Controller for managing file systems.
/// </summary>
[Route("/file-system")]
public class FileSystemController : Controller
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IApiHttpClient _apiHttpClient;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemController"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public FileSystemController(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the type of the file system.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-type")]
public async Task<IActionResult> GetType(CancellationToken cancellationToken)
{
FileSystemTypeModel response = await _apiHttpClient.GetAsync<FileSystemTypeModel>($"file-system/get-type", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { platformType = response.PlatformType.ToString() } });
}
#endregion
}
@@ -0,0 +1,73 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Models.FileManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
#endregion
namespace Lumina.Presentation.Web.Controllers.FileManagement;
/// <summary>
/// Controller for managing file system files.
/// </summary>
[Route("[controller]")]
public class FilesController : Controller
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IApiHttpClient _apiHttpClient;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FilesController"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public FilesController(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the files of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the files.</param>
/// <param name="includeHiddenElements">Whether to include hidden file system elements or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-tree-files")]
public async IAsyncEnumerable<FileSystemTreeNodeModel?> GetTreeFiles([FromQuery] string path, [FromQuery] bool includeHiddenElements, [EnumeratorCancellation] CancellationToken cancellationToken)
{
IAsyncEnumerable<FileSystemTreeNodeModel?> response = _apiHttpClient.GetAsyncEnumerable<FileSystemTreeNodeModel>(
$"files/get-tree-files?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken: cancellationToken);
await foreach (FileSystemTreeNodeModel? file in response)
{
if (cancellationToken.IsCancellationRequested)
yield break;
yield return file;
}
}
/// <summary>
/// Gets the files of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the files.</param>
/// <param name="includeHiddenElements">Whether to include hidden file system elements or not.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-files")]
public async IAsyncEnumerable<FileModel?> GetFiles([FromQuery] string path, [FromQuery] bool includeHiddenElements, [EnumeratorCancellation] CancellationToken cancellationToken)
{
IAsyncEnumerable<FileModel?> response = _apiHttpClient.GetAsyncEnumerable<FileModel>(
$"files/get-files?path={Uri.EscapeDataString(path)}&includeHiddenElements={includeHiddenElements}", cancellationToken: cancellationToken);
await foreach (FileModel? file in response)
{
if (cancellationToken.IsCancellationRequested)
yield break;
yield return file;
}
}
#endregion
}
@@ -0,0 +1,105 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Api;
using Lumina.Presentation.Web.Common.Models.FileManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading;
using System.Threading.Tasks;
#endregion
namespace Lumina.Presentation.Web.Controllers.FileManagement;
/// <summary>
/// Controller for managing file system paths.
/// </summary>
[Route("[controller]")]
public class PathController : Controller
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly IApiHttpClient _apiHttpClient;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="PathController"/> class.
/// </summary>
/// <param name="apiHttpClient">Injected service for interactions with the API.</param>
public PathController(IApiHttpClient apiHttpClient)
{
_apiHttpClient = apiHttpClient;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Gets the root of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the root.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-path-root")]
public async Task<IActionResult> GetPathRoot([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel response = await _apiHttpClient.GetAsync<PathSegmentModel>($"path/get-path-root?path={Uri.EscapeDataString(path)}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { root = response } });
}
/// <summary>
/// Gets the path separator character of the file system.
/// </summary>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-path-separator")]
public async Task<IActionResult> GetPathSeparator(CancellationToken cancellationToken)
{
PathSeparatorModel response = await _apiHttpClient.GetAsync<PathSeparatorModel>($"path/get-path-separator", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { pathSeparator = response.Separator } });
}
/// <summary>
/// Gets the path separator character of the file system.
/// </summary>
/// <param name="path">The path for which to get the parent path.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("get-path-parent")]
public async Task<IActionResult> GetPathParent([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/get-path-parent?path={Uri.EscapeDataString(path)}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { pathSegments = response } });
}
/// <summary>
/// Gets the path components of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path for which to get the path segments.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("split")]
public async Task<IActionResult> SplitPath([FromQuery] string path, CancellationToken cancellationToken)
{
PathSegmentModel[] response = await _apiHttpClient.GetAsync<PathSegmentModel[]>($"path/split?path={Uri.EscapeDataString(path)}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { pathSegments = response } });
}
/// <summary>
/// Validates the validity of <paramref name="path"/>.
/// </summary>
/// <param name="path">The path to be validated.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("validate")]
public async Task<IActionResult> ValidatePath([FromQuery] string path, CancellationToken cancellationToken)
{
PathValidModel response = await _apiHttpClient.GetAsync<PathValidModel>($"path/validate?path={Uri.EscapeDataString(path)}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { isValid = response.IsValid } });
}
/// <summary>
/// Checks whether <paramref name="path"/> exists or not.
/// </summary>
/// <param name="path">The path to be checked.</param>
/// <param name="cancellationToken">Cancellation token that can be used to stop the execution.</param>
[HttpGet("check-path-exists")]
public async Task<IActionResult> CheckPathExists([FromQuery] string path, CancellationToken cancellationToken)
{
PathExistsModel response = await _apiHttpClient.GetAsync<PathExistsModel>($"path/check-path-exists?path={Uri.EscapeDataString(path)}", cancellationToken: cancellationToken);
return Json(new { success = true, data = new { exists = response.Exists } });
}
#endregion
}
@@ -1,17 +0,0 @@
<<<<<<< Updated upstream
@page "/"
@using Lumina.Presentation.Web.Components
<PageTitle>Lumina - Home</PageTitle>
<FileSystemBrowser IncludeFiles="true" Path="C:\Users\ROCH\Downloads\" />
=======
@page "/"
@using Lumina.Presentation.Web.Components
<PageTitle>Lumina - Home</PageTitle>
<FileSystemBrowser IncludeFiles="true" Path="C:\Users\ROCH\Downloads\" />
>>>>>>> Stashed changes
+1 -1
View File
@@ -35,7 +35,7 @@ public class Program
app.UseHsts();
}
app.UseHttpsRedirection();
//app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
@@ -4,7 +4,7 @@
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
//"launchBrowser": true,
"applicationUrl": "http://localhost:5012",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
@@ -13,8 +13,8 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "https://localhost:7112;http://localhost:5012",
//"launchBrowser": true,
"applicationUrl": "http://localhost:5012;https://localhost:7112",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@@ -0,0 +1,49 @@
#region ========================================================================= USING =====================================================================================
using Lumina.Presentation.Web.Common.Enums.FileSystem;
using Lumina.Presentation.Web.Common.Models.Configuration;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
#endregion
namespace Lumina.Presentation.Web.ViewComponents;
/// <summary>
/// View component for the file system browser.
/// </summary>
public class FileSystemBrowserViewComponent : ViewComponent
{
#region ================================================================== FIELD MEMBERS ================================================================================
private readonly ServerConfigurationModel _serverConfigurationModel;
#endregion
#region ====================================================================== CTOR =====================================================================================
/// <summary>
/// Initializes a new instance of the <see cref="FileSystemBrowserViewComponent"/> class.
/// </summary>
/// <param name="serverConfigurationModelOptions">Injected service for retrieving <see cref="ServerConfigurationModel"/>.</param>
public FileSystemBrowserViewComponent(IOptions<ServerConfigurationModel> serverConfigurationModelOptions)
{
_serverConfigurationModel = serverConfigurationModelOptions.Value;
}
#endregion
#region ===================================================================== METHODS ===================================================================================
/// <summary>
/// Invokes the <see cref="FileSystemBrowser"/> view component.
/// </summary>
/// <returns>
/// An <see cref="IViewComponentResult"/> that renders the view with file system browsing configuration.
/// </returns>
public IViewComponentResult Invoke()
{
return View(new
{
Path = @"C:\",
ServerBasePath = $"{_serverConfigurationModel.BaseAddress}:{_serverConfigurationModel.Port}/api/v{_serverConfigurationModel.ApiVersion}/",
ClientBasePath = "http://localhost:5012/", // TODO: take from appsettings or environment
ViewMode = FileSystemViewMode.List,
IconSize = FileSystemIconSize.Large
});
}
#endregion
}
@@ -1,8 +1 @@
@{
ViewData["Title"] = "Home Page";
}
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>Learn about <a href="https://learn.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
@await Component.InvokeAsync("FileSystemBrowser")
@@ -0,0 +1,537 @@
@using Lumina.Presentation.Web.Common.Models.Common
@using Lumina.Presentation.Web.Common.Api
@using Lumina.Presentation.Web.Common.Enums.FileSystem
@using Lumina.Presentation.Web.Common.Enums.Notifications
@using Lumina.Presentation.Web.Common.Exceptions
@using Lumina.Presentation.Web.Common.Models.FileManagement
@using Lumina.Presentation.Web.Common.Models.UI
@using Lumina.Presentation.Web.Common.Services
@using Microsoft.AspNetCore.Components
@using System.Text.Json
@using System.Text
@inject IApiHttpClient _apiHttpClient
@inject INotificationService _notificationService
<div id="file-system-browser-dialog" class="container-background above-modal">
<div id="file-system-browser-content">
<div id="file-system-browser-header">
<div id="file-system-browser-shine-spark"></div>
<div id="file-system-browser-shine-effect"></div>
<div id="file-system-browser-header-navigation-container">
<!--File System Navigator-->
<div id="navigator-view-mode-container">
<!--List View Mode-->
<svg id="navigator-list-view" class="navigator-icon" width="30" height="30" 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">
<title>List View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M3,5 h8 v8 h-8 z M11,9 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M5,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M3,13 h8 v8 h-8 z M11,17 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M5,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M3,21 h8 v8 h-8 z M11,25 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M5,23 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M20,5 h8 v8 h-8 z M28,9 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M22,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M20,13 h8 v8 h-8 z M28,17 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M22,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M20,21 h8 v8 h-8 z M28,25 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill list" filter="url(#glow)" d="M22,23 h4 v4 h-4 z" />
</g>
</svg>
<!--Details View Mode-->
<svg id="navigator-details-view" class="navigator-icon" width="30" height="30" 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">
<title>Details View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M3,5 h8 v8 h-8 z M11,9 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M5,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M3,13 h8 v8 h-8 z M11,17 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M5,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M3,21 h8 v8 h-8 z M11,25 h4" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M5,23 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M17.5,8.5 h5 v1 h-5 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M17.5,16.5 h5 v1 h-5 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M17.5,24.5 h5 v1 h-5 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M25,8.5 h5 v1 h-5 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M25,16.5 h5 v1 h-5 z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill details" filter="url(#glow)" d="M25,24.5 h5 v1 h-5 z" />
</g>
</svg>
<!--Small Icons View Mode-->
<svg id="navigator-small-icons-view" class="navigator-icon" width="30" height="30" 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">
<title>Small Icons View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M4,5 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M6,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M4,13 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M6,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M4,21 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M6,23 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M12,5 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M14,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M12,13 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M14,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M12,21 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M14,23 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M20,5 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M22,7 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M20,13 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M22,15 h4 v4 h-4 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M20,21 h8 v8 h-8 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill small-icons" filter="url(#glow)" d="M22,23 h4 v4 h-4 z" />
</g>
</svg>
<!--Medium Icons View Mode-->
<svg id="navigator-medium-icons-view" class="navigator-icon" width="30" height="30" 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">
<title>Medium Icons View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M4,5 h12 v12 h-12 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M6,7 h8 v8 h-8 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M4,17 h12 v12 h-12 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M6,19 h8 v8 h-8 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M16,5 h12 v12 h-12 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M18,7 h8 v8 h-8 z" />
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M16,17 h12 v12 h-12 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill medium-icons" filter="url(#glow)" d="M18,19 h8 v8 h-8 z" />
</g>
</svg>
<!--Large Icons View Mode-->
<svg id="navigator-large-icons-view" class="navigator-icon" width="30" height="30" 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">
<title>Large Icons View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill large-icons" filter="url(#glow)" d="M4,5 h24 v24 h-24 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill large-icons" filter="url(#glow)" d="M6,7 h20 v20 h-20 z" />
</g>
</svg>
<!--Extra Large Icons View Mode-->
<svg id="navigator-extra-large-icons-view" class="navigator-icon" width="30" height="30" 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">
<title>Extra Large Icons View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="stroke:currentColor;" class="navigator-icon-fill extra-large-icons" filter="url(#glow)" d="M4,5 h24 v24 h-24 z" fill="none" stroke-width="1" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill extra-large-icons" filter="url(#glow)" d="M11,12 L16,17 L21,12 L26,17 V7 H6 V17 Z" fill="none" stroke-width="1" />
</g>
</svg>
</div>
<div id="navigator-navigation-controls-container">
<!--Navigation-->
<div id="navigator-history">
<img src="images/ui/back.svg" id="navigator-navigate-back" class="navigation-icon" alt="Back" title="Back" />
<img src="images/ui/forward.svg" id="navigator-navigate-forward" class="navigation-icon" alt="Forward" title="Forward" />
<img src="images/ui/up.svg" id="navigator-navigate-up" class="navigation-icon" alt="Up One Level" title="Up One Level" />
</div>
<!--Toggle Tree View-->
<svg id="navigator-toggle-tree-view-button" class="navigator-icon" width="30" height="30" 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">
<title>Toggle Tree View</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(6,6) scale(0.55)">
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill tree-view" filter="url(#glow)" 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" />
</g>
</svg>
<!--Toggle Thumbnails-->
<svg id="navigator-toggle-thumbnails-button" class="navigator-icon" width="30" height="30" 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">
<title>Toggle Thumbanils</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(3,2.5) scale(0.32)">
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill" filter="url(#glow)" 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 " />
</g>
</svg>
<!--Toggle Hidden Elements-->
<svg id="navigator-toggle-hidden-button" class="navigator-icon" width="30" height="30" 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">
<title>Toggle Hidden Items</title>
<defs>
<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="linearGradient" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(5,5) scale(0.85)">
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill hidden-elements" filter="url(#glow)" 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" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill hidden-elements" filter="url(#glow)" 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 15.9261Z" />
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill hidden-elements" filter="url(#glow)" 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" />
</g>
</svg>
<!--Toggle Selection Mode-->
<svg id="navigator-toggle-selection-button" class="navigator-icon" width="30" height="30" 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">
<title>Toggle Selection Mode</title>
<defs>
<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="linearGradient1" 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>
<g transform="translate(0,-0.5) scale(0.475)">
<rect x=".99971" y="59" width="62.001" height="1" ry="0" fill="url(#linearGradient)" stroke-width="3.7796" style="mix-blend-mode:normal;paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5">
<rect x="4.5" y="4.5" width="21" height="21" ry="2.5" fill="none" stroke="#039bfc" style="paint-order:stroke fill markers" filter="url(#glow)" />
</g>
<g transform="translate(8,8) scale(0.030)">
<path xmlns="http://www.w3.org/2000/svg" style="fill:currentColor;" class="navigator-icon-fill selection-mode" filter="url(#glow)" d="M161.9,21.9v21.9h131.2V0H161.9v43.7V21.9v21.9h131.2V0H161.9v43.7V21.9z M406.6,425.9L393,408.7l-52.4,41.6l-79.4-102.1 l-53,61.8l-38.9-217.9l198.1,99.1l-78.6,26.2l100.9,122.4L406.6,425.9L393,408.7L406.6,425.9l16.9-13.9l-60.4-73.2l118.3-39.4 L110.8,114l70.4,394.5l78.2-91.2l73.7,94.7l104.5-82.9l-14.2-17.2L406.6,425.9z M424.3,87.5V0h-87.5v43.7l43.7,0l0,43.7H424.3 L424.3,87.5z M118.1,0H30.7v87.5h43.7l0-43.7l43.7,0V0L118.1,0z M30.7,306.2v87.5h87.5v-43.7l-43.7,0l0-43.7H30.7z M402.5,131.2 h-21.9v87.5h43.7v-87.5h-43.7H402.5h-21.9v87.5h43.7v-87.5h-43.7H402.5z M52.5,262.4h21.9V131.2H30.7v131.2h43.7H52.5h21.9V131.2 H30.7v131.2h43.7H52.5z" />
</g>
</svg>
</div>
<!--Navigator-->
<div id="navigator-address-bar-container">
<div id="navigator-address-bar-group">
<input type="text" class="enlightenment-input navigator-address-bar-input" Name="navigator-address-bar-input" autocomplete="on" id="navigator-address-bar-input" />
<div id="navigator-address-bar">
<ul id="navigator-path-segments">
</ul>
</div>
</div>
<button id="navigator-edit-path-button" class="navigator-edit-path-button abort-button f-16" style="height:28px; width:35px;">
<img src="images/ui/edit.svg" id="navigator-edit-icon" alt="Edit Path" title="Edit Path" />
</button>
<button id="navigator-navigate-button" class="navigator-navigate-button confirm-button f-16" style="height:28px; width:35px;">
<img src="images/ui/check.svg" id="navigator-navigate-icon" alt="Navigate" title="Navigate" />
</button>
<button class="file-system-browser-content-new-directory abort-button f-16" style="height:28px; width:35px;">
<img src="images/ui/new-directory.svg" id="navigator-new-directory-icon" alt="New Directory" title="New Directory" />
</button>
<button class="file-system-browser-content-favorite-directory abort-button f-16" style="height:28px; width:35px;">
<img src="images/ui/favorite-star.svg" class="navigation-icon favorite-unselected" alt="Favorite directory" title="Favorite directory" />
</button>
</div>
<!--End File System Navigator-->
</div>
</div>
<div id="file-system-browser-file-system-container">
<!--File System Tree View-->
<div id="file-system-browser-file-system-treeview-container">
<div id="file-system-browser-file-system-treeview">
<div id="file-system-browser-treeview" class="treeview">
</div>
</div>
</div>
<!--End File System Tree View-->
<div id="file-system-browser-file-system-directories-container">
<div id="file-system-browser-file-system-directories">
<div id="file-system-browser-file-system-explorer-container" class="scroll-horizontal">
<div id="file-system-browser-file-system-explorer-details-header" style="height: 0px;">
<span>Name</span>
</div>
<div id="file-system-browser-file-system-explorer">
</div>
</div>
</div>
</div>
</div>
<div id="file-system-browser-actions-container">
<div id="file-system-browser-actions-path-container">
<label class="text-light-one">Directory</label>
<input type="text" id="file-system-browser-selected-element" Name="file-system-browser-selected-element" class="enlightenment-input w-100" readonly autocomplete="on" />
</div>
<div id="file-system-browser-actions">
<button id="file-system-browser-cancel-button" class="abort-button w-100px">Cancel</button>
<button id="file-system-browser-confirm-button" class="confirm-button w-100px" disabled>Open</button>
</div>
</div>
</div>
@* <div id="divModal"></div>
<label class="text-light-one">Enter new directory name:</label>
<EnlightenmentInput Type="text" Name="newDirectoryName" AutoComplete="true" />
<EnlightenmentButton IsConfirmButton="false">Cancel</EnlightenmentButton>
<EnlightenmentButton>Confirm</EnlightenmentButton> *@
</div>
<div id="visible-selection-rectangle"></div>
<div id="selection-rectangle"></div>
<script defer src="~/js/file-system-browser-dialog.js" asp-append-version="true"></script>
<script defer>
document.addEventListener('DOMContentLoaded', async function () {
await initFileSystemBrowser(
'@Model.ServerBasePath',
'@Model.ClientBasePath',
'@Model.Path.Replace(@"\", @"\\")',
'@Model.ViewMode.ToString().ToLower()',
'@Model.IconSize.ToString().ToLower()');
});
</script>
@@ -1,49 +1,36 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Lumina.Presentation.Web</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/Lumina.Presentation.Web.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">Lumina.Presentation.Web</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2024 - Lumina.Presentation.Web - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - Lumina</title>
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/button.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/checkbox.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/combobox.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/file-system-browser.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/file-system-tree-view-node.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/navigation-menu.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/notification.css" asp-append-version="true" />
<link rel="stylesheet" href="~/css/textbox.css" asp-append-version="true" />
<link rel="stylesheet" href="~/Lumina.Presentation.Web.styles.css" asp-append-version="true" />
</head>
<body>
<div id="page">
<header>
@await Html.PartialAsync("_NavMenu")
</header>
<main role="main">
<article>
@RenderBody()
</article>
</main>
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
<!--Modal grid background-->
<div id="modal-background"></div>
<script defer src="~/js/notifications.js" asp-append-version="true"></script>
<script defer src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
@@ -0,0 +1,118 @@
<input type="checkbox" id="hamburger-input" class="burger-shower" />
<label id="hamburger-menu" for="hamburger-input">
<span></span>
<span></span>
<span></span>
<nav id="mobile-menu">
<div id="mobile-menu-content">
<div class="mobile-menu-heading">
Account
</div>
<ul>
<li><a href="account/login"><span>Login</span></a></li>
<li><a href="account/logout"><span>Logout</span></a></li>
<li><a href="account/register"><span>Register</span></a></li>
<li><a href="account"><span>My Account</span></a></li>
</ul>
<div class="mobile-menu-heading">
Tools
</div>
<ul>
<li><a href="tools/options"><span>Options</span></a></li>
</ul>
<div class="mobile-menu-heading">
Library
</div>
<ul>
<li><a href="library/manage"><span>Manage libraries</span></a></li>
<li><a href="library/manage/item"><span>Add media library</span></a></li>
</ul>
<div class="mobile-menu-heading">
Written Content
</div>
<ul>
<li><a href="library/written-content/books"><span>Books</span></a></li>
<li><a href="library/written-content/magazines"><span>Magazines</span></a></li>
</ul>
<div class="mobile-menu-heading">
Audio
</div>
<ul>
<li><a href="library/audio/music"><span>Music</span></a></li>
<li><a href="library/audio/interviews"><span>Interviews</span></a></li>
</ul>
<div class="mobile-menu-heading">
Video
</div>
<ul>
<li><a href="library/video/movies"><span>Movies</span></a></li>
<li><a href="library/video/tvshows"><span>TV Shows</span></a></li>
</ul>
<div class="mobile-menu-heading">
Help
</div>
<ul>
<li><a href="help/documentation"><span>Documentation</span></a></li>
<li><a href="help/about"><span>About</span></a></li>
</ul>
</div>
</nav>
</label>
<nav class="menubar">
<ul>
<li tabindex="0">
<input type="radio" id="account-menu" name="menu">
<label for="account-menu">Account</label>
<ul>
<li><a href="account/login">Login</a></li>
<li><a href="account/logout">Logout</a></li>
<li><a href="account/register">Register</a></li>
<li><a href="account">My Account</a></li>
</ul>
</li>
<li tabindex="0">
<input type="radio" id="tools-menu" name="menu">
<label for="tools-menu">Tools</label>
<ul>
<li><a href="tools/options">Options</a></li>
</ul>
</li>
<li tabindex="0">
<input type="radio" id="library-menu" name="menu">
<label for="library-menu">Library</label>
<ul>
<li tabindex="0"><a href="library/manage">Manage libraries</a></li>
<li tabindex="0"><a href="library/manage/item">Add new library</a></li>
<li class="has-submenu" tabindex="0">
<label>Written Content</label>
<ul>
<li><a href="library/written-content/books">Books</a></li>
<li><a href="library/written-content/magazines">Magazines</a></li>
</ul>
</li>
<li class="has-submenu" tabindex="0">
<label>Audio</label>
<ul>
<li><a href="library/audio/music">Music</a></li>
<li><a href="library/audio/interviews">Interviews</a></li>
</ul>
</li>
<li class="has-submenu" tabindex="0">
<label>Video</label>
<ul>
<li><a href="library/video/movies">Movies</a></li>
<li><a href="library/video/tvshows">TV Shows</a></li>
</ul>
</li>
</ul>
</li>
<li tabindex="0">
<input type="radio" id="help-menu" name="menu">
<label for="help-menu">Help</label>
<ul>
<li><a href="help/documentation">Documentation</a></li>
<li><a href="help/about">About</a></li>
</ul>
</li>
</ul>
</nav>
@@ -1,61 +0,0 @@
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}
.blazor-error-boundary {
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
padding: 1rem 1rem 1rem 3.7rem;
color: white;
}
.blazor-error-boundary::after {
content: "An error has occurred."
}
.loading-progress {
position: relative;
display: block;
width: 8rem;
height: 8rem;
margin: 20vh auto 1rem auto;
}
.loading-progress circle {
fill: none;
stroke: #e0e0e0;
stroke-width: 0.6rem;
transform-origin: 50% 50%;
transform: rotate(-90deg);
}
.loading-progress circle:last-child {
stroke: #1b6ec2;
stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
position: absolute;
text-align: center;
font-weight: bold;
inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after {
content: var(--blazor-load-percentage-text, "Loading");
}
@@ -0,0 +1,161 @@
.abort-button {
text-decoration: none;
border-radius: 4px;
border: solid 1px;
border-color: #006666 #004030 #003020 #006666;
background: linear-gradient(to bottom, #90AEA6 0%, #336659 50%, #004030 50%, #004030 100%);
color: #999999;
position: relative;
overflow: hidden;
transition: all 0.3s;
cursor: pointer;
outline: none;
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
z-index: 1;
}
.abort-button:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 50%;
background: radial-gradient(circle at center, #00FF00, transparent);
background-size: 120% 100%;
transform: translateY(100%);
background-position: center;
transition: transform 0.3s, opacity 0.8s;
pointer-events: none;
opacity: 0;
filter: blur(8px);
}
.abort-button:hover {
color: #fff;
}
.abort-button:hover:before {
transform: translateY(50%);
opacity: 1;
}
.abort-button:active {
background: #CC009F58;
font-style: italic;
}
.abort-button:disabled {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
}
.abort-button:disabled:hover:before {
transform: translateY(100%);
opacity: 0;
}
.abort-button:disabled:active {
font-style: normal;
}
.abort-button[disabled] {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
pointer-events: none;
text-decoration: none;
}
.abort-button[disabled]:hover:before {
transform: translateY(100%);
opacity: 0;
}
.abort-button[disabled]:active {
font-style: normal;
}
.confirm-button {
text-decoration: none;
border-radius: 4px;
border: solid 1px;
border-color: #363636 #000 #000 #363636;
background: linear-gradient(to bottom, #AAAAAA 0%, #363636 50%, #000 50%, #000 100%);
color: #AAAAAA;
position: relative;
overflow: hidden;
transition: all 0.3s;
cursor: pointer;
outline: none;
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.5);
z-index: 1;
}
.confirm-button:before {
content: "";
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 50%;
background: radial-gradient(circle at center, #00FF8B, transparent);
background-size: 120% 100%;
transform: translateY(100%);
background-position: center;
transition: transform 0.3s, opacity 0.8s;
pointer-events: none;
opacity: 0;
filter: blur(8px);
}
.confirm-button:hover {
color: #fff;
}
.confirm-button:hover:before {
transform: translateY(50%);
opacity: 1;
}
.confirm-button:active {
background: #CC000000;
font-style: italic;
}
.confirm-button:disabled {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
}
.confirm-button:disabled:hover:before {
transform: translateY(100%);
opacity: 0;
}
.confirm-button:disabled:active {
font-style: normal;
}
confirm-button[disabled] {
background: #333333;
border-color: #333333;
color: #777;
cursor: not-allowed;
pointer-events: none;
text-decoration: none;
}
.confirm-button[disabled]:hover:before {
transform: translateY(100%);
opacity: 0;
}
.confirm-button[disabled]:active {
font-style: normal;
}
@@ -0,0 +1,6 @@
namespace Lumina.Presentation.Web.wwwroot.css
{
public class checkbox
{
}
}
@@ -0,0 +1,154 @@
.enlightenment-combobox {
position: relative;
font-family: Arial, sans-serif;
padding: 0;
margin: 0;
box-sizing: border-box;
}
.enlightenment-toggle-checkbox {
display: none;
}
.enlightenment-toggle {
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
font-family: Arial, sans-serif;
font-size: 14px;
border-radius: 3px;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
color: #6DCBFE;
padding: 3px 24px 3px 18px;
width: 100%;
border: none;
outline: none;
appearance: none;
border-top: #989898 1px solid;
border-bottom: #151515 1px solid;
border-left: #878787 1px solid;
border-right: #202020 1px solid;
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%225%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20d%3D%22M2%2C0L6%2C4L10%2C0%22%2F%3E%3C%2Fsvg%3E'), url('../images/ui/scrollbar_dots_v.png'), linear-gradient(180deg, #606060, #555555, #4C4C4C, #414141);
background-repeat: no-repeat, no-repeat, repeat;
background-position: right 10px top 50%, left 7px top 50%, 0 0;
background-size: 12px 6px, 3px auto, 100%;
user-select: none;
box-sizing: border-box;
}
.enlightenment-toggle:hover {
background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%225%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20stroke-width%3D%222%22%20d%3D%22M2%2C0L6%2C4L10%2C0%22%2F%3E%3C%2Fsvg%3E'), url('../images/ui/scrollbar_dots_lit_v.png'), linear-gradient(180deg, #606060, #555555, #4C4C4C, #414141);
background-repeat: no-repeat, no-repeat, repeat;
background-position: right 10px top 50%, left 7px top 50%, 0 0;
background-size: 12px 6px, 3px auto, 100%;
}
.enlightenment-selected-text {
flex: 1;
text-align: right;
}
.enlightenment-dropdown {
display: none;
position: absolute;
top: 100%;
left: 0;
width: 100%;
box-sizing: border-box;
background-image: url('../images/ui/metal-plate.png'), linear-gradient(180deg, #505050, #464646, #404040, #363636);
background-repeat: repeat, no-repeat;
background-position: 3px 3px, 0 0; /* offset the metal-plate image by 3 pixels from the top and left */
background-clip: content-box, border-box; /* clip the metal-plate image to the content box */
border-top: #989898 1px solid;
border-bottom: #151515 1px solid;
border-left: #878787 1px solid;
border-right: #202020 1px solid;
padding: 3px;
z-index: 999;
max-height: none;
overflow-y: auto;
}
.enlightenment-dropdown > .shine-effect:first-child {
top: -4px;
}
.enlightenment-item {
display: block;
border-left: 1px solid #232323;
border-right: 1px solid #777777;
border-top: 1px solid #232323;
border-bottom: 1px solid #777777;
color: #FFFFFF;
padding: 5px 10px;
width: 100%;
box-sizing: border-box;
user-select: none;
cursor: pointer;
}
.enlightenment-item.first-item {
border-top: 1px solid #232323;
margin-top: -1px;
}
.enlightenment-item.last-item {
border-bottom: 1px solid #777777;
}
.enlightenment-item.disabled {
color: #AAAAAA;
}
.enlightenment-item:hover {
background-image: none;
background: linear-gradient(to bottom, #505050, #464646, #404040, #363636);
color: #1D8AF9;
box-shadow: inset 1px 0 0 0 #777777, inset -1px 0 0 0 #232323, inset 0 1px 0 0 #989898, inset 0 -1px 0 0 #151515;
}
.enlightenment-combobox.open .enlightenment-dropdown {
display: block;
}
.enlightenment-combobox > .shine-effect:first-child {
top: 1px;
opacity: 0;
transition: opacity 0.5s;
}
.enlightenment-combobox:hover > .shine-effect:first-child {
opacity: 1;
}
.enlightenment-combobox > .shine-effect::before,
.enlightenment-combobox > .shine-effect::after {
content: "";
position: absolute;
top: -1px;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.5s;
}
.enlightenment-combobox > .shine-effect::before {
width: 3px;
height: 2px;
border-radius: 5px 5px 0 0;
background-color: #FFFFFF;
}
.enlightenment-combobox > .shine-effect::after {
width: 10px;
height: 3px;
border-radius: 5px 5px 0 0;
background-color: #FFFFFF;
filter: blur(3px);
}
.enlightenment-combobox:hover > .shine-effect::before,
.enlightenment-combobox:hover > .shine-effect::after {
opacity: 1;
}
@@ -1,9 +1,10 @@
#file-system-browser-dialog {
display: none;
position: absolute;
top: 12.5%;
bottom: 12.5%;
left: 10%;
right: 10%;
left: 8%;
right: 8%;
padding: 10px;
border: 1px solid var(--border-color-dialog);
box-shadow: 30px 30px 25px var(--shadow-color);
@@ -65,7 +66,7 @@
min-width: 0;
}
::deep .file-system-browser-content-new-directory {
.file-system-browser-content-new-directory {
min-width: 35px;
flex-basis: 35px;
flex-shrink: 0;
@@ -137,12 +138,12 @@
min-height: 0;
}
#file-system-browser-file-system-treeview-container.collapsed {
max-width: 0px;
min-width: 0px;
border: 0px;
padding: 0px;
}
#file-system-browser-file-system-treeview-container.collapsed {
max-width: 0px;
min-width: 0px;
border: 0px;
padding: 0px;
}
#file-system-browser-file-system-treeview {
background-color: #131313;
@@ -158,7 +159,7 @@
min-height: 0;
}
::deep .file-system-browser-file-system-sources {
.file-system-browser-file-system-sources {
flex-grow: 0;
}
@@ -198,6 +199,7 @@
#file-system-browser-file-system-explorer-details-header {
color: deepskyblue;
background-color: #232323;
}
#file-system-browser-file-system-explorer {
@@ -247,6 +249,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
display: flex;
align-items: center;
user-select: none;
box-sizing: content-box;
}
.e.details-icons {
@@ -629,6 +632,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
/*File System Navigator*/
#navigator-navigation-controls-container {
width: 225px;
display: flex;
align-items: center;
}
@@ -639,7 +643,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
margin-right: 10px;
}
#navigator-history, ::deep .navigator-navigate-button, ::deep .navigator-edit-path-button {
#navigator-history, .navigator-navigate-button, .navigator-edit-path-button {
flex-shrink: 0; /* don't let them shrink */
}
@@ -674,23 +678,23 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
height: 24px;
}
::deep .navigator-navigate-button, ::deep .navigator-edit-path-button {
.navigator-navigate-button, .navigator-edit-path-button {
text-align: end !important;
flex-shrink: 0;
}
::deep .navigator-navigate-button,
::deep .file-system-browser-content-new-directory {
.navigator-navigate-button,
.file-system-browser-content-new-directory {
margin: 0px 10px 2px 0px;
flex-shrink: 0;
}
::deep .file-system-browser-content-favorite-directory {
.file-system-browser-content-favorite-directory {
margin: 0px 2px 2px 0px;
flex-shrink: 0;
}
::deep .navigator-edit-path-button {
.navigator-edit-path-button {
margin: 0px 10px 2px 12px;
flex-shrink: 0;
}
@@ -753,7 +757,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
display: flex;
margin-right: 0px;
align-items: center;
width: 125px;
width: 175px;
margin-left: 5px;
}
@@ -765,7 +769,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
}
::deep .navigator-address-bar-input {
.navigator-address-bar-input {
width: 100%;
}
@@ -885,7 +889,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
border-right: #202020 1px solid;
padding: 3px;
z-index: 999;
max-height: calc(100vh - 100px); /* Subtracting a small value ensures a little space is left on top and bottom */
max-height: calc(100vh - 12.5vh - 60px); /* subtracting a small value ensures a little space is left on top and bottom; -12.5% because parent has "top: 12.5%;" */
overflow-y: auto;
}
@@ -1066,7 +1070,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
width: 100%;
}
::deep .file-system-browser-content-new-directory {
.file-system-browser-content-new-directory {
min-width: 0;
flex-basis: auto;
margin-right: 10px;
@@ -1102,9 +1106,9 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
}
@media screen and (max-width: 399px) {
@media screen and (max-width: 449px) {
#file-system-browser-dialog {
min-width: 400px
min-width: 450px
}
.e.extra-large-icons {
@@ -1116,7 +1120,7 @@ div[id^="file-system-browser-file-system-explorer"]:not([id*="container"]) {
}
.e.extra-large-icons .text span {
max-width: 400px;
max-width: 450px;
}
.e.large-icons {
@@ -0,0 +1,78 @@
.tree-node {
padding: 2px 0;
}
.node-content {
display: flex;
align-items: flex-start;
cursor: pointer;
padding: 0px;
border-radius: 2px;
border: 1px solid transparent;
flex-wrap: wrap;
min-width: 100%;
display: inline-block;
white-space: nowrap;
}
.node-content:hover {
background-color: #131313;
border-top: 1px solid var(--border-color-light);
border-left: 1px solid var(--border-color-light);
border-right: 1px solid var(--border-color-dark);
background-color: var(--container-background);
}
.node-content.selected {
background-color: #131313;
border-bottom: 1px solid var(--border-color-light);
border-right: 1px solid var(--border-color-light);
border-left: 1px solid var(--border-color-dark);
background-color: var(--container-background);
}
.node-icon {
margin-right: 5px;
width: 16px;
text-align: center;
flex-shrink: 0;
}
.node-icon, .expand-button {
flex-shrink: 0;
align-self: center;
}
.child-nodes {
padding-left: 20px;
border-left: 1px dotted #ccc;
margin-left: 7px;
}
.expand-button {
display: inline-flex;
width: 10px;
height: 10px;
margin-right: 5px;
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%231E90FF' d='M6 4l4 4-4 4z'/></svg>");
background-size: contain;
transition: transform 0.2s ease;
}
.expand-button.expanded {
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%23f00' d='M6 4l4 4-4 4z'/></svg>");
transform: rotate(90deg);
}
.spacer {
display: inline-block;
width: 15px;
}
.node-name {
margin-left: 3px;
overflow-wrap: break-word;
word-break: break-all;
flex: 1;
align-self: end;
}
@@ -0,0 +1,344 @@
.overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
visibility: hidden;
transition: opacity 0.50s, visibility 0.50s, height 0.50s;
-webkit-transition: opacity 0.50s, visibility 0.50s, height 0.50s;
overflow: hidden;
background: black;
z-index: -1;
}
#hamburger-input {
display: none;
}
#hamburger-menu {
cursor: pointer;
position: fixed;
border-radius: 4px;
border: 1px solid #777777;
border-bottom-color: #000000;
border-right-color: #000000;
top: 10px;
left: 10px;
width: 46px;
height: 46px;
display: none;
z-index: 2;
padding: 5px 0;
margin: 0px;
font-family: 'Cabin', Sans-serif;
background: linear-gradient(to top, #424343 0%, #505050 50%, #5E5D5D 100%);
}
#hamburger-menu > span {
display: block;
width: 30px;
height: 4px;
margin: 6px auto;
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
border-radius: 2px;
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2);
}
#hamburger-menu:hover {
background: linear-gradient(to top, #505050 0%, #5E5D5D 50%, #6A6969 100%);
}
#hamburger-menu:hover > span {
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.3), 0 1px 0 rgba(255, 255, 255, 0.3);
}
#hamburger-menu #mobile-menu {
visibility: hidden;
position: fixed;
margin: 0px;
top: 0;
left: -100%;
width: 100%;
border: 1px solid #777777;
border-bottom-color: #000000;
border-right-color: #000000;
overflow: auto;
color: #6DCBFE;
text-align: center;
background: #4F4F4F;
transition: 0.50s;
-webkit-transition: 0.50s;
padding: 0px 10px;
box-sizing: border-box;
}
#mobile-menu-content {
border: 1px solid #777777;
border-top-color: #000000;
border-left-color: #000000;
margin-top: 4px;
margin-left: -6px;
margin-right: -5px;
margin-bottom: 3px;
color: #6DCBFE;
text-align: center;
font-size: 18px;
font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
font-weight: bold;
text-shadow: 0px 0px 2px rgba(0,0,0,1);
/*background: #000 url(../images/metal-plate.png);*/
}
.mobile-menu-heading {
height: 35px;
font-size: 28px;
background: rgb(10, 11, 11);
border: 1px solid #777777;
border-bottom-color: #000000;
border-right-color: #000000;
width: 100%;
background-image: linear-gradient(180deg, #505050, #464646, #404040, #363636);
}
#hamburger-menu ul {
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
padding: 0px;
width: 100%;
}
#hamburger-menu li {
width: 100%;
list-style-type: none;
line-height: 2rem;
display: flex;
font-weight: normal;
font-size: 10px;
text-shadow: none;
text-align: left;
border: 1px solid #333333;
border-bottom-color: #000000;
border-right-color: #000000;
}
#hamburger-menu li:nth-child(even) {
background-color: #191E21;
}
#hamburger-menu li:nth-child(odd) {
background-color: #28292B;
}
#hamburger-menu a {
padding-left: 5px;
width: 100%;
color: #6DCBFE;
font-weight: normal;
font-size: 18px;
font-family: 'Arial';
text-decoration: none;
display: inline-block;
margin-left: 0.3em;
}
#hamburger-menu a:focus,
#hamburger-menu a:active {
color: #7CACF8;
}
#hamburger-menu a:hover {
color: #FFFFFF;
background: rgb(10, 11, 11);
background-image: linear-gradient(180deg, #505050, #464646, #404040, #363636);
}
#hamburger-input:checked + #hamburger-menu {
background: linear-gradient(to bottom, #424343 0%, #505050 50%, #5E5D5D 100%);
border: 1px solid #777777;
border-top: 1px solid #000000;
border-left: 1px solid #000000;
}
#hamburger-input:checked + #hamburger-menu #mobile-menu {
visibility: visible;
left: 0;
top: 71px;
}
#hamburger-input:checked + #hamburger-menu {
z-index: 2;
}
#hamburger-input:checked ~ .overlay {
visibility: visible;
opacity: 0.5;
z-index: 1;
}
.menubar {
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
padding: 0;
position: fixed;
top: 0px;
left: 0px;
width: 100%;
z-index: 900;
}
.menubar ul {
list-style-type: none;
margin: 0;
padding: 0;
}
.menubar > ul > li {
display: inline-block;
position: relative;
}
.menubar label,
.menubar a {
display: block;
padding: 2px 10px;
text-decoration: none;
cursor: default;
color: #6DCBFE;
position: relative;
user-select: none;
border: 1px solid transparent;
}
.menubar > ul > li > label:hover,
.menubar > ul > li > a:hover {
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
border-left: 1px solid #777777;
border-right: 1px solid #000000;
border-top: 1px solid #505050;
border-bottom: 1px solid #222222;
color: #FFFFFF;
}
.menubar input[type="radio"] {
display: none;
}
.menubar ul ul {
display: none;
position: absolute;
top: 100%;
left: 0;
min-width: 150px;
background: #4F4F4F;
border: 1px solid #777777;
border-bottom-color: #000000;
border-right-color: #000000;
padding-top: 4px;
padding-left: 4px;
padding-bottom: 4px;
padding-right: 4px;
}
.menubar ul ul li {
background: #232323;
border-left: 1px solid #000000;
border-right: 1px solid #777777;
position: relative;
}
.menubar ul ul li:first-child {
border-top: 1px solid #000000;
}
.menubar ul ul li:last-child {
border-bottom: 1px solid #777777;
}
.menubar ul ul li > label:hover,
.menubar ul ul li > a:hover {
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
border: 1px solid #777777;
border-right-color: #000000;
border-bottom-color: #000000;
color: #FFFFFF;
}
.menubar ul ul ul {
left: 100%;
top: 0;
}
.menubar li:focus-within > ul {
display: block;
outline: none;
}
.menubar > ul > li:focus-within > label,
.menubar > ul > li:focus-within > a {
background-color: #28292B;
background: radial-gradient( 115% 115% at 68% 70%, #30303088 0%, #20202044 50%, #101010 100% );
border: 1px solid #777777;
border-top: 1px solid #000000;
border-left: 1px solid #000000;
color: #FFFFFF;
}
.menubar .has-submenu > label::after,
.menubar .has-submenu > a::after {
content: " ▶";
font-size: 0.6em;
position: absolute;
right: 5px;
top: 50%;
transform: translateY(-50%);
transition: transform 0.3s ease;
}
.menubar .has-submenu:focus-within > label,
.menubar .has-submenu:focus-within > a {
background: linear-gradient( to bottom, #505050 0%, #464646 35%, #404040 55%, #363636 100% );
border: 1px solid #777777;
border-right-color: #000000;
border-bottom-color: #000000;
}
.menubar .has-submenu:focus-within > label::after,
.menubar .has-submenu:focus-within > a::after {
content: " ▼";
color: #FF0000;
transform: translateY(-50%) rotate(0deg);
}
.menubar .has-submenu:focus-within > label,
.menubar .has-submenu:focus-within > a {
color: #7CACF8;
}
/* For phones */
@media only screen and (max-width: 768px) {
.menubar {
visibility: hidden;
}
#hamburger-menu {
display: block;
}
#mobile-menu {
height: calc(100% - 70px);
}
}
/* For desktop: */
@media only screen and (min-width: 768px) {
.menubar {
visibility: visible;
}
.overlay {
visibility: hidden !important;
}
}
@@ -0,0 +1,106 @@
.notification-container {
position: fixed;
bottom: 10px;
left: 20px;
z-index: 1000;
width: 300px;
max-height: calc(100vh - 40px); /* full viewport height minus 40px */
overflow-y: auto; /* add vertical scrollbar if content exceeds max-height */
}
.notification {
border-radius: 4px;
margin-bottom: 10px;
margin-right: 10px;
display: flex;
flex-direction: row; /* stack content horizontally */
align-items: flex-start; /* align items to the top */
background: linear-gradient(135deg, #404040, #232323) !important;
border-top: 1px solid #505050 !important;
border-left: 1px solid #505050 !important;
border-right: 1px solid #000 !important;
border-bottom: 1px solid #000 !important;
box-shadow: 5px 5px 5px var(--shadow-color);
animation: fadeIn 0.3s, fadeOut 0.3s 4.7s;
flex-direction: column;
flex-wrap: nowrap;
align-items: stretch;
justify-content: flex-start;
position: relative;
}
.notification-body {
padding: 15px;
display: flex;
flex-direction: row; /* stack content horizontally */
align-items: flex-start; /* align items to the top */
word-wrap: break-word; /* allow long words to break and wrap */
overflow-wrap: break-word; /* modern browsers */
word-break: break-word; /* for very long words or URLs */
}
.notification-message {
flex-grow: 1; /* allow message to take up available space */
margin-right: 3px; /* add some space between message and close button */
overflow-wrap: break-word; /* modern browsers */
word-break: break-word; /* for very long words or URLs */
hyphens: auto; /* enable automatic hyphenation */
white-space: pre-wrap; /* preserve line breaks */
font-family: monospace;
}
.close-button {
background: none;
color: var(--text-foreground);
border: none;
font-size: 20px;
cursor: pointer;
padding: 0;
line-height: 1;
flex-shrink: 0; /* prevent button from shrinking */
}
.shine-effect {
background: linear-gradient(to right, transparent, #fff, transparent);
width: 100%;
top: -1px;
height: 1px;
flex-shrink: 0;
pointer-events: none; /* ensure it doesn't interfere with interactions */
}
.info {
color: #2196F3;
}
.success {
color: #4CAF50;
}
.warning {
color: #FFC107;
}
.error {
color: #F44336;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@@ -52,6 +52,7 @@ main {
}
#modal-background {
display: none;
z-index: 998;
position: absolute;
top: 0px;
@@ -1244,4 +1245,4 @@ main {
/* For desktop: */
@media only screen and (min-width: 768px) {
}
}
@@ -0,0 +1,56 @@
.enlightenment-input {
font-size: 14px;
padding: 5px;
border: 1px solid;
border-color: var(--border-color-dark) var(--border-color-light) var(--border-color-light) var(--border-color-dark);
border-radius: 3px;
background: linear-gradient(0deg, #90c247, #509c00);
transition: background 0.3s, color 0.3s;
color: #000;
outline: none;
position: relative;
box-sizing: border-box;
}
.enlightenment-input:hover {
background: var(--window-button-over-color);
}
.enlightenment-input:not(:focus) {
background: linear-gradient(0deg, #6b7579, #576b65);
color: #000;
}
.enlightenment-input:focus {
font-style: italic;
color: #333;
background: linear-gradient(0deg, #6AAFF8, #82E9F7);
box-shadow: inset 4px 6px 8px rgba(0,0,0,0.6);
border-color: var(--border-color-dark) var(--border-color-light) var(--border-color-light) var(--border-color-dark);
outline: none;
}
.enlightenment-input::placeholder {
color: #999;
}
.enlightenment-input:disabled {
color: #999;
background: var(--container-background);
}
.enlightenment-input[readonly] {
color: #999;
background: var(--container-background);
border-color: var(--border-color-light) var(--border-color-dark) var(--border-color-dark) var(--border-color-light);
}
.enlightenment-input[data-has-error="true"] {
border-color: #f00;
color: #FFF;
background: #700;
}
textarea {
resize: none;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,107 @@
/**
* Enum-like object for notification types.
* @readonly
* @enum {string}
*/
const NotificationType = {
INFO: 'info',
SUCCESS: 'success',
WARNING: 'warning',
ERROR: 'error'
};
/**
* Manages the creation, display, and removal of notifications.
*/
class NotificationService {
/**
* Creates an instance of NotificationService.
* Initializes the notification container and appends it to the document body.
*/
constructor() {
this.notifications = [];
this.container = document.createElement('div');
this.container.className = 'notification-container';
document.body.appendChild(this.container);
}
/**
* Displays a new notification.
* @param {string} message - The message to display in the notification.
* @param {NotificationType} type - The type of notification.
*/
show(message, type) {
const notification = {
id: Date.now().toString(),
message,
type
};
this.addNotification(notification);
}
/**
* Adds a notification to the list and displays it.
* @param {Object} notification - The notification object to add.
* @param {string} notification.id - Unique identifier for the notification.
* @param {string} notification.message - The notification message.
* @param {NotificationType} notification.type - The type of notification.
*/
addNotification(notification) {
this.notifications.push(notification);
this.displayNotification(notification);
// log the notification to the console
const message = `${notification.type.charAt(0).toUpperCase() + notification.type.slice(1)}: ${notification.message}`;
if (notification.type === 'info')
console.info(message);
else if (notification.type === 'warning')
console.warn(message);
else if (notification.type === 'error')
console.error(message);
else
console.log(message);
// set a timeout to remove the notification after 5 seconds
setTimeout(() => this.removeNotification(notification.id), 5000);
}
/**
* Removes a notification from the list and the DOM.
* @param {string} id - The ID of the notification to remove.
*/
removeNotification(id) {
const index = this.notifications.findIndex(n => n.id === id);
if (index !== -1) {
this.notifications.splice(index, 1);
const element = document.getElementById(`notification-${id}`);
if (element) {
element.remove();
}
}
}
/**
* Creates and displays a notification element in the DOM.
* @param {Object} notification - The notification object to display.
* @param {string} notification.id - Unique identifier for the notification.
* @param {string} notification.message - The notification message.
* @param {NotificationType} notification.type - The type of notification.
*/
displayNotification(notification) {
const notificationElement = document.createElement('div');
notificationElement.id = `notification-${notification.id}`;
notificationElement.className = `notification ${notification.type}`;
notificationElement.innerHTML = `
<div class="shine-effect"></div>
<div class="notification-body">
<span class="notification-message">${notification.message}</span>
<button class="close-button" onclick="notificationService.removeNotification('${notification.id}')">×</button>
</div>
`;
this.container.appendChild(notificationElement);
}
}
// create a global instance of the NotificationService
const notificationService = new NotificationService();
+109 -618
View File
@@ -1,28 +1,89 @@
const scrollbarHeight = getScrollbarHeight();
const scrollbarWidth = getScrollbarWidth();
const progressIndicator = document.getElementById('progress-indicator');
const progressIndicatorValue = document.getElementById('progress-indicator-value');
const progressIndicatorValueShadow = document.getElementById('progress-indicator-value-shadow');
const progressIndicatorValueText = document.getElementById('progress-indicator-value-text');
let selectionStartPosition = { x: 0, y: 0 };
let currentMousePosition = { x: 0, y: 0 };
let isSelecting = false;
let isSelectionMode = false;
let fileSystemExplorer = null;
let fileSystemExplorerContainer = null;
let visibleSelectionRectangle = null;
let selectionRectangle = null;
let scrollTimeout; // timeout to delay thumbnail loading after scrolling
let resizeTimeout; // timeout to delay thumbnail loading after resizing
let abortController; // allows the cancellation of thumbnail retrieval jobs
let hasScrolledAfterModeChange = false; // flag to track if scrolling occurred after a mode change
let showThumbnails = true; // whether to show thumbnails or not
let scrollThumbnailRetrievalTimeout = 1000; // the time span to wait after the last scroll, before getting thumbnails
let inspectFileForThumbnails = false; // whether to check the actual header bytes in order to determine if a file is an image, rather than its extension
let thumbnailsRetrievalBatchSize = 20; // the number of thumbnails to ask from the server, concurrently
let imagePreviewsQuality = 70; // the quality used for image thumbnails
let fullImageQuality = 90; // the quality used for full images
let enableConsoleDebugMessages = false; // whether to display debug messages at the developer console, or not
// =================== common helper function ===================
var ajaxCallCounter = 0;
//+======================================================================================+
//| API interaction |
//+======================================================================================+
/**
* Performs a GET request to the specified API endpoint.
* @param {string} url - The API endpoint URL.
* @returns {Promise<any>} The response data if successful, undefined otherwise.
*/
async function callApiGetAsync(url) {
try {
// create the URL for the API endpoint
const response = await fetch(url); // call the API
if (!response.ok)
throw new Error('Network response was not ok');
const jsonResponse = await response.json();
if (jsonResponse.success)
return jsonResponse.data;
else
notificationService.show(jsonResponse.errorMessage, NotificationType.ERROR);
} catch (error) {
console.error('Error:', error);
notificationService.show(error, NotificationType.ERROR);
}
}
//+======================================================================================+
//| Common Helper Functions |
//+======================================================================================+
/**
* Starts progress indicator
*/
function showBusyIndicator() {
//if (ajaxCallCounter === 0)
//progressIndicator.classList.remove('hidden');
ajaxCallCounter++;
}
/**
* Hides progress indicator
*/
function hideBusyIndicator() {
ajaxCallCounter--;
//if (ajaxCallCounter === 0)
//progressIndicator.classList.add('hidden');
}
/**
* Shows the elements that display a progress operation
*/
function showOperationProgress() {
progressIndicatorValueShadow.classList.remove('hidden');
progressIndicatorValue.classList.remove('hidden');
}
/**
* Hides the elements that display a progress operation
*/
function hideOperationProgress() {
progressIndicatorValueShadow.classList.add('hidden');
progressIndicatorValue.classList.add('hidden');
}
/**
* Updates the progress indicator
* @param {int} completed - Number of completed elements
* @param {int} total - Number of total elements
*/
function updateOperationProgress(completed, total) {
progressIndicatorValueText.innerText = completed + '/' + total;
}
/**
* Convert Blob to Base64.
@@ -117,23 +178,40 @@ function getScrollbarWidth() {
}
/**
* Enables horizontal scrolling to the element identified by the specified id.
* Handles the wheel event for horizontal scrolling.
* @param {WheelEvent} event - The wheel event object.
*/
function addHorizontalScrolling(id) {
document.getElementById(id).addEventListener('wheel', function (e) {
e.preventDefault();
this.scrollLeft += (e.deltaY > 0 ? 1 : -1) * 80;
}, { passive: false });
const scrollHandler = function (event) {
event.preventDefault();
this.scrollLeft += (event.deltaY > 0 ? 1 : -1) * 80;
};
/**
* Enables horizontal scrolling to the element identified by the specified id or element.
* @param {string|HTMLElement} idOrElement - The id of the element or the element itself.
*/
function addHorizontalScrolling(idOrElement) {
let element = idOrElement;
if (typeof idOrElement === 'string')
element = document.getElementById(idOrElement);
if (element instanceof HTMLElement)
element.addEventListener('wheel', scrollHandler, { passive: false });
else
console.error('Invalid input: Expected an element ID or HTMLElement');
}
/**
* Disables horizontal scrolling to the element identified by the specified id.
* Disables horizontal scrolling for the element identified by the specified id or element.
* @param {string|HTMLElement} idOrElement - The id of the element or the element itself.
*/
function removeHorizontalScrolling(id) {
document.getElementById(id).removeEventListener('wheel', function (e) {
e.preventDefault();
this.scrollLeft += (e.deltaY > 0 ? 1 : -1) * 80;
}, { passive: false });
function removeHorizontalScrolling(idOrElement) {
let element = idOrElement;
if (typeof idOrElement === 'string')
element = document.getElementById(idOrElement);
if (element instanceof HTMLElement)
element.removeEventListener('wheel', scrollHandler, { passive: false });
else
console.error('Invalid input: Expected an element ID or HTMLElement');
}
/**
@@ -159,590 +237,3 @@ function getElementOffset(id) {
height: 0
};
}
/**
* Get the position and size of an HTML element.
* @param {string} id - The id of the element to get the rectangle of.
* @returns {object} An object containing the element's X (left), Y (top), Width, and Height in pixels.
*/
function getElementRectangle(id) {
const element = document.getElementById(id);
const rect = element.getBoundingClientRect();
return {
x: rect.left,
y: rect.top,
width: rect.width,
height: rect.height
};
}
// =================== file system browser dialog ===================
/**
* 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.
*/
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`;
});
}
}
/**
* 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`;
}
}
/**
* Focuses the navigator address bar input.
*/
function focusNavigatorInputElement() {
const elements = document.getElementsByClassName('navigator-address-bar-input');
if (elements.length > 0)
elements[0].focus();
}
/**
* 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;
});
}
/**
* Closes all navigator path segments.
*/
function closeNavigatorPathSegments() {
const checkboxes = document.getElementsByClassName('navigator-toggle-checkbox');
for (let i = 0; i < checkboxes.length; i++)
checkboxes[i].checked = false;
}
/**
* Handles the scroll event for the explorer or explorerContainer.
* Clears any previous timeout and creates a new one to fetch visible items.
*/
function handleFileSystemBrowserScrollEvent() {
// clear any previously set timeouts to debounce the getVisibleItems call
if (scrollTimeout) clearTimeout(scrollTimeout);
// if there's an ongoing operation, abort it
if (abortController) {
abortController.abort();
abortController = null;
}
// set a timeout to call getVisibleItems once the user stops scrolling
scrollTimeout = setTimeout(() => {
if (showThumbnails)
getVisibleItems();
}, scrollThumbnailRetrievalTimeout);
hasScrolledAfterModeChange = true;
}
/**
* Handles the window's resize event.
* Clears any previous timeout and creates a new one to fetch file system browser visible items.
*/
function handleFileSystemBrowserResizeEvent() {
// clear any previously set timeouts to debounce the getVisibleItems call during resize
if (resizeTimeout) clearTimeout(resizeTimeout);
// if there's an ongoing operation, abort it
if (abortController) {
abortController.abort();
abortController = null;
}
// set a timeout to call getVisibleItems once the user stops resizing
resizeTimeout = setTimeout(() => {
if (showThumbnails)
getVisibleItems();
}, scrollThumbnailRetrievalTimeout);
}
/**
* Switches to a different view mode.
*/
function switchViewMode() {
hasScrolledAfterModeChange = false; // reset the flag indicating a mode change
// check if content has been scrolled after the mode change; since scroll is the one triggering thumbnails retrieval,
// and there is no initial scroll when mode is changed, we need to trigger the retrieval manually
setTimeout(() => {
if (!hasScrolledAfterModeChange && showThumbnails)
getVisibleItems();
}, 50); // wait 50ms to ensure all other events have processed
}
// =================== file system browser dialog selection ===================
/**
* Function called at the initialization of fle system browser dialog
* @param {any} dotnetHelper - .NET object to invoke methods asynchronously.
*/
function initializeFileSystemBrowser(dotnetHelper) {
// cache frequently accessed elements
if (!selectionRectangle)
selectionRectangle = document.getElementById('selection-rectangle');
if (!visibleSelectionRectangle)
visibleSelectionRectangle = document.getElementById('visible-selection-rectangle');
if (!fileSystemExplorer) {
fileSystemExplorer = document.getElementById('file-system-browser-file-system-explorer');
if (fileSystemExplorer) {
fileSystemExplorer.addEventListener('mouseup', handleFileSystemExplorerMouseUp);
fileSystemExplorer.addEventListener('scroll', handleFileSystemBrowserScrollEvent);
}
}
// event handlers needed for selection
if (!fileSystemExplorerContainer) {
fileSystemExplorerContainer = document.getElementById('file-system-browser-file-system-explorer-container');
if (fileSystemExplorerContainer) {
fileSystemExplorerContainer.addEventListener('mousedown', startSelection);
fileSystemExplorerContainer.addEventListener('mousemove', updateSelection);
fileSystemExplorerContainer.addEventListener('mouseup', endSelection);
fileSystemExplorerContainer.addEventListener('wheel', handleSelection);
fileSystemExplorerContainer.addEventListener('scroll', handleFileSystemBrowserScrollEvent);
fileSystemExplorerContainer.addEventListener('scroll', handleSelection);
}
}
// handler for the mouse down event of file system browser dialog files and directories elements
window.handleFileSystemEntityMouseDown = function (e) {
// stop the event from bubbling up to the explorer - we dont want to start selection rectangles when clicking files or directories
e.stopPropagation();
};
// handler for the mouse up event of file system browser dialog files and directories elements
window.handleFileSystemEntityMouseUp = function (e) {
e.preventDefault();
if (!isSelecting)
e.stopPropagation();
const allEClassElements = Array.from(fileSystemExplorer.querySelectorAll('.e'));
const currentIndex = allEClassElements.indexOf(e.currentTarget);
// If a previous click timestamp exists, check the time difference
const previousTime = parseInt(e.currentTarget.dataset.selectionStartTime || 0);
const currentTime = new Date().getTime();
const timeDifference = currentTime - previousTime;
// TODO: needs to account for when the element is already selected, and a double click occurs - on first click it would check the difference and go to rename -
// maybe just wait half second before performing action
// if time difference is less than 300ms, treat it as a double-click
if (timeDifference < 300) {
if (e.currentTarget.dataset.type === 'directory') { // directories
dotnetHelper.invokeMethodAsync('OnDirectoryDoubleClickAsync', e.currentTarget.dataset.path);
return;
}
else { // files
}
// reset the timestamp used to track double clicks
e.currentTarget.dataset.selectionStartTime = 0;
return;
}
else
e.currentTarget.dataset.selectionStartTime = currentTime; // element was single clicked, update the selection start time to now
if (e.ctrlKey || isSelectionMode) { // when CTRL key is pressed
// toggle selection for the current clicked item
e.currentTarget.classList.toggle('selected');
// set the selection start if it's not already set
if (fileSystemExplorer.dataset.selectionStart === undefined)
fileSystemExplorer.dataset.selectionStart = currentIndex;
}
else if ((e.shiftKey && fileSystemExplorer.dataset.selectionStart !== undefined) || isSelectionMode) { // when SHIFT key is pressed
const start = parseInt(fileSystemExplorer.dataset.selectionStart);
// remove all selections
allEClassElements.forEach(elem => {
elem.classList.remove('selected');
});
// define the range to select items from and to
const [from, to] = start < currentIndex ? [start, currentIndex] : [currentIndex, start];
// add the 'selected' class to items in the range
for (let i = from; i <= to; i++)
allEClassElements[i].classList.add('selected');
}
else { // when neither CTRL nor SHIFT keys are pressed
if (!isSelectionMode) {
// get all elements that are selected
const selectedElements = allEClassElements.filter(element => element.classList.contains('selected'));
// add 'selected' class to the current clicked item
e.currentTarget.classList.add('selected');
// if there are no selected elements, or if there are more than one, deselect all of them, and select just the clicked one
if ((selectedElements.length === 1 && e.currentTarget !== selectedElements[0]) || selectedElements.length !== 1) {
// deselect all items
selectedElements.forEach(elem => {
if (elem !== e.currentTarget) {
elem.classList.remove('selected');
// remove selectionStartTime from all items
delete elem.dataset.selectionStartTime;
}
});
// set the current item as the selection start
fileSystemExplorer.dataset.selectionStart = currentIndex;
// store the current timestamp for future double-click checks
e.currentTarget.dataset.selectionStartTime = currentTime;
}
}
else // if its selection mode, just toggle selection of item, when clicked
e.currentTarget.classList.toggle('selected');
}
};
}
/**
* Handler for the mouse up event of the file system browser dialog explorer
* @param {MouseEvent} e - The mouseup event object.
*/
function handleFileSystemExplorerMouseUp(e) {
const explorerScrollbars = hasScrollbars(fileSystemExplorer);
// check if clicked on the horizontal scrollbar
if (explorerScrollbars.horizontal && e.clientY > fileSystemExplorer.getBoundingClientRect().top + fileSystemExplorer.offsetHeight - scrollbarHeight)
return;
if (!e.ctrlKey && !e.shiftKey && !isSelectionMode) {
// deselect all file system elements when their explorer is clicked
fileSystemExplorer.querySelectorAll('.e.selected').forEach(item => {
item.classList.remove('selected');
});
// do not store information about what item was clicked first, in context of Shift-selection
fileSystemExplorer.removeAttribute('data-selection-start');
}
}
/**
* Handler for the file system browser dialog selection start.
* @param {MouseEvent} e - The mousedown event object.
*/
function startSelection(e) {
const explorerScrollbars = hasScrollbars(fileSystemExplorer);
const containerExplorerScrollbars = hasScrollbars(fileSystemExplorerContainer);
// check if clicked on the horizontal or vertical scrollbar
if (explorerScrollbars.horizontal && e.clientY > fileSystemExplorer.getBoundingClientRect().top + fileSystemExplorer.offsetHeight - scrollbarHeight)
return;
if (containerExplorerScrollbars.vertical && e.clientX > fileSystemExplorerContainer.getBoundingClientRect().left + fileSystemExplorerContainer.offsetWidth - scrollbarWidth)
return;
// store information about selection start
isSelecting = true;
document.body.style.overflowY = 'hidden'; // needed in order to not put a vertical scrollbar on the document, while in vertical layout selection
document.documentElement.style.overflowY = 'hidden';
selectionStartPosition.x = e.pageX + fileSystemExplorer.scrollLeft;
selectionStartPosition.y = e.pageY + fileSystemExplorerContainer.scrollTop; // not a mistake - in vertical mode, this is the overflow container!
// place the selection rectangle at the clicked location (relative to the whole page, and taking into account scroll offset), with 0 size
visibleSelectionRectangle.style.left = e.pageX + 'px';
visibleSelectionRectangle.style.top = e.pageY + 'px';
visibleSelectionRectangle.style.width = '0px';
visibleSelectionRectangle.style.height = '0px';
visibleSelectionRectangle.style.visibility = 'visible';
selectionRectangle.style.left = e.pageX + 'px';
selectionRectangle.style.top = e.pageY + 'px';
selectionRectangle.style.width = '0px';
selectionRectangle.style.height = '0px';
}
/**
* Handler for the file system browser dialog selection update.
* @param {MouseEvent} e - The mousemove event object.
*/
function updateSelection(e) {
if (!isSelecting)
return;
currentMousePosition.x = e.pageX;
currentMousePosition.y = e.pageY;
handleSelection();
}
/**
* Handler for the file system browser dialog selection end.
* @param {MouseEvent} e - The mouseup event object.
*/
function endSelection(e) {
// selection ended, hide the selection rectangle
isSelecting = false;
document.body.style.removeProperty('overflow-y');
document.documentElement.style.removeProperty('overflow-y');
visibleSelectionRectangle.style.visibility = 'hidden';
selectionRectangle.style.visibility = 'hidden';
selectionRectangle.style.left = '0px';
selectionRectangle.style.top = '0px';
selectionRectangle.style.width = '0px';
selectionRectangle.style.height = '0px';
visibleSelectionRectangle.style.left = '0px';
visibleSelectionRectangle.style.top = '0px';
visibleSelectionRectangle.style.width = '0px';
visibleSelectionRectangle.style.height = '0px';
// go through each .e item that was inside the selection rectangle, and mark it as selected
fileSystemExplorer.querySelectorAll('.e.selection-hover').forEach(item => {
item.classList.add('selected');
item.classList.remove('selection-hover');
});
}
/**
* Function for handling the file system browser dialog selection.
*/
function handleSelection() {
if (!isSelecting) // only relevant when we have a selection initialized
return;
// calculate dimensions of the selection rectangle
const currentX = currentMousePosition.x;
const currentY = currentMousePosition.y;
const width = currentX - (selectionStartPosition.x - fileSystemExplorer.scrollLeft);
const height = currentY - (selectionStartPosition.y - fileSystemExplorerContainer.scrollTop);
// update selection rectangle dimensions
visibleSelectionRectangle.style.width = Math.abs(width) + 'px';
visibleSelectionRectangle.style.height = Math.abs(height) + 'px';
selectionRectangle.style.width = Math.abs(width) + 'px';
selectionRectangle.style.height = Math.abs(height) + 'px';
// adjust position based on selection direction
if (width < 0) {
selectionRectangle.style.left = currentX + 'px';
visibleSelectionRectangle.style.left = currentX + 'px';
} else {
selectionRectangle.style.left = (selectionStartPosition.x - fileSystemExplorer.scrollLeft) + 'px';
visibleSelectionRectangle.style.left = (selectionStartPosition.x - fileSystemExplorer.scrollLeft) + 'px';
}
if (height < 0) {
selectionRectangle.style.top = currentY + 'px';
visibleSelectionRectangle.style.top = currentY + 'px';
} else {
selectionRectangle.style.top = (selectionStartPosition.y - fileSystemExplorerContainer.scrollTop) + 'px';
visibleSelectionRectangle.style.top = (selectionStartPosition.y - fileSystemExplorerContainer.scrollTop) + 'px';
}
// do not let the selection rectangle go outside of explorer container, clip it if needed
const containerRect = fileSystemExplorerContainer.getBoundingClientRect();
const left = parseFloat(visibleSelectionRectangle.style.left);
const top = parseFloat(visibleSelectionRectangle.style.top) + 1;
const right = left + parseFloat(visibleSelectionRectangle.style.width);
const bottom = top + parseFloat(visibleSelectionRectangle.style.height);
if (left < containerRect.left) {
const difference = containerRect.left - left;
visibleSelectionRectangle.style.width = (parseFloat(visibleSelectionRectangle.style.width) - difference) + 'px';
visibleSelectionRectangle.style.left = containerRect.left + 'px';
}
if (right > containerRect.right)
visibleSelectionRectangle.style.width = (containerRect.right - left) + 'px';
if (top < containerRect.top) {
const difference = containerRect.top - top;
visibleSelectionRectangle.style.height = (parseFloat(visibleSelectionRectangle.style.height) - difference) + 'px';
visibleSelectionRectangle.style.top = containerRect.top + 'px';
}
if (bottom > containerRect.bottom)
visibleSelectionRectangle.style.height = (containerRect.bottom - top) + 'px';
// change color of items that fall within selection rectangle
const selectionRect = selectionRectangle.getBoundingClientRect();
// go through each .e item which has not had its thumbnail retrieved yet
fileSystemExplorer.querySelectorAll('.e').forEach(item => {
const itemRect = item.getBoundingClientRect();
// check if the item is fully or partially visible horizontally and vertically
const isFullyVisibleHorizontally = itemRect.left >= selectionRect.left && itemRect.right <= selectionRect.right;
const isFullyVisibleVertically = itemRect.top >= selectionRect.top && itemRect.bottom <= selectionRect.bottom;
const isPartiallyVisibleHorizontally = itemRect.left < selectionRect.right && itemRect.right > selectionRect.left;
const isPartiallyVisibleVertically = itemRect.top < selectionRect.bottom && itemRect.bottom > selectionRect.top;
// if the item is fully or partially visible in both directions, add it to our list
if ((isFullyVisibleHorizontally || isPartiallyVisibleHorizontally) && (isFullyVisibleVertically || isPartiallyVisibleVertically))
item.classList.add('selection-hover');
else
item.classList.remove('selection-hover');
});
}
/**
* Toggles the state of selection mode.
* @param {MouseEvent} e - The mouseup event object.
*/
function toggleSelectionMode(e) {
isSelectionMode = !isSelectionMode;
}
// =================== file system browser dialog thumbnails preview ===================
/**
* Identifies items within the explorerContainer that are either fully or partially visible.
* Items with thumbnails already retrieved are excluded.
* Populates a list of such visible items and passes them for further processing.
*/
function getVisibleItems() {
const containerRect = fileSystemExplorerContainer.getBoundingClientRect();
const visibleItems = [];
// go through each .e item which has not had its thumbnail retrieved yet
const fileElements = Array.from(fileSystemExplorer.querySelectorAll('.e:not([data-thumbnail-retrieved])[data-type="file"]'));
// if the option for checking file header bytes is disabled, filter images by extension
const itemsToProcess = inspectFileForThumbnails ? fileElements : fileElements.filter(item => isImageFile(item.getAttribute('data-path')));
itemsToProcess.forEach(item => {
const itemPath = item.getAttribute('data-path');
const itemRect = item.getBoundingClientRect();
// check if the item is fully or partially visible horizontally and vertically
const isFullyVisibleHorizontally = itemRect.left >= containerRect.left && itemRect.right <= containerRect.right;
const isFullyVisibleVertically = itemRect.top >= containerRect.top && itemRect.bottom <= containerRect.bottom;
const isPartiallyVisibleHorizontally = itemRect.left < containerRect.right && itemRect.right > containerRect.left;
const isPartiallyVisibleVertically = itemRect.top < containerRect.bottom && itemRect.bottom > containerRect.top;
// if the item is fully or partially visible in both directions, add it to our list
if ((isFullyVisibleHorizontally || isPartiallyVisibleHorizontally) &&
(isFullyVisibleVertically || isPartiallyVisibleVertically)) {
const imgElement = item.querySelector('img');
visibleItems.push({
path: itemPath,
img: imgElement
});
}
});
// process the list of visible items
processVisibleItems(visibleItems);
}
/**
* Processes a given item by retrieving its thumbnail from an API and updating the item's thumbnail image.
* If there are more items in the visibleItems list, it continues to process the next item.
* If an error occurs during the retrieval process (including an aborted fetch operation), it is handled gracefully.
* @param {Object} item - The item containing its path and corresponding image element.
* @param {Array} visibleItems - List of remaining visible items to process.
* @throws {AbortError} - Indicates the fetch operation was aborted.
* @throws {Error} - Catches and logs other errors that might occur during the thumbnail retrieval.
*/
async function processItem(item, visibleItems) {
try {
const result = await getThumbnailApiCall(item.path, imagePreviewsQuality);
// update the item's thumbnail using the retrieved data
if (typeof result.base64Data !== "undefined")
item.img.src = `data:${result.mimeType};base64,${result.base64Data}`;
item.img.closest('.e').setAttribute('data-thumbnail-retrieved', 'true');
// continue with next item if there are more in the queue
if (visibleItems.length > 0) {
const nextItem = visibleItems.shift();
processItem(nextItem, visibleItems);
}
} catch (error) {
if (error.name === 'AbortError') {
// console.log('Fetch operation was aborted.');
} else {
// on error, revert the icons to the default ones
let itemType = item.img.closest('.e').getAttribute('data-type');
if (itemType === 'directory')
item.img.src = "http://localhost:5012/images/icons/Lyra/directory.svg";
else if (itemType === 'file')
item.img.src = "http://localhost:5012/images/icons/Lyra/file.svg";
console.error('Error processing item:', error);
}
}
}
/**
* Makes an API call to retrieve a thumbnail for the given item.
* @param {string} path - The path of the item for which the thumbnail needs to be fetched.
* @returns {Promise<object>} - Returns a Promise resolving to an object containing base64Data and mimeType.
* @throws {Error} - Throws an error if the API call fails.
*/
async function getThumbnailApiCall(path, quality) {
// fetch the thumbnail for the given item from the server
const response = await fetch('http://localhost:5214/api/v1/thumbnails/get-thumbnail?path=' + encodeURIComponent(path) + '&quality=' + quality, {
signal: abortController.signal // use the abort signal
});
if (!response.ok)
throw new Error('Failed to fetch the thumbnail');
// convert the response to a JSON object
const blob = await response.blob();
const base64Data = await blobToBase64(blob);
const mimeType = response.headers.get('Content-Type');
return {
base64Data: base64Data,
mimeType: mimeType
};
}
/**
* Initiates the processing of visible items. Processing is batched based on thumbnailsRetrievalBatchSize. *
* @param {Array} visibleItemsList - List of visible items to be processed.
*/
async function processVisibleItems(visibleItemsList) {
const visibleItems = [...visibleItemsList];
abortController = new AbortController(); // create a new AbortController
// process items in batches determined by thumbnailsRetrievalBatchSize
for (let i = 0; i < Math.min(thumbnailsRetrievalBatchSize, visibleItems.length); i++) {
const item = visibleItems.shift();
processItem(item, visibleItems);
}
}
// =================== window functions ===================
/**
* Attaches a click event listener to the window, invoking a .NET method when the window is clicked.
* @param {any} dotnetHelper - .NET object to invoke methods asynchronously.
*/
function windowClickHandler(dotnetHelper) {
window.addEventListener('click', (e) => {
dotnetHelper.invokeMethodAsync('OnWindowClickAsync', {
x: e.clientX,
y: e.clientY,
sender: e.target.getAttribute('id')
});
});
}
/**
* Attaches a keydown event listener to the given element, invoking a .NET method when 'Escape' is pressed.
* @param {HTMLElement} element - The HTML element to attach the keydown listener to.
* @param {any} dotnetHelper - .NET object to invoke methods asynchronously.
*/
function windowKeyDownHandler(element, dotnetHelper) {
element.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
e.preventDefault();
dotnetHelper.invokeMethodAsync('EscapePressed');
}
});
}
/**
* Handles the window resize event.
*/
window.addEventListener('resize', function () {
adjustDropdownHeight();
handleFileSystemBrowserResizeEvent();
// 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);
}
});
+1 -1
View File
@@ -82,7 +82,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{
..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md = ..\docs\technical\templates\PULL_REQUEST_TEMPLATE.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lumina.Presentation.Web", "Lumina.Presentation.Web\Lumina.Presentation.Web.csproj", "{613C74E8-720C-4205-8BA7-85B23D2E7881}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lumina.Presentation.Web", "Lumina.Presentation.Web\Lumina.Presentation.Web.csproj", "{613C74E8-720C-4205-8BA7-85B23D2E7881}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution