404
+ +Page not found
+ + +diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..4b63dc5 --- /dev/null +++ b/404.html @@ -0,0 +1,121 @@ + + +
+ + + + +Page not found
+ + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus +nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum +convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, +commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex +eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi +tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit +amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui +lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. +Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, +felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi +auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus +imperdiet purus quis scelerisque.
+test jeslti to jde
+ +Welcome to the user guide for the SMODERP2D model. The aim of this text is +to provide basic information to users on how to run the SMODERP2D model.
+ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @
+ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @
+ \ \ / / / \ \ / \ / / / @ @ @ @ @ @
+ \ _\/ /_/ \ \/ \/ /_____/ @ @ @ @
+ \__/ \ / _\___/ @ @ @
+ \____ \/ / @ @ @
+ \_____/______/ @ @ @
+ \ @ @ @
+ \___________________ @ @ @ @ @ @ @
+
+The SMODERP2D model is designed to calculate hydrological and erosion processes on +individual plots or small catchments. The outputs of the model are primarily +used to determine runoff conditions in a catchment and obtain parameters for +runoff and erosion risk protection measures on agricultural land. Additionally, +the model can assist in designing more complex systems, including sediment +retention ponds, dry basins, or polders. Its use complies with current +methods, technical standards, and recommended practices.
+The SMODERP2D model is open source project developed by the Department +of Landscape Water Conservation, Faculty of Civil Engineering, Czech +Technical University in Prague. Source code is licenced under GNU GPL +and available from GitHub repository https://github.com/storm-fsv-cvut/smoderp2d.
+The SMODERP2D can be downloaded at
A third-party GIS software needs to be installed to run the model properly. +The types od GIS softwares and specific install inslutrctions are described +in section Providers.
+SMODERP2D model relies on a GIS software were the input and output data can be acquired, +modified and visualized. Currently, SMODERP2D supports 3 GIS software as a provider:
+ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus +nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum +convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, +commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex +eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi +tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit +amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui +lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. +Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, +felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi +auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus +imperdiet purus quis scelerisque.
+Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam +erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam +rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at +semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis +tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed +viverra mauris finibus. Nullam eu neque in libero eleifend lacinia.
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus +nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum +convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, +commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex +eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi +tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit +amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui +lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. +Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, +felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi +auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus +imperdiet purus quis scelerisque.
+Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam +erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam +rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at +semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis +tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed +viverra mauris finibus. Nullam eu neque in libero eleifend lacinia.
+ +The SMODERP2D can be downloaded at @@@.
+A third-party GIS software needs to be installed to run the model properly. +The types od GIS softwares and specific install inslutrctions are described +in section Providers.
+ +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus +nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum +convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, +commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex +eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi +tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit +amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui +lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. +Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, +felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi +auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus +imperdiet purus quis scelerisque.
+ +' + escapeHtml(summary) +'
' + noResultsText + '
'); + } +} + +function doSearch () { + var query = document.getElementById('mkdocs-search-query').value; + if (query.length > min_search_length) { + if (!window.Worker) { + displayResults(search(query)); + } else { + searchWorker.postMessage({query: query}); + } + } else { + // Clear results for short queries + displayResults([]); + } +} + +function initSearch () { + var search_input = document.getElementById('mkdocs-search-query'); + if (search_input) { + search_input.addEventListener("keyup", doSearch); + } + var term = getSearchTermFromLocation(); + if (term) { + search_input.value = term; + doSearch(); + } +} + +function onWorkerMessage (e) { + if (e.data.allowSearch) { + initSearch(); + } else if (e.data.results) { + var results = e.data.results; + displayResults(results); + } else if (e.data.config) { + min_search_length = e.data.config.min_search_length-1; + } +} + +if (!window.Worker) { + console.log('Web Worker API not supported'); + // load index in main thread + $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { + console.log('Loaded worker'); + init(); + window.postMessage = function (msg) { + onWorkerMessage({data: msg}); + }; + }).fail(function (jqxhr, settings, exception) { + console.error('Could not load worker.js'); + }); +} else { + // Wrap search in a web worker + var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); + searchWorker.postMessage({init: true}); + searchWorker.onmessage = onWorkerMessage; +} diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 0000000..f388613 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"SMODERP2D - Distributed event-based model for surface and subsurface runoff and erosion Welcome to the user guide for the SMODERP2D model. The aim of this text is to provide basic information to users on how to run the SMODERP2D model. @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ \\ \\ / / / \\ \\ / \\ / / / @ @ @ @ @ @ \\ _\\/ /_/ \\ \\/ \\/ /_____/ @ @ @ @ \\__/ \\ / _\\___/ @ @ @ \\____ \\/ / @ @ @ \\_____/______/ @ @ @ \\ @ @ @ \\___________________ @ @ @ @ @ @ @ The SMODERP2D model is designed to calculate hydrological and erosion processes on individual plots or small catchments. The outputs of the model are primarily used to determine runoff conditions in a catchment and obtain parameters for runoff and erosion risk protection measures on agricultural land. Additionally, the model can assist in designing more complex systems, including sediment retention ponds, dry basins, or polders. Its use complies with current methods, technical standards, and recommended practices. The SMODERP2D model is open source project developed by the Department of Landscape Water Conservation, Faculty of Civil Engineering, Czech Technical University in Prague. Source code is licenced under GNU GPL and available from GitHub repository https://github.com/storm-fsv-cvut/smoderp2d . Installation [Installation instructions] (install.md) The SMODERP2D can be downloaded at . A third-party GIS software needs to be installed to run the model properly. The types od GIS softwares and specific install inslutrctions are described in section Providers . Providers SMODERP2D model relies on a GIS software were the input and output data can be acquired, modified and visualized. Currently, SMODERP2D supports 3 GIS software as a provider: QGIS GRASS GIS ArcGIS Input data Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque. Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed viverra mauris finibus. Nullam eu neque in libero eleifend lacinia. Outputs Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque. Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed viverra mauris finibus. Nullam eu neque in libero eleifend lacinia.","title":"SMODERP2D - Distributed event-based model for surface and subsurface runoff and erosion"},{"location":"index.html#smoderp2d-distributed-event-based-model-for-surface-and-subsurface-runoff-and-erosion","text":"Welcome to the user guide for the SMODERP2D model. The aim of this text is to provide basic information to users on how to run the SMODERP2D model. @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ \\ \\ / / / \\ \\ / \\ / / / @ @ @ @ @ @ \\ _\\/ /_/ \\ \\/ \\/ /_____/ @ @ @ @ \\__/ \\ / _\\___/ @ @ @ \\____ \\/ / @ @ @ \\_____/______/ @ @ @ \\ @ @ @ \\___________________ @ @ @ @ @ @ @ The SMODERP2D model is designed to calculate hydrological and erosion processes on individual plots or small catchments. The outputs of the model are primarily used to determine runoff conditions in a catchment and obtain parameters for runoff and erosion risk protection measures on agricultural land. Additionally, the model can assist in designing more complex systems, including sediment retention ponds, dry basins, or polders. Its use complies with current methods, technical standards, and recommended practices. The SMODERP2D model is open source project developed by the Department of Landscape Water Conservation, Faculty of Civil Engineering, Czech Technical University in Prague. Source code is licenced under GNU GPL and available from GitHub repository https://github.com/storm-fsv-cvut/smoderp2d .","title":"SMODERP2D - Distributed event-based model for surface and subsurface runoff and erosion"},{"location":"index.html#installation","text":"[Installation instructions] (install.md) The SMODERP2D can be downloaded at . A third-party GIS software needs to be installed to run the model properly. The types od GIS softwares and specific install inslutrctions are described in section Providers .","title":"Installation"},{"location":"index.html#providers","text":"SMODERP2D model relies on a GIS software were the input and output data can be acquired, modified and visualized. Currently, SMODERP2D supports 3 GIS software as a provider: QGIS GRASS GIS ArcGIS","title":"Providers"},{"location":"index.html#input-data","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque. Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed viverra mauris finibus. Nullam eu neque in libero eleifend lacinia.","title":"Input data"},{"location":"index.html#outputs","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque. Suspendisse et pulvinar nisi. Nulla bibendum dapibus neque eu vehicula. Aliquam erat volutpat. Suspendisse condimentum risus vitae justo porta rutrum. Nam rhoncus interdum dolor, id rutrum sem posuere vitae. Morbi tempus metus at semper hendrerit. Suspendisse potenti. Quisque id velit venenatis, venenatis tortor vitae, pellentesque augue. Maecenas pretium ligula sed eros semper, sed viverra mauris finibus. Nullam eu neque in libero eleifend lacinia.","title":"Outputs"},{"location":"arcgis.html","text":"ArcGIS Pro Toolbox Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque. Blabla bla test jeslti to jde","title":"ArcGIS Pro Toolbox"},{"location":"arcgis.html#arcgis-pro-toolbox","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque.","title":"ArcGIS Pro Toolbox"},{"location":"arcgis.html#blabla-bla","text":"test jeslti to jde","title":"Blabla bla"},{"location":"grass.html","text":"GRASS GIS Addon","title":"GRASS GIS Addon"},{"location":"grass.html#grass-gis-addon","text":"","title":"GRASS GIS Addon"},{"location":"install.html","text":"The SMODERP2D can be downloaded at @@@. A third-party GIS software needs to be installed to run the model properly. The types od GIS softwares and specific install inslutrctions are described in section Providers .","title":"Install"},{"location":"qgis.html","text":"QGIS Plugin Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque.","title":"QGIS Plugin"},{"location":"qgis.html#qgis-plugin","text":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis vehicula tempus nunc a vulputate. Cras mauris ligula, ultrices facilisis diam quis, condimentum convallis magna. Duis bibendum sapien ac mi tristique volutpat. Morbi dolor mi, commodo consectetur ligula id, laoreet porttitor sapien. Nam aliquet posuere ex eget tincidunt. Praesent vehicula erat lorem. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aenean sit amet elit ac velit placerat blandit dictum faucibus massa. Integer sed dui lectus. Aenean non fermentum enim, sed molestie diam. Cras mollis euismod arcu. Ut eu elit et eros aliquet elementum. Aenean semper, augue quis tempus dapibus, felis ligula sodales justo, sit amet vulputate turpis velit a lorem. Morbi auctor dignissim tincidunt. In hac habitasse platea dictumst. Morbi rhoncus imperdiet purus quis scelerisque.","title":"QGIS Plugin"}]} \ No newline at end of file diff --git a/search/worker.js b/search/worker.js new file mode 100644 index 0000000..8628dbc --- /dev/null +++ b/search/worker.js @@ -0,0 +1,133 @@ +var base_path = 'function' === typeof importScripts ? '.' : '/search/'; +var allowSearch = false; +var index; +var documents = {}; +var lang = ['en']; +var data; + +function getScript(script, callback) { + console.log('Loading script: ' + script); + $.getScript(base_path + script).done(function () { + callback(); + }).fail(function (jqxhr, settings, exception) { + console.log('Error: ' + exception); + }); +} + +function getScriptsInOrder(scripts, callback) { + if (scripts.length === 0) { + callback(); + return; + } + getScript(scripts[0], function() { + getScriptsInOrder(scripts.slice(1), callback); + }); +} + +function loadScripts(urls, callback) { + if( 'function' === typeof importScripts ) { + importScripts.apply(null, urls); + callback(); + } else { + getScriptsInOrder(urls, callback); + } +} + +function onJSONLoaded () { + data = JSON.parse(this.responseText); + var scriptsToLoad = ['lunr.js']; + if (data.config && data.config.lang && data.config.lang.length) { + lang = data.config.lang; + } + if (lang.length > 1 || lang[0] !== "en") { + scriptsToLoad.push('lunr.stemmer.support.js'); + if (lang.length > 1) { + scriptsToLoad.push('lunr.multi.js'); + } + if (lang.includes("ja") || lang.includes("jp")) { + scriptsToLoad.push('tinyseg.js'); + } + for (var i=0; i < lang.length; i++) { + if (lang[i] != 'en') { + scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); + } + } + } + loadScripts(scriptsToLoad, onScriptsLoaded); +} + +function onScriptsLoaded () { + console.log('All search scripts loaded, building Lunr index...'); + if (data.config && data.config.separator && data.config.separator.length) { + lunr.tokenizer.separator = new RegExp(data.config.separator); + } + + if (data.index) { + index = lunr.Index.load(data.index); + data.docs.forEach(function (doc) { + documents[doc.location] = doc; + }); + console.log('Lunr pre-built index loaded, search ready'); + } else { + index = lunr(function () { + if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { + this.use(lunr[lang[0]]); + } else if (lang.length > 1) { + this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility + } + this.field('title'); + this.field('text'); + this.ref('location'); + + for (var i=0; i < data.docs.length; i++) { + var doc = data.docs[i]; + this.add(doc); + documents[doc.location] = doc; + } + }); + console.log('Lunr index built, search ready'); + } + allowSearch = true; + postMessage({config: data.config}); + postMessage({allowSearch: allowSearch}); +} + +function init () { + var oReq = new XMLHttpRequest(); + oReq.addEventListener("load", onJSONLoaded); + var index_path = base_path + '/search_index.json'; + if( 'function' === typeof importScripts ){ + index_path = 'search_index.json'; + } + oReq.open("GET", index_path); + oReq.send(); +} + +function search (query) { + if (!allowSearch) { + console.error('Assets for search still loading'); + return; + } + + var resultDocuments = []; + var results = index.search(query); + for (var i=0; i < results.length; i++){ + var result = results[i]; + doc = documents[result.ref]; + doc.summary = doc.text.substring(0, 200); + resultDocuments.push(doc); + } + return resultDocuments; +} + +if( 'function' === typeof importScripts ) { + onmessage = function (e) { + if (e.data.init) { + init(); + } else if (e.data.query) { + postMessage({ results: search(e.data.query) }); + } else { + console.error("Worker - Unrecognized message: " + e); + } + }; +} diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..f9e3020 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,28 @@ + +