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