diff --git a/public/index.html b/public/index.html index 4c99c4e..71de540 100644 --- a/public/index.html +++ b/public/index.html @@ -2,81 +2,81 @@ - - - - - - + + + + + + - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + - + - + - - + + - + - - - - + + + + - - + + - + @@ -85,12 +85,12 @@ - - - + + + - OHM News + OHM News @@ -100,15 +100,8 @@
-
+
- - - - - - - - - - - - + + + + + + + + + + diff --git a/public/routes/files.js b/public/routes/files.js index d255a42..64e32d8 100644 --- a/public/routes/files.js +++ b/public/routes/files.js @@ -1,5 +1,4 @@ var tagArray = []; -const data=[]; const FileRouter = { template: ` @@ -21,86 +20,95 @@ const FileRouter = { - - - + + + - SUCHE + SUCHE +
+ +
`, data: function () { - return { + return { + searchtext: "", selectedOptions: [], - selected: [], - taglist: data, + selected: [], + taglist: data, + messagelist: _messagelist, + messages: _messages, + } + }, + computed: { + filteredDataArray() { + return this.taglist.filter((option) => { + return option + .toString() + .toLowerCase() + .indexOf(this.searchtext.toLowerCase()) >= 0 + }) } }, methods: { - saveTagsToArray: function() { - tagArray = this.selected; + list_messages: function () { + messages(); + }, + saveTagsToArray: function () { + tagArray = this.selected; console.info(tagArray); }, - createMsg: function () { - var _subject = $("#subject").val(); - var _message = $("#message").val(); - var _tag = tagArray; - var _user = $("#user").val(); - //console.log("Message Created: " + _tag + " " + _message + " " + _user); - $.ajax({ - url: "api/msg", - data: { - subject: _subject, - message: _message, - user: _user, - tag: _tag - }, - method: "POST" - }).done(have_result).fail(have_error); - - function have_result(res) { - //console.log(res); - router.push('/home') - } - - function have_error(err) { - console.log("error: " + err.responseText); - console.log(err); - } - }, - getFilteredTags(text) { - this.taglist = data.filter((option) => { - return option - .toString() - .toLowerCase() - .indexOf(text.toLowerCase()) >= 0 - }) + getFilteredTags(text) { + this.taglist = data.filter((option) => { + return option + .toString() + .toLowerCase() + .indexOf(text.toLowerCase()) >= 0 + }) + this.search(); }, 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]); - } + $.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); - }); - } + } + }).fail(function (e, f, g) { + console.log("err: " + e + f + g); + }); + }, + saveTagsToArray: function () { + tagArray = this.selected; + console.info(tagArray); + }, + search: function () { + searching(this.searchtext); + }, + list_messages: function () { + messages(); + }, + }, + mounted: function () { + //this.search(); + this.list_tags(); + //this.list_messages(); }, }; diff --git a/public/routes/home.js b/public/routes/home.js index d120b9f..b6e2428 100644 --- a/public/routes/home.js +++ b/public/routes/home.js @@ -23,7 +23,10 @@ const HomeRouter = { tags: "foo" }); },*/ - list_messages: function () { + list_messages: function() { + messages(); + } + /*list_messages: function () { $.ajax({url: "api/msg/ids", method: "GET"}) .done(jd => { // NICHT SO wg. Vue: _messagelist = jd; @@ -35,7 +38,7 @@ const HomeRouter = { get_insert_message(jd[e]); } } - /*if(!($".om-searchbar" = "")){ + if(!($".om-searchbar" = "")){ for (var e in jd) { if (!_messages[jd[e]]) { get_insert_message(jd[e]); @@ -47,11 +50,11 @@ const HomeRouter = { get_search_message(jd[e]); } } - }*/ + } }).fail(function (e, f, g) { console.log("list_msg: err: " + e + f + g); }); - } + }*/ }, mounted: function () { diff --git a/public/routes/msgCard.js b/public/routes/msgCard.js index de5f075..720249c 100644 --- a/public/routes/msgCard.js +++ b/public/routes/msgCard.js @@ -5,8 +5,8 @@ Vue.component('MsgCard', { {{ msg.message }}

- - #{{ tag }} +