Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
zedflow
fgdi
Commits
2416f461
Commit
2416f461
authored
1 year ago
by
Traboulsi
Browse files
Options
Download
Email Patches
Plain Diff
Update public/js/add_content.js
parent
6ada9e70
Pipeline
#9013
passed with stage
in 10 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/js/add_content.js
+17
-2
public/js/add_content.js
with
17 additions
and
2 deletions
+17
-2
public/js/add_content.js
+
17
-
2
View file @
2416f461
...
@@ -79,7 +79,16 @@ function addcontent(item) {
...
@@ -79,7 +79,16 @@ function addcontent(item) {
var
sdgProjectLink
=
item
.
sdgImage
;
var
sdgProjectLink
=
item
.
sdgImage
;
var
customColor
=
'
#8A2BE2
'
;
var
customColor
=
'
#8A2BE2
'
;
sdgProjectHTML
=
`<a class="sdg-button btn btn-sm btn-outline-" style="color:
${
customColor
}
; border-color:
${
customColor
}
;" href="javascript:void(0);"onclick="toggleImage('
${
sdgProjectLink
}
');"onmouseover="hoverEffect(this, 'white', '#8A2BE2');" onmouseout="hoverEffect(this, '
${
customColor
}
', 'white');">SDG Projekt<img id="sdgImage" src="" alt="SDG Project Image" style="max-width: 100%; max-height: 100%; display: none;"> </a> `
;
sdgProjectHTML
=
`<a class="sdg-button btn btn-sm btn-outline-" style="color:
${
customColor
}
; border-color:
${
customColor
}
;"
href="javascript:void(0);"
onclick="toggleImage('
${
sdgProjectLink
}
'); changeColor(this, 'lilac');"
onmouseover="hoverEffect(this, 'white', 'lilac');"
onmouseout="hoverEffect(this, '
${
customColor
}
', 'white');">
SDG Projekt
<img id="sdgImage" src="" alt="SDG Project Image" style="max-width: 100%; max-height: 100%; display: none;">
</a> `
;
}
/* var sdgProjectHTML = '';
/* var sdgProjectHTML = '';
if ('sdgImage' in item) {
if ('sdgImage' in item) {
...
@@ -107,7 +116,7 @@ function addcontent(item) {
...
@@ -107,7 +116,7 @@ function addcontent(item) {
window.open(sdgProjectLink, '_blank');
window.open(sdgProjectLink, '_blank');
}
}
</script>`;*/
</script>`;*/
}
//
}
//-- fin (new idea)
//-- fin (new idea)
...
@@ -204,6 +213,7 @@ function addTeam(item) {
...
@@ -204,6 +213,7 @@ function addTeam(item) {
new_row
.
innerHTML
=
new_row
.
innerHTML
+
html_team
new_row
.
innerHTML
=
new_row
.
innerHTML
+
html_team
}
}
}
}
function
toggleImage
(
imageLink
)
{
function
toggleImage
(
imageLink
)
{
var
imageElement
=
document
.
getElementById
(
'
sdgImage
'
);
var
imageElement
=
document
.
getElementById
(
'
sdgImage
'
);
if
(
imageElement
.
src
===
imageLink
)
{
if
(
imageElement
.
src
===
imageLink
)
{
...
@@ -219,3 +229,8 @@ function hoverEffect(element, color, textColor) {
...
@@ -219,3 +229,8 @@ function hoverEffect(element, color, textColor) {
element
.
style
.
backgroundColor
=
color
;
element
.
style
.
backgroundColor
=
color
;
element
.
style
.
color
=
textColor
;
element
.
style
.
color
=
textColor
;
}
}
function
changeColor
(
element
,
newColor
)
{
element
.
style
.
backgroundColor
=
newColor
;
element
.
style
.
color
=
'
white
'
;
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment