Browse Source

search for tags / normal text search not working

master
Senta Mandutz 4 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

<div class="om-header-container"> <div class="om-header-container">
<div class="om-header"> <div class="om-header">
<a class="logo-img" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a> <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-field>
<b-taginput <b-taginput
id="search-text" id="search-text"


<script> <script>
var tagArray = []; var tagArray = [];
const data=[
const dat=[
'th', 'th',
'efi', 'efi',
'wichtig', 'wichtig',
}) })
}, },
getFilteredTags(text) { getFilteredTags(text) {
this.taglist = data.filter((option) => {
this.taglist = dat.filter((option) => {
return option return option
.toString() .toString()
.toLowerCase() .toLowerCase()
tagArray = this.selected; tagArray = this.selected;
console.info(tagArray); 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 () { mounted: function () {
//this.search(); //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