-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
67 lines (55 loc) · 1.46 KB
/
script.js
File metadata and controls
67 lines (55 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* Startfunction
*/
async function init() {
generateNavbar();
}
/**
* This function is used to generate side navbar and header
*/
function generateNavbar() {
document.getElementById('navbar').innerHTML = getNavbarTemplate();
}
/**
* This function is used to show menu after click on own profile picture
*/
function showProfileMenu() {
let profileMenuClass = document.getElementById('profileMenu').classList;
if (profileMenuClass.contains('dNone')) {
profileMenuClass.remove('dNone');
} else {
profileMenuClass.add('dNone');
}
}
function logout() {
window.location.href = `index.html?msg=Du hast dich erfolgreich ausgeloggt!`;
}
function goToLegalNotice() {
window.location.href = `impressum.html`;
}
function goToHelp() {
window.location.href = `help.html`;
}
function backTo() {
window.location.href = "summary.html";
}
/**
* This function generates last charakter.
* @param {string} contactId - This is the Id of contact you want to show
* @returns string of last character
*/
function generateColorId(contactId) {
let colorId = contactId.slice(-1);
return colorId;
}
/**
* This function is used to generate initials of name
* @param {string} name - This is the name
* @returns string of initials
*/
function generateInitials(name) {
initials = name.toLowerCase().split(' ');
initials = initials.map(word => word.charAt(0).toUpperCase());
initials = initials.join('');
return initials;
}