Browse Source

search for tags / normal text search not working

master
Senta Mandutz 5 years ago
parent
commit
d48a3bf5ed
1 changed files with 29 additions and 11 deletions
  1. 29
    11
      public/index.html

+ 29
- 11
public/index.html View File

@@ -97,7 +97,7 @@
<div class="om-header-container">
<div class="om-header">
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
<form class="om-searchbar" @submit.prevent="search()">
<form class="om-searchbar" @submit.prevent="search">
<b-field>
<b-taginput
id="search-text"
@@ -168,7 +168,7 @@

<script>
var tagArray = [];
const data=[
const dat=[
'th',
'efi',
'wichtig',
@@ -216,7 +216,7 @@
})
},
getFilteredTags(text) {
this.taglist = data.filter((option) => {
this.taglist = dat.filter((option) => {
return option
.toString()
.toLowerCase()
@@ -227,19 +227,37 @@
tagArray = this.selected;
console.info(tagArray);
},
function get_insert_tag(id){
$.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
data.push("#"+tag.name);
console.log("it worked!");
}).fail(function (e, f, g) {
console.log("cannot load " + id + ".json: " + e + f + g);
})
},
list_tags: function () {
$.ajax({url: "api/tag/ids",method: "GET"})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
_taglist.splice(0, _taglist.length);
_taglist.push.apply(_taglist, jd);
console.log("tag: jd: " + jd);
for (var e in jd) {
if (!_tags[jd[e]]) {
get_insert_tag(jd[e]);
}
}
}).fail(function (e, f, g) {
console.log("err: " + e + f + g);
});
}

},
mounted: function () {
//this.search();
this.list_tags();
},
});
function get_insert_tag(id){
$.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
dat.push("#"+tag.name);
console.log("it worked!");
}).fail(function (e, f, g) {
console.log("cannot load " + id + ".json: " + e + f + g);
})
}




Loading…
Cancel
Save