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

View file

@ -1030,6 +1030,34 @@ th, tr, td, label {
background-color: var(--highlight); background-color: var(--highlight);
border: 1px solid 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 { #mod-print {
background-color: rgba(255,255,255,0.85); 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 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"> <div id="mod-help" class="mdialog f-col">
<a href="https://en.wikipedia.org/wiki/Slicer_(3D_printing)">wikipedia</a> <div class="f-row j-center title">
<a href="https://www.onshape.com/cad-blog/partner-spotlight-kirimoto">Onshape</a> <label>Kiri:Moto Help</label>
<a href="https://www.inov3d.net/3d-printing-slicer-software-download/">slicer news</a> </div>
<a href="https://sienci.com/2016/08/24/the-story-of-kirimoto/">Sienci Labs</a> <div class="f-col">
<a href="https://www.youtube.com/watch?v=IZ1VG07oFCo">Teaching Tech</a> <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>
<div id="mod-setup" class="mdialog f-row"> <div id="mod-setup" class="mdialog f-row">
<div class="f-col left a-stretch"> <div class="f-col left a-stretch">