OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
breader
/
inc
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
11/07/2024 07:55:42 AM
rwxr-xr-x
📁
PHPMailer
-
07/27/2024 04:06:35 PM
rwxr-xr-x
📄
bcommon.js
40.38 KB
08/08/2023 10:27:10 AM
rw-r--r--
📄
bconfig.php
10.12 KB
07/05/2024 11:14:48 AM
rw-r--r--
📄
common.js
41.63 KB
08/02/2024 12:02:39 PM
rw-r--r--
📄
config.php
18.75 KB
07/26/2024 06:00:21 AM
rw-r--r--
📁
fontawesome
-
07/27/2024 04:02:26 PM
rwxr-xr-x
📄
function.php
2.8 KB
08/07/2024 10:37:23 AM
rw-r--r--
📄
genai_func.js
13.09 KB
07/15/2024 07:24:32 AM
rw-r--r--
📄
genai_style.css
3.13 KB
07/01/2024 07:28:21 AM
rw-r--r--
📄
grayscale.min.css
4.55 KB
08/16/2020 03:58:30 PM
rw-r--r--
📄
handler.php
5.02 KB
08/02/2024 11:49:22 AM
rw-r--r--
📄
hhandler.php
4.51 KB
08/02/2024 11:49:14 AM
rw-r--r--
📄
jquery.magnific-popup.min.js
19.74 KB
06/05/2017 08:11:48 AM
rw-r--r--
📄
magnific-popup.css
6.79 KB
06/05/2017 08:11:48 AM
rw-r--r--
📄
old_genai_func.js
10.34 KB
06/27/2024 11:56:41 AM
rw-r--r--
📄
old_genai_style.css
2.21 KB
06/27/2024 11:56:41 AM
rw-r--r--
📄
oldcommon.js
45.07 KB
07/02/2024 11:04:36 AM
rw-r--r--
📄
repconfig.php
16.79 KB
07/22/2024 10:59:00 AM
rw-r--r--
📁
simplepie
-
07/27/2024 04:02:32 PM
rwxrwxrwx
📄
style.css
7.75 KB
05/19/2024 04:39:49 PM
rw-r--r--
📄
validate.logged.php
433 bytes
06/06/2021 07:12:13 AM
rw-r--r--
📄
zconfig.php
9.7 KB
04/04/2024 02:35:08 PM
rw-r--r--
📄
zzconfig.php
10.02 KB
07/04/2024 12:55:22 PM
rw-r--r--
Editing: old_genai_func.js
Close
// Function to remove <br> with new line function replaceBrWithNewline(input) { // Replace <br> tags with newline characters (\n) var replacedString = input.replace(/<br\s*\/?>/ig, '\n'); return replacedString; } // Function to copy the content function copyText() { // Get the text from the div with class 'generated-text' var text = $('.generated-text').text().trim(); // Create a temporary textarea element using jQuery var $textarea = $('<textarea>'); $textarea.val(text); $('body').append($textarea); // Select the text in the textarea $textarea.select(); try { // Copy the text var successful = document.execCommand('copy'); if (successful) { alert('Text copied to clipboard'); } else { alert('Failed to copy text'); } } catch (err) { alert('Oops, unable to copy'); } // Remove the temporary textarea $textarea.remove(); } // Function to save the content in the database function genai_save(generatedText, workingHeadline) { $.ajax({ type: 'POST', url: '/genai/genai_save.php', data: { generated_content: generatedText, working_headline: workingHeadline }, success: function (response) { alert(response); }, error: function (xhr, status, error) { // Handle error console.error('Error saving data:', error); // Optionally, you can show an error message to the user } }); } // Function to share the data on whatsapp function share_whatsapp() { var base_url = "https://web.whatsapp.com/send?text="; // Base URL for WhatsApp web // Example values (replace with actual session values) var headline = $('#working_headline').val().trim(); var content = $('.generated-text').html().trim(); content = content.replace(/<br\s*\/?>/gi, '\n'); // Encode headline and content var encoded_headline = encodeURIComponent(headline); var encoded_content = encodeURIComponent(content); // Construct the WhatsApp share URL var share_url = base_url + encoded_headline + encodeURIComponent("\n\n") + encoded_content; share_url = share_url + "Powered by Knobly Cream"; // Log the generated WhatsApp share link to console (optional) console.log(share_url); // Attempt to open the WhatsApp share link in a new tab or window var newWindow = window.open(share_url, "_blank"); if (!newWindow || newWindow.closed || typeof newWindow.closed == 'undefined') { // Popup blocked or not opened (optional handling) console.error("Popup blocked or not opened"); } } // Function to generate the content in OpenAI // function genai_generate() { // var headline = $('#working_headline').val(); // Get the value of the textarea // console.log(avatar); // Optional: Log the avatar value // console.log(headline); // Optional: Log the headline value // // AJAX call using jQuery // $.ajax({ // url: '/genai/process_genai.php', // PHP file to handle the request // type: 'POST', // Method type // data: { // avatar: avatar, // working_headline: headline // }, // Data to send // success: function (response) { // console.log(response); // // On success, update the content of the div // try { // var decodedData = decodeURIComponent(response); // } // catch { // decodedData = response; // } // decodedData = convert_text(decodedData); // $(".generated-content").show(); // $('.generated-text').append(decodedData).html(); // $('.generated-text').append("<br><br>"); // // $('.loadingIndicator').hide(); // }, // error: function () { // // On error, show an alert or handle the error gracefully // alert('Error: Unable to fetch data.'); // } // }); // } function genai_generate(avatar, headline){ // AJAX call using jQuery $.ajax({ url: '/genai/process_genai.php', // PHP file to handle the request type: 'POST', // Method type data: { avatar: avatar, // Assuming avatar is defined elsewhere working_headline: headline }, // Data to send beforeSend: function() { // This function executes before the AJAX request is sent console.log('AJAX request sending...'); }, success: function(response) { console.log('AJAX request successful'); console.log(response); // On success, update the content of the div try { var decodedData = decodeURIComponent(response); } catch { decodedData = response; } decodedData = convert_text(decodedData); $(".generated-content").show(); $('.generated-text').append(decodedData).html(); $('.generated-text').append("<br><br>"); // Hide loading indicator after successful response $('.loadingIndicator').hide(); }, error: function() { console.error('AJAX request failed'); // On error, show an alert or handle the error gracefully alert('Error: Unable to fetch data.'); // Hide loading indicator on error $('.loadingIndicator').hide(); } }); } // Function to set active button function setActiveButton(buttonId) { // Remove 'active' class from all buttons $('.reportButton').removeClass('active-tab'); // Add 'active' class to the clicked button $('#' + buttonId).addClass('active-tab'); } // Function to replace all the markdown syntax function convert_text(data) { data = replaceHeaders(data); data = replaceCodeBlock(data); data = replaceInlineCode(data); data = replaceEmphasis(data); data = replaceStrike(data); data = replaceHorizontalRule(data); data = replaceTasksAndEscapes(data); data = replaceLists(data); data = replaceImages(data); data = replaceLinks(data); data = replaceBlockquotes(data); data = replaceTables(data); data = replaceSuperscriptAndSubscript(data); return data; } function replaceHeaders(text) { text = text.replace(/#{7,} (.*?)(\r?\n|$)/g, '<h6>$1</h6>'); text = text.replace(/###### (.*?)(\r?\n|$)/g, '<h6>$1</h6>'); text = text.replace(/##### (.*?)(\r?\n|$)/g, '<h6>$1</h6>'); text = text.replace(/#### (.*?)(\r?\n|$)/g, '<h5>$1</h5>'); text = text.replace(/### (.*?)(\r?\n|$)/g, '<h4>$1</h4>'); text = text.replace(/## (.*?)(\r?\n|$)/g, '<h3>$1</h3>'); text = text.replace(/# (.*?)(\r?\n|$)/g, '<h2>$1</h2>'); return text; } function replaceEmphasis(text) { text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>'); text = text.replace(/\*(.*?)\*/g, '<em>$1</em>'); return text; } function replaceLists(text) { // Replace Markdown unordered list with HTML <ul> tags text = text.replace(/^\s*-\s*(.*)$/gm, '<ul><li>$1</li></ul>'); // // Replace Markdown ordered list with HTML <ol> tags // text = text.replace(/^\s*\d+\.\s*(.*)$/gm, '<ol><li>$1</li></ol>'); // Replace Markdown ordered list with HTML <ol> tags text = text.replace(/^\s*\d+\.\s*(.*)$/gm, '<ul><li>$1</li></ul>'); return text; } function replaceInlineCode(text) { return text.replace(/`(.*?)`/g, '<code>$1</code>'); } function replaceStrike(text) { return text.replace(/~~(.*?)~~/g, '<del>$1</del>'); } function replaceCodeBlock(text) { return text.replace(/```([\s\S]*?)```/g, '<pre><code>$1</code></pre>'); } function replaceLinks(text) { var pattern = /\[([^\]]+)\]\(([^)]+)\)/g; var replacement = '<a href="$2">$1</a>'; return text.replace(pattern, replacement); } function replaceImages(text) { var pattern = /!\[([^\]]+)\]\(([^)]+)\)/g; var replacement = '<img src="$2" alt="$1">'; return text.replace(pattern, replacement); } function replaceBlockquotes(text) { var pattern = /^> (.+)$/gm; var replacement = '<blockquote>$1</blockquote>'; return text.replace(pattern, replacement); } function replaceHorizontalRule(text) { var pattern = /^\s*---+\s*$/gm; var replacement = '<hr>'; return text.replace(pattern, replacement); } function replaceTables(text) { var pattern = /^\|(.+)\|$/gm; // Check if the text begins and ends with a table row if (pattern.test(text)) { // Replace Markdown tables with HTML <table> tags text = text.replace(pattern, function (match) { var cells = match.split('|').map(function (cell) { return '<td>' + cell.trim() + '</td>'; }).join(''); return '<tr>' + cells + '</tr>'; }); // Wrap the whole table with <table> tags text = '<table>' + text + '</table>'; } return text; } function replaceTasksAndEscapes(text) { // Parse task lists text = text.replace(/^- \[(x|X| )\]/gm, '<input type="checkbox" disabled checked>'); text = text.replace(/^- \[ \]/gm, '<input type="checkbox" disabled>'); // Parse backslash escapes text = text.replace(/\\/g, ''); return text; } function replaceSuperscriptAndSubscript(text) { // Parse superscript (^) and subscript (~) syntax text = text.replace(/\^([^\s]+)\^/g, '<sup>$1</sup>'); text = text.replace(/~([^\s]+)~/g, '<sub>$1</sub>'); return text; } // Capitalise the title and headline function capitalizeWords(input) { // Split the input string into words var words = input.split(' '); // Capitalize the first letter of each word except short words (length == 2 or length == 3) for (var i = 0; i < words.length; i++) { var word = words[i]; // Check if the length of the word is not 2 and not 3 if (word.length != 2 && word.length != 3) { words[i] = word.charAt(0).toUpperCase() + word.slice(1); // Capitalize the word } } // Join the words back into a string and return return words.join(' '); }