Fix shared link URL and notification placement
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ title: "TRIMSP-NL Workbench"
|
||||
type: software
|
||||
version: 1.5.0
|
||||
date-released: 2026-08-28
|
||||
url: "http://musruser.psi.ch/TrimSP-NL/"
|
||||
url: "http://musruser.psi.ch/TRIMSP-NL/"
|
||||
repository-code: "https://gitea.psi.ch/LMU/TRIMSP"
|
||||
license: GPL-3.0-or-later
|
||||
authors:
|
||||
|
||||
@@ -53,7 +53,7 @@ Repository metadata is also provided in [CITATION.cff](CITATION.cff).
|
||||
### Supported platforms ###
|
||||
|
||||
* [Linux]
|
||||
* Online at: http://musruser.psi.ch/TrimSP-NL/
|
||||
* Online at: http://musruser.psi.ch/TRIMSP-NL/
|
||||
* Source repository: https://gitea.psi.ch/LMU/TRIMSP
|
||||
|
||||
### Installation ###
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ window.openElectronAuxiliaryWindow = openElectronAuxiliaryWindow;
|
||||
|
||||
// Electron links always point to the public web application rather than a
|
||||
// machine-local file:// URL, so they can be sent directly to another user.
|
||||
var TRIMSP_CANONICAL_SHARE_URL = 'http://musruser.psi.ch/TrimSP-NL/';
|
||||
var TRIMSP_CANONICAL_SHARE_URL = 'http://musruser.psi.ch/TRIMSP-NL/';
|
||||
|
||||
function encodeElectronSharedConfiguration(config) {
|
||||
let json = JSON.stringify(config);
|
||||
|
||||
+16
-2
@@ -3128,8 +3128,22 @@ function showTransientWarning(message, targetElement, duration = 4000) {
|
||||
warning.textContent = message;
|
||||
if (targetElement) {
|
||||
const rect = targetElement.getBoundingClientRect();
|
||||
warning.style.left = `${Math.max(12, rect.left + window.scrollX)}px`;
|
||||
warning.style.top = `${rect.bottom + window.scrollY + 8}px`;
|
||||
const viewportMargin = 12;
|
||||
const targetGap = 8;
|
||||
const maximumLeft = Math.max(viewportMargin,
|
||||
window.innerWidth - warning.offsetWidth - viewportMargin);
|
||||
const left = Math.min(Math.max(viewportMargin, rect.left), maximumLeft);
|
||||
let top = rect.bottom + targetGap;
|
||||
|
||||
// Keep notifications inside the viewport, including for controls near its
|
||||
// right and bottom edges. Fixed-position elements use viewport coordinates.
|
||||
if (top + warning.offsetHeight > window.innerHeight - viewportMargin) {
|
||||
top = rect.top - warning.offsetHeight - targetGap;
|
||||
}
|
||||
top = Math.max(viewportMargin,
|
||||
Math.min(top, window.innerHeight - warning.offsetHeight - viewportMargin));
|
||||
warning.style.left = `${left}px`;
|
||||
warning.style.top = `${top}px`;
|
||||
}
|
||||
warning.classList.add('visible');
|
||||
|
||||
|
||||
@@ -580,7 +580,8 @@ input[type="button"]:hover {
|
||||
box-shadow: 0 7px 20px rgba(29, 43, 50, 0.17);
|
||||
color: #523c08;
|
||||
line-height: 1.35;
|
||||
max-width: 380px;
|
||||
box-sizing: border-box;
|
||||
max-width: min(380px, calc(100vw - 24px));
|
||||
opacity: 0;
|
||||
padding: 9px 12px;
|
||||
pointer-events: none;
|
||||
|
||||
@@ -156,7 +156,7 @@ function showAboutDialog(parentWindow) {
|
||||
'',
|
||||
'Project repository:',
|
||||
'Gitea: gitea.psi.ch/LMU/TRIMSP',
|
||||
'Web application: musruser.psi.ch/TrimSP-NL/'
|
||||
'Web application: musruser.psi.ch/TRIMSP-NL/'
|
||||
].join('\n');
|
||||
|
||||
dialog.showMessageBox(parentWindow, {
|
||||
@@ -507,7 +507,7 @@ ipcMain.on('openQuickStartWindow', (event, options) => {
|
||||
|
||||
ipcMain.handle('copyConfigurationLink', async (event, url) => {
|
||||
if (typeof url !== 'string' || url.length > 500000
|
||||
|| !url.startsWith('http://musruser.psi.ch/TrimSP-NL/')) {
|
||||
|| !url.startsWith('http://musruser.psi.ch/TRIMSP-NL/')) {
|
||||
throw new Error('Invalid configuration link');
|
||||
}
|
||||
clipboard.writeText(url);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
"plotly.js-dist": "^1.58.4"
|
||||
},
|
||||
"config": {},
|
||||
"homepage": "http://musruser.psi.ch/TrimSP-NL/",
|
||||
"homepage": "http://musruser.psi.ch/TRIMSP-NL/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://gitea.psi.ch/LMU/TRIMSP.git"
|
||||
|
||||
Reference in New Issue
Block a user