Browse Source

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

master
Edwina Barbalan 4 years ago
parent
commit
d66be879cd
3 changed files with 39 additions and 6 deletions
  1. 5
    0
      mong.js
  2. 31
    4
      public/index.html
  3. 3
    2
      public/routes/msgCard.js

+ 5
- 0
mong.js 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"}])

+ 31
- 4
public/index.html View File

@@ -120,6 +120,7 @@
@typing="getFilteredTags"
@input="saveTagsToArray">
</b-taginput>-->
<button @click="clear">x</button>
</b-field>
</form>
</div>
@@ -161,8 +162,9 @@
router,
el: '#api',
data: function() {
return{
return {
searchtext: "",
isSearchActiv: false,
selected: [],
taglist: dat,
};
@@ -179,6 +181,7 @@
},
methods: {
search: function() {
this.isSearchActiv = true;
console.log("Searchtext: " +this.searchtext.replace(/#/g,''));
$.ajax({
url: "api/msg/search/" + this.searchtext.replace(/#/g, ''),
@@ -197,6 +200,22 @@
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) {
this.taglist = dat.filter((option) => {
return option
@@ -224,12 +243,20 @@
}
}).fail(function (e, f, g) {
console.log("err: " + e + f + g);
});
}
});
},

clear: function() {
console.log("clear");

this.isSearchActiv = false;
this.searchtext = "";
this.list_messages();
},

},
mounted: function () {
this.search();
//this.search();
this.list_tags();
},
});

+ 3
- 2
public/routes/msgCard.js View File

@@ -5,7 +5,8 @@ Vue.component('MsgCard', {
<img src="favicon.ico" width=20px height=20px>
</h6>
{{ 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>
<div class="om-card-footer"> <div class="om-user-line">
<i class="material-icons">account_circle</i>
@@ -22,7 +23,7 @@ Vue.component('MsgCard', {
},

methods: {
myFilter: function() {
myFilter: function() {
this.isActive = !this.isActive;
},
}

Loading…
Cancel
Save