mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-05 09:21:30 +02:00
Add VTX hyperlink support for URLs
This commit is contained in:
parent
7837a2a7bd
commit
b0260049ba
5 changed files with 26 additions and 5 deletions
|
@ -56,7 +56,7 @@ exports.getSyncTERMFontFromAlias = getSyncTERMFontFromAlias;
|
|||
exports.setSyncTermFontWithAlias = setSyncTermFontWithAlias;
|
||||
exports.setCursorStyle = setCursorStyle;
|
||||
exports.setEmulatedBaudRate = setEmulatedBaudRate;
|
||||
|
||||
exports.getVtxHyperlink = getVtxHyperlink;
|
||||
|
||||
//
|
||||
// See also
|
||||
|
@ -485,3 +485,14 @@ function setEmulatedBaudRate(rate) {
|
|||
}[rate] || 0;
|
||||
return 0 === speed ? exports.emulationSpeed() : exports.emulationSpeed(1, speed);
|
||||
}
|
||||
|
||||
function getVtxHyperlink(client, url, text) {
|
||||
if(!client.terminalSupports('vtx_hyperlink')) {
|
||||
return '';
|
||||
}
|
||||
|
||||
text = text || url;
|
||||
|
||||
url = url.split('').map(c => c.charCodeAt(0)).join(';');
|
||||
return `${ESC_CSI}1;${text.length};1;1;${url}\\`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue