diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 20c9506..f927526 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -11,6 +11,7 @@ {{ partial "style.html" "scss/style.scss" }} {{ partial "style.html" "css/font-awesome.css" }} {{ partial "style.html" "css/highlight.css" }} + {{ partial "style.html" "css/shareon.css" }} {{ if eq .Params.layout "flickr" }} {{ partial "style.html" "css/lightgallery.css" }} diff --git a/layouts/partials/share.html b/layouts/partials/share.html index 1297ca9..4909ab2 100644 --- a/layouts/partials/share.html +++ b/layouts/partials/share.html @@ -1,11 +1,19 @@ {{ if .Section }}
{{ end }} diff --git a/package-lock.json b/package-lock.json index 9716bad..760f982 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,12 +9,12 @@ "dependencies": { "@fortawesome/fontawesome-free": "5.15.3", "bootstrap": "4.6.0", - "clipboard": "2.0.8", "elevator.js": "1.0.1", "jquery": "3.6.0", "lg-thumbnail": "1.2.1", "lightgallery": "1.10.0", - "lunr": "2.3.9" + "lunr": "2.3.9", + "shareon": "1.6.2" }, "devDependencies": { "broken-link-checker-local": "0.2.1", @@ -1348,16 +1348,6 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, - "node_modules/clipboard": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz", - "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", - "dependencies": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, "node_modules/cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -1703,11 +1693,6 @@ "node": ">= 0.4" } }, - "node_modules/delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" - }, "node_modules/depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -3790,14 +3775,6 @@ "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", "dev": true }, - "node_modules/good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "dependencies": { - "delegate": "^3.1.2" - } - }, "node_modules/graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -6221,11 +6198,6 @@ "integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=", "dev": true }, - "node_modules/select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" - }, "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -6311,6 +6283,11 @@ "sha.js": "bin.js" } }, + "node_modules/shareon": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/shareon/-/shareon-1.6.2.tgz", + "integrity": "sha512-MLvXj3pI+MkixWKWJ0lp0hcq4ep9A3HotIpM/HRRd1j1BedCuTDMxYCf9iHCMA5Dar6UGVgDi6mpeaNJlSxmPg==" + }, "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -7090,11 +7067,6 @@ "node": ">=0.6.0" } }, - "node_modules/tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" - }, "node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -8756,16 +8728,6 @@ "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", "dev": true }, - "clipboard": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.8.tgz", - "integrity": "sha512-Y6WO0unAIQp5bLmk1zdThRhgJt/x3ks6f30s3oE3H1mgIEU33XyQjEf8gsf6DxC7NPX8Y1SsNWjUjL/ywLnnbQ==", - "requires": { - "good-listener": "^1.2.2", - "select": "^1.1.2", - "tiny-emitter": "^2.0.0" - } - }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", @@ -9060,11 +9022,6 @@ "object-keys": "^1.0.12" } }, - "delegate": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", - "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==" - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -10831,14 +10788,6 @@ } } }, - "good-listener": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", - "requires": { - "delegate": "^3.1.2" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -12844,11 +12793,6 @@ "integrity": "sha1-8MgtmKOxOah3aogIBQuCRDEIf8o=", "dev": true }, - "select": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" - }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -12924,6 +12868,11 @@ "safe-buffer": "^5.0.1" } }, + "shareon": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/shareon/-/shareon-1.6.2.tgz", + "integrity": "sha512-MLvXj3pI+MkixWKWJ0lp0hcq4ep9A3HotIpM/HRRd1j1BedCuTDMxYCf9iHCMA5Dar6UGVgDi6mpeaNJlSxmPg==" + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -13596,11 +13545,6 @@ "setimmediate": "^1.0.4" } }, - "tiny-emitter": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", - "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==" - }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", diff --git a/package.json b/package.json index c333d26..bf73594 100644 --- a/package.json +++ b/package.json @@ -15,11 +15,11 @@ "dependencies": { "@fortawesome/fontawesome-free": "5.15.3", "bootstrap": "4.6.0", - "clipboard": "2.0.8", "elevator.js": "1.0.1", "jquery": "3.6.0", "lg-thumbnail": "1.2.1", "lightgallery": "1.10.0", - "lunr": "2.3.9" + "lunr": "2.3.9", + "shareon": "1.6.2" } } diff --git a/scripts/build.sh b/scripts/build.sh index 2881f92..c169dc5 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,6 +16,7 @@ cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/css/all.min.css $STATIC_BUILD/css/font-awesome.css cp $BASEDIR/node_modules/lightgallery/dist/css/lightgallery.min.css $STATIC_BUILD/css/lightgallery.css cp -r $BASEDIR/node_modules/@fortawesome/fontawesome-free/webfonts $STATIC_BUILD +cp $BASEDIR/node_modules/shareon/dist/shareon.min.css $STATIC_BUILD/css/shareon.css cp -r $STATIC_SRC/js/ $STATIC_BUILD/js/ cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.min.js diff --git a/static/src/js/app.js b/static/src/js/app.js index ca4a14d..68b96ac 100644 --- a/static/src/js/app.js +++ b/static/src/js/app.js @@ -1,5 +1,5 @@ -const Clipboard = require('clipboard'); const Elevator = require('elevator.js'); +const shareon = require('shareon'); function waitFor(obj, property, callback) { // Wait for a property to exist on window before running callback @@ -22,12 +22,6 @@ $(document).ready(function() { }); }); - new Clipboard('a').on('success', function(e) { - const ele = $(e.trigger); - ele.find('i').attr('class', 'fas fa-check'); - alert('Copied "' + ele.data('clipboard-text') + '" to clipboard!'); - }); - // HACK: ToC has blank li if no initial header $('#TableOfContents').each(function() { let ele = $(this); @@ -59,6 +53,8 @@ $(document).ready(function() { endAudio: '/audio/ding.mp3', preloadAudio: false, }); + + shareon(); }); function scrollTo(offset) { @@ -84,7 +80,3 @@ $('a[href^="#"] ').on('click', function(event) { scrollTo(target.offset().top); } }); - -$('[data-clipboard-text]').on('click', function(event) { - event.preventDefault(); -});