Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6b7389201 | ||
|
|
5ccde1e34c | ||
|
|
8e018ad74a | ||
|
|
9e3981a7b1 | ||
|
|
f727a5c44a | ||
|
|
1165918cd6 | ||
|
|
b891d8f516 | ||
|
|
0a3a45107a | ||
|
|
90c5362a57 | ||
|
|
675b9051dc | ||
|
|
e063535127 | ||
|
|
2686af2208 | ||
|
|
81e6a60def | ||
|
|
389a744ebe | ||
|
|
84e73466e1 | ||
|
|
31ba4a0b8b | ||
|
|
dda5e89990 | ||
|
|
6a69bbcaf7 | ||
|
|
577f041928 | ||
|
|
285249254a | ||
|
|
9f9d3c1480 | ||
|
|
9a16ed0480 | ||
|
|
ce740b61ec | ||
|
|
499f0764da | ||
|
|
bac8786ab4 | ||
|
|
6529b1d937 | ||
|
|
2d4850520d | ||
|
|
b1d0a0f095 | ||
|
|
ae5360386a | ||
|
|
85bca37a8c | ||
|
|
a6dd34cf81 | ||
|
|
9eaf71ec3d | ||
|
|
6eb741760f | ||
|
|
3550f1558b | ||
|
|
b62927c28d | ||
|
|
0f06d8fcd7 | ||
|
|
613041d5cb | ||
|
|
783938821c | ||
|
|
1f6261dba0 | ||
|
|
4aa5856fbc | ||
|
|
d003166e33 | ||
|
|
0097de5122 | ||
|
|
5a4faca86f |
No files matched your search
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 96 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 99 KiB |
|
After Width: | Height: | Size: 599 KiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 165 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 59 KiB |
@@ -0,0 +1,361 @@
|
|||||||
|
@online{spa:1,
|
||||||
|
author = {t3n},
|
||||||
|
title = {Was ist eigentlich eine Single-Page-Webanwendung?},
|
||||||
|
month = {04},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://t3n.de/news/single-page-webanwendung-1023623/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{spa:2,
|
||||||
|
author = {Nebil Aboobacker},
|
||||||
|
title = {Was ist eine Single Page Application (SPA)?},
|
||||||
|
month = {05},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://www.yuhiro.de/was-ist-eine-single-page-application-spa/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue,
|
||||||
|
author = {Marc Teufel},
|
||||||
|
title = {Vue.js Tutorial: So entwickelt man Komponenten mit Vue.js},
|
||||||
|
month = {07},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://entwickler.de/online/javascript/einfuehrung-vuejs-vue-579851816.html},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:warum,
|
||||||
|
author = {Verena Sappelt},
|
||||||
|
title = {Vue.js – Vorteile: Das Beste aus zwei Welten},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.ppw.de/blog/vue-js-vorteile-das-beste-aus-zwei-welten/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router,
|
||||||
|
author = {Said Hayani},
|
||||||
|
title = {How to use routing in Vue.js to create a better user experience},
|
||||||
|
month = {06},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://medium.freecodecamp.org/how-to-use-routing-in-vue-js-to-create-a-better-user-experience-98d225bbcdd9},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router2,
|
||||||
|
title = {Vue Router - Getting Started},
|
||||||
|
month = {01},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://router.vuejs.org/guide/#javascript},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{vue:router3,
|
||||||
|
author = {Raymond Camden},
|
||||||
|
title = {Working with Routes in Vue.js},
|
||||||
|
month = {012},
|
||||||
|
year = {2017},
|
||||||
|
url = {https://www.raymondcamden.com/2017/11/12/working-with-routes-in-vue},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api2,
|
||||||
|
author = {Björn Behrendt},
|
||||||
|
title = {Application-Programming-Interface (API)},
|
||||||
|
month = {06},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://www.gruenderszene.de/lexikon/begriffe/application-programming-interface-api?interstitial},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{scrib,
|
||||||
|
title = {Scribble},
|
||||||
|
month = {08},
|
||||||
|
year = {2017},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Scribble},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{md,
|
||||||
|
title = {Material Design},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Material_Design},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{md2,
|
||||||
|
author = {Google},
|
||||||
|
title = {Homepage Material Design},
|
||||||
|
url = {https://material.io},
|
||||||
|
note = {(o.D.), Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bootstrap,
|
||||||
|
author = {Federico Zivolo and Bootstrap contributors},
|
||||||
|
title = {Bootstrap Material Design},
|
||||||
|
month = {08},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://fezvrasta.github.io/bootstrap-material-design/},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{less,
|
||||||
|
author = {Alexis Sellier },
|
||||||
|
title = {LESS - Die dynamische Stylesheet Sprache},
|
||||||
|
month = {01},
|
||||||
|
year = {2013},
|
||||||
|
url = {http://www.lesscss.de},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{ajax1,
|
||||||
|
author = {Jesse James Garret},
|
||||||
|
title = {Ajax: A New Approach to Web Applications},
|
||||||
|
month = {07},
|
||||||
|
year = {2008},
|
||||||
|
url = {https://web.archive.org/web/20080702075113/http://www.adaptivepath.com/ideas/essays/archives/000385.php},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{ajax2,
|
||||||
|
author = {Matthias Hertel},
|
||||||
|
title = {The AJAX Engine},
|
||||||
|
month = {02},
|
||||||
|
year = {2007},
|
||||||
|
url = {http://www.mathertel.de/AJAXEngine/#view=Home},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@book{ajax3,
|
||||||
|
author = {David Sawyer McFarland},
|
||||||
|
title = {JavaScript \& jQuery - the missing manual},
|
||||||
|
year = {2012},
|
||||||
|
publisher = {O'Reilly Media, inc.},
|
||||||
|
address = {1005 Gravenstein Highway North, Sebastopol, CA 95472},
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api,
|
||||||
|
title = {Programmierschnittstelle},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Programmierschnittstelle},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{rest,
|
||||||
|
author = {Thomas Bayer},
|
||||||
|
title = {REST Web Services},
|
||||||
|
month = {11},
|
||||||
|
year = {2002},
|
||||||
|
url = {https://www.oio.de/public/xml/rest-webservices.htm},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{mongo,
|
||||||
|
title = {What is MongoDB?},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.mongodb.com/what-is-mongodb},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{mongoose,
|
||||||
|
author = {Nick Karnik},
|
||||||
|
title = {Introduction to Mongoose for MongoDB},
|
||||||
|
month = {02},
|
||||||
|
year = {2018},
|
||||||
|
url = {https://medium.freecodecamp.org/introduction-to-mongoose-for-mongodb-d2a7aa593c57},
|
||||||
|
note = {Zuletzt besucht am 26.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{Bear,
|
||||||
|
author = {Sevilleja, Chris},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
title = {Build a RESTful API Using Node and Express 4},
|
||||||
|
url = {https://scotch.io/tutorials/build-a-restful-api-using-node-and-express-4},
|
||||||
|
note = {Zuletzt besucht am 01.03.219}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{gitefi,
|
||||||
|
author = {Matthias Hopf},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
title = {Git efi},
|
||||||
|
url = {https://git.efi.th-nuernberg.de/gitea/hopfma/om/wiki/_pages},
|
||||||
|
note = {Zuletzt besucht am 25.02.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{Powtoon,
|
||||||
|
title = {Powtoon - Brings Awesomeness to your presentations},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.powtoon.com/my-powtoons/#/},
|
||||||
|
note = {Zuletzt besucht am 01.03.219}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@online{Risingstack,
|
||||||
|
author = {Gergely Nemeth},
|
||||||
|
year = {2017},
|
||||||
|
title = {10 Best Practices for Writing Node.js REST APIs | @RisingStack},
|
||||||
|
url = {https://blog.risingstack.com/10-best-practices-for-writing-node-js-rest-apis/},
|
||||||
|
note = {Zuletzt besucht am 01.03.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{trello:uri,
|
||||||
|
author = {ATLASSIAN},
|
||||||
|
title = {Trello},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://trello.com/home},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
@online{trello:price,
|
||||||
|
author = {ATLASSIAN},
|
||||||
|
title = {Trello-Preisliste},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://trello.com/pricing},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bitrix:uri,
|
||||||
|
author = {Bitrix, Inc.},
|
||||||
|
title = {Führende Kostenlose Plattform Für Kommunikation Und Zusammenarbeit Mit Aufgaben, Projekten, CRM, Dokumenten, Chat u.v.a.m.},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.bitrix24.de/},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
@online{bitrix:feature,
|
||||||
|
author = {Bitrix, Inc.},
|
||||||
|
title = {Bitrix24: Führende kostenlose Software zum Projektmanagement},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://www.bitrix24.de/tools/tasks_and_projects/},
|
||||||
|
note = {(Zuletzt besucht am 25.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:staleWhileRevalidate,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#stale-while-revalidate},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:cacheBackToNetwork,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#cache-falling-back-to-network},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:networkBackToCache,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#network-falling-back-to-cache},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{sw:cacheThenNetwork,
|
||||||
|
author = {Jake Archibald},
|
||||||
|
title = {The offline cookbook - JakeArchibald.com},
|
||||||
|
month = {12},
|
||||||
|
year = {2014},
|
||||||
|
url = {https://jakearchibald.com/2014/offline-cookbook/#cache-then-network},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{api:doku,
|
||||||
|
author = {Erik Römmelt},
|
||||||
|
title = {Build, Collaborate \& Integrate APIs | SwaggerHub - OHM News API},
|
||||||
|
month = {02},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://app.swaggerhub.com/apis-docs/roemmelter/om_api/1.0},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{dev:homescreen,
|
||||||
|
author = {Pete LePage},
|
||||||
|
title = {Your First Progressive Web App | Web Fundamentals | Google Developers},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/#support_native_integration},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{dev:codeSource,
|
||||||
|
author = {Pete LePage},
|
||||||
|
title = {Your First Progressive Web App | Web Fundamentals | Google Developers},
|
||||||
|
month = {01},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://developers.google.com/web/fundamentals/codelabs/your-first-pwapp/},
|
||||||
|
note = {(Zuletzt besucht am 26.02.2019)}
|
||||||
|
}
|
||||||
|
|
||||||
|
%Senta:
|
||||||
|
@online{q1,
|
||||||
|
author = {Rafael Beraldo},
|
||||||
|
title = {Buefy Autocomplete},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://buefy.org/documentation/autocomplete/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{q2,
|
||||||
|
author = {MongoDB,Inc},
|
||||||
|
title = {Mongodb Manual Text Index},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://docs.mongodb.com/manual/core/index-text/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{q3,
|
||||||
|
author = {MongoDB,Inc},
|
||||||
|
title = {Mongodb Manual Text Search},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://docs.mongodb.com/manual/text-search/},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@book{q4,
|
||||||
|
title = {JavaScript \& jQuery - the missing manual},
|
||||||
|
author = {D. S. McFarland},
|
||||||
|
year = {2012},
|
||||||
|
publisher = {O’Reilly Media, inc.}
|
||||||
|
}
|
||||||
|
%Edwina:
|
||||||
|
@online{vuetify,
|
||||||
|
author = {Vuetify},
|
||||||
|
title = {Why Vuetify?},
|
||||||
|
year = {2016-2019},
|
||||||
|
url = {https://vuetifyjs.com/en/getting-started/why-vuetify},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{buefy,
|
||||||
|
author = {Stackshare},
|
||||||
|
title = {Buefy vs. Vuetify},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://stackshare.io/stackups/buefy-vs-vuetify},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
|
@online{bulma,
|
||||||
|
author = {Wikipedia},
|
||||||
|
title = {Bulma (Framework)},
|
||||||
|
day = {23},
|
||||||
|
month = {05},
|
||||||
|
year = {2019},
|
||||||
|
url = {https://de.wikipedia.org/wiki/Bulma_(Framework)},
|
||||||
|
note = {Zuletzt besucht am 07.08.2019}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
var db = db.getSiblingDB('omdb');
|
var db = db.getSiblingDB('om');
|
||||||
|
|
||||||
// Insert data in collections
|
|
||||||
load('mong_msg.js');
|
|
||||||
load('mong_tag.js');
|
|
||||||
load('mong_usr.js');
|
|
||||||
|
|
||||||
// Delete all collections + all records
|
// Delete all collections + all records
|
||||||
//db.messages.drop(); db.tags.drop(); db.user.drop(); db.sessions.drop()
|
//db.messages.deleteMany({});
|
||||||
|
//db.tags.deleteMany({});
|
||||||
|
//db.users.deleteMany({});
|
||||||
|
//db.sessions.deleteMany({});
|
||||||
|
|
||||||
|
// Insert data in collections
|
||||||
|
//load('mong_msg.js');
|
||||||
|
load('mong_tag.js');
|
||||||
|
load('mong_usr.js');
|
||||||
|
|
||||||
// Print all collections + records count
|
// Print all collections + records count
|
||||||
var collections = db.getCollectionNames();
|
var collections = db.getCollectionNames();
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
db.tags.insert([
|
db.tags.insert([
|
||||||
{"name":"Lorem"},{"name":"fugiat"},{"name":"aliqua"},{"name":"consequat"},{"name":"mollit"},{"name":"aet"},{"name":"consectetur"},{"name":"dolore"},{"name":"nulla"},{"name":"tempor"},{"name":"veniam"},{"name":"ipsum"},{"name":"adipisicing"},{"name":"qui"},{"name":"sint"},{"name":"ullamco"},{"name":"incididunt"},{"name":"nisi"},{"name":"sit"},{"name":"minim"},{"name":"labore"},{"name":"sunt"},{"name":"in"}
|
{"name":"efi"},{"name":"wichtig"},{"name":"Wintersemester19/20"},{"name":"Rückmeldung"},{"name":"bme6"},{"name":"Mkz"},{"name":"Freizeit"},{"name":"Prüfungsanmeldung"},{"name":"THNürnberg"},{"name":"Prüfung"},{"name":"Stundenplan"}
|
||||||
])
|
])
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
db.user.insert([
|
db.users.insert([
|
||||||
// author,OHMNEWS2019
|
// User: author, Pwd: author
|
||||||
{"_id":"author","name":"Test Author","type":"author","roles":["user","author"],"hash":"sha256","salt":"cy5CkPrplcEze6o4psURhw==","pwd":"Gc8ozlxjEGITkS+fW9tz2xLROzws44s04EOCWuP04qE=","tags":["wichtig","th"],"bookmarks":["th"],},
|
{"_id":"author","name":"Author","type":"PF@EFI;","roles":{"user":true,"author":true},"hash":"sha256","salt":"SIzKNsNKsCRVr8a9U90q6A==","pwd":"HZly68TSAKHioz6Kz0QCbXVTHpT6hMmabUbFYVlCMeE=","abos":[],"bookmarks":[]},
|
||||||
// admin,oZuse1
|
// User: admin, Pwd: SwenMho
|
||||||
{"_id":"admin","name":"Test Admin","type":"admin","roles":["user","author","admin"],"hash":"sha256","salt":"PoIUHbDp7tP34ji31iQ0zw==","pwd":"mJpIfIksYs6LJJwYRBemFKqR6TacsSl2E0ZtpO1GMuk=","tags":["wichtig","th"],"bookmarks":["wichtig"],},
|
// {"_id":"admin","name":"Test Admin","type":"MA@AMP;","roles":'{"user":true,"author":true,"admin":true}',"hash":"sha256","salt":"z3PNXGmQaWvaT7m2ZlT+0w==","pwd":"nfUfNv032J745xj3Hzya3Mkk43Dz/H0BmNTZhtx8UM0=","abos":["veniam","ipsum"],"bookmarks":[],},
|
||||||
])
|
])
|
||||||
|
|
||||||
//var c = require('./server/crypto.js'),
|
//var c = require('./server/crypto.js'),
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<script src="lib/jquery-3.3.1.min.js"></script>
|
<script src="lib/jquery-3.3.1.min.js"></script>
|
||||||
|
|
||||||
<!-- NOTE: Include .js Routes -->
|
<!-- NOTE: Include .js Routes -->
|
||||||
|
<script src="routes/initGlobals.js"></script>
|
||||||
<script src="routes/auth.js"></script><!-- Must load before profile.js -->
|
<script src="routes/auth.js"></script><!-- Must load before profile.js -->
|
||||||
<script src="routes/home.js"></script>
|
<script src="routes/home.js"></script>
|
||||||
<script src="routes/files.js"></script>
|
<script src="routes/files.js"></script>
|
||||||
@@ -76,9 +77,6 @@
|
|||||||
<script src="routes/bookmark.js"></script>
|
<script src="routes/bookmark.js"></script>
|
||||||
<script src="routes/profil.js"></script>
|
<script src="routes/profil.js"></script>
|
||||||
<script src="routes/msgCard.js"></script>
|
<script src="routes/msgCard.js"></script>
|
||||||
<script src="routes/messageData.js"></script>
|
|
||||||
<script src="routes/tagData.js"></script>
|
|
||||||
<script src="routes/majorData.js"></script>
|
|
||||||
<script src="routes/profilCard.js"></script>
|
<script src="routes/profilCard.js"></script>
|
||||||
<script src="routes/navRoutes.js"></script>
|
<script src="routes/navRoutes.js"></script>
|
||||||
<script src="search.js"></script>
|
<script src="search.js"></script>
|
||||||
@@ -89,14 +87,14 @@
|
|||||||
<div class="om-header">
|
<div class="om-header">
|
||||||
<a class="logo-img is-hidden-desktop" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
<a class="logo-img is-hidden-desktop" href="index.html"><img src="img/app_icon.png" width=45px height=45px></a>
|
||||||
<a class="logo-img is-hidden-touch" href="index.html"><img src="img/app_icon_desk.png" width=100px height=100px></a>
|
<a class="logo-img is-hidden-touch" href="index.html"><img src="img/app_icon_desk.png" width=100px height=100px></a>
|
||||||
<search></search>
|
<search :key="vueRender.search"></search>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="om-content">
|
<div class="om-content">
|
||||||
<div id=xxx></div>
|
<div id=xxx></div>
|
||||||
<nav-router></nav-router>
|
<nav-router :key="auth.user"></nav-router>
|
||||||
<router-view :key="auth.user"></router-view>
|
<router-view :key="vueRender.key"></router-view>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -104,22 +102,14 @@
|
|||||||
new Vue({
|
new Vue({
|
||||||
router,
|
router,
|
||||||
el: '#api',
|
el: '#api',
|
||||||
components: {
|
|
||||||
// Locally registered components
|
|
||||||
},
|
|
||||||
data: {
|
data: {
|
||||||
// Locally registered variables
|
vueRender : vueRender,
|
||||||
auth: auth,
|
auth: auth,
|
||||||
},
|
},
|
||||||
computed:{
|
|
||||||
// Methods to change data appearance, does cache results
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// Methods to change data content, run always again
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- NOTE: Call SW registration -->
|
<!-- NOTE: Call SW registration -->
|
||||||
<script src="registerSW.js"></script>
|
<script src="registerSW.js"></script>
|
||||||
|
|
||||||
|
|||||||
@@ -4148,7 +4148,7 @@ a.list-item {
|
|||||||
font-size: 1.5rem; }
|
font-size: 1.5rem; }
|
||||||
|
|
||||||
.menu-list {
|
.menu-list {
|
||||||
line-height: 1.25;
|
line-height: 1.5;
|
||||||
float: left;
|
float: left;
|
||||||
width: 230px;
|
width: 230px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -4161,6 +4161,7 @@ a.list-item {
|
|||||||
color: white; }
|
color: white; }
|
||||||
.menu-list a {
|
.menu-list a {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
padding-bottom: 5px;
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0.5em 0.75em;
|
padding: 0.5em 0.75em;
|
||||||
background-color: #0046a0;
|
background-color: #0046a0;
|
||||||
@@ -4176,9 +4177,8 @@ a.list-item {
|
|||||||
margin: 0.75em;
|
margin: 0.75em;
|
||||||
padding-left: 0.75em;
|
padding-left: 0.75em;
|
||||||
background-color: #0046a0; }
|
background-color: #0046a0; }
|
||||||
.menu-item li a {
|
.menu-item li {
|
||||||
display: block;
|
line-height: 1.5;
|
||||||
padding: 8px 16px;
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
var auth = {};
|
|
||||||
|
|
||||||
function clearAuthState() {
|
function clearAuthState() {
|
||||||
auth.user = ''; // Login name
|
auth.user = ''; // Login name
|
||||||
auth.name = ''; // Full name
|
auth.name = ''; // Full name
|
||||||
auth.type = ''; // type of login (domain specific)
|
|
||||||
auth.mail = ''; // Full mail address
|
auth.mail = ''; // Full mail address
|
||||||
|
auth.type = ''; // type of login (domain specific)
|
||||||
auth.roles = {}; // Role authorizations e.g. {user: true}
|
auth.roles = {}; // Role authorizations e.g. {user: true}
|
||||||
auth.gender = ''; // Gender (e.g. Frau)
|
auth.gender = ''; // Gender (e.g. Frau)
|
||||||
|
auth.abos = []; // Followed tags
|
||||||
|
auth.bookmarks = []; // Ids of bookmarks
|
||||||
}
|
}
|
||||||
clearAuthState();
|
clearAuthState();
|
||||||
|
|
||||||
@@ -20,6 +20,33 @@ function fillAuthState(state) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateUserInDB() {
|
||||||
|
$.ajax({
|
||||||
|
url: "api/usr",
|
||||||
|
data: {
|
||||||
|
_id: auth.user,
|
||||||
|
name: auth.name,
|
||||||
|
mail: auth.mail,
|
||||||
|
type: auth.type,
|
||||||
|
gender: auth.gender,
|
||||||
|
roles: JSON.stringify(auth.roles),
|
||||||
|
abos: JSON.stringify(auth.abos),
|
||||||
|
bookmarks: JSON.stringify(auth.bookmarks),
|
||||||
|
},
|
||||||
|
method: "PUT"
|
||||||
|
}).done(successful_save).fail(failed_save);
|
||||||
|
|
||||||
|
function successful_save(res) {
|
||||||
|
console.info("User-save: Successful.");
|
||||||
|
console.info(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
function failed_save(err) {
|
||||||
|
console.info("User-save: Failed.");
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Login component: Login panel (if not logged in) or Logout element (if logged in)
|
// Login component: Login panel (if not logged in) or Logout element (if logged in)
|
||||||
Vue.component('login-panel', {
|
Vue.component('login-panel', {
|
||||||
template: `
|
template: `
|
||||||
@@ -48,7 +75,7 @@ Vue.component('login-panel', {
|
|||||||
</b-input>
|
</b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-checkbox>Eingeloggt bleiben</b-checkbox>
|
<b-checkbox>Eingeloggt bleiben</b-checkbox>
|
||||||
<div v-if="error" style="color:red;"> Versuche es nochmal.</div>
|
<div v-if="error" :key="error" style="color:red;"> Versuche es nochmal.</div>
|
||||||
</section>
|
</section>
|
||||||
<footer class="modal-card-foot">
|
<footer class="modal-card-foot">
|
||||||
<button class="button" type="button" @click.prevent="$parent.close()">Close</button>
|
<button class="button" type="button" @click.prevent="$parent.close()">Close</button>
|
||||||
@@ -57,16 +84,16 @@ Vue.component('login-panel', {
|
|||||||
</div>`,
|
</div>`,
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
auth: auth,
|
|
||||||
user: '',
|
user: '',
|
||||||
pwd: '',
|
pwd: '',
|
||||||
error: false,
|
error: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
// TODO: Check if enough for session cookie re-login; checkbox
|
// TODO: Check if enough for session cookie re-login; checkbox
|
||||||
// mounted: function() {
|
// Doesn't work
|
||||||
// this.checkData();
|
beforeMount: function() {
|
||||||
// },
|
this.checkData();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
closeLoginPanel: function() {
|
closeLoginPanel: function() {
|
||||||
this.$emit('close-login-panel');
|
this.$emit('close-login-panel');
|
||||||
@@ -94,6 +121,9 @@ Vue.component('login-panel', {
|
|||||||
|
|
||||||
function successful_login(resData) {
|
function successful_login(resData) {
|
||||||
fillAuthState(resData);
|
fillAuthState(resData);
|
||||||
|
// updateUserInDB();
|
||||||
|
auth.abos = [];
|
||||||
|
auth.bookmarks = [];
|
||||||
console.info("Correct credentials");
|
console.info("Correct credentials");
|
||||||
this.closeLoginPanel;
|
this.closeLoginPanel;
|
||||||
|
|
||||||
@@ -103,7 +133,7 @@ Vue.component('login-panel', {
|
|||||||
|
|
||||||
function failed_login(err) {
|
function failed_login(err) {
|
||||||
console.info("Wrong credentials");
|
console.info("Wrong credentials");
|
||||||
this.showError=true;
|
this.error=true;
|
||||||
this.showLoginPanel;
|
this.showLoginPanel;
|
||||||
|
|
||||||
console.log("error: " + err.responseText);
|
console.log("error: " + err.responseText);
|
||||||
@@ -122,6 +152,7 @@ Vue.component('login-panel', {
|
|||||||
function successful_login(res) {
|
function successful_login(res) {
|
||||||
console.info("Re-Auth: Correct credentials");
|
console.info("Re-Auth: Correct credentials");
|
||||||
this.closeLoginPanel;
|
this.closeLoginPanel;
|
||||||
|
vueForceRender('key');
|
||||||
|
|
||||||
//console.log(res);
|
//console.log(res);
|
||||||
router.push('/home')
|
router.push('/home')
|
||||||
@@ -129,17 +160,11 @@ Vue.component('login-panel', {
|
|||||||
|
|
||||||
function failed_login(err) {
|
function failed_login(err) {
|
||||||
console.info("Re-Auth: Wrong credentials");
|
console.info("Re-Auth: Wrong credentials");
|
||||||
this.showError=true;
|
this.error=true;
|
||||||
this.showLoginPanel;
|
this.showLoginPanel;
|
||||||
|
|
||||||
console.log("error: " + err.responseText);
|
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logout: function() {
|
|
||||||
clearAuthState();
|
|
||||||
$.ajax({ url: "api/logout", method: "POST" });
|
|
||||||
this.closeLoginPanel;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -1,120 +1,85 @@
|
|||||||
const BookmarkRouter = {
|
const BookmarkRouter = {
|
||||||
template: `
|
template: `
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="is-hidden-desktop">
|
<div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop">
|
||||||
<div class="bookmark-headline"><h4>Gepeicherte Beiträge</h4></div>
|
<h3>Gespeicherte Nachrichten </h3>
|
||||||
<div class="om-card card">
|
<MsgCard
|
||||||
<h6 class="msg-head">
|
v-for="id in msgDisplay"
|
||||||
<b>Betreff</b>
|
:key="id"
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
:msg="messages[id] || {}"
|
||||||
</h6>
|
:isBookmark="bookmarkArray[id]"
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br><br>
|
></MsgCard>
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 1
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="om-card card">
|
|
||||||
<h6 class="msg-head">
|
|
||||||
<b>Betreff</b>
|
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
|
||||||
</h6>
|
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. <br><br>
|
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 2
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="om-card card">
|
|
||||||
<h6 class="msg-head">
|
|
||||||
<b>Betreff</b>
|
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
|
||||||
</h6>
|
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br><br>
|
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 3
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
|
||||||
<div class="bookmark-headline"><h4>Gepeicherte Beiträge</h4></div>
|
|
||||||
<div class="om-card card">
|
|
||||||
<h6 class="msg-head">
|
|
||||||
<b>Betreff</b>
|
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
|
||||||
</h6>
|
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br><br>
|
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 1
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="om-card card">
|
|
||||||
<h6 class="msg-head">
|
|
||||||
<b>Betreff</b>
|
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
|
||||||
</h6>
|
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. <br><br>
|
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 2
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="om-card card">
|
|
||||||
<h6 class="msg-head">
|
|
||||||
<b>Betreff</b>
|
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
|
||||||
</h6>
|
|
||||||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. <br><br>
|
|
||||||
<a href="#">#beispiel #tag</a>
|
|
||||||
<div class="om-card-footer">
|
|
||||||
<div class="om-user-line">
|
|
||||||
<i class="material-icons">account_circle</i>
|
|
||||||
Erstellt von User 3
|
|
||||||
</div>
|
|
||||||
<i class="material-icons" @click="myFilter" v-if="!isActive">bookmark_border</i>
|
|
||||||
<i class="material-icons" @click="myFilter" v-else="isActive">bookmark</i>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>`,
|
</div>`,
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
|
messagelist: _messagelist,
|
||||||
messages: _messages,
|
messages: _messages,
|
||||||
isActive: false,
|
isActive: true,
|
||||||
|
messageId: '',
|
||||||
|
bookmarkArray: auth.bookmarks,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
msgDisplay: function(){
|
||||||
|
return (this.messagelist.slice().reverse());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
myFilter () {
|
myFilter: function() {
|
||||||
this.isActive = !this.isActive;
|
this.isActive = !this.isActive;
|
||||||
|
},
|
||||||
|
getMessageId: function(){
|
||||||
|
|
||||||
|
},
|
||||||
|
getMessages: function(){
|
||||||
|
var arr = auth.bookmarks;
|
||||||
|
console.log("arr: "+arr+" auth.bookmarks: "+auth.bookmarks);
|
||||||
|
_messagelist.splice(0, _messagelist.length);
|
||||||
|
_messagelist.push.apply(_messagelist, arr);
|
||||||
|
for (var e in arr) {
|
||||||
|
if (!_messages[arr[e]]) {
|
||||||
|
//arr[e] =arr[e].replace(/\[/g, '').replace(/\"/g, '').replace(/\]/g, '')
|
||||||
|
console.log("getinsertmessage: "+ arr[e]);
|
||||||
|
get_insert_message(arr[e]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*var _usrid = auth.user;
|
||||||
|
$.ajax({
|
||||||
|
url: "api/usr/id/" + _usrid,
|
||||||
|
method: "GET"
|
||||||
|
})
|
||||||
|
.done(have_result).fail(have_error);
|
||||||
|
|
||||||
|
function have_result(res) {
|
||||||
|
var str = JSON.stringify(res[0].bookmarks).split(",");
|
||||||
|
_messagelist.splice(0, _messagelist.length);
|
||||||
|
for (var e in str) {
|
||||||
|
if (!_messages[str[e]]) {
|
||||||
|
str[e] =str[e].replace(/\[/g, '').replace(/\"/g, '').replace(/\]/g, '')
|
||||||
|
get_insert_message(str[e]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_messagelist.push.apply(_messagelist, str);
|
||||||
|
//console.log("bookmark str: "+str);
|
||||||
|
}
|
||||||
|
|
||||||
|
function have_error(err) {
|
||||||
|
console.log("error: " + err.responseText);
|
||||||
|
console.log(err);
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
beforeMount: function(){
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted: function (){
|
||||||
|
this.getMessages();
|
||||||
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
@@ -1,19 +1,14 @@
|
|||||||
var tagArray = [];
|
|
||||||
const data=[
|
|
||||||
'th',
|
|
||||||
'efi',
|
|
||||||
'wichtig',
|
|
||||||
];
|
|
||||||
const CreateMsgRouter = {
|
const CreateMsgRouter = {
|
||||||
template: `
|
template: `
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="is-hidden-desktop">
|
<div class="column pull-right-sm is-four-fifths-desktop">
|
||||||
<div id="mobile" class="content card om-card">
|
<div id="mobile" class="om-card card">
|
||||||
<h4>Neue Nachricht erstellen</h4>
|
<h4>Neue Nachricht erstellen</h4>
|
||||||
<b-field>
|
<!--<b-field>
|
||||||
<b-input placeholder="User" id="user"></b-input>
|
<b-input placeholder="User" id="user"></b-input>
|
||||||
</b-field>
|
</b-field>-->
|
||||||
|
|
||||||
|
<label class="label">{{ userName }}</label>
|
||||||
<b-field>
|
<b-field>
|
||||||
<b-input placeholder="Betreff" id="subject"></b-input>
|
<b-input placeholder="Betreff" id="subject"></b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
@@ -22,12 +17,12 @@ const CreateMsgRouter = {
|
|||||||
<b-taginput
|
<b-taginput
|
||||||
id="tag"
|
id="tag"
|
||||||
v-model="selected"
|
v-model="selected"
|
||||||
:data=taglist
|
:data="filteredDataArray"
|
||||||
autocomplete
|
autocomplete
|
||||||
allow-new:false
|
allow-new:false
|
||||||
icon="label"
|
icon="label"
|
||||||
placeholder="#"
|
placeholder="#"
|
||||||
@typing="getFilteredTags"
|
|
||||||
@input="saveTagsToArray">
|
@input="saveTagsToArray">
|
||||||
</b-taginput>
|
</b-taginput>
|
||||||
</b-field>
|
</b-field>
|
||||||
@@ -40,40 +35,6 @@ const CreateMsgRouter = {
|
|||||||
<b-button type="is-primary" @click="createMsg">SENDEN</b-button>
|
<b-button type="is-primary" @click="createMsg">SENDEN</b-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
|
||||||
<div id="desktop" class="content">
|
|
||||||
<h4>Neue Nachricht erstellen</h4>
|
|
||||||
<b-field>
|
|
||||||
<b-input placeholder="User" id="user"></b-input>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-field>
|
|
||||||
<b-input placeholder="Betreff" id="subject"></b-input>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-field label="Tags">
|
|
||||||
<b-taginput
|
|
||||||
id="tag"
|
|
||||||
v-model="selected"
|
|
||||||
:data=taglist
|
|
||||||
autocomplete
|
|
||||||
allow-new:false
|
|
||||||
icon="label"
|
|
||||||
placeholder="#"
|
|
||||||
@typing="getFilteredTags"
|
|
||||||
@input="saveTagsToArray">
|
|
||||||
</b-taginput>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-field>
|
|
||||||
<b-input placeholder="Nachricht" id="message" type="textarea"></b-input>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-button @click="$router.go(-1)">ABBRECHEN</b-button>
|
|
||||||
<b-button type="is-primary" @click="createMsg">SENDEN</b-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>`,
|
</div>`,
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
@@ -81,19 +42,44 @@ const CreateMsgRouter = {
|
|||||||
auth: auth,
|
auth: auth,
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
selected: [],
|
selected: [],
|
||||||
|
searchtext : "",
|
||||||
taglist: data,
|
taglist: data,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed:{
|
||||||
|
filteredDataArray: function() {
|
||||||
|
return this.taglist.filter((option) => {
|
||||||
|
return option
|
||||||
|
.toString()
|
||||||
|
.toLowerCase()
|
||||||
|
.indexOf(this.searchtext.toLowerCase()) >= 0
|
||||||
|
})
|
||||||
|
},
|
||||||
|
userName: function() {
|
||||||
|
return 'User: '+auth.name;
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
saveTagsToArray: function() {
|
saveTagsToArray: function() {
|
||||||
tagArray = this.selected;
|
tagArray = this.selected;
|
||||||
console.info(tagArray);
|
console.info(tagArray);
|
||||||
},
|
},
|
||||||
createMsg: function () {
|
createMsg: function () {
|
||||||
var _subject = $("#subject").val();
|
var _subject = $("#subject").val();
|
||||||
var _message = $("#message").val();
|
var _message = $("#message").val();
|
||||||
var _tag = tagArray;
|
var tmpArr = [];
|
||||||
var _user = auth.name ? auth.name : $("#user").val();
|
tagArray.forEach(function(tag) {
|
||||||
|
console.info(tag);
|
||||||
|
tmpArr.push(tag.replace(/#/g, ''));
|
||||||
|
});
|
||||||
|
tagArray = tmpArr;
|
||||||
|
var _tag = tagArray;
|
||||||
|
var _user = auth.name.split(' ');
|
||||||
|
if (_user.length < 2) {
|
||||||
|
_user = _user[0];
|
||||||
|
} else {
|
||||||
|
_user = _user[1] + ', ' + _user[0];
|
||||||
|
}
|
||||||
//console.log("Message Created: " + _tag + " " + _message + " " + _user);
|
//console.log("Message Created: " + _tag + " " + _message + " " + _user);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "api/msg",
|
url: "api/msg",
|
||||||
@@ -125,9 +111,11 @@ const CreateMsgRouter = {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
list_tags: function () {
|
list_tags: function () {
|
||||||
$.ajax({url: "api/tag/ids",method: "GET"})
|
$.ajax({url: "api/tag/ids",method: "GET"})
|
||||||
.done(jd => {
|
.done(jd => {
|
||||||
// NICHT SO wg. Vue: _messagelist = jd;
|
// NICHT SO wg. Vue: _messagelist = jd;
|
||||||
|
console.log("DATA: "+data);
|
||||||
|
if(data == ""){
|
||||||
_taglist.splice(0, _taglist.length);
|
_taglist.splice(0, _taglist.length);
|
||||||
_taglist.push.apply(_taglist, jd);
|
_taglist.push.apply(_taglist, jd);
|
||||||
console.log("tag: jd: " + jd);
|
console.log("tag: jd: " + jd);
|
||||||
@@ -136,35 +124,16 @@ const CreateMsgRouter = {
|
|||||||
get_insert_tag(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);
|
||||||
}
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
var userField = $('#user');
|
//this.list_tags();
|
||||||
if (auth != null && auth.mail != '') {
|
|
||||||
// userField.prop('placeholder',auth.name);
|
|
||||||
var authorName = auth.name.split(' ');
|
|
||||||
authorName = authorName[1] + ', ' + authorName[0];
|
|
||||||
userField.val(authorName);
|
|
||||||
userField.prop('disabled',true);
|
|
||||||
} else {
|
|
||||||
userField.prop('placeholder','User');
|
|
||||||
userField.prop('disabled',false);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.list_tags();
|
|
||||||
if ($(this).bootstrapMaterialDesign)
|
if ($(this).bootstrapMaterialDesign)
|
||||||
$(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);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
var tagArray = [];
|
|
||||||
|
|
||||||
const FileRouter = {
|
const FileRouter = {
|
||||||
template: `
|
template: `
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<div class="column is-four-fifths-desktop pull-right-sm">
|
||||||
<div class="is-hidden-desktop">
|
|
||||||
<h4>Erweiterte Suche</h4>
|
<h4>Erweiterte Suche</h4>
|
||||||
<b-field label="Suche nach">
|
<b-field label="Suche nach">
|
||||||
<b-select
|
<b-select
|
||||||
@@ -23,16 +20,16 @@ const FileRouter = {
|
|||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
<b-field v-if="selectedOptions=='tags'">
|
<b-field v-if="selectedOptions=='tags'">
|
||||||
<b-autocomplete rounded v-model="searchtext"
|
<b-autocomplete v-model="searchtext"
|
||||||
:data="filteredDataArray"
|
:data="filteredDataArray"
|
||||||
placeholder="suche..." icon="magnify"
|
placeholder="#" icon="label"
|
||||||
@select="option => selected = option">
|
@select="option => selected = option">
|
||||||
</b-autocomplete>
|
</b-autocomplete>
|
||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
<b-button type="is-primary" @click="search">SUCHE</b-button>
|
<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
|
<MsgCard
|
||||||
v-for="id in messagelist.slice().reverse()"
|
v-for="id in messagelist.slice().reverse()"
|
||||||
:key="id"
|
:key="id"
|
||||||
@@ -40,44 +37,6 @@ const FileRouter = {
|
|||||||
></MsgCard>
|
></MsgCard>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
|
||||||
<h4>Erweiterte Suche</h4>
|
|
||||||
<b-field label="Suche nach">
|
|
||||||
<b-select
|
|
||||||
placeholder="Wähle eine Suchform"
|
|
||||||
v-model="selectedOptions">
|
|
||||||
<option value="freeSearch">Freie Suche</option>
|
|
||||||
<option value="subject">Betreff</option>
|
|
||||||
<option value="tags">Tags</option>
|
|
||||||
<option value="text">Nachrichtentext</option>
|
|
||||||
<option value="user">User</option>
|
|
||||||
</b-select>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-field v-if="selectedOptions=='freeSearch'||selectedOptions=='subject'|| selectedOptions=='text' || selectedOptions=='user'">
|
|
||||||
<b-input id="freeSe"></b-input>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-field v-if="selectedOptions=='tags'">
|
|
||||||
<b-autocomplete rounded v-model="searchtext"
|
|
||||||
:data="filteredDataArray"
|
|
||||||
placeholder="suche..." icon="magnify"
|
|
||||||
@select="option => selected = option">
|
|
||||||
</b-autocomplete>
|
|
||||||
</b-field>
|
|
||||||
|
|
||||||
<b-button type="is-primary" @click="search">SUCHE</b-button>
|
|
||||||
|
|
||||||
<div id="om-msg-cards">
|
|
||||||
<MsgCard
|
|
||||||
v-for="id in messagelist.slice().reverse()"
|
|
||||||
:key="id"
|
|
||||||
:msg="messages[id] || {}"
|
|
||||||
></MsgCard>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data: function () {
|
data: function () {
|
||||||
@@ -88,6 +47,7 @@ const FileRouter = {
|
|||||||
taglist: data,
|
taglist: data,
|
||||||
messagelist: _messagelist,
|
messagelist: _messagelist,
|
||||||
messages: _messages,
|
messages: _messages,
|
||||||
|
isExtendedSearch: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -104,10 +64,6 @@ const FileRouter = {
|
|||||||
list_messages: function () {
|
list_messages: function () {
|
||||||
messages();
|
messages();
|
||||||
},
|
},
|
||||||
saveTagsToArray: function () {
|
|
||||||
tagArray = this.selected;
|
|
||||||
console.info(tagArray);
|
|
||||||
},
|
|
||||||
getFilteredTags(text) {
|
getFilteredTags(text) {
|
||||||
this.taglist = data.filter((option) => {
|
this.taglist = data.filter((option) => {
|
||||||
return option
|
return option
|
||||||
@@ -115,7 +71,6 @@ const FileRouter = {
|
|||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.indexOf(text.toLowerCase()) >= 0
|
.indexOf(text.toLowerCase()) >= 0
|
||||||
})
|
})
|
||||||
this.search();
|
|
||||||
},
|
},
|
||||||
list_tags: function () {
|
list_tags: function () {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -124,6 +79,7 @@ const FileRouter = {
|
|||||||
})
|
})
|
||||||
.done(jd => {
|
.done(jd => {
|
||||||
// NICHT SO wg. Vue: _messagelist = jd;
|
// NICHT SO wg. Vue: _messagelist = jd;
|
||||||
|
if(data == ""){
|
||||||
_taglist.splice(0, _taglist.length);
|
_taglist.splice(0, _taglist.length);
|
||||||
_taglist.push.apply(_taglist, jd);
|
_taglist.push.apply(_taglist, jd);
|
||||||
console.log("tag: jd: " + jd);
|
console.log("tag: jd: " + jd);
|
||||||
@@ -132,6 +88,7 @@ const FileRouter = {
|
|||||||
get_insert_tag(jd[e]);
|
get_insert_tag(jd[e]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).fail(function (e, f, g) {
|
}).fail(function (e, f, g) {
|
||||||
console.log("err: " + e + f + g);
|
console.log("err: " + e + f + g);
|
||||||
});
|
});
|
||||||
@@ -142,6 +99,7 @@ const FileRouter = {
|
|||||||
},
|
},
|
||||||
search: function () {
|
search: function () {
|
||||||
searching(this.searchtext);
|
searching(this.searchtext);
|
||||||
|
this.isExtendedSearch=true;
|
||||||
},
|
},
|
||||||
list_messages: function () {
|
list_messages: function () {
|
||||||
messages();
|
messages();
|
||||||
@@ -149,7 +107,7 @@ const FileRouter = {
|
|||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
//this.search();
|
//this.search();
|
||||||
this.list_tags();
|
//this.list_tags();
|
||||||
//this.list_messages();
|
//this.list_messages();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -1,72 +1,81 @@
|
|||||||
const HomeRouter = {
|
const HomeRouter = {
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<div id="om-msg-cards" class="is-hidden-desktop">
|
<div id="om-msg-cards" class="column pull-right-sm is-four-fifths-desktop">
|
||||||
<MsgCard
|
<b-button id="escape-search-link"
|
||||||
v-for="id in messagelist.slice().reverse()"
|
v-if="_isSearchActiv"
|
||||||
:key="id"
|
@click="goBackToDashboard"
|
||||||
:msg="messages[id] || {}"
|
icon-left="arrow-left"
|
||||||
></MsgCard>
|
type="is-primary"
|
||||||
</div>
|
@toggle-escape-search-link="toggleEscapeSearchLink"
|
||||||
|
outlined>
|
||||||
<div id="om-msg-cards" class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
zurück zu allen Einträgen
|
||||||
<MsgCard
|
</b-button>
|
||||||
v-for="id in messagelist.slice().reverse()"
|
<!--<b-button id="subscribe-btn" type="is-primary" v-if="_isSubscripeButtonActiv" @update-home-abo-button="updateHomeAboButton" @click="changeSubscribtion">
|
||||||
:key="id"
|
{{ subscripeTagName }}
|
||||||
:msg="messages[id] || {}"
|
</b-button>--><br><br>
|
||||||
></MsgCard>
|
<MsgCard
|
||||||
</div>
|
v-for="id in messagelist.slice().reverse()"
|
||||||
|
:key="id"
|
||||||
|
:msg="messages[id] || {}"
|
||||||
|
:isBookmark="bookmarkArray[id]">
|
||||||
|
</MsgCard>
|
||||||
|
</div>
|
||||||
</div>`,
|
</div>`,
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
messagelist: _messagelist,
|
messagelist: _messagelist,
|
||||||
messages: _messages,
|
messages: _messages,
|
||||||
|
isSearchActiv: _isSearchActiv,
|
||||||
|
isSubscripeButtonActiv: _isSubscripeButtonActiv,
|
||||||
|
isSubscriped: false,
|
||||||
|
subscripeTagName: '',
|
||||||
|
bookmarkArray: auth.bookmarks,
|
||||||
|
vueRender: vueRender,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/*refresh_messages: function () {
|
updateHomeAboButton: function(content) {
|
||||||
_messages.push({ //////// alt
|
this.subscripeTagName = content;
|
||||||
id: 42,
|
console.info( this.subscripeTagName);
|
||||||
subject: "xxx",
|
vueForceRender('key');
|
||||||
message: "warum habt ihr auch so viel",
|
},
|
||||||
user: "nobody",
|
toggleEscapeSearchLink: function() {
|
||||||
tags: "foo"
|
console.info('got called');
|
||||||
});
|
this.isSearchActive = !this.isSearchActive;
|
||||||
},*/
|
vueForceRender('key');
|
||||||
|
console.info( this.isSearchActive);
|
||||||
|
},
|
||||||
list_messages: function() {
|
list_messages: function() {
|
||||||
messages();
|
messages();
|
||||||
}
|
},
|
||||||
/*list_messages: function () {
|
goBackToDashboard: function() {
|
||||||
$.ajax({url: "api/msg/ids", method: "GET"})
|
_isSearchActiv = false;
|
||||||
.done(jd => {
|
this.$emit('reset-searchtext','');
|
||||||
// NICHT SO wg. Vue: _messagelist = jd;
|
// $("#escape-search-link").css("visibility", "hidden");
|
||||||
_messagelist.splice(0, _messagelist.length);
|
// $("#subscribe-btn").css("visibility", "hidden");
|
||||||
_messagelist.push.apply(_messagelist, jd);
|
_isSubscripeButtonActiv = false;
|
||||||
//console.log("jd: "+jd);
|
vueForceRender('key');
|
||||||
for (var e in jd) {
|
vueForceRender('search');
|
||||||
if (!_messages[jd[e]]) {
|
},
|
||||||
get_insert_message(jd[e]);
|
changeSubscribtion: function(){
|
||||||
}
|
var btnString = $("#btn-text").text();
|
||||||
}
|
console.log(btnString);
|
||||||
if(!($".om-searchbar" = "")){
|
|
||||||
for (var e in jd) {
|
|
||||||
if (!_messages[jd[e]]) {
|
|
||||||
get_insert_message(jd[e]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
for (var e in jd) {
|
|
||||||
if (!_messages[jd[e]]) {
|
|
||||||
get_search_message(jd[e]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).fail(function (e, f, g) {
|
|
||||||
console.log("list_msg: err: " + e + f + g);
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
},
|
|
||||||
|
|
||||||
|
if(this.isSubscriped){
|
||||||
|
this.subscripeTagName.replace(/deabonnieren/g, '') + "abonnieren";
|
||||||
|
//console.log(btnString);
|
||||||
|
// $("#btn-text").text(newBtnString);
|
||||||
|
}else{
|
||||||
|
this.subscripeTagName.replace(/abonnieren/g, '') + "deabonnieren";
|
||||||
|
//console.log(newBtnString);
|
||||||
|
// $("#btn-text").text(newBtnString);
|
||||||
|
}
|
||||||
|
this.isSubscriped = !this.isSubscriped;
|
||||||
|
vueForceRender('key');
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.list_messages();
|
this.list_messages();
|
||||||
//this.refresh_messages();
|
//this.refresh_messages();
|
||||||
@@ -80,28 +89,3 @@ function get_insert_message(id) {
|
|||||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/*function get_search_message(phrase) {
|
|
||||||
$.ajax({ url: "api/msg/search/"+phrase, method: "GET" }).done(function (msg) {
|
|
||||||
Vue.set(_messages, id, msg);
|
|
||||||
}).fail(function (e, f, g) {
|
|
||||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
$(document).ready(function () {
|
|
||||||
console.log("egal");
|
|
||||||
$.get('list.json').done(function (jd) {
|
|
||||||
// _messagelist = jd;
|
|
||||||
_messagelist.splice(0, _messagelist.length);
|
|
||||||
_messagelist.push.apply(_messagelist, jd);
|
|
||||||
console.log("egal2");
|
|
||||||
//$('#xxx').text(jd[0]);
|
|
||||||
for (var e in jd) {
|
|
||||||
if (!_messages[jd[e]]) {
|
|
||||||
get_insert_message(jd[e]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).fail(function (e, f, g) {
|
|
||||||
console.log("egal3: " + e + f + g);
|
|
||||||
});
|
|
||||||
});*/
|
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
// Global Variables
|
||||||
|
// User
|
||||||
|
var auth = {},
|
||||||
|
|
||||||
|
// Message
|
||||||
|
_messagelist = [],
|
||||||
|
_messages = {},
|
||||||
|
|
||||||
|
// Tag
|
||||||
|
_taglist = [],
|
||||||
|
_tags = [],
|
||||||
|
tagArray = [],
|
||||||
|
|
||||||
|
// Search
|
||||||
|
_isSearchActiv = false,
|
||||||
|
_isSubscripeButtonActiv = false,
|
||||||
|
data = [],
|
||||||
|
search_data = [],
|
||||||
|
|
||||||
|
// Vue Rerender Key
|
||||||
|
vueRender = {
|
||||||
|
key: 0,
|
||||||
|
search: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
const authorRole = 'author',
|
||||||
|
majorList = [
|
||||||
|
{id:'B-AC',name:'Bachelor Angewandte Chemie'},
|
||||||
|
{id:'B-AMP',name:'Bachelor Angewandte Mathematik und Physik'},
|
||||||
|
{id:'B-TJ',name:'Bachelor Technikjournalismus/Technik-PR'},
|
||||||
|
{id:'B-AR',name:'Bachelor Architektur'},
|
||||||
|
{id:'B-BI',name:'Bachelor Bauingenieurwesen'},
|
||||||
|
{id:'B-BW',name:'Bachelor Betriebswirtschaft'},
|
||||||
|
{id:'B-BIO',name:'Bachelor Management in der Biobranche'},
|
||||||
|
{id:'B-IB',name:'Bachelor International Business'},
|
||||||
|
{id:'B-IBT',name:'Bachelor International Business and Technology'},
|
||||||
|
{id:'B-DE',name:'Bachelor Design'},
|
||||||
|
{id:'B-EI',name:'Bachelor Elektrotechnik und Informationstechnik'},
|
||||||
|
{id:'B-MED',name:'Bachelor Medizintechnik'},
|
||||||
|
{id:'B-MF',name:'Bachelor Mechatronik/Feinwerktechnik'},
|
||||||
|
{id:'B-ME',name:'Bachelor Media Engineering'},
|
||||||
|
{id:'B-IN',name:'Bachelor Informatik'},
|
||||||
|
{id:'B-MIN',name:'Bachelor Medieninformatik'},
|
||||||
|
{id:'B-WIN',name:'Bachelor Wirtschaftsinformatik'},
|
||||||
|
{id:'B-MB',name:'Bachelor Maschinenbau'},
|
||||||
|
{id:'B-EGT',name:'Bachelor Energie- und Gebäudetechnik'},
|
||||||
|
{id:'B-EBL',name:'Bachelor Soziale Arbeit: Erziehung und Bildung im Lebenslauf'},
|
||||||
|
{id:'B-SA',name:'Bachelor Soziale Arbeit'},
|
||||||
|
{id:'B-EPT',name:'Bachelor Energieprozesstechnik'},
|
||||||
|
{id:'B-VT',name:'Bachelor Verfahrenstechnik'},
|
||||||
|
{id:'B-WT',name:'Bachelor Werkstofftechnik'},
|
||||||
|
{id:'M-AMP',name:'Master Angewandte Mathematik und Physik'},
|
||||||
|
{id:'M-AR',name:'Master Architektur'},
|
||||||
|
{id:'M-BI',name:'Master Internationales Bauwesen'},
|
||||||
|
{id:'M-URB',name:'Master Urbane Mobilität (Verkehrsingenieurwesen)'},
|
||||||
|
{id:'M-BW',name:'Master Betriebswirtschaft'},
|
||||||
|
{id:'M-TAX',name:'Master Steuerberatung'},
|
||||||
|
{id:'M-WR',name:'Master Wirtschaftsrecht'},
|
||||||
|
{id:'M-IFE',name:'Master International Finance and Economics'},
|
||||||
|
{id:'M-IMA',name:'Master International Marketing'},
|
||||||
|
{id:'M-APR',name:'Master Applied Research in Engineering Sciences'},
|
||||||
|
{id:'M-SY',name:'Master Elektronische und Mechatronische Systeme'},
|
||||||
|
{id:'M-IN',name:'Master Informatik'},
|
||||||
|
{id:'M-MIN',name:'Master Medieninformatik'},
|
||||||
|
{id:'M-WIN',name:'Master Wirtschaftsinformatik'},
|
||||||
|
{id:'M-MB',name:'Master Maschinenbau'},
|
||||||
|
{id:'M-EE',name:'Master Energiemanagement und Energietechnik'},
|
||||||
|
{id:'M-GT',name:'Master Gebäudetechnik'},
|
||||||
|
{id:'M-SA',name:'Master Soziale Arbeit'},
|
||||||
|
{id:'M-VT',name:'Master Chemieingenieurwesen und Verfahrenstechnik'},
|
||||||
|
{id:'M-WT',name:'Master Werkstofftechnik'},
|
||||||
|
],
|
||||||
|
facultyList = [
|
||||||
|
{id:'AC',name:'Angewandte Chemie'},
|
||||||
|
{id:'AMP',name:'Angewandte Mathematik, Physik und Allgemeinwissenschaften'},
|
||||||
|
{id:'AR',name:'Architektur'},
|
||||||
|
{id:'BI',name:'Bauingeneurwesen'},
|
||||||
|
{id:'BW',name:'Betriebswirtschaft'},
|
||||||
|
{id:'D',name:'Design'},
|
||||||
|
{id:'EFI',name:'Elektrotechnik Feinwerktechnik Informationstechnik'},
|
||||||
|
{id:'IN',name:'Informatik'},
|
||||||
|
{id:'MB-VS',name:'Maschinenbau und Versorgungstechnik'},
|
||||||
|
{id:'SW',name:'Sozialwissenschaften'},
|
||||||
|
{id:'VT',name:'Verfahrenstechnik'},
|
||||||
|
{id:'WT',name:'Werkstofftechnik'},
|
||||||
|
];
|
||||||
|
|
||||||
|
// Global Functions
|
||||||
|
function vueForceRender(keyName) {
|
||||||
|
if (vueRender[keyName] >= 10) {
|
||||||
|
vueRender[keyName] = 0;
|
||||||
|
}
|
||||||
|
vueRender[keyName]++;
|
||||||
|
}
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
var majorList = [
|
|
||||||
{id:'B-AC',name:'Bachelor Angewandte Chemie'},
|
|
||||||
{id:'B-AMP',name:'Bachelor Angewandte Mathematik und Physik'},
|
|
||||||
{id:'B-TJ',name:'Bachelor Technikjournalismus/Technik-PR'},
|
|
||||||
{id:'B-AR',name:'Bachelor Architektur'},
|
|
||||||
{id:'B-BI',name:'Bachelor Bauingenieurwesen'},
|
|
||||||
{id:'B-BW',name:'Bachelor Betriebswirtschaft'},
|
|
||||||
{id:'B-BIO',name:'Bachelor Management in der Biobranche'},
|
|
||||||
{id:'B-IB',name:'Bachelor International Business'},
|
|
||||||
{id:'B-IBT',name:'Bachelor International Business and Technology'},
|
|
||||||
{id:'B-DE',name:'Bachelor Design'},
|
|
||||||
{id:'B-EI',name:'Bachelor Elektrotechnik und Informationstechnik'},
|
|
||||||
{id:'B-MED',name:'Bachelor Medizintechnik'},
|
|
||||||
{id:'B-MF',name:'Bachelor Mechatronik/Feinwerktechnik'},
|
|
||||||
{id:'B-ME',name:'Bachelor Media Engineering'},
|
|
||||||
{id:'B-IN',name:'Bachelor Informatik'},
|
|
||||||
{id:'B-MIN',name:'Bachelor Medieninformatik'},
|
|
||||||
{id:'B-WIN',name:'Bachelor Wirtschaftsinformatik'},
|
|
||||||
{id:'B-MB',name:'Bachelor Maschinenbau'},
|
|
||||||
{id:'B-EGT',name:'Bachelor Energie- und Gebäudetechnik'},
|
|
||||||
{id:'B-EBL',name:'Bachelor Soziale Arbeit: Erziehung und Bildung im Lebenslauf'},
|
|
||||||
{id:'B-SA',name:'Bachelor Soziale Arbeit'},
|
|
||||||
{id:'B-EPT',name:'Bachelor Energieprozesstechnik'},
|
|
||||||
{id:'B-VT',name:'Bachelor Verfahrenstechnik'},
|
|
||||||
{id:'B-WT',name:'Bachelor Werkstofftechnik'},
|
|
||||||
{id:'M-AMP',name:'Master Angewandte Mathematik und Physik'},
|
|
||||||
{id:'M-AR',name:'Master Architektur'},
|
|
||||||
{id:'M-BI',name:'Master Internationales Bauwesen'},
|
|
||||||
{id:'M-URB',name:'Master Urbane Mobilität (Verkehrsingenieurwesen)'},
|
|
||||||
{id:'M-BW',name:'Master Betriebswirtschaft'},
|
|
||||||
{id:'M-TAX',name:'Master Steuerberatung'},
|
|
||||||
{id:'M-WR',name:'Master Wirtschaftsrecht'},
|
|
||||||
{id:'M-IFE',name:'Master International Finance and Economics'},
|
|
||||||
{id:'M-IMA',name:'Master International Marketing'},
|
|
||||||
{id:'M-APR',name:'Master Applied Research in Engineering Sciences'},
|
|
||||||
{id:'M-SY',name:'Master Elektronische und Mechatronische Systeme'},
|
|
||||||
{id:'M-IN',name:'Master Informatik'},
|
|
||||||
{id:'M-MIN',name:'Master Medieninformatik'},
|
|
||||||
{id:'M-WIN',name:'Master Wirtschaftsinformatik'},
|
|
||||||
{id:'M-MB',name:'Master Maschinenbau'},
|
|
||||||
{id:'M-EE',name:'Master Energiemanagement und Energietechnik'},
|
|
||||||
{id:'M-GT',name:'Master Gebäudetechnik'},
|
|
||||||
{id:'M-SA',name:'Master Soziale Arbeit'},
|
|
||||||
{id:'M-VT',name:'Master Chemieingenieurwesen und Verfahrenstechnik'},
|
|
||||||
{id:'M-WT',name:'Master Werkstofftechnik'},
|
|
||||||
];
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
_messagelist = [];
|
|
||||||
_messages = {};
|
|
||||||
@@ -1,34 +1,94 @@
|
|||||||
Vue.component('MsgCard', {
|
Vue.component('MsgCard', {
|
||||||
template: `<div class="om-card card">
|
template: `
|
||||||
<h6 class="msg-head">
|
<div class="om-card card">
|
||||||
|
<h6 class="msg-head">
|
||||||
<b>{{ msg.subject }}</b>
|
<b>{{ msg.subject }}</b>
|
||||||
<img src="favicon.ico" width=20px height=20px>
|
<img src="favicon.ico" width=20px height=20px>
|
||||||
</h6>
|
</h6>
|
||||||
{{ msg.message }}<br>
|
{{ msg.message }}<br>
|
||||||
<a v-for="tag in msg.tag" @click="filterForTag(tag)">#{{ tag }} </a>
|
<a v-for="tag in msg.tag" @click="filterForTag(tag)">#{{ tag }} </a>
|
||||||
<br>
|
<br>
|
||||||
</p>
|
<div class="om-card-footer">
|
||||||
<div class="om-card-footer"> <div class="om-user-line">
|
<div class="om-user-line">
|
||||||
<i class="material-icons">account_circle</i>
|
<i class="material-icons">account_circle</i>
|
||||||
Erstellt von {{ msg.user }}</div>
|
Erstellt von {{ msg.user }}
|
||||||
<i class="material-icons" @click="myFilter()" v-if="!isActive">bookmark_border</i>
|
</div>
|
||||||
<i class="material-icons" @click="myFilter()" v-else="isActive">bookmark</i>
|
<i id="bockmark-not-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-if="!isActive">bookmark_border</i>
|
||||||
</div></div>`,
|
<i id="bockmark-active" class="material-icons" :key="vueRender.key" @click="myFilter(msg._id)" v-else>bookmark</i>
|
||||||
props: ['msg'],
|
</div>
|
||||||
|
</div>`,
|
||||||
|
props: ['msg', 'isBookmark'],
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
isActive: false,
|
isActive: this.isBookmark,
|
||||||
|
msgid: this.msg._id,
|
||||||
|
bookmarkArray: auth.bookmarks,
|
||||||
|
vueRender: vueRender,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
myFilter: function() {
|
myFilter: function (_messageid) {
|
||||||
|
//var _messageid = $("#msgid").text();
|
||||||
|
if (this.isActive == true) {
|
||||||
|
var index = this.bookmarkArray.indexOf(_messageid);
|
||||||
|
|
||||||
|
if (index > -1) {
|
||||||
|
this.bookmarkArray.splice(index, 1);
|
||||||
|
}
|
||||||
|
this.isActive = false;
|
||||||
|
} else {
|
||||||
|
console.log("_messsageid: "+_messageid+" bookmarks: "+this.bookmarkArray);
|
||||||
|
this.bookmarkArray.push(_messageid);
|
||||||
|
this.isActive =true;
|
||||||
|
}
|
||||||
|
/*console.log("msgid"+_bookmark);
|
||||||
|
var _userid = auth.user;
|
||||||
this.isActive = !this.isActive;
|
this.isActive = !this.isActive;
|
||||||
|
if(this.isActive){
|
||||||
|
$.ajax({
|
||||||
|
url: "api/usr",
|
||||||
|
data: {
|
||||||
|
userid: _userid,
|
||||||
|
bookmark: _bookmark
|
||||||
|
},
|
||||||
|
method: "PUT"
|
||||||
|
}).done(have_result).fail(have_error);
|
||||||
|
|
||||||
|
function have_result(res) {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
function have_error(err) {
|
||||||
|
console.log("error: " + err.responseText);
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
},
|
},
|
||||||
filterForTag: function(tag) {
|
filterForTag: function (tag) {
|
||||||
console.log("link: " +tag);
|
var btnString = "#" + tag + " abonnieren";
|
||||||
|
$("#btn-text").text(btnString);
|
||||||
|
$("#subscribe-btn").css("visibility", "visible");
|
||||||
|
//console.log("link: " + tag);
|
||||||
searching(tag);
|
searching(tag);
|
||||||
|
var btnString = "#" + tag + " abonnieren";
|
||||||
|
$("#btn-text").text(btnString);
|
||||||
|
$("#subscribe-btn").css("visibility", "visible");
|
||||||
},
|
},
|
||||||
|
isBookmarkActive: function (msgid) {
|
||||||
|
//console.log("isBookmarkActive(): " + msgid);
|
||||||
|
if (this.bookmarkArray.indexOf(msgid) > -1) {
|
||||||
|
// $("#bockmark-not-active").css("visibility","hidden");
|
||||||
|
// $("#bockmark-active").css("visibility","visible");
|
||||||
|
this.isActive = true;
|
||||||
|
//console.log("isBookmarkActive(): " + this.isActive);
|
||||||
|
this.isActive_ = 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeMount: function () {
|
||||||
|
//this.isBookmarkActive();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -11,7 +11,7 @@ Vue.component('nav-router', {
|
|||||||
<i class="material-icons">search</i>
|
<i class="material-icons">search</i>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<router-link to="/createMessage" class="navbar-item is-primary is-expanded is-hidden-desktop">
|
<router-link v-if="auth.roles.author" to="/createMessage" class="navbar-item is-primary is-expanded is-hidden-desktop">
|
||||||
<i class="material-icons">add_circle</i>
|
<i class="material-icons">add_circle</i>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ Vue.component('nav-router', {
|
|||||||
<i class="material-icons">search</i> Search
|
<i class="material-icons">search</i> Search
|
||||||
</router-link></li>
|
</router-link></li>
|
||||||
|
|
||||||
<li><router-link to="/createMessage">
|
<li><router-link v-if="auth.roles.author" to="/createMessage">
|
||||||
<i class="material-icons">add_circle</i> Create Message
|
<i class="material-icons">add_circle</i> Create Message
|
||||||
</router-link></li>
|
</router-link></li>
|
||||||
|
|
||||||
@@ -53,6 +53,11 @@ Vue.component('nav-router', {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>`,
|
</div>`,
|
||||||
|
data: function() {
|
||||||
|
return {
|
||||||
|
auth: auth,
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
|
|||||||
@@ -1,42 +1,23 @@
|
|||||||
const ProfilRouter = {
|
const ProfilRouter = {
|
||||||
template: `
|
template: `
|
||||||
<div>
|
<div>
|
||||||
<div class="is-hidden-desktop">
|
<div class="column pull-right-sm is-four-fifths-desktop">
|
||||||
<div v-if="isAuth">
|
<div v-if="isAuth">
|
||||||
<profil-card></profil-card>
|
<profil-card></profil-card>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<button class="button is-primary is-medium"
|
<button class="button is-primary is-medium"
|
||||||
@click="isLPVisible = true">
|
@click="isLPVisible = true">
|
||||||
Login
|
Login
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<b-modal :active.sync="isLPVisible"
|
<b-modal :active.sync="isLPVisible"
|
||||||
@close-login-panel="closeLoginPanel"
|
@close-login-panel="closeLoginPanel"
|
||||||
@show-login-panel="showLoginPanel"
|
@show-login-panel="showLoginPanel"
|
||||||
has-modal-card>
|
has-modal-card>
|
||||||
<login-panel></login-panel>
|
<login-panel></login-panel>
|
||||||
</b-modal>
|
</b-modal>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="column is-three-quarters is-pulled-right is-hidden-touch content-desktop">
|
|
||||||
<div v-if="isAuth">
|
|
||||||
<profil-card></profil-card>
|
|
||||||
</div>
|
|
||||||
<div v-else>
|
|
||||||
<button class="button is-primary is-medium"
|
|
||||||
@click="isLPVisible = true">
|
|
||||||
Login
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<b-modal :active.sync="isLPVisible"
|
|
||||||
@close-login-panel="closeLoginPanel"
|
|
||||||
@show-login-panel="showLoginPanel"
|
|
||||||
has-modal-card>
|
|
||||||
<login-panel></login-panel>
|
|
||||||
</b-modal>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>`,
|
</div>`,
|
||||||
data: function () {
|
data: function () {
|
||||||
|
|||||||
@@ -11,22 +11,24 @@ Vue.component('profil-card', {
|
|||||||
|
|
||||||
<div class="profil-text">
|
<div class="profil-text">
|
||||||
<span style="font-size:120%; display:inline-block; margin: 0.8rem 0 0 0;"><b>{{ auth.name }}</b></span><br><br>
|
<span style="font-size:120%; display:inline-block; margin: 0.8rem 0 0 0;"><b>{{ auth.name }}</b></span><br><br>
|
||||||
<span style="font-size:90%; display:inline-block; margin: 0 0 0.8rem 0;"><b>{{ major }}</b></span>
|
<span style="font-size:100%; display:inline-block; margin: 0 0 0.8rem 0;"><b>{{ labelMajorOrFaculty }}</b></span>
|
||||||
|
<br>
|
||||||
|
<span style="font-size:90%; display:inline-block; margin: 0 0 0.8rem 0;"><b>{{ majorOrFaculty }}</b></span>
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr class="first">
|
<hr class="first">
|
||||||
|
|
||||||
<div class="btnprofil">
|
<div class="btnprofil">
|
||||||
<button @click="isCardModalActive = true"><b>Abonniert: <br/>{{ abo }}</b> <br/></button>
|
<button @click="isCardModalActive = true"><b>Abonniert: <br/>{{ abos }}</b> <br/></button>
|
||||||
<button @click="$router.push('/bookmark')"><b>Gespeichert:<br/> {{ saved }}</b><br/></button>
|
<button @click="$router.push('/bookmark')"><b>Gespeichert:<br/> {{ bookmarks }}</b><br/></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<b-modal :active.sync="isCardModalActive" :width="600" scroll="keep">
|
<b-modal :active.sync="isCardModalActive" :width="600" scroll="keep">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<header class="modal-card-head">
|
<header class="modal-card-head">
|
||||||
<p class="modal-card-title">Abonnierte Kanäle</p>
|
<p class="modal-card-title">Abonnierte Tags</p>
|
||||||
</header>
|
</header>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -51,30 +53,51 @@ Vue.component('profil-card', {
|
|||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
auth: auth,
|
auth: auth,
|
||||||
abo: 7,
|
abos: auth.abos ? auth.abos.length : '-',
|
||||||
saved: 3,
|
bookmarks: auth.bookmarks ? auth.bookmarks.length : '-',
|
||||||
isCardModalActive: false,
|
isCardModalActive: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
major: function() {
|
majorOrFaculty: function() {
|
||||||
// e.g. ST@B-ME;ST@EFI;
|
// e.g. ST@B-ME;ST@EFI;
|
||||||
var majorID = auth.type.split(';')[0].split('@')[1];
|
if (auth.roles.author) {
|
||||||
//console.info(majorID);
|
var facultyID = auth.type.split(';');
|
||||||
//console.info(majorList);
|
console.info(facultyID[facultyID.length-2]);
|
||||||
var majorName = 'Studiengang Unbekannt';
|
facultyID = facultyID[facultyID.length-2].split('@')[1];
|
||||||
majorList.forEach(function(major) {
|
var facultyName = '';
|
||||||
if (major.id == majorID) {
|
facultyList.forEach(function(faculty) {
|
||||||
majorName = major.name;
|
if (faculty.id == facultyID) {
|
||||||
}
|
facultyName = faculty.name;
|
||||||
});
|
}
|
||||||
return majorName;
|
});
|
||||||
|
return facultyName;
|
||||||
|
} else {
|
||||||
|
var majorID = auth.type.split(';')[0].split('@')[1];
|
||||||
|
//console.info(majorID);
|
||||||
|
//console.info(majorList);
|
||||||
|
var majorName = 'Studiengang Unbekannt';
|
||||||
|
majorList.forEach(function(major) {
|
||||||
|
if (major.id == majorID) {
|
||||||
|
majorName = major.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return majorName;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
labelMajorOrFaculty: function() {
|
||||||
|
if (auth.roles.author) {
|
||||||
|
return 'Fakultät:'
|
||||||
|
} else {
|
||||||
|
return 'Studiengang:'
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
logout: function() {
|
logout: function() {
|
||||||
clearAuthState();
|
clearAuthState();
|
||||||
$.ajax({ url: "api/logout", method: "POST" });
|
$.ajax({ url: "api/logout", method: "POST" });
|
||||||
|
vueForceRender('key');
|
||||||
router.push('/profil');
|
router.push('/profil');
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
_taglist = [];
|
|
||||||
_tags = [];
|
|
||||||
@@ -1,13 +1,3 @@
|
|||||||
var isSearchActive = false,
|
|
||||||
tagArray = ["lorem"];
|
|
||||||
|
|
||||||
const dat=[
|
|
||||||
'th',
|
|
||||||
'efi',
|
|
||||||
'wichtig',
|
|
||||||
],
|
|
||||||
search_data = [];
|
|
||||||
|
|
||||||
Vue.component('search',{
|
Vue.component('search',{
|
||||||
template: `
|
template: `
|
||||||
<form class="om-searchbar" @submit.prevent="search()">
|
<form class="om-searchbar" @submit.prevent="search()">
|
||||||
@@ -18,31 +8,35 @@ Vue.component('search',{
|
|||||||
:data="filteredDataArray"
|
:data="filteredDataArray"
|
||||||
placeholder="suche..."
|
placeholder="suche..."
|
||||||
icon="magnify"
|
icon="magnify"
|
||||||
|
@reset-searchtext="resetSearchtext($event)"
|
||||||
@select="option => selected = option">
|
@select="option => selected = option">
|
||||||
</b-autocomplete>
|
</b-autocomplete>
|
||||||
<button class="clearButton" @click="clear">x</button>
|
<button class="clearButton" @click="clear">x</button>
|
||||||
</b-field>
|
</b-field>
|
||||||
</form>`,
|
</form>`,
|
||||||
data: function() {
|
data: function() {
|
||||||
return{
|
return {
|
||||||
searchtext: "",
|
searchtext: "",
|
||||||
selected: [],
|
selected: [],
|
||||||
taglist: dat,
|
taglist: data,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
filteredDataArray() {
|
filteredDataArray: function() {
|
||||||
return this.taglist.filter((option) => {
|
return this.taglist.filter((option) => {
|
||||||
return option
|
return option
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.indexOf(this.searchtext.toLowerCase()) >= 0
|
.indexOf(this.searchtext.toLowerCase()) >= 0
|
||||||
})
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getFilteredTags(text) {
|
resetSearchtext: function(param) {
|
||||||
this.taglist = dat.filter((option) => {
|
this.searchtext = param;
|
||||||
|
},
|
||||||
|
getFilteredTags: function(text) {
|
||||||
|
this.taglist = data.filter((option) => {
|
||||||
return option
|
return option
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
@@ -51,7 +45,12 @@ Vue.component('search',{
|
|||||||
this.search();
|
this.search();
|
||||||
},
|
},
|
||||||
search: function() {
|
search: function() {
|
||||||
searching(this.searchtext);
|
var btnString = '';
|
||||||
|
btnString = searching(this.searchtext, btnString);
|
||||||
|
console.info(btnString);
|
||||||
|
this.$emit('update-home-abo-button', btnString);
|
||||||
|
vueForceRender('key');
|
||||||
|
|
||||||
},
|
},
|
||||||
saveTagsToArray: function() {
|
saveTagsToArray: function() {
|
||||||
tagArray = this.selected;
|
tagArray = this.selected;
|
||||||
@@ -64,6 +63,7 @@ Vue.component('search',{
|
|||||||
$.ajax({url: "api/tag/ids", method: "GET"})
|
$.ajax({url: "api/tag/ids", method: "GET"})
|
||||||
.done(jd => {
|
.done(jd => {
|
||||||
// NICHT SO wg. Vue: _messagelist = jd;
|
// NICHT SO wg. Vue: _messagelist = jd;
|
||||||
|
if(data == ""){
|
||||||
_taglist.splice(0, _taglist.length);
|
_taglist.splice(0, _taglist.length);
|
||||||
_taglist.push.apply(_taglist, jd);
|
_taglist.push.apply(_taglist, jd);
|
||||||
// console.log("tag: jd: " + jd);
|
// console.log("tag: jd: " + jd);
|
||||||
@@ -72,16 +72,23 @@ Vue.component('search',{
|
|||||||
get_insert_tag(jd[e]);
|
get_insert_tag(jd[e]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}).fail(function (e, f, g) {
|
}).fail(function (e, f, g) {
|
||||||
console.log("err: " + e + f + g);
|
console.log("err: " + e + f + g);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clear: function() {
|
clear: function() {
|
||||||
console.log("clear");
|
this.searchtext = "";
|
||||||
|
|
||||||
isSearchActiv = false;
|
|
||||||
this.searchtext = "";
|
|
||||||
this.list_messages();
|
this.list_messages();
|
||||||
|
//router.push('/files')
|
||||||
|
//router.push('/home')
|
||||||
|
_isSearchActiv = false;
|
||||||
|
_isSubscripeButtonActiv = false;
|
||||||
|
this.$emit('toggle-escape-search-link');
|
||||||
|
vueForceRender('key');
|
||||||
|
console.info('done');
|
||||||
|
// $("#escape-search-link").css("visibility", "hidden");
|
||||||
|
// $("#subscribe-btn").css("visibility", "hidden");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted: function() {
|
mounted: function() {
|
||||||
@@ -96,31 +103,46 @@ function get_insert_tag(id) {
|
|||||||
url: "api/tag/id/" + id,
|
url: "api/tag/id/" + id,
|
||||||
method: "GET"
|
method: "GET"
|
||||||
}).done(function(tag) {
|
}).done(function(tag) {
|
||||||
dat.push("#" + tag.name);
|
data.push('#'+tag.name);
|
||||||
}).fail(function(e, f, g) {
|
}).fail(function(e, f, g) {
|
||||||
console.log("cannot load " + id + ".json: " + e + f + g);
|
console.log("cannot load " + id + ".json: " + e + f + g);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function searching(searchtext) {
|
function searching(searchtext,btnString) {
|
||||||
isSearchActiv = true;
|
_isSearchActiv = true;
|
||||||
console.log("Searchtext: " + searchtext.replace(/#/g, ''));
|
// $("#escape-search-link").css("visibility", "visible");
|
||||||
$.ajax({
|
//console.log(_tags);
|
||||||
url: "api/msg/search/" + searchtext.replace(/#/g, ''),
|
// console.log(data);
|
||||||
method: "GET"
|
if(data.indexOf(searchtext) > -1){
|
||||||
}).done(jd => {
|
btnString = searchtext + " abonnieren";
|
||||||
// NICHT SO wg. Vue: _messagelist = jd;
|
// $("#btn-text").text(btnString);
|
||||||
_messagelist.splice(0, _messagelist.length);
|
// $("#subscribe-btn").css("visibility", "visible");
|
||||||
_messagelist.push.apply(_messagelist, jd);
|
_isSubscripeButtonActiv = true;
|
||||||
//console.log("jd: "+jd);
|
}else{
|
||||||
for (var e in jd) {
|
// $("#subscribe-btn").css("visibility", "hidden");
|
||||||
if (!_messages[jd[e]]) {
|
_isSubscripeButtonActiv = false;
|
||||||
get_insert_message(jd[e]);
|
}
|
||||||
|
|
||||||
|
if (searchtext !== '') {
|
||||||
|
$.ajax({
|
||||||
|
url: "api/msg/search/" + searchtext.replace(/#/g, ''),
|
||||||
|
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) {
|
||||||
}).fail(function(e, f, g) {
|
console.log("searching: err: " + e + f + g);
|
||||||
console.log("searching: err: " + e + f + g);
|
})
|
||||||
})
|
}
|
||||||
|
return btnString;
|
||||||
}
|
}
|
||||||
|
|
||||||
function messages() {
|
function messages() {
|
||||||
|
|||||||
@@ -36,12 +36,6 @@
|
|||||||
.om-content a:hover {
|
.om-content a:hover {
|
||||||
color: #0046a0;
|
color: #0046a0;
|
||||||
}
|
}
|
||||||
.om-content a .menu-list {
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
.om-content a .menu-list:hover {
|
|
||||||
color: white !important;
|
|
||||||
}
|
|
||||||
.content-desktop {
|
.content-desktop {
|
||||||
margin-right: 30px;
|
margin-right: 30px;
|
||||||
}
|
}
|
||||||
@@ -242,3 +236,18 @@ button.clearButton {
|
|||||||
.taglink {
|
.taglink {
|
||||||
color: #0046a0;
|
color: #0046a0;
|
||||||
}
|
}
|
||||||
|
@media (min-width: 1088px) {
|
||||||
|
.pull-right-sm {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#subscribe-btn {
|
||||||
|
float: right;
|
||||||
|
-visibility: hidden;
|
||||||
|
}
|
||||||
|
#escape-search-link {
|
||||||
|
-visibility: hidden;
|
||||||
|
}
|
||||||
|
#bockmark-not-active {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
@@ -39,10 +39,7 @@
|
|||||||
a{
|
a{
|
||||||
color: #0046a0;
|
color: #0046a0;
|
||||||
&:hover{color: #0046a0;}
|
&:hover{color: #0046a0;}
|
||||||
.menu-list {
|
}
|
||||||
color: white !important;
|
|
||||||
&:hover{color: white !important; }
|
|
||||||
}}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-desktop {
|
.content-desktop {
|
||||||
@@ -282,3 +279,22 @@ button.clearButton{
|
|||||||
color: @color;
|
color: @color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1088px) {
|
||||||
|
.pull-right-sm {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#subscribe-btn{
|
||||||
|
float: right;
|
||||||
|
-visibility: hidden;
|
||||||
|
}
|
||||||
|
#escape-search-link{
|
||||||
|
-visibility: hidden;
|
||||||
|
}
|
||||||
|
#bockmark-not-active{
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
#bockmark-active{
|
||||||
|
//visibility: hidden;
|
||||||
|
}
|
||||||
@@ -53,8 +53,8 @@ app.disable('x-powered-by');
|
|||||||
app.set('trust proxy', 1) // trust first proxy, neccessary for cookie secure: true flag
|
app.set('trust proxy', 1) // trust first proxy, neccessary for cookie secure: true flag
|
||||||
app.use(session({
|
app.use(session({
|
||||||
secret: 'ahhgylhuvh', // caesar(3) 2 letter surname
|
secret: 'ahhgylhuvh', // caesar(3) 2 letter surname
|
||||||
resave: false,
|
saveUninitialized: false, // don't create session until something stored
|
||||||
saveUninitialized: false,
|
resave: false, //don't save session if unmodified
|
||||||
cookie: {
|
cookie: {
|
||||||
maxAge: 30 * 24 * 3600 * 1000, // TODO: ttl for session as well (Store)
|
maxAge: 30 * 24 * 3600 * 1000, // TODO: ttl for session as well (Store)
|
||||||
secure: true, // true for https only (since our app works only with https)
|
secure: true, // true for https only (since our app works only with https)
|
||||||
@@ -64,7 +64,7 @@ app.use(session({
|
|||||||
mongooseConnection: mong.connection,
|
mongooseConnection: mong.connection,
|
||||||
ttl: 30 * 24 * 3600,
|
ttl: 30 * 24 * 3600,
|
||||||
}), // mongoose + connect-mongo
|
}), // mongoose + connect-mongo
|
||||||
//store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
// store: new MemoryStore ({checkPeriod: 24*3600*1000}), // memorystore
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Favicon for Desktop
|
// Favicon for Desktop
|
||||||
@@ -112,7 +112,7 @@ app.use('/api', api_routes);
|
|||||||
app.use(express.static(__dirname + '/public'));
|
app.use(express.static(__dirname + '/public'));
|
||||||
|
|
||||||
// Other stuff is NOT authorized unless logged in
|
// Other stuff is NOT authorized unless logged in
|
||||||
app.use (authorize.genCheckAuthorized ('user'));
|
//app.use (authorize.genCheckAuthorized ('user'));
|
||||||
|
|
||||||
// No error so far? Then it's a 404!
|
// No error so far? Then it's a 404!
|
||||||
app.use(function (req, res, next) {
|
app.use(function (req, res, next) {
|
||||||
|
|||||||
@@ -12,20 +12,75 @@ const ldap = require ('./ldap_ohm'),
|
|||||||
const serverVisibleSession = { user: true, name: true, type: true, mail: true, roles: true, gender: true, deactivated: true, host: true };
|
const serverVisibleSession = { user: true, name: true, type: true, mail: true, roles: true, gender: true, deactivated: true, host: true };
|
||||||
const clientVisibleSession = { user: true, name: true, type: true, mail: true, roles: true, gender: true };
|
const clientVisibleSession = { user: true, name: true, type: true, mail: true, roles: true, gender: true };
|
||||||
|
|
||||||
|
// Return user role, query from found.mail
|
||||||
|
function getUserRole(found) {
|
||||||
|
var roles = "user:true";
|
||||||
|
var mail = found.mail;
|
||||||
|
if (!/\d/.test(mail)) {
|
||||||
|
// Mail contains no number
|
||||||
|
roles += ',"author:true"';
|
||||||
|
}
|
||||||
|
return ('{'+roles+'}');
|
||||||
|
}
|
||||||
|
|
||||||
// Fill in session object
|
// Fill in session object
|
||||||
function fillSession (req, user, roles, cb) {
|
function fillSession (req, user, roles, cb) {
|
||||||
if (req.session === undefined)
|
if (req.session === undefined)
|
||||||
next (common.genError (500, "Error"));
|
next (common.genError (500, "Error"));
|
||||||
req.session.regenerate (function (err) {
|
// regenerate a new session-id with clean instance
|
||||||
if (user !== undefined && ! err) {
|
if (user !== undefined && roles !== undefined) {
|
||||||
common.shallowCopy (user, serverVisibleSession, {roles: true}, req.session);
|
req.session.regenerate (function (err) {
|
||||||
if (user._id) {
|
if (user !== undefined && ! err) {
|
||||||
req.session.user = user._id;
|
common.shallowCopy (user, serverVisibleSession, {roles: true}, req.session);
|
||||||
|
// console.info(req.session);
|
||||||
|
if (user._id) {
|
||||||
|
req.session.user = user._id;
|
||||||
|
}
|
||||||
|
req.session.roles = roles;
|
||||||
|
console.info(req.session);
|
||||||
}
|
}
|
||||||
req.session.roles = roles;
|
return cb (err);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return cb ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save found user into DB, if not already exists
|
||||||
|
function saveFoundToDB(found, cb) {
|
||||||
|
// console.info(found);
|
||||||
|
Users.findById(found.user)
|
||||||
|
.exec(function(err, result){
|
||||||
|
if (err) {
|
||||||
|
console.error("Error: Users collection.");
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
// User doesn't exist
|
||||||
|
if (found !== undefined && !result) {
|
||||||
|
Users.create({
|
||||||
|
_id: found.user,
|
||||||
|
name: found.name,
|
||||||
|
mail: found.mail,
|
||||||
|
type: found.type,
|
||||||
|
gender: found.gender,
|
||||||
|
abos: '',
|
||||||
|
bookmarks: '',
|
||||||
|
roles: getUserRole(found),
|
||||||
|
}, function(err, done) {
|
||||||
|
if (err) {
|
||||||
|
console.error("User creation: Failed");
|
||||||
|
console.error(err);
|
||||||
|
} else {
|
||||||
|
console.info("User created: "+ found.user);
|
||||||
|
}
|
||||||
|
if (done == null) {
|
||||||
|
console.error("Can not create user.");
|
||||||
|
}
|
||||||
|
return cb(err);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return cb(err);
|
||||||
}
|
}
|
||||||
return cb (err);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +117,7 @@ const authorization = {
|
|||||||
|
|
||||||
// Check whether to just validate current session ID
|
// Check whether to just validate current session ID
|
||||||
if (user === '' && pwd === '') {
|
if (user === '' && pwd === '') {
|
||||||
console.log ("auth revalidate: " + req.session.user);
|
console.log ("auth revalidate: " + req.session._id);
|
||||||
if (req.session.user === undefined)
|
if (req.session.user === undefined)
|
||||||
return returnError();
|
return returnError();
|
||||||
return returnSession ();
|
return returnSession ();
|
||||||
@@ -72,8 +127,9 @@ const authorization = {
|
|||||||
Users.findById (req.body.user) .exec (function (err, entry) {
|
Users.findById (req.body.user) .exec (function (err, entry) {
|
||||||
// If there is a local user AND it has a password associated, test against this, and only this
|
// If there is a local user AND it has a password associated, test against this, and only this
|
||||||
if (entry != null && entry.pwd) {
|
if (entry != null && entry.pwd) {
|
||||||
|
console.info(entry);
|
||||||
if (crypto.checkLocalAuth (entry, req.body.pwd)) {
|
if (crypto.checkLocalAuth (entry, req.body.pwd)) {
|
||||||
return fillSession (req, entry, common.arrayToHash(entry.roles), returnSession);
|
return fillSession (req, entry, entry.roles, returnSession);
|
||||||
}
|
}
|
||||||
return returnError ();
|
return returnError ();
|
||||||
}
|
}
|
||||||
@@ -95,15 +151,25 @@ const authorization = {
|
|||||||
entry.type = found.type;
|
entry.type = found.type;
|
||||||
if (! entry.orclgender || entry.orclgender === "")
|
if (! entry.orclgender || entry.orclgender === "")
|
||||||
entry.orclgender = found.orclgender;
|
entry.orclgender = found.orclgender;
|
||||||
return fillSession (req, entry, entry.roles.length > 0 ? common.arrayToHash(entry.roles) : {user:true}, returnSession);
|
return fillSession (req, entry, entry.roles.length > 0 ? entry.roles : {user:true}, returnSession);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise create standard user entry
|
// Otherwise create standard user entry
|
||||||
return fillSession (req, found, {user:true}, returnSession);
|
saveFoundToDB(found, function() {
|
||||||
|
return fillSession (req, found, {user:true}, returnSession);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
logout: function (req, res, next) {
|
logout: function (req, res, next) {
|
||||||
fillSession (req, undefined, undefined, function (err) {
|
fillSession (req, undefined, undefined, function (err) {
|
||||||
|
// Session delete, exists further in db
|
||||||
|
req.session.destroy(function(err) {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.info(req.session);
|
||||||
return res.json ({});
|
return res.json ({});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -16,20 +16,22 @@ const dbs = {
|
|||||||
* -> Array of message schema object ids
|
* -> Array of message schema object ids
|
||||||
* Get ALL known message ids
|
* Get ALL known message ids
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Messages.find({},{_id: true}).exec()
|
model.Messages.find({}, {
|
||||||
|
_id: true
|
||||||
|
}).exec()
|
||||||
.then(results => {
|
.then(results => {
|
||||||
//selects id from message:
|
//selects id from message:
|
||||||
var parsed = [];
|
var parsed = [];
|
||||||
for (var i in results) {
|
for (var i in results) {
|
||||||
parsed.push (results[i]._id);
|
parsed.push(results[i]._id);
|
||||||
}
|
}
|
||||||
res.send(parsed);
|
res.send(parsed);
|
||||||
} )
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log (err);
|
console.log(err);
|
||||||
res.status(500).json(err);
|
res.status(500).json(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"msg/id": {
|
"msg/id": {
|
||||||
@@ -38,10 +40,10 @@ const dbs = {
|
|||||||
* -> Message schema
|
* -> Message schema
|
||||||
* Get a particular message
|
* Get a particular message
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Messages.findById(req.params.id) .exec(function(err, result) {
|
model.Messages.findById(req.params.id).exec(function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log (err);
|
console.log(err);
|
||||||
res.status(404).json(err);
|
res.status(404).json(err);
|
||||||
} else {
|
} else {
|
||||||
//console.log(JSON.stringify(result));
|
//console.log(JSON.stringify(result));
|
||||||
@@ -56,22 +58,27 @@ const dbs = {
|
|||||||
* -> Message schema
|
* -> Message schema
|
||||||
* Get a particular message
|
* Get a particular message
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Messages.find(
|
model.Messages.find({
|
||||||
{$text: {$search: req.params.phrase}})
|
$text: {
|
||||||
.sort({tag:1, user:1, message:1, subject:1})
|
$search: req.params.phrase
|
||||||
.exec().then(results => {
|
}
|
||||||
//selects id from message:
|
})
|
||||||
var parsed = [];
|
.sort({
|
||||||
for (var i in results) {
|
tag: -1
|
||||||
parsed.push (results[i]._id);
|
})
|
||||||
}
|
.exec().then(results => {
|
||||||
res.send(parsed);
|
//selects id from message:
|
||||||
} )
|
var parsed = [];
|
||||||
.catch(err => {
|
for (var i in results) {
|
||||||
console.log (err);
|
parsed.push(results[i]._id);
|
||||||
res.status(500).json(err);
|
}
|
||||||
});
|
res.send(parsed);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
res.status(500).json(err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"msg": {
|
"msg": {
|
||||||
@@ -80,7 +87,7 @@ const dbs = {
|
|||||||
* -> Message schema
|
* -> Message schema
|
||||||
* Create a new message
|
* Create a new message
|
||||||
*/
|
*/
|
||||||
post: function(req, res) {
|
post: function (req, res) {
|
||||||
/*
|
/*
|
||||||
if ( !(req.body.tags instanceof Array) ) {
|
if ( !(req.body.tags instanceof Array) ) {
|
||||||
return res.status(400).json({ error: "bad request" });
|
return res.status(400).json({ error: "bad request" });
|
||||||
@@ -92,11 +99,13 @@ const dbs = {
|
|||||||
message: req.body.message,
|
message: req.body.message,
|
||||||
user: req.body.user,
|
user: req.body.user,
|
||||||
tag: req.body.tag
|
tag: req.body.tag
|
||||||
}, function(err, result) {
|
}, function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return res.status(401).json(err.message);
|
return res.status(401).json(err.message);
|
||||||
} else {
|
} else {
|
||||||
res.json({message: "Message created!!"});
|
res.json({
|
||||||
|
message: "Message created!!"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
return res.status(500).json("Can not create message.")
|
return res.status(500).json("Can not create message.")
|
||||||
@@ -115,20 +124,22 @@ const dbs = {
|
|||||||
* -> Array of tag schema object ids
|
* -> Array of tag schema object ids
|
||||||
* Get ALL known tag ids
|
* Get ALL known tag ids
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Tags.find({},{_id: true}).exec()
|
model.Tags.find({}, {
|
||||||
|
_id: true
|
||||||
|
}).exec()
|
||||||
.then(results => {
|
.then(results => {
|
||||||
//selects id from tag:
|
//selects id from tag:
|
||||||
var parsed = [];
|
var parsed = [];
|
||||||
for (var i in results) {
|
for (var i in results) {
|
||||||
parsed.push (results[i]._id);
|
parsed.push(results[i]._id);
|
||||||
}
|
}
|
||||||
res.send(parsed);
|
res.send(parsed);
|
||||||
} )
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.log (err);
|
console.log(err);
|
||||||
res.status(500).json(err);
|
res.status(500).json(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"tag/id": {
|
"tag/id": {
|
||||||
@@ -137,17 +148,43 @@ const dbs = {
|
|||||||
* -> Tag schema
|
* -> Tag schema
|
||||||
* Get a particular tag
|
* Get a particular tag
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Tags.findById(req.params.id)
|
model.Tags.findById(req.params.id)
|
||||||
.exec(function(err, result) {
|
.exec(function (err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log (err);
|
console.log(err);
|
||||||
res.status(404).json(err);
|
res.status(404).json(err);
|
||||||
} else {
|
} else {
|
||||||
//console.log(JSON.stringify(result));
|
//console.log(req.params.id);
|
||||||
res.json(result);
|
res.json(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"usr/bookmark/ids": {
|
||||||
|
/* GET /api/usr/bookmark/ids [no args]
|
||||||
|
* -> Array of message schema object ids
|
||||||
|
* Get bookmark message ids
|
||||||
|
*/
|
||||||
|
|
||||||
|
get: function (req, res) {
|
||||||
|
model.Users.find({
|
||||||
|
},
|
||||||
|
function (err, result) {
|
||||||
|
if (err) {
|
||||||
|
return res.status(401).json(err.message);
|
||||||
|
} else {
|
||||||
|
var parsed = [];
|
||||||
|
for (var i in result) {
|
||||||
|
parsed.push(result[i].bookmarks);
|
||||||
|
}
|
||||||
|
console.log("bookmarks:" + JSON.stringify(parsed));
|
||||||
|
res.send(parsed);
|
||||||
|
}
|
||||||
|
if (result == null) {
|
||||||
|
return res.status(500).json("Can save bookmark.")
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"usr/id": {
|
"usr/id": {
|
||||||
@@ -156,17 +193,19 @@ const dbs = {
|
|||||||
* -> User Schema
|
* -> User Schema
|
||||||
* Get a particular user
|
* Get a particular user
|
||||||
*/
|
*/
|
||||||
get: function(req, res) {
|
get: function (req, res) {
|
||||||
model.Users.findById(req.params.id)
|
model.Users.find({
|
||||||
.exec(function(err, result) {
|
_id: req.params.id
|
||||||
if (err) {
|
})
|
||||||
console.log(err);
|
.exec(function (err, result) {
|
||||||
res.status(404).json(err);
|
if (err) {
|
||||||
} else {
|
console.log(err);
|
||||||
//console.log(JSON.stringify(result));
|
res.status(404).json(err);
|
||||||
res.json(result);
|
} else {
|
||||||
}
|
console.log(result);
|
||||||
});
|
res.json(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"usr": {
|
"usr": {
|
||||||
@@ -176,22 +215,22 @@ const dbs = {
|
|||||||
* Create a new user
|
* Create a new user
|
||||||
*/
|
*/
|
||||||
post: function(req, res) {
|
post: function(req, res) {
|
||||||
model.User.create({
|
// console.info(req.body);
|
||||||
_id: req.body.id,
|
model.Users.create({
|
||||||
|
_id: req.body._id,
|
||||||
name: req.body.name,
|
name: req.body.name,
|
||||||
|
mail: req.body.mail,
|
||||||
type: req.body.type,
|
type: req.body.type,
|
||||||
roles: req.body.roles,
|
gender: req.body.gender,
|
||||||
hash: req.body.hash,
|
|
||||||
salt: req.body.salt,
|
|
||||||
pwd: req.body.pwd,
|
|
||||||
abos: req.body.abos,
|
abos: req.body.abos,
|
||||||
bookmarks: req.body.bookmarks,
|
bookmarks: req.body.bookmarks,
|
||||||
|
roles: req.body.roles,
|
||||||
}, function(err, result) {
|
}, function(err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log (err);
|
console.log(err);
|
||||||
return res.status(401).json(err.message);
|
return res.status(401).json(err.message);
|
||||||
} else {
|
} else {
|
||||||
res.json({message: "User created!!"});
|
res.json({message: "User created!", user: req.body});
|
||||||
}
|
}
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
return res.status(500).json("Can not create user.")
|
return res.status(500).json("Can not create user.")
|
||||||
@@ -203,15 +242,41 @@ const dbs = {
|
|||||||
* -> User schema
|
* -> User schema
|
||||||
* Change a user
|
* Change a user
|
||||||
*/
|
*/
|
||||||
put: function(req, res) {
|
put: function (req, res) {
|
||||||
model.Users.findById(reg.body._id)
|
|
||||||
.exec(function(err, entry) {
|
model.Users.find({
|
||||||
if (err)
|
_id: req.body.userid
|
||||||
console.log (err);
|
})
|
||||||
if (entry == null)
|
.exec(function (err, entry) {
|
||||||
return res.status(404).json(err.message);
|
if (err) {
|
||||||
// TODO Catch edge cases
|
console.log(err);
|
||||||
entry.save(function(err, data) {
|
} else {
|
||||||
|
|
||||||
|
model.Users.update({
|
||||||
|
_id: req.body.userid
|
||||||
|
}, {
|
||||||
|
bookmarks: req.body.bookmark
|
||||||
|
}, function (err, data) {
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
console.log(err);
|
||||||
|
} else {
|
||||||
|
res.json({
|
||||||
|
id: "Bookmark saved"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (data == null) {
|
||||||
|
return res.status(404).json(err.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry == null)
|
||||||
|
return res.status(404).json(err.message);
|
||||||
|
// TODO Catch edge cases
|
||||||
|
|
||||||
// TODO Save/Update user
|
// TODO Save/Update user
|
||||||
/*
|
/*
|
||||||
_id: req.body.id,
|
_id: req.body.id,
|
||||||
@@ -224,9 +289,8 @@ const dbs = {
|
|||||||
abos: req.body.abos,
|
abos: req.body.abos,
|
||||||
bookmarks: req.body.bookmarks,
|
bookmarks: req.body.bookmarks,
|
||||||
*/
|
*/
|
||||||
res.json(data);
|
// res.json(data);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -241,7 +305,7 @@ const dbs = {
|
|||||||
* Local db: common.config.dbLocalConn
|
* Local db: common.config.dbLocalConn
|
||||||
* TH db: common.config.dbConn
|
* TH db: common.config.dbConn
|
||||||
*/
|
*/
|
||||||
common.mongoose.connect (common.config.dbLocalConn, {
|
common.mongoose.connect(common.config.dbConn, {
|
||||||
useNewUrlParser: true
|
useNewUrlParser: true
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log("Database connected successfully.");
|
console.log("Database connected successfully.");
|
||||||
@@ -258,63 +322,68 @@ const dbs = {
|
|||||||
* - per entry: _comment: Comment for Admin UI - TODO: not working yet
|
* - per entry: _comment: Comment for Admin UI - TODO: not working yet
|
||||||
*/
|
*/
|
||||||
var messageSchema = common.mongoose.Schema({
|
var messageSchema = common.mongoose.Schema({
|
||||||
subject: { type: String, required: true,
|
subject: {
|
||||||
_comment: "" },
|
type: String,
|
||||||
message: { type: String, required: true,
|
required: true,
|
||||||
_comment: "" },
|
_comment: ""
|
||||||
user: { type: String, required: true,
|
},
|
||||||
_comment: "" },
|
message: {
|
||||||
tag: { type: [String],
|
type: String,
|
||||||
_comment: "" },
|
required: true,
|
||||||
|
_comment: ""
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
_comment: ""
|
||||||
|
},
|
||||||
|
tag: {
|
||||||
|
type: [String],
|
||||||
|
_comment: ""
|
||||||
|
},
|
||||||
//createtime: { type: Date, default: Date.now },
|
//createtime: { type: Date, default: Date.now },
|
||||||
});
|
});
|
||||||
messageSchema.index({ "$**":'text' });
|
messageSchema.index({
|
||||||
|
"$**": 'text'
|
||||||
|
});
|
||||||
model.Messages = common.mongoose.model('messages', messageSchema);
|
model.Messages = common.mongoose.model('messages', messageSchema);
|
||||||
model.Messages._list = [ "" ];
|
model.Messages._list = [""];
|
||||||
|
|
||||||
var tagSchema = common.mongoose.Schema({
|
var tagSchema = common.mongoose.Schema({
|
||||||
name: { type: String, required: true,
|
name: {
|
||||||
_comment: "" }, //unique
|
type: String,
|
||||||
|
required: true,
|
||||||
|
_comment: ""
|
||||||
|
}, //unique
|
||||||
});
|
});
|
||||||
model.Tags = common.mongoose.model('tags', messageSchema);
|
model.Tags = common.mongoose.model('tags', messageSchema);
|
||||||
model.Tags._list = [ "" ];
|
model.Tags._list = [""];
|
||||||
|
|
||||||
var userSchema = common.mongoose.Schema({
|
var userSchema = common.mongoose.Schema({
|
||||||
_id: { type: String },
|
_id: { type: String, required: true },
|
||||||
name: { type: String, required: true,
|
name: { type: String,
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
|
mail: { type: String },
|
||||||
|
type: { type: String },
|
||||||
|
gender: { type: String },
|
||||||
pwd: { type: String,
|
pwd: { type: String,
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
hash: { type: String },
|
hash: { type: String },
|
||||||
salt: { type: String },
|
salt: { type: String },
|
||||||
type: { type: String },
|
|
||||||
roles: { type: [String], required: true,
|
|
||||||
_comment: "" },
|
|
||||||
abos: { type: [String],
|
abos: { type: [String],
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
//deactivated: { type: Boolean },
|
//deactivated: { type: Boolean },
|
||||||
//host: { type: Boolean },
|
//host: { type: Boolean },
|
||||||
bookmarks: { type: [String],
|
bookmarks: { type: [String],
|
||||||
_comment: "" },
|
_comment: "" },
|
||||||
|
sessionid: { type: String },
|
||||||
|
roles: { type: String, required: true,
|
||||||
|
_comment: "" },
|
||||||
});
|
});
|
||||||
model.Users = common.mongoose.model('users', userSchema);
|
model.Users = common.mongoose.model('users', userSchema);
|
||||||
model.Users._list = [ "" ];
|
model.Users._list = [""];
|
||||||
},
|
},
|
||||||
models: model,
|
models: model,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
app.get ("/api/msg/search/:phrase", function (req, res) {
|
|
||||||
Message.find ({$text: {$search: req.params.phrase}) .then (function (err, results){
|
|
||||||
if (err) {
|
|
||||||
console.log (err);
|
|
||||||
res .status(404) .json (err);
|
|
||||||
} else {
|
|
||||||
console.log(JSON.stringify(results));
|
|
||||||
res.json(results);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
module.exports = dbs;
|
module.exports = dbs;
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"dbConn": "mongodb://127.0.0.1:27017/om",
|
"dbConn": "mongodb://om:aeg1phuKeDaixese@127.0.0.1:27017/om",
|
||||||
"dbLocalConn": "mongodb://localhost:27017/omdb",
|
"dbLocalConn": "mongodb://localhost:27017/omdb",
|
||||||
"dbUser": "om",
|
"dbUser": "om",
|
||||||
"dbPwd": "aeg1phuKeDaixese",
|
"dbPwd": "aeg1phuKeDaixese",
|
||||||
|
|||||||