- Deleted the `app.js` file and migrated its functionality to a modular structure with multiple JavaScript files for better organization and maintainability. - Updated `index.html` to reference the new `main.js` module, ensuring proper loading of the application. - Introduced new utility modules for API requests, authentication, calendar handling, and DOM manipulation to enhance code clarity and separation of concerns. - Enhanced CSS styles for improved layout and theming consistency across the application. - Added comprehensive comments and documentation to new modules to facilitate future development and understanding.
15 lines
306 B
JavaScript
15 lines
306 B
JavaScript
/**
|
|
* Common utilities.
|
|
*/
|
|
|
|
/**
|
|
* Escape string for safe use in HTML (text content / attributes).
|
|
* @param {string} s - Raw string
|
|
* @returns {string} HTML-escaped string
|
|
*/
|
|
export function escapeHtml(s) {
|
|
const div = document.createElement("div");
|
|
div.textContent = s;
|
|
return div.innerHTML;
|
|
}
|