fixed sanitazer and academy
This commit is contained in:
@@ -327,4 +327,26 @@
|
||||
@if($needsXEmbeds)
|
||||
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||
@endif
|
||||
|
||||
<script>
|
||||
// Make inline article images open with the same preview used for cover images.
|
||||
(function () {
|
||||
function attachStoryImagePreview() {
|
||||
document.querySelectorAll('.story-prose img').forEach(function (img) {
|
||||
if (!img) return;
|
||||
if (!img.hasAttribute('data-news-image-preview')) {
|
||||
img.setAttribute('data-news-image-preview', '');
|
||||
img.setAttribute('data-news-image-src', img.getAttribute('src') || img.getAttribute('data-src') || '');
|
||||
img.setAttribute('data-news-image-alt', img.getAttribute('alt') || img.getAttribute('aria-label') || 'Image preview');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', attachStoryImagePreview);
|
||||
} else {
|
||||
attachStoryImagePreview();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user