Skip to content

Commit 5accf51

Browse files
committed
Suppress open in new tab warning when opening filebrowser from Medley online
1 parent f3317b8 commit 5accf51

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

docker_medley/scripts/request_new_tab.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# 2022-10-11 Frank Halasz
1414
#
1515
#
16-
URL=5d4f26d9d86696b6$1
16+
if [ $(echo $1 | grep -q "online.interlisp.org:3" | echo $?) -eq 0 ]; then nowarn=1; else nowarn=0; fi
17+
URL="5d4f26d9d86696b${nowarn}$1"
1718
OLD_NAME=$(/usr/bin/vncconfig -display ${DISPLAY} -get desktop)
1819
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${URL}"
1920
/usr/bin/vncconfig -display ${DISPLAY} -set desktop="${OLD_NAME}"

web-portal/client/novnc_oio/ui.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ const UI = {
10601060
UI.rfb.addEventListener("capabilities", UI.updatePowerButton);
10611061
UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
10621062
UI.rfb.addEventListener("bell", UI.bell);
1063-
UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
1063+
UI.rfb.addEventListener("desktopname", updateUI.updateDesktopName);
10641064
UI.rfb.clipViewport = UI.getSetting('view_clip');
10651065
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
10661066
UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
@@ -1355,17 +1355,18 @@ const UI = {
13551355
// Interlisp Online
13561356
//
13571357

1358-
async openCLHSTab(url) {
1359-
let noWarn = false;
1358+
async openCLHSTab(url, noWarn) {
13601359
let guest = false;
1361-
let response = await window.fetch('/user/clhstabnotice');
1362-
if(response.ok) {
1363-
let txt = await response.text();
1364-
noWarn = (txt == "true");
1365-
guest = (txt == "guest");
1360+
if (!noWarn) {
1361+
let response = await window.fetch('/user/clhstabnotice');
1362+
if(response.ok) {
1363+
let txt = await response.text();
1364+
noWarn = (txt == "true");
1365+
guest = (txt == "guest");
1366+
}
13661367
}
13671368
if(noWarn)
1368-
UI.openCLHSTabFinish(url);
1369+
UI.openCLHSTabFinish(url);
13691370
else {
13701371
const dlg = document.getElementById('OIO_CLHS_tab_notice_dlg');
13711372
if(guest) document.getElementById('OIO_CLHS_do_not_checkbox_div').hidden = true;
@@ -1815,11 +1816,13 @@ const UI = {
18151816
},
18161817

18171818
// Interlisp Online
1819+
// Used as a way to open a new tab to show a url
1820+
// url is encoded in new desktop name
18181821
updateDesktopName(e) {
18191822
let payload = e.detail.name;
1820-
if (payload.match(/^5d4f26d9d86696b6/)) {
1823+
if (payload.match(/^5d4f26d9d86696b/)) {
18211824
let url=payload.slice(16);
1822-
UI.openCLHSTab(url);
1825+
UI.openCLHSTab(url, payload.match(/^5d4f26d9d86696b1/);
18231826
} else {
18241827
UI.desktopName = payload;
18251828
// Display the desktop name in the document title

0 commit comments

Comments
 (0)