From 1c6b43d3a392d52a2ef12d031a4ac4a160884a9e Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 00:59:21 -0500 Subject: Move docs to root of gh-pages site --- js/darkfish.js | 84 ++++++++++++++++++ js/navigation.js | 105 +++++++++++++++++++++++ js/navigation.js.gz | Bin 0 -> 833 bytes js/search.js | 110 ++++++++++++++++++++++++ js/search_index.js | 1 + js/search_index.js.gz | Bin 0 -> 3942 bytes js/searcher.js | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++ js/searcher.js.gz | Bin 0 -> 1688 bytes 8 files changed, 529 insertions(+) create mode 100644 js/darkfish.js create mode 100644 js/navigation.js create mode 100644 js/navigation.js.gz create mode 100644 js/search.js create mode 100644 js/search_index.js create mode 100644 js/search_index.js.gz create mode 100644 js/searcher.js create mode 100644 js/searcher.js.gz (limited to 'js') diff --git a/js/darkfish.js b/js/darkfish.js new file mode 100644 index 0000000..111bbf8 --- /dev/null +++ b/js/darkfish.js @@ -0,0 +1,84 @@ +/** + * + * Darkfish Page Functions + * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ + * + * Author: Michael Granger + * + */ + +/* Provide console simulation for firebug-less environments */ +/* +if (!("console" in window) || !("firebug" in console)) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml", + "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"]; + + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +}; +*/ + + +function showSource( e ) { + var target = e.target; + while (!target.classList.contains('method-detail')) { + target = target.parentNode; + } + if (typeof target !== "undefined" && target !== null) { + target = target.querySelector('.method-source-code'); + } + if (typeof target !== "undefined" && target !== null) { + target.classList.toggle('active-menu') + } +}; + +function hookSourceViews() { + document.querySelectorAll('.method-heading').forEach(function (codeObject) { + codeObject.addEventListener('click', showSource); + }); +}; + +function hookSearch() { + var input = document.querySelector('#search-field'); + var result = document.querySelector('#search-results'); + result.classList.remove("initially-hidden"); + + var search_section = document.querySelector('#search-section'); + search_section.classList.remove("initially-hidden"); + + var search = new Search(search_data, input, result); + + search.renderItem = function(result) { + var li = document.createElement('li'); + var html = ''; + + // TODO add relative path to