(no commit message)
authorChristian Weiske <cweiske@cweiske.de>
Fri, 20 Jan 2017 12:46:05 +0000 (13:46 +0100)
committerwww-cweiske <www-cweiske@localhost.localdomain>
Fri, 20 Jan 2017 12:46:05 +0000 (13:46 +0100)
phork0.txt [new file with mode: 0644]

diff --git a/phork0.txt b/phork0.txt
new file mode 100644 (file)
index 0000000..df911be
--- /dev/null
@@ -0,0 +1,25 @@
+// https://leaverou.github.io/awesomplete/\r
+  var search = new Awesomplete('#producerdbsearch', {\r
+  minChars: 0,\r
+  });\r
+  document.getElementById('producerdbsearch').addEventListener('input', function() {\r
+      var query = this.value;\r
+      console.log('adf', query);\r
+\r
+      var xhr = new XMLHttpRequest()\r
+      xhr.open('GET', '/somefoo&q=' + query);\r
+      xhr.onreadystatechange = function() {\r
+          if (xhr.readyState>3 && xhr.status==200) {\r
+              showSearchResults(JSON.parse(xhr.response));\r
+          };\r
+      };\r
+      xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\r
+      xhr.send();\r
+  });\r
+  function showSearchResults(list)\r
+  {\r
+      var newlist = [];\r
+      list.forEach(function(obj) { newlist.push(obj.title);});\r
+      search.list = newlist;\r
+  }\r
+\r