diff --git a/.eleventy.js b/.eleventy.js index 301f2ca..d116a96 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -56,7 +56,7 @@ function initClipboardJS(options) { throw minified.error; } return ` -`; +`; } module.exports = { diff --git a/.gitignore b/.gitignore index 51cb94d..0292607 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules .idea example/node_modules -example/_site \ No newline at end of file +example/_site + +*.iml diff --git a/init-clipboard.js b/init-clipboard.js index 2c0633b..5e9e057 100644 --- a/init-clipboard.js +++ b/init-clipboard.js @@ -5,8 +5,8 @@ function showTooltip(el, msg) { } } -window.onload = () => { +window.addEventListener('load', () => { const clipboard = new ClipboardJS(''); // replaced by plugin clipboard.on('success', (el) => showTooltip(el, 'Copied!')); clipboard.on('error', (el) => showTooltip(el, 'Failed...')); -}; +}); diff --git a/package-lock.json b/package-lock.json index 24480e7..f4af18d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "eleventy-plugin-code-clipboard", - "version": "0.0.8", + "version": "0.0.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eleventy-plugin-code-clipboard", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "dependencies": { "uglify-js": "^3.14.5" diff --git a/package.json b/package.json index 8d22d55..ffddd01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eleventy-plugin-code-clipboard", - "version": "0.0.8", + "version": "0.0.9", "description": "eleventy plugin to copy fence into clipboard", "homepage": "https://github.com/mamezou-tech/eleventy-plugin-code-clipboard", "main": ".eleventy.js", diff --git a/test/__snapshots__/test.js.snap b/test/__snapshots__/test.js.snap index 3cc2aa7..6645294 100644 --- a/test/__snapshots__/test.js.snap +++ b/test/__snapshots__/test.js.snap @@ -1,13 +1,13 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`clipboard.js initialization custom plugin config 1`] = ` -" -" +" +" `; exports[`clipboard.js initialization default plugin config 1`] = ` -" -" +" +" `; exports[`custom renderer custom renderer config 1`] = `