Merge remote-tracking branch 'origin/developer' into developer
# Conflicts: # public/routes/createMessage.js # public/routes/files.js
This commit is contained in:
commit
b62927c28d
2
node_modules/lodash/core.min.js
generated
vendored
2
node_modules/lodash/core.min.js
generated
vendored
@ -26,4 +26,4 @@ return t(n),n},o.thru=function(n,t){return t(n)},o.toArray=function(n){return M(
|
||||
},o.isDate=function(n){return H(n)&&"[object Date]"==hn.call(n)},o.isEmpty=function(t){return M(t)&&(Nn(t)||L(t)||U(t.splice)||n(t))?!t.length:!_n(t).length},o.isEqual=function(n,t){return b(n,t)},o.isFinite=function(n){return typeof n=="number"&&gn(n)},o.isFunction=U,o.isNaN=function(n){return K(n)&&n!=+n},o.isNull=function(n){return null===n},o.isNumber=K,o.isObject=V,o.isRegExp=function(n){return H(n)&&"[object RegExp]"==hn.call(n)},o.isString=L,o.isUndefined=function(n){return n===Z},o.last=function(n){
|
||||
var t=null==n?0:n.length;return t?n[t-1]:Z},o.max=function(n){return n&&n.length?a(n,X,v):Z},o.min=function(n){return n&&n.length?a(n,X,_):Z},o.noConflict=function(){return on._===this&&(on._=vn),this},o.noop=function(){},o.reduce=C,o.result=function(n,t,r){return t=null==n?Z:n[t],t===Z&&(t=r),U(t)?t.call(n):t},o.size=function(n){return null==n?0:(n=M(n)?n:_n(n),n.length)},o.some=function(n,t,r){return t=r?Z:t,E(n,g(t))},o.uniqueId=function(n){var t=++sn;return Q(n)+t},o.each=z,o.first=q,Y(o,function(){
|
||||
var n={};return s(o,function(t,r){pn.call(o.prototype,r)||(n[r]=t)}),n}(),{chain:false}),o.VERSION="4.17.15",mn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:an)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);o.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Nn(u)?u:[],n)}return this[r](function(r){return t.apply(Nn(r)?r:[],n);
|
||||
})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this);
|
||||
})}}),o.prototype.toJSON=o.prototype.valueOf=o.prototype.value=function(){return w(this.__wrapped__,this.__actions__)},typeof define=="function"&&typeof define.amd=="object"&&define.amd?(on._=o, define(function(){return o})):cn?((cn.exports=o)._=o,un._=o):on._=o}).call(this);
|
||||
|
2
node_modules/lodash/index.js
generated
vendored
2
node_modules/lodash/index.js
generated
vendored
@ -1 +1 @@
|
||||
module.exports = require('./lodash');
|
||||
module.exports = require('./lodash');
|
||||
|
2
node_modules/lodash/lodash.min.js
generated
vendored
2
node_modules/lodash/lodash.min.js
generated
vendored
@ -134,4 +134,4 @@ return!i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({func:Qe,args:
|
||||
n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c<a;){var l=o[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=Ci(n,f+s);break;case"takeRight":f=Ui(f,n-s)}}if(n={start:f,end:n},o=n.start,f=n.end,n=f-o,o=u?f:o-1,f=this.__iteratees__,c=f.length,a=0,l=Ci(n,this.__takeCount__),!e||!u&&i==n&&l==n)return wr(t,this.__actions__);
|
||||
e=[];n:for(;n--&&a<l;){for(o+=r,u=-1,i=t[o];++u<c;){var h=f[u],s=h.type,h=(0,h.iteratee)(i);if(2==s)i=h;else if(!h){if(1==s)continue n;break n}}e[a++]=i}return e},An.prototype.at=To,An.prototype.chain=function(){return Ye(this)},An.prototype.commit=function(){return new On(this.value(),this.__chain__)},An.prototype.next=function(){this.__values__===T&&(this.__values__=mu(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){
|
||||
for(var t,r=this;r instanceof En;){var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head,
|
||||
wi&&(An.prototype[wi]=Xe),An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this);
|
||||
wi&&(An.prototype[wi]=Xe),An}();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($n._=rt, define(function(){return rt})):Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt}).call(this);
|
||||
|
@ -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,12 +100,15 @@ const CreateMsgRouter = {
|
||||
$.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]);
|
||||
console.log("DATA: "+data);
|
||||
if(data == ""){
|
||||
_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) {
|
||||
@ -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