diff --git a/search.html b/search.html index 0e0d6d8..17d26a1 100644 --- a/search.html +++ b/search.html @@ -26,17 +26,50 @@
-
-

Recherche

+
+
+

Recherche

+
+
+
+
+ +
+
+
+ + + + +
+
+
+ +

Cocher pour rechercher les élements contenant tous les mots saisis

+
+
+ +
+

{{ booksCount }}

diff --git a/search.js b/search.js index 2547ebb..7fac97a 100644 --- a/search.js +++ b/search.js @@ -69,17 +69,28 @@ var app = new Vue({ this.sendQuery(this.searchParams('cgi-bin/bouquins/books'), this.stdError, this.searchBooksSuccess); }, searchAll: function() { + this.clear(); + this.searchBooks(); + }, + clear: function() { this.authors = []; this.books = []; this.series = []; this.booksCount = 0; - this.searchBooks(); + }, + searchFull: function() { + if (document.getElementById("q").value) { + this.clear(); + this.terms = document.getElementById("q").value.split(' '); + // TODO criteria + this.searchBooks(); + } }, searchUrl: function() { if (this.urlParams.q) { this.terms = this.urlParams.q.split(' '); this.searchAll(); - // TODO copy in form + document.getElementById("q").value = this.urlParams.q; } } },