mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-26 22:00:38 -04:00
+ remove js warning in kiwix-serve autosuggest
This commit is contained in:
parent
5fb669acec
commit
523f8bc5a5
@ -212,7 +212,7 @@ static int accessHandlerCallback(void *cls,
|
||||
}
|
||||
|
||||
if (isVerbose()) {
|
||||
std::cout << "Searching suggestions for: \"" << term<< "\"" << endl;
|
||||
std::cout << "Searching suggestions for: \"" << term << "\"" << endl;
|
||||
}
|
||||
|
||||
reader->searchSuggestions(term, 10);
|
||||
@ -220,9 +220,10 @@ static int accessHandlerCallback(void *cls,
|
||||
content = "[";
|
||||
while (reader->getNextSuggestion(suggestion)) {
|
||||
content += content == "[" ? "" : ",";
|
||||
content += "{\"value\":\"" + suggestion + "\",\"id\":\"" + suggestion + "\"}";
|
||||
content += "{\"value\":\"" + suggestion + "\",\"label\":\"" + suggestion + "\"}";
|
||||
}
|
||||
content += "]\n";
|
||||
content += "]";
|
||||
mimeType = "text/x-json; charset=utf-8";
|
||||
}
|
||||
|
||||
/* Get static skin stuff */
|
||||
|
@ -3,6 +3,8 @@
|
||||
$( "#kiwixsearchbox" ).autocomplete({
|
||||
|
||||
source: "/suggest?content=__CONTENT__",
|
||||
dataType: "json",
|
||||
cache: false,
|
||||
|
||||
select: function(event, ui) {
|
||||
$( "#kiwixsearchform" ).submit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user