added email verification

This commit is contained in:
andrei-mihnea-cerbu
2025-02-04 19:08:34 +02:00
parent 9baec7a7cb
commit dcf505c89b
67 changed files with 3922 additions and 3638 deletions
+1 -10
View File
@@ -1,11 +1,9 @@
// Load announcement content from the application info when the page loads
async function loadAnnouncement() {
try {
const announcementText = await window.electronAPI.readApplicationInfo('announcement');
const announcementText = await window.electronAPI.readAnnouncement();
const announcementContent = document.getElementById('announcement-content');
if (announcementContent && announcementText) {
console.log('Announcement:', announcementText);
announcementContent.innerHTML = formatTextForHtml(announcementText);
}
} catch (error) {
@@ -15,14 +13,8 @@ async function loadAnnouncement() {
}
function formatTextForHtml(text) {
// Replace newlines with <br> tags
let formattedText = text.replace(/\n/g, '<br>');
// Replace tabs with a few non-breaking spaces for indentation
formattedText = formattedText.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
// Replace other special characters as needed
// Example: Handle double spaces by converting to &nbsp;
formattedText = formattedText.replace(/ /g, ' &nbsp;');
return formattedText;
@@ -30,6 +22,5 @@ function formatTextForHtml(text) {
// Close the window when the close button is clicked
function closeWindow() {
window.electronAPI.writeApplicationInfo('announcement', '');
window.electronAPI.closeAnnouncementWindow();
}