summaryrefslogtreecommitdiff
path: root/help3xsl/help.js
diff options
context:
space:
mode:
authorIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2018-01-22 16:48:08 +0200
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-01-23 12:03:49 +0100
commit995f740adfff22aff1105a7e1b2801dfdab43434 (patch)
treeb130ea7c62f69430fb97df90fb5b6bf40784645c /help3xsl/help.js
parentd8623712ce8523cd6d29116a5bd903e1d7edbd62 (diff)
Use list.js for Index listing and search
List.js - http://listjs.com/ - allows us to paginate the results so the height does not get out of hand. Fuzzy search would be cool: http://listjs.com/docs/fuzzysearch/ ...but it gives too big of a perf hit with our 5700 items. Might try to bribe the creator to look into perf. Thanks a lot to David Tardon for the makefile solution and to Christian Lohmaier for playing a rubber duck. Change-Id: I359eed541470ccaa309b0b6ff5d809a796d9befd Reviewed-on: https://gerrit.libreoffice.org/48335 Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org> Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/help.js')
-rw-r--r--help3xsl/help.js33
1 files changed, 0 insertions, 33 deletions
diff --git a/help3xsl/help.js b/help3xsl/help.js
index 5ad90e765c..999af538b0 100644
--- a/help3xsl/help.js
+++ b/help3xsl/help.js
@@ -90,37 +90,4 @@ function getParameterByName(name, url) {
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
-var debouncer = null;
-$(document).ready(function() {
- $('#search-bar').keyup(function() {
- if (debouncer) {
- clearTimeout(debouncer);
- }
- debouncer = setTimeout(function(){
- if ($('#search-bar').val().length > 2) {
- var toShow = $('#Index ul a').filter(function(){
- return $(this).text().toLowerCase().indexOf($('#search-bar').val().toLowerCase()) > -1;
- });
- toShow.parent().show();
- $("#Index ul a").not(toShow).parent().hide();
- $("#Bookmarks").show();
-
- var listToShow = $('');
- $('#Index ul li').filter(':visible').each(function(){
- //add all module labels that have results in search
- listToShow = listToShow.add($(this).parent().prev());
- });
- $(listToShow).show();
- //hide all labels with 0 results
- $('#Bookmarks > p').not(listToShow).hide();
- }
- else {
- $("#Bookmarks").hide();
- }
- }, 200);
- });
-
- //prevent all results to be shown
- $("#Bookmarks").toggle($('#search-bar').val().length > 2);
-});
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */