Commit 0288c98d authored by Traboulsi's avatar Traboulsi
Browse files

Update public/js/add_content.js

parent 0bf0bcf0
......@@ -82,39 +82,9 @@ function addcontent(item) {
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"> Global Goals </a> &nbsp;`;
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"> Global Goals </a> &nbsp;`;
}
/* 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> &nbsp;`
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> &nbsp;`;
}*/
//-- 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> &nbsp;`;*/
// 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 ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment