I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
Badge Customizer for Publications
Generated Code
Preview
`;
if (enableAltmetric) {
code += `
`;
}
if (enableDimensions) {
code += `
`;
}
if (enableScite) {
code += `
`;
}
code += `
`;
// Display generated code
document.getElementById('generatedCode').textContent = code;
// Render preview
const preview = document.getElementById('preview');
preview.innerHTML = '';
if (enableAltmetric) {
const altmetricDiv = document.createElement('div');
altmetricDiv.className = 'badge altmetric-embed';
altmetricDiv.setAttribute('data-badge-popover', 'bottom');
altmetricDiv.setAttribute('data-badge-type', '2');
altmetricDiv.setAttribute('data-hide-no-mentions', 'true');
preview.appendChild(altmetricDiv);
}
if (enableDimensions) {
const dimensionsSpan = document.createElement('span');
dimensionsSpan.className = 'badge __dimensions_badge_embed__';
dimensionsSpan.setAttribute('data-hide-zero-citations', 'true');
dimensionsSpan.setAttribute('data-legend', 'hover-bottom');
dimensionsSpan.setAttribute('data-style', 'large_rectangle');
preview.appendChild(dimensionsSpan);
}
if (enableScite) {
const sciteDiv = document.createElement('div');
sciteDiv.className = 'badge scite-badge';
sciteDiv.setAttribute('data-layout', 'horizontal');
sciteDiv.setAttribute('data-show-zero', 'true');
sciteDiv.setAttribute('data-small', 'false');
preview.appendChild(sciteDiv);
}
// Re-initialize badges
window._altmetric_embed_init();
window.__dimensions_embed.addBadges();
});