aboutsummaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-01-17 21:31:12 (UTC)
committerrtz12 <koenig@fagott.pw>2016-01-17 21:31:12 (UTC)
commit72ad0e53f3887b5ad74034a99c6453a88eeb0cbd (patch)
treea2b83127f37ff1706e593f15299cd6e7347f788a /assets/js
parent6cb2de0a1f583ef8d018e430181a7414fa7faff1 (diff)
Geiles neues Buildsystem fuer die Assets
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/list.js17
-rw-r--r--assets/js/search.js40
2 files changed, 0 insertions, 57 deletions
diff --git a/assets/js/list.js b/assets/js/list.js
deleted file mode 100644
index 25ff80d..0000000
--- a/assets/js/list.js
+++ /dev/null
@@ -1,17 +0,0 @@
1function clickSearchResult(resId) {
2 var xhr = new XMLHttpRequest();
3 xhr.onreadystatechange = function() {
4 if (xhr.readyState == XMLHttpRequest.DONE) {
5 if (xhr.status !== 200) {
6 alert(xhr.status + ": " + xhr.response);
7 return;
8 }
9
10 data = xhr.responseText;
11 document.getElementById("gril-list").innerHTML += data;
12 }
13 }
14 xhr.open('POST', window.location, true);
15 xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
16 xhr.send('id=' + resId);
17} \ No newline at end of file
diff --git a/assets/js/search.js b/assets/js/search.js
deleted file mode 100644
index 0cb33df..0000000
--- a/assets/js/search.js
+++ /dev/null
@@ -1,40 +0,0 @@
1var strokeTimeout = null;
2
3function instantSearch() {
4 if (strokeTimeout) {
5 clearTimeout(strokeTimeout);
6 }
7 strokeTimeout = setTimeout(doSearch, 150);
8}
9
10function doSearch() {
11 value = document.getElementById("search").value;
12
13 if (value === "") {
14 strokeTimeout = null;
15 document.getElementById("search-results").innerHTML = "";
16 return;
17 }
18 var xhr = new XMLHttpRequest();
19 xhr.onreadystatechange = function() {
20 if (xhr.readyState == XMLHttpRequest.DONE) {
21 if (xhr.status === 404 || xhr.status === 400 || typeof xhr.response === 'undefined' || xhr.response === '404 not found') {
22 document.getElementById("search-results").innerHTML = '';
23 return
24 }
25 if (value === "") {
26 document.getElementById("search-results").innerHTML = "";
27 return;
28 }
29
30 document.getElementById("search-results").innerHTML = xhr.response.replace(new RegExp('{ (.*?)(' + value + ')(.*?) }', 'gi'), "$1<b>$2</b>$3").replace(new RegExp('{ (.*?) }', 'gi'), '$1');
31 }
32 }
33 xhr.open('GET', '/search/gril_instant/' + value, true);
34 xhr.send(null);
35 strokeTimeout = null;
36}
37
38function clickSearchResult(resId) {
39
40} \ No newline at end of file