summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/search/results.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-12-23 06:58:03 +0100
committerJules Laplace <julescarbon@gmail.com>2017-12-23 06:58:03 +0100
commit939932ca9e08512a65f2c40df2311cdda7a309d0 (patch)
tree633684665c0b5f8896672969459cfc11fb3fd23d /public/assets/js/lib/views/search/results.js
parentdbb2d747323293e6ded68e5fd037ca3e01a7c6c2 (diff)
next page link on mailbox pages
Diffstat (limited to 'public/assets/js/lib/views/search/results.js')
-rw-r--r--public/assets/js/lib/views/search/results.js23
1 files changed, 5 insertions, 18 deletions
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"), "<b>" + term + "</b>")
- })
- return s
-}
-function querystring(opt){
- return '?' + Object.keys(opt).map((key) => {
- return encodeURIComponent(key) + "=" + encodeURIComponent(opt[key])
- }).join("&")
-}