Skip to content

Commit

Permalink
update MWT to v2022-08-09-001
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkaminski committed Aug 9, 2022
1 parent 8c19a6a commit 5c95750
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .massivewikibuilder/massive-wiki-themes
2 changes: 1 addition & 1 deletion .massivewikibuilder/this-wiki-themes/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Massive Wiki Themes

Version 2022-07-30-002.
Version 2022-08-09-001.

Massive Wiki Builder and Missive Weaver use a simple theming system. All the files for one theme are placed in a subdirectory in the themes directory, usually `massive-wiki-themes`. For example, the Alto theme is in `massive-wiki-themes/alto`, and to use the Alto theme, pass `-t massive-wiki-themes/alto` to MWB.

Expand Down
45 changes: 1 addition & 44 deletions .massivewikibuilder/this-wiki-themes/basso/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,12 @@
<link rel="stylesheet" href="/mwb-static/css/mystyles.css">
<link rel="stylesheet" href="/mwb-static/css/markdown.css">
<link rel="stylesheet" href="/mwb-static/css/sidebar.css">
<link rel="stylesheet" href="/mwb-static/css/custom.css">
{% if lunr_index_sitepath != '' %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.9/lunr.min.js"></script>
<script src="{{lunr_index_sitepath}}"></script>
<script>var index = lunr.Index.load(lunr_index)</script>
{% endif %}
{% if lunr_posts_sitepath != '' %}
<script src="{{lunr_posts_sitepath}}"></script>
{% endif %}
<script>
function doSearch() {
let searchString=document.getElementById("inputID").value;
var ul = document.createElement('ul');
ul.setAttribute('id','resList');
const searchResultList = index.search(searchString).map((item) => {
return lunr_posts.find((post) => item.ref === post.link)
})
render_list = document.getElementById('renderList');
removeAllChildNodes(render_list);
render_list.appendChild(ul);
searchResultList.forEach(renderResultList);
function renderResultList(element, index, arr) {
var anchor = document.createElement('a');
anchor.append(document.createTextNode(`${element.title}`));
anchor.setAttribute('class', 'wikilink');
anchor.setAttribute('href',`${element.link}`);
anchor.setAttribute('target', '_blank');
var li = document.createElement('li');
li.setAttribute('class','item');
li.append(anchor);
ul.append(li);
}
}
</script>
<script>
<!-- search on Enter in input textbox -->
var input_id = document.getElementById('inputID')
input_id.addEventListener('keypress', function(event) {
if (event.key === "Enter") {
event.preventDefault();
document.getElementById("searchButton").click();
}
});
</script>
<script>
function removeAllChildNodes(parent) {
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}
}
</script>
{% endif %}
</head>
5 changes: 5 additions & 0 deletions .massivewikibuilder/this-wiki-themes/basso/_javascript.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// ensure the DOM is loaded, for things that need it
document.addEventListener('DOMContentLoaded', () => {

////////////////////////////////////////////////////////////////
// Bulma navbar helpers
////////////////////////////////////////////////////////////////

// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);

Expand Down
52 changes: 52 additions & 0 deletions .massivewikibuilder/this-wiki-themes/basso/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,58 @@ <h1>Search in {{wiki_title}}</h1>
</section>
{% include '_footer.html' %}
<script>{% include '_javascript.html' %}</script>
<script>
function doSearch() {
let searchString=document.getElementById("inputID").value;
var ul = document.createElement('ul');
ul.setAttribute('id','resList');
const searchResultList = index.search(searchString).map((item) => {
return lunr_posts.find((post) => item.ref === post.link)
})
render_list = document.getElementById('renderList');

// clear any previous results, then populate results
removeAllChildNodes(render_list);
render_list.appendChild(ul);
searchResultList.forEach(renderResultList);
if (ul.childNodes.length == 0) {
render_list.append('No results for "' + searchString + '"')
}

// helper to set a single result (in scope of doSearch())
function renderResultList(element, index, arr) {
var anchor = document.createElement('a');
anchor.append(document.createTextNode(`${element.title}`));
anchor.setAttribute('class', 'wikilink');
anchor.setAttribute('href',`${element.link}`);
anchor.setAttribute('target', '_blank');
var li = document.createElement('li');
li.setAttribute('class','item');
li.append(anchor);
ul.append(li);
}
}

// helper to clear previous search results
function removeAllChildNodes(parent) {
while (parent.firstChild) {
parent.removeChild(parent.firstChild);
}
}

// ensure the DOM is loaded
document.addEventListener('DOMContentLoaded', () => {
// search on Enter
var input_id = document.getElementById('inputID')
input_id.addEventListener('keypress', function(event) {
if (event.key === "Enter") {
event.preventDefault();
document.getElementById("searchButton").click();
}
});
})
</script>

<!-- uncomment to add Hypothes.is
<script src="https://hypothes.is/embed.js" async></script>
-->
Expand Down

0 comments on commit 5c95750

Please sign in to comment.