open external link

This commit is contained in:
pypy
2020-03-21 15:30:13 +09:00
parent d10a149de5
commit 2db0d6294c
3 changed files with 22 additions and 6 deletions

View File

@@ -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()

View File

@@ -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!!<br>${this.latestAppVersion}`,
timeout: 60000,
callbacks: {
onClick: () => VRCX.OpenRepository()
onClick: () => VRCX.OpenLink('https://github.com/pypy-vrc/VRCX/releases')
}
}).show();
this.notifyMenu('more');

View File

@@ -553,7 +553,7 @@
<span v-else class="extra">Click to refresh</span>
</div>
</div>
<div class="x-friend-item" @click="VRCX.OpenRepository()">
<div class="x-friend-item" @click="openExternalLink('https://github.com/pypy-vrc/VRCX')">
<div class="detail">
<span class="name">Repository URL</span>
<span class="extra">https://github.com/pypy-vrc/VRCX</span>
@@ -609,7 +609,7 @@
<template #content>
<span v-text="link"></span>
</template>
<img :src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px">
<img :src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px" @click.stop="openExternalLink(link)">
</el-tooltip>
</div>
</div>
@@ -1034,7 +1034,7 @@
<template #content>
<span v-text="link"></span>
</template>
<img :src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px">
<img :src="getFaviconUrl(link)" style="width:16px;height:16px;vertical-align:middle;margin-right:5px" @click.stop="openExternalLink(link)">>
</el-tooltip>
</div>
</div>