Merge remote-tracking branch 'origin/developer' into developer
# Conflicts: # public/routes/createMessage.js # public/routes/files.js
This commit is contained in:
commit
b62927c28d
@ -101,6 +101,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
el: '#api',
|
||||
@ -111,6 +112,7 @@
|
||||
// Locally registered variables
|
||||
auth: auth,
|
||||
},
|
||||
|
||||
computed:{
|
||||
// Methods to change data appearance, does cache results
|
||||
},
|
||||
@ -120,6 +122,7 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<!-- NOTE: Call SW registration -->
|
||||
<script src="registerSW.js"></script>
|
||||
|
||||
|
@ -1,9 +1,4 @@
|
||||
var tagArray = [];
|
||||
const data=[
|
||||
'th',
|
||||
'efi',
|
||||
'wichtig',
|
||||
];
|
||||
const CreateMsgRouter = {
|
||||
template: `
|
||||
<div class="content">
|
||||
@ -22,12 +17,12 @@ const CreateMsgRouter = {
|
||||
<b-taginput
|
||||
id="tag"
|
||||
v-model="selected"
|
||||
:data=taglist
|
||||
:data="filteredDataArray"
|
||||
autocomplete
|
||||
allow-new:false
|
||||
icon="label"
|
||||
placeholder="#"
|
||||
@typing="getFilteredTags"
|
||||
|
||||
@input="saveTagsToArray">
|
||||
</b-taginput>
|
||||
</b-field>
|
||||
@ -47,9 +42,20 @@ const CreateMsgRouter = {
|
||||
auth: auth,
|
||||
isDisabled: false,
|
||||
selected: [],
|
||||
searchtext : "",
|
||||
taglist: data,
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
filteredDataArray() {
|
||||
return this.taglist.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.indexOf(this.searchtext.toLowerCase()) >= 0
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
saveTagsToArray: function() {
|
||||
tagArray = this.selected;
|
||||
@ -94,6 +100,8 @@ const CreateMsgRouter = {
|
||||
$.ajax({url: "api/tag/ids",method: "GET"})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
console.log("DATA: "+data);
|
||||
if(data == ""){
|
||||
_taglist.splice(0, _taglist.length);
|
||||
_taglist.push.apply(_taglist, jd);
|
||||
console.log("tag: jd: " + jd);
|
||||
@ -102,6 +110,7 @@ const CreateMsgRouter = {
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
@ -120,17 +129,9 @@ const CreateMsgRouter = {
|
||||
userField.prop('disabled',false);
|
||||
}
|
||||
|
||||
this.list_tags();
|
||||
//this.list_tags();
|
||||
if ($(this).bootstrapMaterialDesign)
|
||||
$(this).bootstrapMaterialDesign();
|
||||
},
|
||||
};
|
||||
|
||||
function get_insert_tag(id){
|
||||
$.ajax({ url: "api/tag/id/"+id, method: "GET" }).done(function (tag) {
|
||||
data.push("#" + tag.name);
|
||||
console.log("Array:"+this.data);
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||
})
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ var tagArray = [];
|
||||
const FileRouter = {
|
||||
template: `
|
||||
<div class="content">
|
||||
|
||||
<div class="column is-four-fifths-desktop pull-right-sm">
|
||||
<h4>Erweiterte Suche</h4>
|
||||
<b-field label="Suche nach">
|
||||
@ -23,16 +22,16 @@ const FileRouter = {
|
||||
</b-field>
|
||||
|
||||
<b-field v-if="selectedOptions=='tags'">
|
||||
<b-autocomplete rounded v-model="searchtext"
|
||||
<b-autocomplete v-model="searchtext"
|
||||
:data="filteredDataArray"
|
||||
placeholder="suche..." icon="magnify"
|
||||
placeholder="#" icon="label"
|
||||
@select="option => selected = option">
|
||||
</b-autocomplete>
|
||||
</b-field>
|
||||
|
||||
<b-button type="is-primary" @click="search">SUCHE</b-button>
|
||||
|
||||
<div id="om-msg-cards">
|
||||
<div id="om-msg-cards" v-if="isExtendedSearch==true">
|
||||
<MsgCard
|
||||
v-for="id in messagelist.slice().reverse()"
|
||||
:key="id"
|
||||
@ -40,7 +39,6 @@ const FileRouter = {
|
||||
></MsgCard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
`,
|
||||
data: function () {
|
||||
@ -51,6 +49,7 @@ const FileRouter = {
|
||||
taglist: data,
|
||||
messagelist: _messagelist,
|
||||
messages: _messages,
|
||||
isExtendedSearch: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -67,10 +66,6 @@ const FileRouter = {
|
||||
list_messages: function () {
|
||||
messages();
|
||||
},
|
||||
saveTagsToArray: function () {
|
||||
tagArray = this.selected;
|
||||
console.info(tagArray);
|
||||
},
|
||||
getFilteredTags(text) {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
@ -78,7 +73,6 @@ const FileRouter = {
|
||||
.toLowerCase()
|
||||
.indexOf(text.toLowerCase()) >= 0
|
||||
})
|
||||
this.search();
|
||||
},
|
||||
list_tags: function () {
|
||||
$.ajax({
|
||||
@ -87,6 +81,7 @@ const FileRouter = {
|
||||
})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
if(data == ""){
|
||||
_taglist.splice(0, _taglist.length);
|
||||
_taglist.push.apply(_taglist, jd);
|
||||
console.log("tag: jd: " + jd);
|
||||
@ -95,6 +90,7 @@ const FileRouter = {
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
@ -105,6 +101,7 @@ const FileRouter = {
|
||||
},
|
||||
search: function () {
|
||||
searching(this.searchtext);
|
||||
this.isExtendedSearch=true;
|
||||
},
|
||||
list_messages: function () {
|
||||
messages();
|
||||
@ -112,7 +109,7 @@ const FileRouter = {
|
||||
},
|
||||
mounted: function () {
|
||||
//this.search();
|
||||
this.list_tags();
|
||||
//this.list_tags();
|
||||
//this.list_messages();
|
||||
},
|
||||
};
|
||||
|
@ -1,11 +1,7 @@
|
||||
var isSearchActive = false,
|
||||
tagArray = ["lorem"];
|
||||
|
||||
const dat=[
|
||||
'th',
|
||||
'efi',
|
||||
'wichtig',
|
||||
],
|
||||
const data=[],
|
||||
search_data = [];
|
||||
|
||||
Vue.component('search',{
|
||||
@ -27,7 +23,7 @@ Vue.component('search',{
|
||||
return{
|
||||
searchtext: "",
|
||||
selected: [],
|
||||
taglist: dat,
|
||||
taglist: data,
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -42,7 +38,7 @@ Vue.component('search',{
|
||||
},
|
||||
methods: {
|
||||
getFilteredTags(text) {
|
||||
this.taglist = dat.filter((option) => {
|
||||
this.taglist = data.filter((option) => {
|
||||
return option
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
@ -64,6 +60,7 @@ Vue.component('search',{
|
||||
$.ajax({url: "api/tag/ids", method: "GET"})
|
||||
.done(jd => {
|
||||
// NICHT SO wg. Vue: _messagelist = jd;
|
||||
if(data == ""){
|
||||
_taglist.splice(0, _taglist.length);
|
||||
_taglist.push.apply(_taglist, jd);
|
||||
// console.log("tag: jd: " + jd);
|
||||
@ -72,6 +69,7 @@ Vue.component('search',{
|
||||
get_insert_tag(jd[e]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}).fail(function (e, f, g) {
|
||||
console.log("err: " + e + f + g);
|
||||
});
|
||||
@ -96,7 +94,7 @@ function get_insert_tag(id) {
|
||||
url: "api/tag/id/" + id,
|
||||
method: "GET"
|
||||
}).done(function(tag) {
|
||||
dat.push("#" + tag.name);
|
||||
data.push("#" + tag.name);
|
||||
}).fail(function(e, f, g) {
|
||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||
})
|
||||
|
@ -59,7 +59,7 @@ const dbs = {
|
||||
get: function(req, res) {
|
||||
model.Messages.find(
|
||||
{$text: {$search: req.params.phrase}})
|
||||
.sort({tag:1, user:1, message:1, subject:1})
|
||||
.sort({tag:-1})
|
||||
.exec().then(results => {
|
||||
//selects id from message:
|
||||
var parsed = [];
|
||||
|
Loading…
x
Reference in New Issue
Block a user