From 939932ca9e08512a65f2c40df2311cdda7a309d0 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 23 Dec 2017 06:58:03 +0100 Subject: next page link on mailbox pages --- public/assets/js/lib/views/search/results.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'public/assets/js/lib/views/search') diff --git a/public/assets/js/lib/views/search/results.js b/public/assets/js/lib/views/search/results.js index 0af68ba..0f34845 100644 --- a/public/assets/js/lib/views/search/results.js +++ b/public/assets/js/lib/views/search/results.js @@ -2,15 +2,15 @@ var SearchResults = View.extend({ el: "#search", template: $("#search .template").html(), - + events: { }, - + action: "/api/search", - + initialize: function(opt){ }, - + load: function(){ var query = window.location.search.substr(1) if (! query || ! query.length) { @@ -19,7 +19,7 @@ var SearchResults = View.extend({ } $.get(this.action, query, this.populate.bind(this)) }, - + populate: function(res){ var query = sanitize(res.meta.query) var terms = res.meta.terms @@ -63,16 +63,3 @@ var SearchResults = View.extend({ }, }) - -function bold_terms (s, terms) { - s = sanitize(s) - terms.forEach( (term) => { - s = s.replace(new RegExp(term, "ig"), "" + term + "") - }) - return s -} -function querystring(opt){ - return '?' + Object.keys(opt).map((key) => { - return encodeURIComponent(key) + "=" + encodeURIComponent(opt[key]) - }).join("&") -} -- cgit v1.2.3-70-g09d2