Remove legacy redact function in favor of tinymce integration redact

This commit is contained in:
johnnyq
2025-03-24 13:22:41 -04:00
parent 85ae42190a
commit 4c85db5e49
6 changed files with 0 additions and 310 deletions

View File

@@ -320,23 +320,6 @@ $(document).ready(function() {
}
});
// Initialize TinyMCE editor with only a redact button
tinymce.init({
selector: '.tinymceTicketRedact',
browser_spellcheck: false,
contextmenu: false,
resize: true,
min_height: 300,
max_height: 500,
promotion: false,
branding: false,
menubar: false,
statusbar: false,
license_key: 'gpl',
readonly: true,
toolbar: '',
});
tinymce.init({
selector: '.tinymceRedact', // Your selector
browser_spellcheck: true,

View File

@@ -1,15 +0,0 @@
// 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.');
}
}