Files
i2p.i2p/apps/i2psnark/resources/js/search.js
zzz 1dbd94d52d i2psnark: Search CSS and JS
WIP, more polishing todo
default theme only, others to follow
2023-01-18 11:15:22 -05:00

33 lines
646 B
JavaScript

/* @license http://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 */
/* see also licenses/LICENSE-GPLv2.txt */
/**
* Search form helpers
*
* @since 0.9.58
*/
function initSearch()
{
var sch = document.getElementById("search");
if (sch != null) {
var box = document.getElementById("searchbox");
sch.addEventListener("reset", function(event) {
if (box.value !== "") {
box.value = "";
requestAjax2(-1);
}
event.preventDefault();
});
box.addEventListener("input", function(event) {
requestAjax2(-1);
});
}
}
document.addEventListener("DOMContentLoaded", function() {
initSearch();
}, true);
/* @license-end */