]> git.ipfire.org Git - ipfire.org.git/blobdiff - static/js/site.js
planet: Introduce tags for searching.
[ipfire.org.git] / static / js / site.js
index f7ddd39b5803b5c608318c9aeb59a0dd05de6209..f8e535ccf98acc5a84b4a871d3a3381474a156fe 100644 (file)
@@ -46,6 +46,17 @@ if (/.*download-splash.*/i.test(window.location.href)) {
        });
 }
 
+$(".planet-search-autocomplete").typeahead({
+       source: function(query, process) {
+               $.get("http://planet.ipfire.org/api/search/autocomplete", { q: query }, function(data) {
+                       if (data.query == query) {
+                               process(data.results);
+                       }
+               });
+       },
+});
+
+
 function getCookie(name) {
        var r = document.cookie.match("\\b" + name + "=([^;]*)\\b");
        return r ? r[1] : undefined;