diff --git a/app/src/plugins/app/_theme/global.sass b/app/src/plugins/app/_theme/global.sass index 2382e8e..7ff4fb9 100644 --- a/app/src/plugins/app/_theme/global.sass +++ b/app/src/plugins/app/_theme/global.sass @@ -29,11 +29,6 @@ padding: 5px 20px min-width: 50px -.description-detail - background: rgba(0, 0, 0, 0.04) - color: rgba(0, 0, 0, 0.6) - height: fit-content - .employee-selected-avatar background: #6200EE color: #fff @@ -115,4 +110,41 @@ input[type="time"]::-webkit-calendar-picker-indicator @media (max-width: 534px) .mobile-view flex-direction: column - gap: 20px \ No newline at end of file + gap: 20px + +.description-detail + background: rgba(0, 0, 0, 0.04) + color: rgba(0, 0, 0, 0.6) + height: fit-content + + $indentSize: 15px + + li + margin-left: $indentSize + + &.ql-indent-1 + margin-left: 2 * $indentSize + + &.ql-indent-2 + margin-left: 3 * $indentSize + + &.ql-indent-3 + margin-left: 4 * $indentSize + + &.ql-indent-4 + margin-left: 5 * $indentSize + + &.ql-indent-5 + margin-left: 6 * $indentSize + + &.ql-indent-6 + margin-left: 7 * $indentSize + + &.ql-indent-7 + margin-left: 8 * $indentSize + + &.ql-indent-8 + margin-left: 9 * $indentSize + + &.ql-indent-9 + margin-left: 10 * $indentSize \ No newline at end of file diff --git a/app/src/plugins/tm@_utils/server-links.utils.ts b/app/src/plugins/tm@_utils/server-links.utils.ts index 22f972a..aca5125 100644 --- a/app/src/plugins/tm@_utils/server-links.utils.ts +++ b/app/src/plugins/tm@_utils/server-links.utils.ts @@ -27,45 +27,29 @@ export function prepareHTMLDescription(description) { const os = detectOS() - // make an array from the description of strings from between

and

tags - const paragraphs = description.split('

').map(p => p.split('

')[0]) + if (os === 'mac') { + description = description.replace(/\\\\/g, 'smb://') - const modifiedParagraphs = paragraphs.map(paragraph => { - const words = paragraph.split(' ') - - const modifiedWords = words.map(word => { - let link = null - - if (os === 'mac' && word.startsWith('smb://')) { - link = word - } else if (os === 'win' && word.startsWith('\\\\')) { - link = `${word.replace(/\//g, '\\')}` - } else if (os === 'mac' && word.startsWith('\\\\')) { - const smbLink = 'smb:' + word.replace(/\\/g, '/') - link = smbLink - } else if (os === 'win' && word.startsWith('smb://')) { - const windowsLink = word.replace(/^smb:/, '').replace(/\//g, '\\') - link = `${windowsLink}` - } - - if (!link) return word - - if (os === 'mac') return `${link}` - - return `${link}` + // find all smb links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters + description = description = description.replace(/(smb:\/\/[^\s<>"()]+)/g, function(match) { + return '' + match.replace(/\\/g, '/') + '' }) + } else { + description = description.replace(/smb:\/\//g, '\\\\') - return `

${modifiedWords.join(' ')}

` - }) - - description = modifiedParagraphs.join('') + + // find all windows links and replace them with clickable links, separated by ' ', '<', '>', '"', and '(', ')' characters + description = description.replace(/(\\\\[^\s<>"()]+)/g, function(match) { + match = match.replaceAll('/', '\\') + return '' + match + ''; + }); + } return description; } function getCopyFunction(text) { return ` - console.log('${text.replace(/\\/g, '\\\\')}') if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText('${text.replace(/\\/g, '\\\\')}').then(() => { window.toast.success('Link copied to clipboard!')