Merge remote-tracking branch 'origin/developer' into developer

This commit is contained in:
Edwina Barbalan 2019-07-19 11:54:26 +02:00
commit d66be879cd
3 changed files with 39 additions and 6 deletions

View File

@ -82,3 +82,8 @@ db.messages.insert(
} }
] ]
) )
db.tags.insert([{"name":"Lorem"},{"name":"fugiat"},{"name":"aliqua"},{"name":"consequat"},{"name":"mollit"},{"name":"a
et"},{"name":"consectetur"},{"name":"dolore"},{"name":"nulla"},{"name":"tempor"},{"name":"veniam"},{"name":"ipsum"},{"n
me":"adipisicing"},{"name":"qui"},{"name":"sint"},{"name":"ullamco"},{"name":"incididunt"},{"name":"nisi"},{"name":"sit
},{"name":"minim"},{"name":"labore"},{"name":"sunt"},{"name":"in"}])

View File

@ -120,6 +120,7 @@
@typing="getFilteredTags" @typing="getFilteredTags"
@input="saveTagsToArray"> @input="saveTagsToArray">
</b-taginput>--> </b-taginput>-->
<button @click="clear">x</button>
</b-field> </b-field>
</form> </form>
</div> </div>
@ -161,8 +162,9 @@
router, router,
el: '#api', el: '#api',
data: function() { data: function() {
return{ return {
searchtext: "", searchtext: "",
isSearchActiv: false,
selected: [], selected: [],
taglist: dat, taglist: dat,
}; };
@ -179,6 +181,7 @@
}, },
methods: { methods: {
search: function() { search: function() {
this.isSearchActiv = true;
console.log("Searchtext: " +this.searchtext.replace(/#/g,'')); console.log("Searchtext: " +this.searchtext.replace(/#/g,''));
$.ajax({ $.ajax({
url: "api/msg/search/" + this.searchtext.replace(/#/g, ''), url: "api/msg/search/" + this.searchtext.replace(/#/g, ''),
@ -196,6 +199,22 @@
}).fail(function(e, f, g) { }).fail(function(e, f, g) {
console.log("searching: err: " + e + f + g); console.log("searching: err: " + e + f + g);
}) })
},
list_messages: function () {
$.ajax({url: "api/msg/ids", method: "GET"})
.done(jd => {
// NICHT SO wg. Vue: _messagelist = jd;
_messagelist.splice(0, _messagelist.length);
_messagelist.push.apply(_messagelist, jd);
//console.log("jd: "+jd);
for (var e in jd) {
if (!_messages[jd[e]]) {
get_insert_message(jd[e]);
}
}
}).fail(function (e, f, g) {
console.log("list_msg: err: " + e + f + g);
});
}, },
getFilteredTags(text) { getFilteredTags(text) {
this.taglist = dat.filter((option) => { this.taglist = dat.filter((option) => {
@ -225,11 +244,19 @@
}).fail(function (e, f, g) { }).fail(function (e, f, g) {
console.log("err: " + e + f + g); console.log("err: " + e + f + g);
}); });
} },
clear: function() {
console.log("clear");
this.isSearchActiv = false;
this.searchtext = "";
this.list_messages();
},
}, },
mounted: function () { mounted: function () {
this.search(); //this.search();
this.list_tags(); this.list_tags();
}, },
}); });

View File

@ -5,7 +5,8 @@ Vue.component('MsgCard', {
<img src="favicon.ico" width=20px height=20px> <img src="favicon.ico" width=20px height=20px>
</h6> </h6>
{{ msg.message }}<br><br> {{ msg.message }}<br><br>
<a v-for="tag in msg.tag" href="#">#{{ tag }} </a> <!--<a v-for="tag in msg.tag" href="#">#{{ tag }} </a>-->
<b-button class="tags" type="is-text" v-for="tag in msg.tag>#{{ tag }} </b-button>
</p> </p>
<div class="om-card-footer"> <div class="om-user-line"> <div class="om-card-footer"> <div class="om-user-line">
<i class="material-icons">account_circle</i> <i class="material-icons">account_circle</i>