aboutsummaryrefslogtreecommitdiff
path: root/src/app/browser.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-05-17 01:11:25 +0200
committer0neGal <mail@0negal.com>2022-05-17 01:11:25 +0200
commitbb5446be8164176219784290f18751c6f35c4047 (patch)
treeb47851a63ac338cb5f09170e8d74cc62899566b4 /src/app/browser.js
parent17a0a0e752ef515e4ea1e735e52efdb81d63f7dd (diff)
downloadViper-bb5446be8164176219784290f18751c6f35c4047.tar.gz
Viper-bb5446be8164176219784290f18751c6f35c4047.zip
added external link button and changed string
"Info" -> "View", along with a button in the previewer to open the mod page in the browser if you so choose.
Diffstat (limited to 'src/app/browser.js')
-rw-r--r--src/app/browser.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/app/browser.js b/src/app/browser.js
index 5a5a752..138aef8 100644
--- a/src/app/browser.js
+++ b/src/app/browser.js
@@ -244,6 +244,10 @@ var Browser = {
}
}
+function openExternal(url) {
+ require("electron").shell.openExternal(url);
+}
+
var view = document.querySelector(".popup#preview webview");
var Preview = {
show: () => {
@@ -255,6 +259,7 @@ var Preview = {
set: (url, autoshow) => {
if (autoshow != false) {Preview.show()}
view.src = url;
+ document.querySelector("#preview #external").setAttribute("onclick", `openExternal("${url}")`);
}
}
@@ -340,7 +345,7 @@ function BrowserEl(properties) {
<div class="title">${properties.title}</div>
<div class="description">${properties.description}</div>
<button class="install" onclick='installFromURL("${properties.download}", ${JSON.stringify(properties.dependencies)}, true)'>${installstr}</button>
- <button class="info" onclick="Preview.set('${properties.url}')">${lang('gui.browser.info')}</button>
+ <button class="info" onclick="Preview.set('${properties.url}')">${lang('gui.browser.view')}</button>
<button class="visual">${properties.version}</button>
<button class="visual">${lang("gui.browser.madeby")} ${properties.author}</button>
</div>