Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/bitfoundation/bitplatform
Browse files Browse the repository at this point in the history
…into 6591-support-for-static-blazor-webassembly-deployment-in-boilerplate-project-template
  • Loading branch information
ysmoradi committed Jan 16, 2024
2 parents f553abd + 196eeb8 commit 9603c2c
Show file tree
Hide file tree
Showing 39 changed files with 1,321 additions and 454 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<BitTypography Variant="BitTypographyVariant.H5" Gutter>Blazor Entity Framework Sqlite utilities</BitTypography>

<BitTypography Variant="BitTypographyVariant.Subtitle1">
Dreaming of an offline web application capable of saving data and syncing later?
<br />
Enter Besql, your solution to incorporating EF core & sqlite in your browser.
It's a crucial aid for achieving this objective seamlessly.
<br />
bit Besql facilitates the use of Entity Framework and sqlite in web browsers with Blazor WebAssembly.
</BitTypography>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@
Service Worker when building PWAs with Blazor.
It utilizes the Service Worker's events to handle Installing and Updating the app
as fast and smooth as possible while minimizing the download size.
<br />
This unique tool harnesses the power of Progressive Web Apps (PWA) within the innovative
new structure of dotnet 8. By amalgamating pre-rendering techniques reminiscent of renowned
platforms like GitHub, Reddit, and Facebook, Bswup ensures an exceptional user experience.
</BitTypography>


<br />

<div class="section-card-txt">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
<BitTypography Variant="BitTypographyVariant.H5" Gutter>Blazor Utilities for JavaScript</BitTypography>

<BitTypography Variant="BitTypographyVariant.Subtitle1">
Embracing Blazor because of your love for C#?
<br />
Butil enables you to stay true to that sentiment by providing essential Browser APIs in C#,
eliminating the need to revert to JavaScript for any functionality.
<br />
bit Butil helps C# developers to access the browser APIs that are only accessible through JavaScript in C#.
</BitTypography>

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
namespace Bit.Websites.Platform.Client.Pages.Butil;

