OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
Xpress_backup
/
js
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:19 AM
rwxrwxrwx
📄
app.js
3.33 KB
01/07/2025 10:57:31 AM
rw-r--r--
Editing: app.js
Close
// Initialize TinyMCE with additional plugins tinymce.init({ selector: '#textEditor', plugins: 'code preview image table lists link', toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | image table link | code preview', height: 400, setup: function (editor) { editor.on('change', function () { const content = editor.getContent(); document.getElementById('output').innerHTML = content; }); } }); // Toggle Editor const toggleEditorBtn = document.getElementById('toggleEditor'); const editorForm = document.getElementById('editorForm'); const cancelEditorBtn = document.getElementById('cancelEditor'); toggleEditorBtn.addEventListener('click', () => { if (editorForm.style.display === 'none') { editorForm.style.display = 'block'; toggleEditorBtn.innerHTML = 'Switch to Preview'; const currentContent = document.getElementById('output').innerHTML; tinymce.get('textEditor').setContent(currentContent); } else { editorForm.style.display = 'none'; toggleEditorBtn.innerHTML = 'Edit Source Code'; } }); cancelEditorBtn.addEventListener('click', () => { editorForm.style.display = 'none'; toggleEditorBtn.innerHTML = 'Edit Source Code'; }); // Save Content and Display in Preview function saveContent() { const content = tinymce.get('textEditor').getContent(); document.getElementById('output').innerHTML = content; // Save to backend fetch('save.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `content=${encodeURIComponent(content)}` }) .then(response => response.text()) .then(() => alert('Content saved successfully!')); } // function confirmSelection() { // const emailBody = document.getElementById('output').innerHTML; // if (!emailBody.trim()) { // alert('Email body cannot be empty!'); // return false; // } // document.getElementById('emailBody').value = emailBody; // document.getElementById('emailForm').submit(); // } // function confirmSelection() { // // Populate the emailBody hidden input from the preview content // var previewContent = document.getElementById('output').innerHTML; // document.getElementById('emailBody').value = previewContent; // // Get the form elements // var campaignName = document.getElementById('createCampaign').value; // var subject = document.getElementById('subject').value; // var emailBody = document.getElementById('emailBody').value; // // Check if any of the required fields are empty // if (campaignName === '' || subject === '' || emailBody.trim() === '') { // alert("Please fill in all required fields: Campaign Name, Subject, and Email Body."); // return false; // Prevent form submission // } // // Ask for confirmation before sending // var listDropdown = document.getElementById('list_id'); // var selectedListName = listDropdown.options[listDropdown.selectedIndex].text; // var confirmationMessage = "Are you sure you want to send an email to this list: " + selectedListName + "?"; // if (confirm(confirmationMessage)) { // document.getElementById('emailForm').submit(); // } // }