Skip to content

Commit

Permalink
Coloron Preparation 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor committed Feb 3, 2023
1 parent 3e9e472 commit 4b1b609
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
19 changes: 19 additions & 0 deletions src/GamePortal/Helper/HelperBrowser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.JSInterop;

namespace GamePortal.Helper
{
public class HelperBrowser
{
[JSInvokable("BrowserOpen")]
//[JSInvokableAttribute("BrowserOpen")]
public static async void BrowserOpen(string Uri)
{
try
{
Uri uri = new(Uri);
await Browser.Default.OpenAsync(uri, BrowserLaunchMode.External);
}
catch { }
}
}
}
16 changes: 1 addition & 15 deletions src/GamePortal/Shared/Partial/Game/Coloron/GameColoronStop.razor
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,4 @@
<a class="main-menu" onclick="game.intro()">@Localizer["Menu"]</a>
</div>
</div>
</div>

@code {
[JSInvokable("OpenBrowser")]
//[JSInvokableAttribute("OpenBrowser")]
public static async void OpenBrowser(string Uri)
{
try
{
Uri uri = new Uri(Uri);
await Browser.Default.OpenAsync(uri, BrowserLaunchMode.External);
}
catch {}
}
}
</div>
2 changes: 1 addition & 1 deletion src/GamePortal/wwwroot/js/game/coloron/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Game {
let left = $(window).width() / 2 - 300;
let uri = new URL("https://twitter.com/intent/tweet?url=https://github.com/Soferity/GamePortal&text=" + String.format(this.tweettext, this.score) + "&hashtags=soferity,gameportal,coloron&via=ReaLTaiizor")
/*window.open(uri, "TweetWindow", "width=600px,height=300px,top=" + top + ",left=" + left);*/
Taiizor.Invoke.MethodAsync("GamePortal", "OpenBrowser", uri);
Taiizor.Invoke.MethodAsync("GamePortal", "BrowserOpen", uri);
}
catch (err) { }
}
Expand Down

0 comments on commit 4b1b609

Please sign in to comment.