mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
485 B
17 lines
485 B
const ImageOverlay = require('./components/ImageOverlay')
|
|
const AnchorCopyButton = require('./components/AnchorCopyButton')
|
|
|
|
module.exports = {
|
|
init($, config) {
|
|
// wrap images
|
|
$('p > img').each((i, element) => {
|
|
const src = $(element).attr('src');
|
|
$(element).wrap(`<div class="ty-image-wrapper"></div>`)
|
|
$(element).parent().append(ImageOverlay(src))
|
|
})
|
|
|
|
// add anchor button to headlines
|
|
$('h1,h2,h3,h4,h5,h6').append(AnchorCopyButton())
|
|
}
|
|
}
|