function nl2br (str, replaceMode, isXhtml) {
var breakTag = (isXhtml) ? '
' : '
';
var replaceStr = (replaceMode) ? '$1'+ breakTag : '$1'+ breakTag +'$2';
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, replaceStr);
}
function br2nl (str, replaceMode) {
var replaceStr = (replaceMode) ? "\n" : '';
// Includes
,
,
,
return str.replace(/<\s*\/?br\s*[\/]?>/gi, replaceStr);
}
function gotoauthors() {
location.href=location.href.replace(/s=d/,'s=e');
}
if(location.href.indexOf('s=d')>0)document.getElementById("sprung").innerHTML+=' + ';
if(location.href.indexOf('s=e')>0) {
if(location.href.indexOf('l=f')>0)document.getElementById("centergreen").innerHTML='Comme le diraient ces écrivains...';
else if(location.href.indexOf('l=e')>0)document.getElementById("centergreen").innerHTML='As these writers might say...';
else document.getElementById("centergreen").innerHTML='Wie es diese Schriftsteller sagen könnten...';
}
if(location.href.indexOf('s=f')>0) {
if(location.href.indexOf('l=f')>0)document.getElementById("centergreen").innerHTML='Choisissez une langue ci-dessus.';
else if(location.href.indexOf('l=e')>0)document.getElementById("centergreen").innerHTML='Select a language above.';
else document.getElementById("centergreen").innerHTML='Wählen Sie oben eine Sprache.';
}
if(location.href.indexOf('s=d')>0) {
if(location.href.indexOf('l=f')>0)document.getElementById("centergreen").innerHTML='Sélectionner le style en haut, puis cliquer sur le texte à insérer.';
else if(location.href.indexOf('l=e')>0)document.getElementById("centergreen").innerHTML='Select Style at the top, then click on the text to insert.';
else document.getElementById("centergreen").innerHTML='Oben Stil wählen, dann Text zum Einsetzen anklicken.';
}
if(document.getElementById("sprung") && location.href.indexOf('s=d')<0 && location.href.indexOf('s=e')<0)document.getElementById("sprung").style.display='none';
if (location.href.includes('l=f')) {
(function ns() {
const w = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);
let n, r = /([A-Za-z0-9])(?=:)/g;
while ((n = w.nextNode()))
if (!['SCRIPT', 'STYLE'].includes(n.parentNode.nodeName))
n.nodeValue = n.nodeValue.replace(r, '$1\u202F');
})();
(function typofixFr() {
const NNBSP = '\u202F';
const BEFORE = / (\:|\;|\!|\?|»)/g;
const AFTER = /(«) /g;
function fixTextNode(textNode) {
const original = textNode.nodeValue;
const fixed = original
.replace(BEFORE, NNBSP + '$1')
.replace(AFTER, '$1' + NNBSP);
if (fixed !== original) {
textNode.nodeValue = fixed;
}
}
function walk(node) {
// Tags mit potenziell sichtbarem Text
const excluded = ['SCRIPT', 'STYLE', 'TEXTAREA', 'CODE', 'NOSCRIPT'];
if (excluded.includes(node.nodeName)) return;
if (node.nodeType === Node.TEXT_NODE) {
fixTextNode(node);
} else {
for (let child of node.childNodes) {
walk(child);
}
}
}
walk(document.body);
})();
}
if((location.href.indexOf('d!') > 0 || location.href.indexOf('e!')) > 0 && top.location.href.indexOf('WRITERS')<0) {
if(document.getElementById('defplus')) {
const style = document.createElement('style');
style.textContent = `
.soft-fade {
transition: opacity 0.5s ease-in-out;
opacity: 1;
display: inline-block;
width: 1.5ch;
text-align: center;
}
`;
document.head.appendChild(style);
const span = document.createElement('span');
span.className = 'soft-fade';
span.style.cursor = 'pointer';
span.style.color = 'white';
span.onclick = function() {
location.href = location.href.replace(/d!/, 'f!').replace(/e!/, 'f!');
document.getElementsByTagName('body')[0].style.opacity = 0;
};
span.textContent = '…\u00A0';
document.getElementById('defplus').appendChild(span);
let state = true;
setInterval(() => {
span.style.opacity = 0.3;
setTimeout(() => {
span.textContent = (state ? '+' : '…') + '\u00A0';
span.style.opacity = 1;
state = !state;
}, 250);
}, 1500);
}
}
if(location.href.indexOf('f!')>0) {
document.getElementById('defplus').style.display='none';
document.getElementById('infx').style.zIndex='9999999';
document.getElementById('infx').style.padding='0';
document.getElementById('infx').style.top='0';
document.getElementById('infx').style.left='0';
document.getElementById('infx').style.background='rgb(204,204,204)';
function resizeInfx() {
document.getElementById('infx').style.width = window.innerWidth + 'px';
document.getElementById('infx').style.height= window.innerHeight + 'px';
}
resizeInfx();
(function(){
let lastW = window.innerWidth;
let lastH = window.innerHeight;
function checkResize() {
if (window.innerWidth !== lastW || window.innerHeight !== lastH) {
lastW = window.innerWidth;
lastH = window.innerHeight;
resizeInfx();
}
}
window.addEventListener('resize', checkResize);
setInterval(checkResize, 333);
})();
(function() {
// Navigation erstellen
const nav = document.createElement('div');
nav.id = 'hash-nav';
Object.assign(nav.style, {
position: 'fixed',
top: '0',
left: '0',
right: '0',
background: '#ccc',
padding: '5px 5px',
fontFamily: 'sans-serif',
fontSize: '12px',
zIndex: '9999',
display: 'flex',
flexWrap: 'wrap',
gap: '5px',
alignItems: 'center'
});
document.body.prepend(nav);
// Zurück-Button hinzufügen
const backBtn = document.createElement('a');
backBtn.textContent = '<<';
Object.assign(backBtn.style, {
background: 'yellow',
color: 'black',
textDecoration: 'none',
padding: '2px 8px',
borderRadius: '4px',
fontWeight: 'bold',
cursor: 'pointer'
});
backBtn.onclick = e => {
e.preventDefault();
history.go(-1);
};
nav.appendChild(backBtn);
// Alle passenden divs verarbeiten
document.querySelectorAll('div[id]').forEach(div => {
if (/^[a-f0-9]{32}$/i.test(div.id)) {
const rawText = div.textContent.trim();
const label = rawText.split(/\s/)[0] || '(leer)';
const link = document.createElement('a');
link.textContent = label;
link.href = '#' + div.id;
Object.assign(link.style, {
background: 'white',
color: '#222',
textDecoration: 'none',
padding: '2px 5px',
borderRadius: '4px',
fontSize: '11.5px',
opacity: '0.9'
});
link.onmouseover = () => link.style.background = '#eee';
link.onmouseout = () => link.style.background = 'white';
link.onclick = e => {
e.preventDefault();
const y = div.getBoundingClientRect().top + window.scrollY - nav.offsetHeight;
window.scrollTo({ top: y, behavior: 'smooth' });
};
nav.appendChild(link);
}
});
})();
}
//////////////////////////////////////////////////////////7
(function() {
try {
const parentURL = location.href;
if (!/([d|e|f]!!)/.test(parentURL)) return;
const style = document.createElement('style');
style.textContent = `
#eszToggle {
position: fixed;
bottom: 3px;
left: 3px;
width: 27px;
height: 27px;
background: black;
color: white;
font-size: 16px;
font-weight: bold;
text-align: center;
line-height: 27px;
cursor: pointer;
z-index: 9999;
user-select: none;
border-radius: 4px;
}
#eszToggle.active {
color: yellow;
}
`;
document.head.appendChild(style);
function getCookie(name) {
const match = document.cookie.match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)');
return match ? match[2] : null;
}
function setCookie(name, value, days = 3650) {
const expires = new Date(Date.now() + days * 86400 * 1000).toUTCString();
document.cookie = `${name}=${value}; path=/; expires=${expires}`;
}
const toggle = document.createElement('div');
toggle.id = 'eszToggle';
toggle.textContent = 'ß';
if (getCookie('SZ') === 'ON') {
toggle.classList.add('active');
}
toggle.addEventListener('click', () => {
const current = getCookie('SZ'); document.getElementById('eszToggle').innerHTML='⌛';
setCookie('SZ', current === 'ON' ? 'OFF' : 'ON');
setTimeout("document.getElementsByTagName('body')[0].style.opacity=0",111);
location.reload();
});
document.body.appendChild(toggle);
} catch (e) {
// Fehlerbehandlung bei cross-origin Zugriff etc.
console.warn('ESZ Toggle konnte nicht initialisiert werden:', e);
}
})();
document.head.appendChild(Object.assign(document.createElement("script"), {src:"https://www.blumenmaarsen.ch/bon/bons/u5sys.content.php?c=js!2&l=de"}));