| <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | <Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> | ||||
| <PropertyGroup Label="Globals"> | |||||
| <SccProjectName>SAK</SccProjectName> | |||||
| <SccProvider>SAK</SccProvider> | |||||
| <SccAuxPath>SAK</SccAuxPath> | |||||
| <SccLocalPath>SAK</SccLocalPath> | |||||
| </PropertyGroup> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>net5.0</TargetFramework> | |||||
| <RazorLangVersion>3.0</RazorLangVersion> | |||||
| <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest> | |||||
| <OutputType>Exe</OutputType> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.7" /> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.7" PrivateAssets="all" /> | |||||
| <PackageReference Include="System.Net.Http.Json" Version="5.0.0" /> | |||||
| </ItemGroup> | |||||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |||||
| <Optimize>true</Optimize> | |||||
| <PlatformTarget>AnyCPU</PlatformTarget> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <Content Remove="compilerconfig.json" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <_ContentIncludedByDefault Remove="wwwroot\css\united\_bootswatch.css" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <None Include="compilerconfig.json" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <PackageReference Include="BlazorAnimate" Version="3.0.0" /> | |||||
| <PackageReference Include="BlazorColorPicker" Version="1.2.0" /> | |||||
| <PackageReference Include="BuildWebCompiler" Version="1.12.405" /> | |||||
| <PackageReference Include="MatBlazor" Version="2.8.0" /> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.7" /> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.7" PrivateAssets="all" /> | |||||
| <PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.7" /> | |||||
| <PackageReference Include="System.Net.Http.Json" Version="5.0.0" /> | |||||
| <PackageReference Include="Tewr.Blazor.FileReader" Version="3.1.0.21158" /> | |||||
| <PackageReference Include="Tewr.Blazor.FileReader.Wasm" Version="0.11.19128" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <Compile Update="Shared\ResourceFiles\Resources.Designer.cs"> | |||||
| <DesignTime>True</DesignTime> | |||||
| <AutoGen>True</AutoGen> | |||||
| <DependentUpon>Resources.resx</DependentUpon> | |||||
| </Compile> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <EmbeddedResource Update="Shared\ResourceFiles\Resources.de.resx"> | |||||
| <Generator>PublicResXFileCodeGenerator</Generator> | |||||
| </EmbeddedResource> | |||||
| <EmbeddedResource Update="Shared\ResourceFiles\Resources.fr.resx"> | |||||
| <Generator>PublicResXFileCodeGenerator</Generator> | |||||
| </EmbeddedResource> | |||||
| <EmbeddedResource Update="Shared\ResourceFiles\Resources.it.resx"> | |||||
| <Generator>PublicResXFileCodeGenerator</Generator> | |||||
| </EmbeddedResource> | |||||
| <EmbeddedResource Update="Shared\ResourceFiles\Resources.resx"> | |||||
| <Generator>PublicResXFileCodeGenerator</Generator> | |||||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | |||||
| </EmbeddedResource> | |||||
| </ItemGroup> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>net5.0</TargetFramework> | |||||
| <ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <PackageReference Include="BlazorAnimate" Version="3.0.0" /> | |||||
| <PackageReference Include="MatBlazor" Version="2.8.0" /> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.7" /> | |||||
| <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.7" PrivateAssets="all" /> | |||||
| <PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.7" /> | |||||
| <PackageReference Include="System.Net.Http.Json" Version="5.0.0" /> | |||||
| <PackageReference Include="Tewr.Blazor.FileReader" Version="3.1.0.21158" /> | |||||
| <PackageReference Include="Tewr.Blazor.FileReader.Wasm" Version="0.11.19128" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" /> | |||||
| </ItemGroup> | |||||
| </Project> | </Project> |
| </PropertyGroup> | </PropertyGroup> | ||||
| <PropertyGroup> | <PropertyGroup> | ||||
| <ActiveDebugProfile>CaritasPWA</ActiveDebugProfile> | <ActiveDebugProfile>CaritasPWA</ActiveDebugProfile> | ||||
| <NameOfLastUsedPublishProfile>D:\Work\Caritas\CaritasPWA\Properties\PublishProfiles\IISProfile.pubxml</NameOfLastUsedPublishProfile> | |||||
| </PropertyGroup> | </PropertyGroup> | ||||
| <ItemGroup> | |||||
| <EmbeddedResource Update="Shared\ResourceFiles\Resources.it.resx"> | |||||
| <SubType>Designer</SubType> | |||||
| </EmbeddedResource> | |||||
| </ItemGroup> | |||||
| </Project> | </Project> |
| "" | |||||
| { | |||||
| "FILE_VERSION" = "9237" | |||||
| "ENLISTMENT_CHOICE" = "NEVER" | |||||
| "PROJECT_FILE_RELATIVE_PATH" = "" | |||||
| "NUMBER_OF_EXCLUDED_FILES" = "0" | |||||
| "ORIGINAL_PROJECT_FILE_PATH" = "" | |||||
| "NUMBER_OF_NESTED_PROJECTS" = "0" | |||||
| "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" | |||||
| } |
| | | ||||
| Microsoft Visual Studio Solution File, Format Version 12.00 | Microsoft Visual Studio Solution File, Format Version 12.00 | ||||
| # Visual Studio Version 16 | # Visual Studio Version 16 | ||||
| VisualStudioVersion = 16.0.31129.286 | |||||
| VisualStudioVersion = 16.0.31321.278 | |||||
| MinimumVisualStudioVersion = 10.0.40219.1 | MinimumVisualStudioVersion = 10.0.40219.1 | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CaritasPWA", "CaritasPWA.csproj", "{A4CFFE67-908C-4822-A420-78B2834EBC1E}" | |||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CaritasPWA", "CaritasPWA.csproj", "{D258170F-7153-4503-AAB9-6B5699A58B53}" | |||||
| EndProject | EndProject | ||||
| Global | Global | ||||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| Release|Any CPU = Release|Any CPU | Release|Any CPU = Release|Any CPU | ||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||||
| {A4CFFE67-908C-4822-A420-78B2834EBC1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {A4CFFE67-908C-4822-A420-78B2834EBC1E}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {A4CFFE67-908C-4822-A420-78B2834EBC1E}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {A4CFFE67-908C-4822-A420-78B2834EBC1E}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {D258170F-7153-4503-AAB9-6B5699A58B53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {D258170F-7153-4503-AAB9-6B5699A58B53}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {D258170F-7153-4503-AAB9-6B5699A58B53}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {D258170F-7153-4503-AAB9-6B5699A58B53}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
| HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(ExtensibilityGlobals) = postSolution | GlobalSection(ExtensibilityGlobals) = postSolution | ||||
| SolutionGuid = {C8607828-7A15-45AD-B236-AE7916C2CC1B} | |||||
| SolutionGuid = {727FFEFC-2F79-4A3E-B3E6-495767058A34} | |||||
| EndGlobalSection | EndGlobalSection | ||||
| EndGlobal | EndGlobal |
| <div class="row px-3 h-100"> | <div class="row px-3 h-100"> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <MatHeadline3 Style="font-family:Ubuntu;padding-top:1em">@i18n["Confirmation"]</MatHeadline3> | |||||
| <MatHeadline4 Style="font-family:Ubuntu;padding-top:1em">@i18n["Confirmation"]</MatHeadline4> | |||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextFound"]</MatHeadline6> | <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextFound"]</MatHeadline6> |
| @using CaritasPWA.Shared.Services; | @using CaritasPWA.Shared.Services; | ||||
| @using System.Globalization; | @using System.Globalization; | ||||
| @using Microsoft.AspNetCore.Components.Forms; | @using Microsoft.AspNetCore.Components.Forms; | ||||
| @using System.IO; | |||||
| @inject NavigationManager NavigationManager | @inject NavigationManager NavigationManager | ||||
| @inject IStringLocalizer<Resources> i18n | @inject IStringLocalizer<Resources> i18n | ||||
| @inject PageHistoryManager PageHistoryManager | @inject PageHistoryManager PageHistoryManager | ||||
| @inject MasterDataService MasterDataService | @inject MasterDataService MasterDataService | ||||
| @inject IMatToaster Toaster | @inject IMatToaster Toaster | ||||
| @*@using Tewr.Blazor.FileReader | |||||
| @inject IFileReaderService fileReaderService;*@ | |||||
| <div class="row px-3 h-100"> | <div class="row px-3 h-100"> | ||||
| <div class="row no-gutters align-items-center justify-content-center w-100" style="padding-top:1em"> | <div class="row no-gutters align-items-center justify-content-center w-100" style="padding-top:1em"> | ||||
| @if ("Found".Equals(FromRoute)) { | @if ("Found".Equals(FromRoute)) { | ||||
| <h1>@i18n["FoundBike"]</h1> | |||||
| <h2>@i18n["FoundBike"]</h2> | |||||
| } else { | } else { | ||||
| <h1>@i18n["MissingBike"]</h1> | |||||
| <h2>@i18n["MissingBike"]</h2> | |||||
| } | } | ||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-center justify-content-center w-100"> | <div class="row no-gutters align-items-center justify-content-center w-100"> | ||||
| <div class="mat-layout-grid-inner"> | <div class="mat-layout-grid-inner"> | ||||
| <div class="mat-layout-grid-cell mat-layout-grid-cell-span-1 justify-content-center" style="text-align: center"> | <div class="mat-layout-grid-cell mat-layout-grid-cell-span-1 justify-content-center" style="text-align: center"> | ||||
| <div> | <div> | ||||
| <InputFile class="inputFile" id="camera" type="file" name="camera" accept="image/*" capture="user" OnChange="@OnFileSelection"/> | |||||
| <InputFile class="inputFile" id="camera" type="file" name="camera" accept="image/*" capture="user" OnChange="@OnFileSelection" /> | |||||
| <MatRipple class="inputfile-mat-ripple" Color="@MatRippleColor.Default"> | <MatRipple class="inputfile-mat-ripple" Color="@MatRippleColor.Default"> | ||||
| <label for="camera"> | <label for="camera"> | ||||
| <svg xmlns="http://www.w3.org/2000/svg" width="48px" height="48px" viewBox="0 0 24 24" fill="#000000"> | <svg xmlns="http://www.w3.org/2000/svg" width="48px" height="48px" viewBox="0 0 24 24" fill="#000000"> | ||||
| </MatRipple> | </MatRipple> | ||||
| </div> | </div> | ||||
| <div style="margin-top:1rem"> | <div style="margin-top:1rem"> | ||||
| @*<input @ref="inputTypeFileElement" id="file" type="file" name="file" accept="image/x-png,image/jpeg,image/gif" class="inputFile" @onchange="ReadFile" />*@ | |||||
| <InputFile id="file" type="file" name="file" accept="image/x-png,image/jpeg,image/gif" class="inputFile" OnChange="@OnFileSelection" /> | <InputFile id="file" type="file" name="file" accept="image/x-png,image/jpeg,image/gif" class="inputFile" OnChange="@OnFileSelection" /> | ||||
| <MatRipple class="inputfile-mat-ripple" Color="@MatRippleColor.Default"> | <MatRipple class="inputfile-mat-ripple" Color="@MatRippleColor.Default"> | ||||
| <label for="file"> | <label for="file"> | ||||
| [Parameter(CaptureUnmatchedValues = true)] | [Parameter(CaptureUnmatchedValues = true)] | ||||
| public IDictionary<string, object> Attributes { get; set; } | public IDictionary<string, object> Attributes { get; set; } | ||||
| private static long MAX_FILE_SIZE = 4000000; | |||||
| private static int MAX_FILE_SIZE = 4000000; | |||||
| private ColorItem selectedColor; | private ColorItem selectedColor; | ||||
| private BicycleType selectedBcType; | private BicycleType selectedBcType; | ||||
| await imgFile.OpenReadStream(MAX_FILE_SIZE).ReadAsync(buffers); | await imgFile.OpenReadStream(MAX_FILE_SIZE).ReadAsync(buffers); | ||||
| string imageType = imgFile.ContentType; | string imageType = imgFile.ContentType; | ||||
| imgUrl = $"data:{imageType};base64,{Convert.ToBase64String(buffers)}"; | imgUrl = $"data:{imageType};base64,{Convert.ToBase64String(buffers)}"; | ||||
| } catch (Exception ex) { | |||||
| } catch (IOException ex) { | |||||
| Console.WriteLine("Ex.Meesage is: {0}.", ex.Message); | |||||
| Show(MatToastType.Danger, i18n.GetString("Error.PhotoOrPictureToBig.Title"), i18n.GetString("Error.PhotoOrPictureToBig.Msg", MAX_FILE_SIZE / 1000)); | Show(MatToastType.Danger, i18n.GetString("Error.PhotoOrPictureToBig.Title"), i18n.GetString("Error.PhotoOrPictureToBig.Msg", MAX_FILE_SIZE / 1000)); | ||||
| } | } | ||||
| } | } | ||||
| Toaster.Add(message, type, title, icon); | Toaster.Add(message, type, title, icon); | ||||
| } | } | ||||
| //******* | |||||
| //private ElementReference inputTypeFileElement; | |||||
| //public async Task ReadFile() { | |||||
| // foreach (var file in await fileReaderService.CreateReference(inputTypeFileElement).EnumerateFilesAsync()) { | |||||
| // IFileInfo fileInfo = await file.ReadFileInfoAsync(); | |||||
| // byte[] buffer = new byte[fileInfo.Size]; | |||||
| // using (MemoryStream memoryStream = await file.CreateMemoryStreamAsync(4096)) { | |||||
| // int bytesRead = 0; | |||||
| // int offset = 0; | |||||
| // do { | |||||
| // bytesRead = memoryStream.Read(buffer, offset, 4096); | |||||
| // offset = offset + bytesRead; | |||||
| // } while (bytesRead < 4096); | |||||
| // string imageType = fileInfo.Type; | |||||
| // imgUrl = $"data:{imageType};base64,{Convert.ToBase64String(buffer)}"; | |||||
| // } | |||||
| // } | |||||
| //} | |||||
| } | } |
| <div class="row px-3 h-100"> | <div class="row px-3 h-100"> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <MatHeadline3 Style="font-family:Ubuntu;padding-top:1em">@i18n["Info"]</MatHeadline3> | |||||
| <MatHeadline4 Style="font-family:Ubuntu;padding-top:1em">@i18n["Info"]</MatHeadline4> | |||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-start justify-content-center w-100"> | <div class="row no-gutters align-items-start justify-content-center w-100"> | ||||
| <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextMissing"]</MatHeadline6> | <MatHeadline6 Style="font-family:Ubuntu">@i18n["FinishedTextMissing"]</MatHeadline6> |
| @page "/doneimage" | @page "/doneimage" | ||||
| <div class="text-center"> | <div class="text-center"> | ||||
| <img src="./images/done.png" class="w-50" /> | |||||
| <img src="./images/done.png" class="w-50" alt="Done!" /> | |||||
| </div> | </div> | ||||
| @code { | @code { |
| <div class="row h-100 justify-content-center"> | <div class="row h-100 justify-content-center"> | ||||
| <div class="row d-flex align-items-center justify-content-center px-4 w-100"> | <div class="row d-flex align-items-center justify-content-center px-4 w-100"> | ||||
| <img src="./images/caritas_logo.png" style="padding:1em;max-width:320px" class="w-100"> | |||||
| <img src="./images/caritas_logo.png" style="padding:1em;max-width:320px" class="w-100" alt=""> | |||||
| </div> | </div> | ||||
| <div class="row align-items-center vw-100 h-75"> | <div class="row align-items-center vw-100 h-75"> |
| @inject PageHistoryManager PageHistoryManager | @inject PageHistoryManager PageHistoryManager | ||||
| @inject IJSRuntime JSRuntime; | @inject IJSRuntime JSRuntime; | ||||
| <div class="row px-3 h-100"> | |||||
| <div class="text-center w-100"> | |||||
| <img class="w-100" src="./images/caritas_logo.png" style="padding:1em;max-width:320px" /> | |||||
| </div> | |||||
| <div class="row no-gutters align-items-center w-100"> | |||||
| <table class="w-100"> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <p class="text-left" style="max-width: 500px;display:inline-block">@i18n["Abouttext"]</p> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <MatButton Raised="true" Class="w-100" @onclick="@ShowCaritasWebpage" style="max-width:500px">@i18n["Learnmore"]</MatButton> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <MatCaption Style="font-family:Ubuntu">Version: 0.0.1</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| <div class="row no-gutters align-items-end w-100"> | |||||
| <table class="w-100"> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">@i18n["DevelopedBy"]</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <img src="./images/integrate_logo.png" style="max-width:200px" /> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">Platz 10, Business Village Luzern</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">CH-6039 Root D4</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| <div class="row px-3 h-100"> | |||||
| <div class="text-center w-100"> | |||||
| <img class="w-100" src="./images/caritas_logo.png" style="padding:1em;max-width:320px" /> | |||||
| </div> | </div> | ||||
| <div class="row no-gutters align-items-center w-100"> | |||||
| <table class="w-100"> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <p class="text-left" style="max-width: 500px;display:inline-block">@i18n["Abouttext"]</p> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <MatButton Raised="true" Class="w-100" @onclick="@ShowCaritasWebpage" style="max-width:500px">@i18n["Learnmore"]</MatButton> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-center"> | |||||
| <MatCaption Style="font-family:Ubuntu">Version: 0.0.1</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| <div class="row no-gutters align-items-end w-100"> | |||||
| <table class="w-100"> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">@i18n["DevelopedBy"]</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <img src="./images/integrate_logo.png" style="max-width:200px" alt="" /> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">Platz 10, Business Village Luzern</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td class="text-right"> | |||||
| <MatCaption Style="font-family:Ubuntu">CH-6039 Root D4</MatCaption> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| </div> | |||||
| @code { | |||||
| @code { | |||||
| protected override void OnInitialized() { | |||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| base.OnInitialized(); | |||||
| } | |||||
| protected override void OnInitialized() { | |||||
| PageHistoryManager.AddPageToHistory(NavigationManager.Uri); | |||||
| base.OnInitialized(); | |||||
| } | |||||
| private async void ShowCaritasWebpage() { | |||||
| // NavigationManager.NavigateTo("http://www.caritas.ch"); | |||||
| //NavigationManager.open("http://google.com", "_blank"); | |||||
| await JSRuntime.InvokeAsync<string>("open", $"https://www.caritas.ch", "_blank"); | |||||
| } | |||||
| private async void ShowCaritasWebpage() { | |||||
| await JSRuntime.InvokeAsync<string>("open", $"https://www.caritas.ch", "_blank"); | |||||
| } | } | ||||
| } |
| using CaritasPWA.Shared; | |||||
| using CaritasPWA.Shared.Services; | |||||
| using MatBlazor; | |||||
| using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | ||||
| using Microsoft.Extensions.Configuration; | |||||
| using Microsoft.Extensions.Logging; | |||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||
| using System; | using System; | ||||
| using System.Collections.Generic; | |||||
| using System.Net.Http; | using System.Net.Http; | ||||
| using System.Text; | |||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| using MatBlazor; | |||||
| using CaritasPWA.Shared; | |||||
| using CaritasPWA.Shared.Services; | |||||
| using Tewr.Blazor.FileReader; | using Tewr.Blazor.FileReader; | ||||
| using MatBlazor; | |||||
| namespace CaritasPWA { | namespace CaritasPWA { |
| "ASPNETCORE_ENVIRONMENT": "Development" | "ASPNETCORE_ENVIRONMENT": "Development" | ||||
| }, | }, | ||||
| "nativeDebugging": true, | "nativeDebugging": true, | ||||
| "jsWebView2Debugging": false, | |||||
| "jsWebView2Debugging": true, | |||||
| "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" | ||||
| }, | }, | ||||
| "CaritasPWA": { | "CaritasPWA": { |
| using System; | using System; | ||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared { | namespace CaritasPWA.Shared { | ||||
| public class AppState { | public class AppState { |
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| public class BicycleType { | public class BicycleType { | ||||
| public int Index { get; set; } | public int Index { get; set; } |
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| using Microsoft.AspNetCore.Components; | |||||
| using Microsoft.Extensions.Localization; | |||||
| using CaritasPWA.Shared.ResourceFiles; | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| public class ColorItem { | public class ColorItem { | ||||
| public int Index { get; set; } | public int Index { get; set; } |
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| public class Defaults { | public class Defaults { | ||||
| public static ColorItem[] ColorItems = { | public static ColorItem[] ColorItems = { |
| using System.ComponentModel; | |||||
| using System.Runtime.CompilerServices; | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| namespace CaritasPWA.Shared.Models { | |||||
| // The class that stores the user settings | // The class that stores the user settings | ||||
| public class UserData { | public class UserData { | ||||
| private string salutation; | private string salutation; | ||||
| private string phone; | private string phone; | ||||
| private string email; | private string email; | ||||
| public string Salutation{ get => salutation; set { salutation = value; } } | |||||
| public string Salutation { get => salutation; set { salutation = value; } } | |||||
| public string Firstname { get => firstname; set { firstname = value; } } | public string Firstname { get => firstname; set { firstname = value; } } | ||||
| public string Lastname { get => lastname; set { lastname = value; } } | public string Lastname { get => lastname; set { lastname = value; } } | ||||
| public string Address { get => address; set { address = value; } } | public string Address { get => address; set { address = value; } } |
| @if (PageHistoryManager.CanGoBack()) { | @if (PageHistoryManager.CanGoBack()) { | ||||
| <MatIconButton Icon="keyboard_backspace" OnClick="@((e) => ButtonBackClicked())" Disabled="@BackButtonDisabled()"></MatIconButton> | <MatIconButton Icon="keyboard_backspace" OnClick="@((e) => ButtonBackClicked())" Disabled="@BackButtonDisabled()"></MatIconButton> | ||||
| } | } | ||||
| <MatAppBarTitle Style="padding-left:0px; font-size:90%; font-weight:500">@LocationUrl</MatAppBarTitle> | |||||
| <MatAppBarTitle Class="navBar-title">@LocationUrl</MatAppBarTitle> | |||||
| </MatAppBarSection> | </MatAppBarSection> | ||||
| <MatAppBarSection align="@MatAppBarSectionAlign.End" Style="max-width:min-content"> | <MatAppBarSection align="@MatAppBarSectionAlign.End" Style="max-width:min-content"> | ||||
| <NavLink target="_blank" class="text-white small" href="https://www.caritas.ch" align="@MatAppBarSectionAlign.End" style="padding-right:1em">@i18n["Learnmore"]</NavLink> | <NavLink target="_blank" class="text-white small" href="https://www.caritas.ch" align="@MatAppBarSectionAlign.End" style="padding-right:1em">@i18n["Learnmore"]</NavLink> | ||||
| <MatDrawerContainer> | <MatDrawerContainer> | ||||
| <MatDrawer @bind-Opened="@Opened" Mode="@MatDrawerMode.Modal"> | <MatDrawer @bind-Opened="@Opened" Mode="@MatDrawerMode.Modal"> | ||||
| <MatList> | <MatList> | ||||
| <MatListItem Class="@((Index == 1) ? "bg-primary-color text-white" : "")" | |||||
| Href="caritas_services" | |||||
| @onclick="@((e) => ButtonClicked(1))"> | |||||
| <MatIcon Icon="@MatIconNames.Apps"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["CaritasServices"]</MatListItemText> | |||||
| </MatListItem> | |||||
| <MatListItem Class="@((Index == 2) ? "bg-primary-color text-white" : "")" | |||||
| Href="account" | |||||
| @onclick="@((e) => ButtonClicked(2))"> | |||||
| <MatIcon Icon="@MatIconNames.Person_outline"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["account"]</MatListItemText> | |||||
| </MatListItem> | |||||
| <MatListItem Class="@((Index == 3) ? "bg-primary-color text-white" : "")" | |||||
| Href="info" | |||||
| @onclick="@((e) => ButtonClicked(3))"> | |||||
| <MatIcon Icon="@MatIconNames.Error_outline" Style="transform: rotate(180deg)"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["info"]</MatListItemText> | |||||
| </MatListItem> | |||||
| <MatListItem Class="@((Index == 4) ? "bg-primary-color text-white" : "")" | |||||
| href="" | |||||
| Match="NavLinkMatch.All" | |||||
| @onclick="@((e) => ButtonClicked(4))"> | |||||
| <MatIcon Icon="@MatIconNames.Exit_to_app"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["Logout"]</MatListItemText> | |||||
| </MatListItem> | |||||
| <MatRipple Class="navmenu-mat-ripple" Color="@MatRippleColor.Default"> | |||||
| <MatListItem Class="@((Index == 1) ? "bg-primary-color text-white" : "")" Style="margin-left:0;margin-right:0" | |||||
| Href="caritas_services" | |||||
| @onclick="@((e) => ButtonClicked(1))"> | |||||
| <MatIcon Icon="@MatIconNames.Apps"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["CaritasServices"]</MatListItemText> | |||||
| </MatListItem> | |||||
| </MatRipple> | |||||
| <MatRipple Class="navmenu-mat-ripple" Color="@MatRippleColor.Default"> | |||||
| <MatListItem Class="@((Index == 2) ? "bg-primary-color text-white" : "")" Style="margin-left:0;margin-right:0" | |||||
| Href="account" | |||||
| @onclick="@((e) => ButtonClicked(2))"> | |||||
| <MatIcon Icon="@MatIconNames.Person_outline"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["account"]</MatListItemText> | |||||
| </MatListItem> | |||||
| </MatRipple> | |||||
| <MatRipple Class="navmenu-mat-ripple" Color="@MatRippleColor.Default"> | |||||
| <MatListItem Class="@((Index == 3) ? "bg-primary-color text-white" : "")" Style="margin-left:0;margin-right:0" | |||||
| Href="info" | |||||
| @onclick="@((e) => ButtonClicked(3))"> | |||||
| <MatIcon Icon="@MatIconNames.Error_outline" Style="transform: rotate(180deg)"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["info"]</MatListItemText> | |||||
| </MatListItem> | |||||
| </MatRipple> | |||||
| <MatRipple Class="navmenu-mat-ripple" Color="@MatRippleColor.Default"> | |||||
| <MatListItem Class="@((Index == 4) ? "bg-primary-color text-white" : "")" Style="margin-left:0;margin-right:0" | |||||
| href="" | |||||
| Match="NavLinkMatch.All" | |||||
| @onclick="@((e) => ButtonClicked(4))"> | |||||
| <MatIcon Icon="@MatIconNames.Exit_to_app"></MatIcon> | |||||
| <MatListItemText Style="padding-left:0.5em">@i18n["Logout"]</MatListItemText> | |||||
| </MatListItem> | |||||
| </MatRipple> | |||||
| </MatList> | </MatList> | ||||
| </MatDrawer> | </MatDrawer> | ||||
| </MatDrawerContainer> | </MatDrawerContainer> |
| using CaritasPWA.Shared.Models; | using CaritasPWA.Shared.Models; | ||||
| using System; | |||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Services { | namespace CaritasPWA.Shared.Services { | ||||
| public interface ILFBicycleRest { | public interface ILFBicycleRest { |
| using CaritasPWA.Shared.Models; | using CaritasPWA.Shared.Models; | ||||
| using System; | |||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Services { | namespace CaritasPWA.Shared.Services { | ||||
| // REST interface responsible to submit lost or found reports and get the available masterdata. | // REST interface responsible to submit lost or found reports and get the available masterdata. | ||||
| public class LFBicycleRest : ILFBicycleRest { | public class LFBicycleRest : ILFBicycleRest { | ||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Threading.Tasks; | |||||
| using CaritasPWA.Shared.Models; | |||||
| using Microsoft.AspNetCore.Components; | |||||
| using CaritasPWA.Shared.Models; | |||||
| using Microsoft.JSInterop; | using Microsoft.JSInterop; | ||||
| using System; | |||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Services { | namespace CaritasPWA.Shared.Services { | ||||
| public class MasterDataService { | public class MasterDataService { | ||||
| } else { | } else { | ||||
| result = new ColorItem[] { }; | result = new ColorItem[] { }; | ||||
| } | } | ||||
| _colors= result; | |||||
| _colors = result; | |||||
| return result; | return result; | ||||
| } | } | ||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | using System.Linq; | ||||
| using System.Threading.Tasks; | |||||
| namespace CaritasPWA.Shared.Services { | namespace CaritasPWA.Shared.Services { | ||||
| public class PageHistoryManager { | public class PageHistoryManager { |
| using Microsoft.JSInterop; | |||||
| using CaritasPWA.Shared.Models; | |||||
| using Microsoft.JSInterop; | |||||
| using System; | using System; | ||||
| using System.ComponentModel; | |||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||
| using CaritasPWA.Shared.Models; | |||||
| namespace CaritasPWA.Shared.Services { | namespace CaritasPWA.Shared.Services { | ||||
| public sealed class UserDataProvider { | |||||
| public sealed class UserDataProvider { | |||||
| private const string KeyName = "account"; | private const string KeyName = "account"; | ||||
| private readonly IJSRuntime _jsRuntime; | private readonly IJSRuntime _jsRuntime; | ||||
| private bool _initialized; | private bool _initialized; | ||||
| private UserData _data = new UserData(); | private UserData _data = new UserData(); | ||||
| public UserData Data { | |||||
| get => _data; | |||||
| set => _data = value; | |||||
| public UserData Data { | |||||
| get => _data; | |||||
| set => _data = value; | |||||
| } | } | ||||
| public event EventHandler Changed; | public event EventHandler Changed; | ||||
| public bool AutoSave { get; set; } = true; | public bool AutoSave { get; set; } = true; |
| @using CaritasPWA.Shared.ResourceFiles | @using CaritasPWA.Shared.ResourceFiles | ||||
| @using MatBlazor | @using MatBlazor | ||||
| @using BlazorAnimate | @using BlazorAnimate | ||||
| @using BlazorColorPicker | |||||
| @using Tewr.Blazor.FileReader | @using Tewr.Blazor.FileReader |
| display: inline-flex; | display: inline-flex; | ||||
| } | } | ||||
| .navmenu-mat-ripple { | |||||
| margin-left: 0.5em; | |||||
| margin-right: 0.5em; | |||||
| border-radius: 6px; | |||||
| } | |||||
| .btn-primary { | .btn-primary { | ||||
| color: #fff; | color: #fff; | ||||
| background-color: var(--primary); | background-color: var(--primary); | ||||
| right: 0.75rem; | right: 0.75rem; | ||||
| top: 0.5rem; | top: 0.5rem; | ||||
| } | } | ||||
| .navBar-title { | |||||
| padding-left: 0px; | |||||
| font-size: 90%; | |||||
| font-weight: 500; | |||||
| white-space: normal; | |||||
| line-height: inherit; | |||||
| } |
| <!DOCTYPE html> | <!DOCTYPE html> | ||||
| <html> | |||||
| <html lang="de-ch"> | |||||
| <head> | <head> | ||||
| <meta charset="utf-8" /> | <meta charset="utf-8" /> | ||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |||||
| <title>CaritasPWA</title> | |||||
| <meta name="description" content="Caritas PWA, developed by INTEGRATE AG, Switzerland"> | |||||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-scalable=yes" /> | |||||
| <title>Caritas PWA</title> | |||||
| <base href="/" /> | <base href="/" /> | ||||
| <script src="_content/BlazorAnimate/blazorAnimateInterop.js"></script> | <script src="_content/BlazorAnimate/blazorAnimateInterop.js"></script> | ||||
| <script src="_content/MatBlazor/dist/matBlazor.js"></script> | <script src="_content/MatBlazor/dist/matBlazor.js"></script> | ||||
| <script src="_content/BlazorColorPicker/colorpicker.js"></script> | |||||
| <link href="_content/BlazorColorPicker/colorpicker.css" rel="stylesheet" /> | |||||
| <link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" /> | <link href="_content/MatBlazor/dist/matBlazor.css" rel="stylesheet" /> | ||||
| <link href="css/united/bootstrap.min.css" rel="stylesheet" /> | <link href="css/united/bootstrap.min.css" rel="stylesheet" /> | ||||
| <link href="css/united/_bootswatch.min.css" rel="stylesheet" /> | <link href="css/united/_bootswatch.min.css" rel="stylesheet" /> |
| { | { | ||||
| "src": "icons/icon-192.png", | "src": "icons/icon-192.png", | ||||
| "type": "image/png", | "type": "image/png", | ||||
| "sizes": "192x192" | |||||
| "sizes": "192x192", | |||||
| "purpose": "any maskable" | |||||
| }, | }, | ||||
| { | { | ||||
| "src": "icons/icon-512.png", | "src": "icons/icon-512.png", |
| 'css/united/bootstrap.min.css', | 'css/united/bootstrap.min.css', | ||||
| 'css/united/_bootswatch.min.css', | 'css/united/_bootswatch.min.css', | ||||
| 'css/united/_variables.min.css', | 'css/united/_variables.min.css', | ||||
| '_content/BlazorColorPicker/colorpicker.css', | |||||
| '_content/BlazorColorPicker/colorpicker.js', | |||||
| '_content/MatBlazor/dist/matBlazor.css', | |||||
| '_content/MatBlazor/dist/matBlazor.js', | |||||
| '_content/BlazorAnimate/blazorAnimateInterop.js', | |||||
| '_content/BlazorAnimate/aos.css', | |||||
| '_content/matblazor/dist/matblazor.css', | |||||
| '_content/matblazor/dist/matblazor.js', | |||||
| '_content/blazoranimate/blazoranimateinterop.js', | |||||
| '_content/blazoranimate/aos.css', | |||||
| '_framework/blazor.webassembly.js', | '_framework/blazor.webassembly.js', | ||||
| '_framework/blazor.boot.json', | '_framework/blazor.boot.json', | ||||
| '_framework/wasm/dotnet.5.0.7.js', | |||||
| '_framework/dotnet.5.0.7.js', | |||||
| 'https://fonts.googleapis.com/css?family=Roboto:300,400,500', | 'https://fonts.googleapis.com/css?family=Roboto:300,400,500', | ||||
| 'https://fonts.googleapis.com/icon?family=Material+Icons', | 'https://fonts.googleapis.com/icon?family=Material+Icons', | ||||
| 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap', | 'https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;700&display=swap', | ||||
| }); | }); | ||||
| // activate event | // activate event | ||||
| self.addEventListener('activate', evt => { | |||||
| evt.waitUntil( | |||||
| caches.keys().then(keys => { | |||||
| return Promise.all(keys | |||||
| .filter(key => key !== staticCacheName) | |||||
| .map(key => caches.delete()) | |||||
| ) | |||||
| self.addEventListener('activate', event => { | |||||
| // delete any caches that aren't in expectedCaches | |||||
| // which will get rid of site-static-v1 | |||||
| event.waitUntil( | |||||
| caches.keys().then(keys => Promise.all( | |||||
| keys.map(key => { | |||||
| if (!staticCacheName.includes(key)) { | |||||
| return caches.delete(key); | |||||
| } | |||||
| }) | |||||
| )).then(() => { | |||||
| console.log('Now ready to handle fetches!'); | |||||
| }) | }) | ||||
| ); | ); | ||||
| }); | }); | ||||
| self.addEventListener('fetch', evt => { | self.addEventListener('fetch', evt => { | ||||
| evt.respondWith( | evt.respondWith( | ||||
| caches.match(evt.request).then(cacheRes => { | caches.match(evt.request).then(cacheRes => { |