Files
radixOS/public/views/integrated/help.hbs
2026-04-22 11:55:23 +02:00

106 lines
3.1 KiB
Handlebars

<html lang="de">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hilfe</title>
<style>
ul#help li a,
ul#help li a:visited {
text-decoration: none;
color: var(--theme-container-card-color);
}
ul#help {
display:flex;
width: 100%;
padding: 0;
margin: 0;
left: 0;
position: relative;
overflow: auto;
flex-wrap: nowrap;
scrollbar-width: thin;
}
ul#help li {
display: inline-block;
width: auto;
padding: 10px;
box-sizing: border-box;
text-align: center;
}
</style>
</head>
<body>
<div class="container static" style="height: 100vh;">
<div id="helpTabs" class="tabs" style="overflow-y: auto;scrollbar-width: thin; padding:0;flex: 0 0 auto;"></div>
<div class="card static" style="overflow-y:auto;flex: 1 1 auto;" >
<div id="tabWrapper" class="tab-contents" ></div>
</div>
<div id="helpFooter" class="card static" style="height:auto;bottom:0;text-align:left;flex:0 0 auto;flex-direction:row;justify-content:space-between;gap:4px">
<div class="selectable">
<div style="color:var(--theme-accent-default-backcolor);font-weight:bold;">
<span>&copy; Radix OS</span> <span id="year"></span>
<span>Manuel Sowada</span>
</div>
</div>
<div id="plugin"></div>
</div>
</div>
</div>
<script type="text/javascript">
function showTabs() {
fetch(`/api/help/getTabs`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(data => data.json())
.then(async data => {
data.forEach(async t => {
const tabElement = document.createElement('div');
tabElement.className = 'tab';
tabElement.dataset.tab = t.name;
tabElement.textContent = t.name;
tabElement.addEventListener('click', async () => {
Array.from(document.querySelectorAll('.tab')).forEach(t => t.classList.remove('active'));
tabElement.classList.add('active');
tabWrapper.innerHTML = '';
const response = await fetch('/api/help/getHelp', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ name: t.name })
});
const item = await response.json();
const html = `
<div>
<p>${response.status === 500 ? 'Hilfe nicht verfügbar' : item.html}</p>
${item.description ? `<hr /><p>${item.description}</p>` : ''}
</div>
`;
const container = document.querySelector('#tabWrapper');
container.innerHTML = html;
});
document.getElementById('helpTabs').appendChild(tabElement);
})
})
}
showTabs();
year.textContent = new Date().getFullYear();
</script>
</body>
</html>