diff options
author | 0neGal <mail@0negal.com> | 2022-05-17 01:11:25 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-05-17 01:11:25 +0200 |
commit | bb5446be8164176219784290f18751c6f35c4047 (patch) | |
tree | b47851a63ac338cb5f09170e8d74cc62899566b4 /src/app/browser.js | |
parent | 17a0a0e752ef515e4ea1e735e52efdb81d63f7dd (diff) | |
download | Viper-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.js | 7 |
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> |