ec3b1d4 Completed cluster documentation 348fee3 Update .gitea/workflows/copy_documentation.yml 911e52f Update .gitea/workflows/copy_documentation.yml d472790 Update .gitea/workflows/copy_documentation.yml b87f40f Trying to get the workflow running...10 2b0db4f Trying to get the workflow running...9 927fd6d Trying to get the workflow running...8 176f399 Trying to get the workflow running...7 3c841c7 Trying to get the workflow running...6 5c798c2 Trying to get the workflow running...5 30b25a1 Trying to get the workflow running...4 5edf019 Trying to get the workflow running...3 587cf82 Trying to get the workflow running...2 a1d3aa7 Trying to get the workflow running...1 97ec277 Removed LinearAlgebra, first setup webserver copy workflow 5827396 Fixed documentation links ce19335 Added Documentation da370bb Improvements 32b5885 Multi smell works 33ea14b Single smell works a651ec6 Add neuron property drawer baa7def Pheromones WIP 551b4d9 Improve ant walking speed 7187f61 Ant is walking again c78722a Make it work again 2ff550c Removed clusterPrefab property 2ef67fe Cleanup and fix connect neuron a9a0072 Merge commit 'dd326823a8256f3ddb808e071d98c4aede72e410' 22ee17c Insect rig improvements b6a3bc1 Added insect body parts 517e738 Merge commit '4ae9a15fc61f386b96ce0f7b440780f562d7dc68' 033ddf4 Merge commit '05fd588f9bc41d84113d410a2ca992f1a2ee66e0' ef700c0 Merge commit '3f8716794ad9d685cfb9ed9dd230eb31cd8df10f' 7d5e157 Added NanoBrain namespace f138201 Merge commit '611055cdcd58b01f2f19991ad35eb8fe8e573ebb' 1c4d361 Merge commit '9fcbaa5bf84f91680d24b56dbf114bcb97de4aee' 0f83945 Added NanoBrain subtree 6f398ad Merge commit '8e87e4ea77308b51c3691bdad96e7f9707952821' as 'NanoBrain' 587f104 Move out non-subtree NanoBrain fc581a0 cleanup & documentation 837c5ce WIP Physics based walking 63486d1 The ant does it ant things! ce8e476 Added sample assets... 88d5eb5 Placing home pheromones 481829c Ensure model follows target in editor 018c99d Any walks e709ea4 Steps to get it working c1dcc83 Initial Ant setup af2fa77 Merge commit '04ca8dda0793476a59fc06f1958453730a99c105' as 'NanoBrain' 04ca8dd Squashed 'NanoBrain/' content from commit b3423b9 d9ba98d WIP: Initial scripts 2219e98 Initial commit git-subtree-dir: NanoBrain git-subtree-split: ec3b1d46ab2b9f332a8ae63589b09c3fb6fb1b1a
137 lines
5.8 KiB
JavaScript
137 lines
5.8 KiB
JavaScript
/*
|
|
@licstart The following is the entire license notice for the JavaScript code in this file.
|
|
|
|
The MIT License (MIT)
|
|
|
|
Copyright (C) 1997-2020 by Dimitri van Heesch
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
|
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or
|
|
substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
|
|
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
@licend The above is the entire license notice for the JavaScript code in this file
|
|
*/
|
|
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
|
|
function makeTree(data,relPath) {
|
|
var result='';
|
|
if ('children' in data) {
|
|
result+='<ul>';
|
|
for (var i in data.children) {
|
|
var url;
|
|
var link;
|
|
link = data.children[i].url;
|
|
if (link.substring(0,1)=='^') {
|
|
url = link.substring(1);
|
|
} else {
|
|
url = relPath+link;
|
|
}
|
|
result+='<li><a href="'+url+'">'+
|
|
data.children[i].text+'</a>'+
|
|
makeTree(data.children[i],relPath)+'</li>';
|
|
}
|
|
result+='</ul>';
|
|
}
|
|
return result;
|
|
}
|
|
var searchBoxHtml;
|
|
if (searchEnabled) {
|
|
if (serverSide) {
|
|
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
|
'<div class="left">'+
|
|
'<form id="FSearchBox" action="'+relPath+searchPage+
|
|
'" method="get"><span id="MSearchSelectExt"> </span>'+
|
|
'<input type="text" id="MSearchField" name="query" value="" placeholder="'+search+
|
|
'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)"'+
|
|
' onblur="searchBox.OnSearchFieldFocus(false)"/>'+
|
|
'</form>'+
|
|
'</div>'+
|
|
'<div class="right"></div>'+
|
|
'</div>';
|
|
} else {
|
|
searchBoxHtml='<div id="MSearchBox" class="MSearchBoxInactive">'+
|
|
'<span class="left">'+
|
|
'<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()"'+
|
|
' onmouseout="return searchBox.OnSearchSelectHide()"> </span>'+
|
|
'<input type="text" id="MSearchField" value="" placeholder="'+search+
|
|
'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" '+
|
|
'onblur="searchBox.OnSearchFieldFocus(false)" '+
|
|
'onkeyup="searchBox.OnSearchFieldChange(event)"/>'+
|
|
'</span>'+
|
|
'<span class="right"><a id="MSearchClose" '+
|
|
'href="javascript:searchBox.CloseResultsWindow()">'+
|
|
'<img id="MSearchCloseImg" border="0" src="'+relPath+
|
|
'search/close.svg" alt=""/></a>'+
|
|
'</span>'+
|
|
'</div>';
|
|
}
|
|
}
|
|
|
|
$('#main-nav').before('<div class="sm sm-dox"><input id="main-menu-state" type="checkbox"/>'+
|
|
'<label class="main-menu-btn" for="main-menu-state">'+
|
|
'<span class="main-menu-btn-icon"></span> '+
|
|
'Toggle main menu visibility</label>'+
|
|
'<span id="searchBoxPos1" style="position:absolute;right:8px;top:8px;height:36px;"></span>'+
|
|
'</div>');
|
|
$('#main-nav').append(makeTree(menudata,relPath));
|
|
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
|
|
if (searchBoxHtml) {
|
|
$('#main-menu').append('<li id="searchBoxPos2" style="float:right"></li>');
|
|
}
|
|
var $mainMenuState = $('#main-menu-state');
|
|
var prevWidth = 0;
|
|
if ($mainMenuState.length) {
|
|
function initResizableIfExists() {
|
|
if (typeof initResizable==='function') initResizable();
|
|
}
|
|
// animate mobile menu
|
|
$mainMenuState.change(function(e) {
|
|
var $menu = $('#main-menu');
|
|
var options = { duration: 250, step: initResizableIfExists };
|
|
if (this.checked) {
|
|
options['complete'] = function() { $menu.css('display', 'block') };
|
|
$menu.hide().slideDown(options);
|
|
} else {
|
|
options['complete'] = function() { $menu.css('display', 'none') };
|
|
$menu.show().slideUp(options);
|
|
}
|
|
});
|
|
// set default menu visibility
|
|
function resetState() {
|
|
var $menu = $('#main-menu');
|
|
var $mainMenuState = $('#main-menu-state');
|
|
var newWidth = $(window).outerWidth();
|
|
if (newWidth!=prevWidth) {
|
|
if ($(window).outerWidth()<768) {
|
|
$mainMenuState.prop('checked',false); $menu.hide();
|
|
$('#searchBoxPos1').html(searchBoxHtml);
|
|
$('#searchBoxPos2').hide();
|
|
} else {
|
|
$menu.show();
|
|
$('#searchBoxPos1').empty();
|
|
$('#searchBoxPos2').html(searchBoxHtml);
|
|
$('#searchBoxPos2').show();
|
|
}
|
|
if (typeof searchBox!=='undefined') {
|
|
searchBox.CloseResultsWindow();
|
|
}
|
|
prevWidth = newWidth;
|
|
}
|
|
}
|
|
$(window).ready(function() { resetState(); initResizableIfExists(); });
|
|
$(window).resize(resetState);
|
|
}
|
|
$('#main-menu').smartmenus();
|
|
}
|
|
/* @license-end */
|