Link the online user manual from the Quick Start footer
This commit is contained in:
1 parent
ce386b1158
commit
c6fc699fe0
3 files changed
+15
-1
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// Copyright (C) 2026 Zaher Salman
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { app, BrowserWindow, Menu, dialog, ipcMain, screen } = require('electron');
|
||||
const { app, BrowserWindow, Menu, dialog, ipcMain, screen, shell } = require('electron');
|
||||
const path = require('path');
|
||||
const childProcess = require('child_process');
|
||||
|
||||
@@ -57,6 +57,16 @@ function createAuxiliaryWindow(options = {}) {
|
||||
}
|
||||
});
|
||||
|
||||
// Auxiliary windows have no in-app navigation of their own. Send external
|
||||
// links (the Quick Start references the online docs) to the system browser
|
||||
// instead of spawning a new Electron window that would leave a dead frame.
|
||||
auxiliaryWindow.webContents.setWindowOpenHandler(function (details) {
|
||||
if (/^https?:\/\//i.test(details.url)) {
|
||||
shell.openExternal(details.url);
|
||||
}
|
||||
return { action: "deny" };
|
||||
});
|
||||
|
||||
if (options.dataChannel) {
|
||||
auxiliaryWindow.webContents.once("did-finish-load", () => {
|
||||
auxiliaryWindow.webContents.send(options.dataChannel, options.data || {});
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
<footer class="quick-start-footer" id="quickStartFooter">
|
||||
<span>Questions? Contact <a href="mailto:zaher.salman@psi.ch">Zaher Salman</a>.</span>
|
||||
<span>Full user manual: <a href="https://musruser.psi.ch/muSRFlow/docs/" target="_blank" rel="noopener">muSRFlow docs</a>.</span>
|
||||
</footer>
|
||||
<script>
|
||||
(function() {
|
||||
|
||||
@@ -32,6 +32,9 @@ function testSharedHelpWindowInfrastructure() {
|
||||
assert.match(help, /quickStartSection/);
|
||||
assert.match(help, /class="quick-start-footer"/);
|
||||
assert.match(help, /zaher\.salman@psi\.ch/);
|
||||
assert.match(help, /https:\/\/musruser\.psi\.ch\/muSRFlow\/docs\//);
|
||||
assert.match(main, /shell\.openExternal/);
|
||||
assert.match(main, /setWindowOpenHandler/);
|
||||
assert.match(deploy, /quick-start\.html/);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user