mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-14 12:01:52 +00:00
open note urls in new tab #4091
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
9ebd23a518
commit
fc83211e90
2 changed files with 26 additions and 0 deletions
|
@ -1708,6 +1708,19 @@
|
||||||
mainUpdate(512);
|
mainUpdate(512);
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
// open notes markdown links in new tab
|
||||||
|
if (DOMPurify) {
|
||||||
|
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
||||||
|
if ('target' in node) {
|
||||||
|
node.setAttribute('target', '_blank');
|
||||||
|
node.setAttribute('rel', 'noopener noreferrer');
|
||||||
|
}
|
||||||
|
if (!node.hasAttribute('target') && (node.hasAttribute('xlink:href') || node.hasAttribute('href'))) {
|
||||||
|
node.setAttribute('xlink:show', 'new');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Connect to the mesh server
|
// Connect to the mesh server
|
||||||
meshserver = MeshServerCreateControl(domainUrl);
|
meshserver = MeshServerCreateControl(domainUrl);
|
||||||
meshserver.onStateChanged = onStateChanged;
|
meshserver.onStateChanged = onStateChanged;
|
||||||
|
|
|
@ -2369,6 +2369,19 @@
|
||||||
mainUpdate(512);
|
mainUpdate(512);
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
||||||
|
// open notes markdown links in new tab
|
||||||
|
if (DOMPurify) {
|
||||||
|
DOMPurify.addHook('afterSanitizeAttributes', function (node) {
|
||||||
|
if ('target' in node) {
|
||||||
|
node.setAttribute('target', '_blank');
|
||||||
|
node.setAttribute('rel', 'noopener noreferrer');
|
||||||
|
}
|
||||||
|
if (!node.hasAttribute('target') && (node.hasAttribute('xlink:href') || node.hasAttribute('href'))) {
|
||||||
|
node.setAttribute('xlink:show', 'new');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Connect to the mesh server
|
// Connect to the mesh server
|
||||||
meshserver = MeshServerCreateControl(domainUrl);
|
meshserver = MeshServerCreateControl(domainUrl);
|
||||||
meshserver.onStateChanged = onStateChanged;
|
meshserver.onStateChanged = onStateChanged;
|
||||||
|
|
Loading…
Reference in a new issue