All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nasdanika.html.model.app.gen.search.js Maven / Gradle / Ivy

There is a newer version: 2024.10.0
Show newest version
// Script for full-text search of JsTree

window.nsdJsTreeSearchCallback = function(str, node) { 
    var sf = new $.vakata.search(str, true, { caseSensitive : false, fuzzy : false }); 
    if (sf.search(node.text).isMatch) {
		return true;
	} 
    let searchResult = this.search(str); 
    for (const sr in searchResult) {
        if (searchResult[sr].ref === node.original['data-nsd-label-uuid']) {
            return true;
        } 
    } 
    return false; 
}.bind(lunr(function () {
			  this.ref('id');
			  this.field('title');
			  this.field('content');

			  for (const key in searchDocuments) {
				  let doc = searchDocuments[key];
				this.add({
					id: doc['action-uuid'],
					title: doc.title,
					path: doc.path,
					content: doc.content
				});  
			  }
			}));




© 2015 - 2025 Weber Informatics LLC | Privacy Policy