public partial class Butil04WindowPage
{
private float innerHeight;

private float innerWidth;

private string? origin;

private float outerHeight;

private float outerWidth;

private string? btoaText;
private string? btoaValue;

private string? atobText;
private string? atobValue;


private async Task GetInnerHeight() => innerHeight = await window.GetInnerHeight();

private async Task GetInnerWidth() => innerWidth = await window.GetInnerWidth();

private async Task GetOrigin() => origin = await window.GetOrigin();

private async Task GetOuterHeight() => outerHeight = await window.GetOuterHeight();

private async Task GetOuterWidth() => outerWidth = await window.GetOuterWidth();

private async Task EncodeData() => btoaText = await window.Btoa(btoaValue!);

private async Task DecodeData() => atobText = await window.Atob(atobValue!);

private string getInnerHeightExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=GetInnerHeight>GetInnerHeight</BitButton>
<div>InnerHeight is: @innerHeight</div>
@code {
private string? innerHeight;
private async Task GetInnerHeight() => innerHeight = await window.GetInnerHeight();
}";
private string getInnerWidthExampleCode =

Check warning on line 48 in src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04WindowPage.razor.cs

View workflow job for this annotation

GitHub Actions / build api + blazor

The field 'Butil04WindowPage.getInnerWidthExampleCode' is assigned but its value is never used

Check warning on line 48 in src/Websites/Platform/src/Bit.Websites.Platform.Client/Pages/Butil/Butil04WindowPage.razor.cs

View workflow job for this annotation

GitHub Actions / build and test

The field 'Butil04WindowPage.getInnerWidthExampleCode' is assigned but its value is never used
@"@inject Bit.Butil.Window window
<BitButton OnClick=GetInnerWidth>GetInnerWidth</BitButton>
<div>InnerWidth is: @innerWidth</div>
@code {
private string? innerWidth;
private async Task GetInnerWidth() => innerWidth = await window.GetInnerWidth();
}";
private string getOriginExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=GetOrigin>GetOrigin</BitButton>
<div>Origin is: @origin</div>
@code {
private string? origin;
private async Task GetOrigin() => origin = await window.GetOrigin();
}";
private string getOuterHeightExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=GetOuterHeight>GetOuterHeight</BitButton>
<div>OuterHeight is: @outerHeight</div>
@code {
private float outerHeight;
private async Task GetOuterHeight() => outerHeight = await window.GetOuterHeight();
}";
private string getOuterWidthExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=GetOuterWidth>GetOuterWidth</BitButton>
<div>OuterWidth is: @outerWidth</div>
@code {
private float outerWidth;
private async Task GetOuterWidth() => outerWidth = await window.GetOuterWidth();
}";
private string btoaExampleCode =
@"@inject Bit.Butil.Window window
<BitTextField @bind-Value=""btoaValue"" />
<BitButton OnClick=EncodeData>EncodeData</BitButton>
<div>Encoded data is: @btoaText</div>
@code {
private string? btoaText;
private string? btoaValue;
private async Task EncodeData() => btoaText = await window.Btoa(btoaValue!);
}";
private string atobExampleCode =
@"@inject Bit.Butil.Window window
<BitTextField @bind-Value=""atobValue"" />
<BitButton OnClick=DecodeData>DecodeData</BitButton>
<div>Decoded data is: @atobText</div>
@code {
private string? atobText;
private string? atobValue;
private async Task DecodeData() => atobText = await window.Atob(atobValue!);
}";
private string alertExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=""@(() => window.Alert(""Alert from C#""))"">ShowAlert</BitButton>";
private string confirmExampleCode =
@"@inject Bit.Butil.Window window
<BitButton OnClick=""@(() => window.Confirm(""Confirm from C#""))"">ShowConfirm</BitButton>";
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/butil/keyboard"
@inherits AppComponentBase
@inject Bit.Butil.Keyboard keyboard

<PageOutlet Url="butil/keyboard"
Title="Keyboard - Butil"
Expand Down Expand Up @@ -30,11 +31,53 @@
<section class="section-card">
<BitTypography Variant="BitTypographyVariant.H5" Gutter>Methods</BitTypography>
<div class="section-card-txt">
<b>Add</b>: Adds a handler to a keyboard key combination.
<b>Add</b>, <b>Remove</b>: Adds/Removes a handler to a keyboard key combination.
<br /><br />
<b>Remove</b>: Removes a handler from a keyboard key combination.
<BitAccordion Title="Sample">
<ChildContent>
<BitPivot>
<BitPivotItem HeaderText="Code">
<pre class="code-box">
@exampleCode1
</pre>
</BitPivotItem>
<BitPivotItem HeaderText="Result">
<br />
<div>Press Ctrl+F to focus on search box</div>
<br />
<BitSearchBox @ref="searchBox" Style="max-width: 18.75rem;" />
<br />
</BitPivotItem>
</BitPivot>
</ChildContent>
</BitAccordion>
</div>
</section>
</div>

<NavigationButtons Prev="Document" PrevUrl="/butil/document" Next="Console" NextUrl="/butil/console" />

@code {
private BitSearchBox searchBox = default!;

protected override async Task OnInitAsync()
{
await keyboard.Add(ButilKeyCodes.KeyF, () => _ = searchBox.FocusInput(), ButilModifiers.Ctrl);
}

private string exampleCode1 =
@"@inject Bit.Butil.Document document
<div>Press Ctrl+F to focus on search box</div>
<BitSearchBox @ref=""searchBox"" />
@code {
private BitSearchBox searchBox = default!;
protected override async Task OnInitAsync()
{
await keyboard.Add(ButilKeyCodes.KeyF, () => _ = searchBox.FocusInput(), ButilModifiers.Ctrl);
}
}";
}
Loading

0 comments on commit 9603c2c

Please sign in to comment.