test simplified help

This commit is contained in:
Stewart Allen 2021-10-26 19:35:57 -04:00
commit 955a74d44b
3 changed files with 74 additions and 34 deletions

View file

@ -3041,42 +3041,44 @@
}
function showHelp() {
showHelpFile(`/kiri/lang/${KIRI.lang.get()}-help.html?${KIRI.version}`,() => {
const sel = $('help-sel');
const labels = [...sel.getElementsByTagName('div')];
const tabs = [];
const click = (label, tab) => {
labels.forEach(l => l.classList.remove('sel'));
label.classList.add('sel');
tabs.forEach(t => t.style.display = 'none');
tab.style.display = 'flex';
};
labels.forEach(label => {
const name = label.getAttribute('tab');
const tab = $(`help-tab-${name}`);
tabs.push(tab);
label.onclick = () => { click(label, tab) };
});
click(labels[1], tabs[1]);
});
showHelpFile(`local`,() => {});
// showHelpFile(`/kiri/lang/${KIRI.lang.get()}-help.html?${KIRI.version}`,() => {
// const sel = $('help-sel');
// const labels = [...sel.getElementsByTagName('div')];
// const tabs = [];
// const click = (label, tab) => {
// labels.forEach(l => l.classList.remove('sel'));
// label.classList.add('sel');
// tabs.forEach(t => t.style.display = 'none');
// tab.style.display = 'flex';
// };
// labels.forEach(label => {
// const name = label.getAttribute('tab');
// const tab = $(`help-tab-${name}`);
// tabs.push(tab);
// label.onclick = () => { click(label, tab) };
// });
// click(labels[1], tabs[1]);
// });
}
function showHelpFile(local,then) {
if (!local) {
WIN.open("//wiki.grid.space/wiki/Kiri:Moto", "_help");
WIN.open("//docs.grid.space/", "_help");
return;
}
ajax(local, function(html) {
UI.help.innerHTML = html;
try {
// ajax(local, function(html) {
// UI.help.innerHTML = html;
// try {
$('kiri-version').innerHTML = `${LANG.version} ${KIRI.version}`;
// $('kiri-version').innerHTML = `${KIRI.version}`;
} catch (e) { }
if (then) {
then();
}
// // $('kiri-version').innerHTML = `${KIRI.version}`;
// } catch (e) { }
// if (then) {
// then();
// }
// showModal('help');
// });
showModal('help');
});
API.event.emit('help.show', local);
}

View file

@ -1030,6 +1030,34 @@ th, tr, td, label {
background-color: var(--highlight);
border: 1px solid var(--highlight);
}
#mod-help svg {
width: 36px;
height: 36px;
padding-right: 10px;
color: var(--main-color);
}
#mod-help a {
border-radius: 5px;
padding: 3px 10px 3px 5px;
display: flex;
align-items: center;
justify-content: flex-start;
}
#mod-help a:hover {
background-color: #eee;
}
#mod-help a:hover svg {
color: #123;
}
#mod-help .title {
font-weight: bold;
font-size: larger;
padding-bottom: 10px;
}
#kiri-version {
font-family: monospace;
padding-top: 5px;
}
#mod-print {
background-color: rgba(255,255,255,0.85);
}

View file

@ -276,11 +276,21 @@
<div class="mod-top f-row"><div id="mod-x"><i class="fas fa-times"></i></div></div>
<div id="mod-help" class="mdialog f-col">
<a href="https://en.wikipedia.org/wiki/Slicer_(3D_printing)">wikipedia</a>
<a href="https://www.onshape.com/cad-blog/partner-spotlight-kirimoto">Onshape</a>
<a href="https://www.inov3d.net/3d-printing-slicer-software-download/">slicer news</a>
<a href="https://sienci.com/2016/08/24/the-story-of-kirimoto/">Sienci Labs</a>
<a href="https://www.youtube.com/watch?v=IZ1VG07oFCo">Teaching Tech</a>
<div class="f-row j-center title">
<label>Kiri:Moto Help</label>
</div>
<div class="f-col">
<a target="_rsc" href="https://docs.grid.space/projects/kiri-moto"><i class="fas fa-question-circle"></i>Kiri:Moto Full Documentation</a>
<a href="https://youtu.be/08795Sj22QE" target="youtube"><i class="fab fa-youtube"></i>Video Guide to Kiri:Moto 2.5</a>
<a target="_rsc" href="https://www.youtube.com/c/GridSpace/videos"><i class="fab fa-youtube"></i>YouTube Channel</a>
<a target="_rsc" href="https://discord.gg/suyCCgr"><i class="fab fa-discord"></i> Discord Live Chat</a>
<a target="_rsc" href="https://forum.grid.space"><i class="fab fa-discourse"></i> Discourse Forums</a>
<a target="_rsc" href="https://twitter.com/grid_space_3d"><i class="fab fa-twitter"></i> Follow on Twitter</a>
<a target="_rsc" href="https://paypal.me/gridspace3d?locale.x=en_US"><i class="fab fa-paypal"></i> Donations are welcome!</a>
</div>
<div class="f-row j-center">
<label id="kiri-version"></label>
</div>
</div>
<div id="mod-setup" class="mdialog f-row">
<div class="f-col left a-stretch">