An error occurred while loading the file. Please try again.
-
Wolfgang Knopki authored663b4b1e
var urlKeyword, urlParams;
urlParams = new URLSearchParams(window.location.search);
urlKeyword = urlParams.get('keyword');
function addcontent(item) {
var lang_cont_person = ""
var lang_keywords = ""
var new_row = document.getElementById("row_main")
if (item === undefined) {
} else if (urlKeyword == null || (item.item.keywords.includes(urlKeyword))) {
// Prepare YouTube Link
// var array_contains_youtube = true
var description = ""
if (lang_setting == "1") {
description = item.item.description_en
lang_cont_person = " Contact Person"
lang_keywords = " Keywords"
} else if (lang_setting == "2") {
description = item.item.description_de
lang_cont_person = " Kontaktperson"
lang_keywords = " Stichworte"
}
// Prepare Explore Link
// var array_contains_explore_link = true
var YouTubeHTML = ''
if ('youtube' in item.links) { // to be replaced by if (item.YouTubelink) or so...
var YouTubelink = item.links.youtube // to be replaced by item.YouTubelink or so...
YouTubeHTML = `<a class="btn btn-sm btn-outline-danger mt-1" href="${YouTubelink}" target="_blank"><i class="fab fa-youtube"></i> YouTube</a> `
}
var ExploreHTML = ''
if ('demo' in item.links) {
var ExploreLink = item.links.demo
ExploreHTML = `<a class="btn btn-sm btn-outline-secondary mt-1" href="${ExploreLink}" target="_blank"> <i class="fas fa-search"></i> Explore</a> `
}
var publicationHTML = ''
if ('publication' in item.links) {
var publicationLink = item.links.publication
publicationHTML = `<a class="btn btn-sm btn-outline-primary mt-1" href="${publicationLink}" target="_blank"> <i class="fas fa-book"></i> Publication</a> `
}
var reportHTML = ''
if ('report' in item.links) {
var publicationLink = item.links.report
reportHTML = `<a class="btn btn-sm btn-outline-primary mt-1" href="${publicationLink}" target="_blank"> <i class="fas fa-book"></i> Report</a> `
}
var projectHTML = ''
if ('project' in item.links) {
var projectLink = item.links.project
projectHTML = `<a class="btn btn-sm btn-outline-success mt-1" href="${projectLink}" target="_blank"> <i class="fas fa-project-diagram"></i> Project</a> `
}
var presentationHTML = ''
if ('presentation' in item.links) {
var presentationLink = item.links.presentation
presentationHTML = `<a class="btn btn-sm btn-outline-warning mt-1" href="${presentationLink}" target="_blank"> <i class="fas fa-file-powerpoint"></i> Presentation</a> `
}
var repoHTML = ''
if ('repo' in item.links) {
var repoLink = item.links.repo
repoHTML = `<a class="btn btn-sm btn-outline-info mt-1" href="${repoLink}" target="_blank"> <i class="fa fa-gitlab"></i> Git/Repository </a> `
}
if ('internal' in item.item) {
if (item.item.internal) {
var internal_tag = `<span class="badge bg-secondary" style="color: white;">Internal Access Only</span> <br>`
description = internal_tag + description
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
}
}
// Salam:
var sdgProjectHTML = ''
if ('sdgImage' in item.links) {
var sdgProjectLink = item.links.sdgImage;
var titleLink=item.project;
sdgProjectHTML = `<a class="btn btn-sm btn-outline-info mt-1"
href="${sdgProjectLink}"
target="_blank"
onclick="var popupWindow=window.open('', '_blank'); popupWindow.document.body.innerHTML='<div style=\'text-align: center;\'><h2>SDG</h2><img src=\'${sdgProjectLink}\' alt=\'SDG Project Image\' style=\'width: 100%; max-width: 400px; background-color: white;\'><p>${titleLink}</p></div>'; popupWindow.document.title='${titleLink}';">
<img src="imgs/thumbnails/sdg.png" alt="SDG" width="20" height="20"> Sustainable Development Goals
</a> `;
}
/* var sdgProjectHTML = '';
if ('sdgImage' in item) {
var sdgProjectLink = item.sdgImage;
var customColor = '#8A2BE2';
//sdgProjectHTML = `<a class="btn btn-sm btn-outline-info mt-1" href="${sdgProjectLink}" target="_blank"> <i class="fas fa-sdg"></i> SDG Project</a> `
sdgProjectHTML = `<a class="btn btn-sm btn-outline- mt-1" style="color: ${customColor}; border-color: ${customColor};" href="${sdgProjectLink}" target="_blank"> <i class="fas fa-sdg"></i> SDG Project</a> `;
}*/
//-- debut
/*var sdgProjectHTML = '';
if ('sdgImage' in item.item) {
var sdgProjectLink = item.sdgImage;
var customColor = '#8A2BE2';
sdgProjectHTML = `<a class="btn btn-sm btn-outline- mt-1" style="color: ${customColor}; border-color: ${customColor};" href="javascript:void(0);" onclick="document.querySelector('.btn-outline- img').src='${sdgProjectLink}'; document.querySelector('.btn-outline- img').alt='SDG Project Image'; document.querySelector('.btn-outline- img').onclick=function(){window.open('${sdgProjectLink}', '_blank');}"><img src="imgs/thumbnails/SDG-HFT.png" alt="SDG Project Image" class="btn-outline-" style="max-width:100px ; max-height:60px;"></a> `;*/
// Add a JavaScript function to change the image and open the link
/* sdgProjectHTML += `
<script>
function changeImage(sdgProjectLink) {
var img = document.querySelector('.btn-outline- img');
img.src = sdgProjectLink;
img.alt = 'SDG Project Image';
window.open(sdgProjectLink, '_blank');
}
</script>`;*/
//}
//-- fin (new idea)
// Salam ...
new_row.innerHTML = new_row.innerHTML + '<div class="col-lg-4">' +
'<div class="card mb-4 shadow-sm extension overflow-auto">' +
'<h5>' + item.item.title + ' <span class="content-subtitle text-muted"> ' + item.item.project + '</span></h5>' +
'<img class="thumbimg" src="' + item.item.imageLink + '" alt="">' +
'<div class="card-body">' +
'<p class="card-text-lg small">' +
description +
'<br>' +
'<b><i class="fas fa-user"></i>' + lang_cont_person + '</b>: <a ' +
' href="' + item.item.author.hftURL + '" target ="_blank"> ' + item.item.author.firstName +
' ' + item.item.author.lastName + '</a> <br>' +
'<b><i class="fas fa-star"></i>' + lang_keywords + '</b>: ' + item.item.keywords.join(', ') + '</br>' +
ExploreHTML +
repoHTML +
publicationHTML +
reportHTML +
projectHTML +
presentationHTML +
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
YouTubeHTML +
sdgProjectHTML +
'</p>' +
'</div>' +
'</div>' +
'</div>'
}
}
function replaceUmlauts(value) {
value = value.replace('ä', 'ae');
value = value.replace('ö', 'oe');
value = value.replace('ü', 'ue');
return value;
}
function addTeam(item) {
var new_row = document.getElementById("team-section")
if (item === undefined) {
} else {
var optional_profile_url_link = ``
if ('optional' in item) {
if ('researchGateURL' in item.optional) {
if (item.optional.researchGateURL !== "") {
optional_profile_url_link += `<a class="p-2 fa-lg" href="${item.optional.researchGateURL}" target="_blank">
<i class="fab fa-researchgate"></i>
</a>`
}
}
if ('googleScholarURL' in item.optional) {
if (item.optional.googleScholarURL !== "") {
optional_profile_url_link += `<a class="p-2 fa-lg" href="${item.optional.googleScholarURL}" target="_blank">
<i class="fab fa-google"></i>
</a>`
}
}
if ('LinkedInURL' in item.optional) {
if (item.optional.LinkedInURL !== "") {
optional_profile_url_link += `<a class="p-2 fa-lg" href="${item.optional.LinkedInURL}" target="_blank">
<i class="fab fa-linkedin"></i>
</a>`
}
}
if (optional_profile_url_link !== "") {
optional_profile_url_link = `<ul class="list-unstyled mb-0">${optional_profile_url_link}</ul>`
}
}
var html_team = `
<div class="col-lg-3 col-md-6 mb-lg-5 mb-5">
<div class="avatar mx-auto">
<img src="${item.imgUrl}" class="rounded-circle z-depth-1" width="150px">
</div>
<h5 class="font-weight-bold mt-4 mb-3">${item.firstName} ${item.lastName}</h5>
<p class="text-uppercase blue-text"><strong>${item.jobTitle_en}</strong></p>
<a href=${item.profile_link} target="_blank">
<button class="btn btn-primary btn-sm profile">See full profile</button>
</a>
<p class="grey-text">Research topic: ${item.researchTopics}</p>
${optional_profile_url_link}
</div>
`
new_row.innerHTML = new_row.innerHTML + html_team
}
}
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
function toggleImage(imageLink, element) {
var imageElement = document.getElementById('sdgImage');
if (imageElement.src === imageLink) {
imageElement.src = '';
imageElement.alt = '';
element.style.backgroundColor = ''; // Reset background color on image hide
} else {
imageElement.src = imageLink;
imageElement.alt = 'SDG Project Image';
}
}
function hoverEffect(element, color, textColor) {
element.style.backgroundColor = color;
element.style.color = textColor;
}
function changeColor(element, newColor) {
element.style.backgroundColor = newColor;
if (newColor === 'white') {
element.style.color = 'lilac'; // Reset background color on image hide
} else {
element.style.color = 'white';
}
}