2021-06-20 02:51:55 +02:00
|
|
|
<main>
|
|
|
|
<section class="panel-generic">
|
|
|
|
<h1 id="{{ section.slug }}">{{ section_intro.title }}</h1>
|
|
|
|
<p>This is the full chat command reference for WorldEditAdditions. It has 2 parts:</p>
|
|
|
|
|
|
|
|
<ol>
|
|
|
|
<li>A contents list of commands and their syntax</li>
|
|
|
|
<li>A full reference, with detailed explanations for each command</li>
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
<p>After the contents, there is a <a href="#filter">filter box</a> for filtering the detailed explanations to quickly find the one you're after.</p>
|
|
|
|
</section>
|
|
|
|
|
2021-08-05 02:32:44 +02:00
|
|
|
<section id="filter" class="panel-generic">
|
|
|
|
<div class="form-item bigsearch">
|
|
|
|
<label for="input-filter">Filter:</label>
|
|
|
|
<input type="search" id="input-filter" />
|
|
|
|
</div>
|
|
|
|
<div class="form-item centre checkbox">
|
|
|
|
<input type="checkbox" id="input-searchall" placeholder="Start typing to filter the sections." />
|
|
|
|
<label for="input-searchall" title="If unchecked, only the title will be searched.">Search content</label>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2021-06-20 02:51:55 +02:00
|
|
|
<section class="panel-generic">
|
|
|
|
<h2 id="contents" class="linked-section-heading">
|
|
|
|
<a class="section-link" href="#{{ section.slug }}">🔗 <!-- Link Symbol --></a>
|
|
|
|
<span>Contents</span>
|
|
|
|
</h2>
|
2021-06-20 03:27:47 +02:00
|
|
|
<p>TODO: Group commands here by category (*especially* the meta commands)</p>
|
2021-06-20 02:51:55 +02:00
|
|
|
<ul class="command-list">
|
|
|
|
{% for section in sections_help %}
|
2021-08-05 02:32:44 +02:00
|
|
|
<li data-filtermode-force="all"><a href="#{{ section.slug }}">
|
2021-06-20 02:51:55 +02:00
|
|
|
<code>{{ section.title }}</code>
|
|
|
|
</a></li>
|
|
|
|
{% endfor %}
|
|
|
|
</ul>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
function search_text(query, text) {
|
|
|
|
return text.toLocaleLowerCase().includes(query);
|
|
|
|
}
|
|
|
|
|
|
|
|
function do_filter() {
|
|
|
|
let el_search = document.querySelector("#input-filter");
|
|
|
|
let el_searchall = document.querySelector("#input-searchall");
|
2021-08-05 02:32:44 +02:00
|
|
|
/* Filterable items
|
|
|
|
- Sections
|
|
|
|
- Commands in the command list
|
|
|
|
*/
|
|
|
|
let els_filterable = document.querySelectorAll("section.filterable, .command-list > li");
|
2021-06-20 02:51:55 +02:00
|
|
|
|
|
|
|
let query = el_search.value.toLocaleLowerCase();
|
|
|
|
|
|
|
|
let mode = el_searchall.checked ? "all" : "header";
|
|
|
|
console.log(`SEARCH | mode`, mode, `query`, query);
|
|
|
|
|
2021-08-05 02:32:44 +02:00
|
|
|
for(let i = 0; i < els_filterable.length; i++) {
|
|
|
|
let el_next = els_filterable[i];
|
|
|
|
|
|
|
|
let mode_this = mode;
|
|
|
|
if(typeof el_next.dataset.filtermodeForce == "string")
|
|
|
|
mode_this = el_next.dataset.filtermodeForce;
|
2021-06-20 02:51:55 +02:00
|
|
|
|
|
|
|
let show = true;
|
|
|
|
if(query.length > 0) {
|
2021-08-05 02:32:44 +02:00
|
|
|
switch(mode_this) {
|
2021-06-20 02:51:55 +02:00
|
|
|
case "all":
|
|
|
|
show = search_text(query,
|
|
|
|
el_next.textContent
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
case "header":
|
|
|
|
show = search_text(query,
|
|
|
|
el_next.querySelector(".linked-section-heading").textContent
|
|
|
|
);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
el_next.classList.remove("visible", "hidden");
|
|
|
|
el_next.classList.add(show ? "visible" : "hidden");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener("load", (_event) => {
|
|
|
|
let el_search = document.querySelector("#input-filter");
|
|
|
|
let el_searchall = document.querySelector("#input-searchall");
|
|
|
|
|
|
|
|
el_search.addEventListener("input", do_filter);
|
|
|
|
el_search.addEventListener("search", do_filter);
|
|
|
|
el_searchall.addEventListener("change", do_filter);
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
{% for section in sections_help %}
|
|
|
|
<section class="panel-generic filterable">
|
|
|
|
<h2 id="{{ section.slug }}" class="linked-section-heading">
|
|
|
|
<a class="section-link" href="#{{ section.slug }}">🔗 <!-- Link Symbol --></a>
|
|
|
|
<span>{{ section.title }}</span>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
{{ section.content }}
|
|
|
|
</section>
|
|
|
|
{% endfor %}
|
|
|
|
</main>
|