From b55b94aef67ca11c80f778e367d02cf426fd64c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20Lefran=C3=A7ois?= Date: Sun, 14 Jun 2020 03:49:01 +0200 Subject: [PATCH] search --- portal/search.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/portal/search.html b/portal/search.html index 773f5e2..ccba0cc 100644 --- a/portal/search.html +++ b/portal/search.html @@ -213,8 +213,13 @@ $(document).ready(function(){ if(!urlParams.has('q')) { return; } - var q = urlParams.get('q') - var ds="/api/search?q="+q; + var p; + if(!urlParams.has('p')) { + p=1; + } else { + p = urlParams.get('p') + } + var ds="/api/search?q="+q+"&p="+p; if(q) { $("

The results for "+q+":

").appendTo("#results"); } @@ -226,10 +231,9 @@ $(document).ready(function(){ $.each(data["results"], function(key, value){ $("
"+value.label+"
").appendTo("#resultsDIV"); $("
"+value.comment+"
").appendTo("#resultsDIV"); - $("
score: "+value.score+"
").appendTo("#resultsDIV"); - $("
offset: "+data["offset"]+"
").appendTo("#resultsDIV"); - $("
count: "+data["count"]+"
").appendTo("#resultsDIV"); }); + $("
previous - offset: "+data["offset"]+" - count: "+data["count"]+" - next
").appendTo("#resultsDIV"); + } }); }); -- GitLab