Compare commits

..

No commits in common. "34789014509e0c91a28a73eec8eb0d6b617b971c" and "ab358abe986e2d291a689ac791492a8724b6b4b3" have entirely different histories.

View File

@ -99,13 +99,7 @@
<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()">
<b-field>
<b-input
type="search"
v-model="searchtext"
icon="magnify"
placeholder="Suche...">
</b-input>
<!--<b-taginput
<b-taginput
id="search-text"
type="search"
v-model="selected"
@ -113,10 +107,10 @@
autocomplete
allow-new:true
icon="magnify"
placeholder="Suche.."
placeholder="suche.."
@typing="getFilteredTags"
@input="saveTagsToArray">
</b-taginput>-->
</b-taginput>
</b-field>
</form>
</div>
@ -173,8 +167,8 @@
</div>
<script>
var tagArray = ["lorem"];
const dat=[
var tagArray = [];
const data=[
'th',
'efi',
'wichtig',
@ -198,12 +192,12 @@
return{
searchtext: "ipsum",
selected: [],
taglist: dat,
taglist: data,
};
},
methods: {
search: function() {
console.log("Searchtext: " +this.searchtext + tagArray);
console.log("Searchtext: " +this.searchtext);
$.ajax({
url: "api/msg/search/" + this.searchtext,
method: "GET"
@ -222,49 +216,30 @@
})
},
getFilteredTags(text) {
this.taglist = dat.filter((option) => {
this.taglist = data.filter((option) => {
return option
.toString()
.toLowerCase()
.indexOf(text.toLowerCase()) >= 0
})
this.search();
},
saveTagsToArray: function() {
tagArray = this.selected;
console.info(tagArray);
},
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){
function get_insert_tag(id){
$.ajax({ url: "api/tag/"+id, method: "GET" }).done(function (tag) {
dat.push("#"+tag.name);
data.push("#"+tag.name);
console.log("it worked!");
}).fail(function (e, f, g) {
console.log("cannot load " + id + ".json: " + e + f + g);
})
}
},
},
mounted: function () {
//this.search();
},
});