<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> | ||||
<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/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> |
var auth = {}; | |||||
function clearAuthState() { | function clearAuthState() { | ||||
auth.user = ''; // Login name | auth.user = ''; // Login name | ||||
auth.name = ''; // Full name | auth.name = ''; // Full name |
var tagArray = []; | |||||
const CreateMsgRouter = { | const CreateMsgRouter = { | ||||
template: ` | template: ` | ||||
<div class="content"> | <div class="content"> | ||||
data: function () { | data: function () { | ||||
return { | return { | ||||
auth: auth, | |||||
isDisabled: false, | isDisabled: false, | ||||
selected: [], | selected: [], | ||||
searchtext : "", | searchtext : "", | ||||
}, | }, | ||||
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 _tag = tagArray; | ||||
var _user = auth.name ? auth.name : $("#user").val(); | |||||
var _user = auth.name != '' ? auth.name : $("#user").val(); | |||||
//console.log("Message Created: " + _tag + " " + _message + " " + _user); | //console.log("Message Created: " + _tag + " " + _message + " " + _user); | ||||
$.ajax({ | $.ajax({ | ||||
url: "api/msg", | url: "api/msg", |
var tagArray = []; | |||||
const FileRouter = { | const FileRouter = { | ||||
template: ` | template: ` | ||||
<div class="content"> | <div class="content"> |
}; | }; | ||||
}, | }, | ||||
methods: { | methods: { | ||||
/*refresh_messages: function () { | |||||
_messages.push({ //////// alt | |||||
id: 42, | |||||
subject: "xxx", | |||||
message: "warum habt ihr auch so viel", | |||||
user: "nobody", | |||||
tags: "foo" | |||||
}); | |||||
},*/ | |||||
list_messages: function() { | list_messages: function() { | ||||
messages(); | messages(); | ||||
} | } | ||||
/*list_messages: function () { | |||||
$.ajax({url: "api/msg/ids", 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]); | |||||
} | |||||
} | |||||
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); | |||||
}); | |||||
}*/ | |||||
}, | }, | ||||
mounted: function () { | mounted: function () { | ||||
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); | |||||
}); | |||||
});*/ |
// Global Variables | |||||
// User | |||||
var auth = {}, | |||||
majorList = [], | |||||
// Message | |||||
_messagelist = [], | |||||
_messages = {}, | |||||
// Tag | |||||
_taglist = [], | |||||
_tags = [], | |||||
tagArray = [], | |||||
// Search | |||||
isSearchActive = false, | |||||
data = [], | |||||
search_data = []; |
var majorList = [ | |||||
majorList = [ | |||||
{id:'B-AC',name:'Bachelor Angewandte Chemie'}, | {id:'B-AC',name:'Bachelor Angewandte Chemie'}, | ||||
{id:'B-AMP',name:'Bachelor Angewandte Mathematik und Physik'}, | {id:'B-AMP',name:'Bachelor Angewandte Mathematik und Physik'}, | ||||
{id:'B-TJ',name:'Bachelor Technikjournalismus/Technik-PR'}, | {id:'B-TJ',name:'Bachelor Technikjournalismus/Technik-PR'}, |
_messagelist = []; | |||||
_messages = {}; |
_taglist = []; | |||||
_tags = []; |
var isSearchActive = false, | |||||
tagArray = ["lorem"]; | |||||
const data=[], | |||||
search_data = []; | |||||
Vue.component('search',{ | Vue.component('search',{ | ||||
template: ` | template: ` | ||||
<form class="om-searchbar" @submit.prevent="search()"> | <form class="om-searchbar" @submit.prevent="search()"> |