Add ticket redaction feature

This commit is contained in:
wrongecho
2025-03-18 09:40:39 +00:00
parent ad9e4b4fb4
commit 6a8d2cf1d4
6 changed files with 560 additions and 251 deletions

15
js/ticket_redact.js Normal file
View File

@@ -0,0 +1,15 @@
// Redact the selected text in TinyMCE
function redactSelectedText() {
const editor = tinymce.get('tinymceTicketRedact'); // Get TinyMCE editor instance
const selectedText = editor.selection.getContent(); // Get selected content
if (selectedText) {
// Wrap the selected text with a redacted span
const redactedNode = `<strong><span style="color: #e03e2d;">[REDACTED]</span></strong>`;
// Replace the selected text with the redacted span
editor.selection.setContent(redactedNode);
} else {
alert('Please select some text to redact.');
}
}