feat(liens): décore les liens extérieurs et emails avec js ; fix #43
Parent
0b6d4d4e51
révision
755b4dc120
|
@ -3,6 +3,7 @@ import './lib/carte-hdf';
|
|||
import './lib/sticky';
|
||||
import './lib/toc';
|
||||
import './lib/leaflet';
|
||||
import './lib/links';
|
||||
import $ from 'jquery';
|
||||
|
||||
// Export jQuery for external usage
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
import $ from 'jquery';
|
||||
|
||||
$(() => {
|
||||
$('.rich-text a[href]').each(function () {
|
||||
const link = $(this);
|
||||
if (link.attr('href').startsWith('mailto')) {
|
||||
link.prepend('<i class="fa fa-envelope mr-1"></i>');
|
||||
} else if (link.attr('href').startsWith('http')) {
|
||||
link.prepend('<i class="fa fa-external-link mr-1"></i>');
|
||||
}
|
||||
});
|
||||
});
|
Chargement…
Référencer dans un nouveau ticket