From 2db0d6294c11bf50c9ee45daf6ce2af8eae694f8 Mon Sep 17 00:00:00 2001 From: pypy Date: Sat, 21 Mar 2020 15:30:13 +0900 Subject: [PATCH] open external link --- VRCX.cs | 7 +++++-- html/app.js | 15 ++++++++++++++- html/index.html | 6 +++--- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/VRCX.cs b/VRCX.cs index ae4f4299..d4e60741 100644 --- a/VRCX.cs +++ b/VRCX.cs @@ -78,9 +78,12 @@ namespace VRCX } } - public void OpenRepository() + public void OpenLink(string url) { - Process.Start("https://github.com/pypy-vrc/VRCX").Close(); + if (url.StartsWith("http://") || url.StartsWith("https://")) + { + Process.Start(url).Close(); + } } public void ShowVRForm() diff --git a/html/app.js b/html/app.js index e5fce1a7..03073854 100644 --- a/html/app.js +++ b/html/app.js @@ -3179,6 +3179,19 @@ CefSharp.BindObjectAsync( } }; + $app.methods.openExternalLink = function (link) { + this.$confirm(`${link}`, 'Open External Link', { + confirmButtonText: 'Confirm', + cancelButtonText: 'Cancel', + type: 'info', + callback: (action) => { + if (action === 'confirm') { + VRCX.OpenLink(link); + } + } + }); + }; + $app.methods.languageClass = function (language) { var style = {}; var mapping = languageMappings[language]; @@ -3201,7 +3214,7 @@ CefSharp.BindObjectAsync( text: `Update available!!
${this.latestAppVersion}`, timeout: 60000, callbacks: { - onClick: () => VRCX.OpenRepository() + onClick: () => VRCX.OpenLink('https://github.com/pypy-vrc/VRCX/releases') } }).show(); this.notifyMenu('more'); diff --git a/html/index.html b/html/index.html index cf744e70..9fe18ec9 100644 --- a/html/index.html +++ b/html/index.html @@ -553,7 +553,7 @@ Click to refresh -
+
Repository URL https://github.com/pypy-vrc/VRCX @@ -609,7 +609,7 @@ - +
@@ -1034,7 +1034,7 @@ - + >