Erhverv

Vær den leder dine medarbejdere fortjener. Bliv den medarbejder du ønsker at være.

Vi har udvikling og trivsel i fokus, hvor vi giver sparring, skaber overblik og kommer med konstruktivt modspil til både lederen og teamet. 

Vi kommer ud og underviser i grupper eller arbejder individuelt med dig i fortrolige rammer.   

Supervision i Aarhus og København

Supervision kan øge trivsel og faglig udvikling. Book tid til supervision i Aarhus og København.

Læs mere

Kontakt

Du er velkommen til at booke en tid. Skulle du ikke finde en ledig tid der du ønsker det, tag kontakt med mig på mail eller telefon, så finder vi en tid som passer for dig.

Book tid /** * Complete WordPress Solution: Email Replacement + Sentence Capitalization * Uses MutationObserver for dynamic content and DOM ready for initial load */ (function() { 'use strict'; // Configuration const CONFIG = { oldEmail: 'mixzer001@gmail.com', newEmail: 'info@bemerk.nu', contentSelectors: [ '.entry-content', '.post-content', 'article', 'main', '.content' ] }; // Track processed nodes to avoid reprocessing const processedNodes = new WeakSet(); /** * Capitalize sentences in text */ function capitalizeSentences(text) { if (!text || typeof text !== 'string') return text; // Capitalize first character text = text.charAt(0).toUpperCase() + text.slice(1); // Capitalize after punctuation (. ! ?) followed by space text = text.replace(/([.!?])\s+([a-zæøå])/gu, (match, punct, letter) => punct + ' ' + letter.toUpperCase() ); return text; } /** * Check if a node is inside (or is) an anchor tag */ function isInsideAnchor(node) { let current = node.nodeType === Node.TEXT_NODE ? node.parentNode : node; while (current) { if (current.tagName === 'A') return true; current = current.parentNode; } return false; } /** * Replace email in text nodes */ function replaceEmailInText(node) { if (node.nodeType === Node.TEXT_NODE) { if (node.textContent.includes(CONFIG.oldEmail)) { node.textContent = node.textContent.replace( new RegExp(CONFIG.oldEmail, 'gi'), CONFIG.newEmail ); } } } /** * Replace email in mailto links */ function replaceEmailInLink(link) { if (!link || link.tagName !== 'A') return; // Replace in href attribute if (link.href && link.href.includes(CONFIG.oldEmail)) { link.href = link.href.replace( new RegExp(CONFIG.oldEmail, 'gi'), CONFIG.newEmail ); } // Replace in text content if (link.textContent.includes(CONFIG.oldEmail)) { link.textContent = link.textContent.replace( new RegExp(CONFIG.oldEmail, 'gi'), CONFIG.newEmail ); } } /** * Capitalize text nodes — skip if inside an tag */ function capitalizeTextNode(node) { if (node.nodeType === Node.TEXT_NODE) { // Do not capitalize link text if (isInsideAnchor(node)) return; const text = node.textContent.trim(); if (text.length > 0) { node.textContent = capitalizeSentences(node.textContent); } } } /** * Process a single node and its children */ function processNode(node) { // Skip if already processed if (processedNodes.has(node)) return; // Skip script and style elements if (node.nodeType === Node.ELEMENT_NODE) { const tagName = node.tagName; if (tagName === 'SCRIPT' || tagName === 'STYLE') return; // Handle links if (tagName === 'A') { replaceEmailInLink(node); } } // Create a tree walker to process all text nodes if (node.nodeType === Node.ELEMENT_NODE) { const walker = document.createTreeWalker( node, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT, { acceptNode: function(n) { // Skip script and style elements if (n.nodeType === Node.ELEMENT_NODE) { const tag = n.tagName; if (tag === 'SCRIPT' || tag === 'STYLE') { return NodeFilter.FILTER_REJECT; } } return NodeFilter.FILTER_ACCEPT; } } ); let currentNode; while (currentNode = walker.nextNode()) { if (currentNode.nodeType === Node.TEXT_NODE) { replaceEmailInText(currentNode); capitalizeTextNode(currentNode); } else if (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.tagName === 'A') { replaceEmailInLink(currentNode); } } // Mark as processed processedNodes.add(node); } else if (node.nodeType === Node.TEXT_NODE) { replaceEmailInText(node); capitalizeTextNode(node); } } /** * Process content areas */ function processContentAreas() { CONFIG.contentSelectors.forEach(function(selector) { const elements = document.querySelectorAll(selector); elements.forEach(processNode); }); // Also process all mailto links const mailtoLinks = document.querySelectorAll('a[href*="mailto"]'); mailtoLinks.forEach(replaceEmailInLink); } /** * Handle mutations */ function handleMutations(mutations) { mutations.forEach(function(mutation) { // Process added nodes if (mutation.addedNodes.length > 0) { mutation.addedNodes.forEach(function(node) { // Only process element nodes if (node.nodeType === Node.ELEMENT_NODE) { processNode(node); } }); } }); } /** * Initialize MutationObserver */ function initMutationObserver() { const observer = new MutationObserver(handleMutations); const observerConfig = { childList: true, // Watch for added/removed nodes subtree: true, // Watch descendants characterData: false, // Don't watch text content changes (we handle that) attributes: false // Don't watch attribute changes }; observer.observe(document.body, observerConfig); return observer; } /** * Initialize on DOM ready */ function init() { processContentAreas(); initMutationObserver(); } /** * DOM Ready handler */ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); } })();