Browse Source

bookmars

master
Senta Mandutz 5 years ago
parent
commit
9f9d3c1480
5 changed files with 22 additions and 8 deletions
  1. 8
    1
      public/routes/bookmark.js
  2. 1
    1
      public/routes/home.js
  3. 1
    1
      public/routes/initGlobals.js
  4. 8
    4
      public/routes/msgCard.js
  5. 4
    1
      public/search.js

+ 8
- 1
public/routes/bookmark.js View File

@@ -6,6 +6,7 @@ const BookmarkRouter = {
v-for="id in msgDisplay"
:key="id"
:msg="messages[id] || {}"
:isBookmark="bookmarkArray[id]"
></MsgCard>
</div>

@@ -21,6 +22,7 @@ const BookmarkRouter = {
messages: _messages,
isActive: true,
messageId: '',
bookmarkArray: auth.bookmarks,
}
},
computed:{
@@ -50,6 +52,7 @@ const BookmarkRouter = {




/*var _usrid = auth.user;
$.ajax({
url: "api/usr/id/" + _usrid,
@@ -75,8 +78,12 @@ const BookmarkRouter = {
console.log(err);
}*/
}
},
beforeMount: function(){

},
mounted: function (){
this.getMessages();
}
},

};

+ 1
- 1
public/routes/home.js View File

@@ -3,7 +3,7 @@ const HomeRouter = {
<div>
<div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop">
<a id="escape-search-link" @click="goBackToDashboard">< zurück zu allen Einträgen</a>
<b-button id="subscribe-btn" type="is-primary" @click="changeSubscribtion"><div id="btn-text"></div></b-button>
<b-button id="subscribe-btn" type="is-primary" @click="changeSubscribtion"><div id="btn-text"></div></b-button><br><br>
<MsgCard
v-for="id in messagelist.slice().reverse()"
:key="id"

+ 1
- 1
public/routes/initGlobals.js View File

@@ -8,7 +8,7 @@ var auth = {},
_messages = {},

// Tag
_taglist = ["efi","wichtig"],
_taglist = [],
_tags = [],
tagArray = [],


+ 8
- 4
public/routes/msgCard.js View File

@@ -14,8 +14,8 @@ Vue.component('MsgCard', {
<i class="material-icons">account_circle</i>
Erstellt von {{ msg.user }}
</div>
<i id="bockmark-not-active" class="material-icons" :key="isActive" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i>
<i id="bockmark-active" class="material-icons" :key="isActive" @click="myFilter(msg._id)" v-else>bookmark</i>
<i id="bockmark-not-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i>
<i id="bockmark-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-else>bookmark</i>
</div>
</div>`,
props: ['msg', 'isBookmark'],
@@ -23,9 +23,9 @@ Vue.component('MsgCard', {
data: function () {
return {
isActive: this.isBookmark,
isActive_: 0,
msgid: this.msg._id,
bookmarkArray: auth.bookmarks,
vueRender: vueRender,
};
},

@@ -68,8 +68,12 @@ Vue.component('MsgCard', {
}*/
},
filterForTag: function (tag) {
console.log("link: " + tag);

//console.log("link: " + tag);
searching(tag);
var btnString = "#" + tag + " abonnieren";
$("#btn-text").text(btnString);
$("#subscribe-btn").css("visibility", "visible");
},
isBookmarkActive: function (msgid) {
//console.log("isBookmarkActive(): " + msgid);

+ 4
- 1
public/search.js View File

@@ -99,7 +99,10 @@ function get_insert_tag(id) {
function searching(searchtext) {
_isSearchActiv = true;
$("#escape-search-link").css("visibility", "visible");
if(_taglist.indexOf(searchtext.replace(/#/g, '')) > -1){
//console.log(_tags);
console.log(data);

if(data.indexOf(searchtext) > -1){
var btnString = "#" + searchtext.replace(/#/g, '') + " abonnieren";
$("#btn-text").text(btnString);
$("#subscribe-btn").css("visibility", "visible");

Loading…
Cancel
Save