From 7375c0d719eacba2f1cd4d7c30ddf1f78f51f6c1 Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Tue, 7 Jun 2022 12:39:26 +0200 Subject: [PATCH 1/2] add resultsize input to navigation Signed-off-by: Tomas Dittmann --- templates/navigate.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/navigate.php b/templates/navigate.php index 6a83d9ea..d007436f 100644 --- a/templates/navigate.php +++ b/templates/navigate.php @@ -48,6 +48,14 @@ +
  • +
    +
    +
    Results:
    +
    +
    +
    +
  • From f70d8561c3af1baadd1ec24d4a85792a4de32b61 Mon Sep 17 00:00:00 2001 From: Tomas Dittmann Date: Tue, 7 Jun 2022 13:05:52 +0200 Subject: [PATCH 2/2] include size in searchrequest Signed-off-by: Tomas Dittmann --- js/navigate.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/js/navigate.js b/js/navigate.js index ed3824c8..834fc454 100644 --- a/js/navigate.js +++ b/js/navigate.js @@ -33,6 +33,7 @@ var fullTextSearch = OCA.FullTextSearch.api; var elements = { searchTimeout: null, search_input: null, + search_size: null, search_submit: null, search_result: null, search_json: null @@ -51,6 +52,7 @@ Navigate.prototype = { var self = this; elements.search_input = $('#search_input'); + elements.search_size = $('#search_size'); elements.search_submit = $('#search_submit'); elements.search_result = $('#search_result'); elements.search_panels = $('#search_navigation'); @@ -78,7 +80,17 @@ Navigate.prototype = { // self.initSearch(true); // } // }); - + + if (typeof (Storage) !== "undefined") { + elements.search_size.on('input', function(){ + localStorage.search_size = elements.search_size.val(); + self.navigateTimedSearch(); + }); + if (localStorage.search_size) { + elements.search_size.val(localStorage.search_size); + } + } + self.initPanels(); }, @@ -100,7 +112,6 @@ Navigate.prototype = { } }, - initPanels: function () { var self = this; $.ajax({ @@ -420,6 +431,7 @@ Navigate.prototype = { var providers = this.getProviders(); var options = this.getOptions(); + var size = elements.search_size.val(); this.displayProviderResults(providers); @@ -427,7 +439,8 @@ Navigate.prototype = { providers: providers, options: options, search: search, - page: curr.page + page: curr.page, + size: size }; fullTextSearch.search(request, this.searchResult);