Skip to content

Commit

Permalink
Merge pull request #86 from hyperaudio/upgrade-hyperaudio-lite-2.0.14
Browse files Browse the repository at this point in the history
upgrade to Hyperaudio Lite 2.0.14
  • Loading branch information
maboa authored Jul 5, 2022
2 parents b678afd + 02db7e2 commit 2d71e01
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
3 changes: 2 additions & 1 deletion wp-hyperaudio/hyperaudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function hyperaudio_shortcode_handler($atts, $transcript, $tag)

$o .= '<script>
ShareThis({
sharers: [ ShareThisViaTwitter ],
sharers: [ ShareThisViaTwitter, ShareThisViaClipboard ],
selector: "article"
}).init();
Expand Down Expand Up @@ -212,6 +212,7 @@ function hyperaudio_init()
wp_enqueue_script('caption', plugins_url('/js/caption.js', __FILE__), false, '1.0.0', false);
wp_enqueue_script('share-this', plugins_url('/js/share-this.js', __FILE__), false, '1.0.0', false);
wp_enqueue_script('share-this-twitter', plugins_url('/js/share-this-twitter.js', __FILE__), false, '1.0.0', false);
wp_enqueue_script('share-this-clipboard', plugins_url('/js/share-this-clipboard.js', __FILE__), false, '1.0.0', false);
wp_enqueue_script('twitter-widget', plugins_url('https://platform.twitter.com/widgets.js', __FILE__), false, '1.0.0', false);
}
}
Expand Down
8 changes: 6 additions & 2 deletions wp-hyperaudio/js/hyperaudio-lite.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! (C) The Hyperaudio Project. MIT @license: en.wikipedia.org/wiki/MIT_License. */
/*! Version 2.0.13 */
/*! Version 2.0.14 */

'use strict';

Expand Down Expand Up @@ -459,7 +459,11 @@ class HyperaudioLite {
if (paymentPointer !== null) {
return paymentPointer;
} else {
let parent = element.parentElement;
let parent = null;

if (typeof element !== 'undefined') {
parent = element.parentElement;
}

if (parent === null) {
return null;
Expand Down
17 changes: 17 additions & 0 deletions wp-hyperaudio/js/share-this-clipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
!function(e,r){
"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e=e||self).ShareThisViaClipboard={})
}
(this,(
function(e){
"use strict";
e.getShareUrl = function(text,refUrl){
const saneText = text.replaceAll("'", "`");
const cbText = "&quot;" + saneText + "&quot; " + refUrl;
return `onclick="navigator.clipboard.writeText('${cbText}');alert('copied the following text to the clipboard – ${cbText}')"`;
},
e.name="clipboard",
e.render = function(text, rawText, refUrl){
return"<a "+this.getShareUrl(text,refUrl)+' rel="noopener nofollow noreferrer"><svg xmlns="http://www.w3.org/2000/svg" viewBox="-9 -9 600 600"><path d="m161,152.9h190c0.1,0 0.1,0 0.2,0 10.8,0 19.6-7.1 19.6-16 0-1.5-14.1-82.7-14.1-82.7-1.3-7.9-9.6-13.8-19.4-13.8l-61.7,.1v-13.5c0-8.8-8.8-16-19.6-16-10.8,0-19.6,7.1-19.6,16v13.6l-61.8,.1c-9.8,0-18,5.9-19.4,13.8l-13.7,80.3c-1.2,14.3 13.5,18.1 19.5,18.1z" fill="currentcolor"/><path d="m427.5,78.9h-26.8c0,0 9.3,53.5 9.3,58 0,30.4-26.4,55.2-58.8,55.2h-190.2c-19.6,0.4-63.3-14.7-58.1-63.9l8.4-49.2h-26.8c-10.8,0-19.6,8.8-19.6,19.6v382.9c0,10.8 8.8,19.6 19.6,19.6h343c10.8,0 19.6-8.8 19.6-19.6v-383c0-10.8-8.8-19.6-19.6-19.6zm-76.5,320.1h-190c-10.8,0-19.6-8.8-19.6-19.6 0-10.8 8.8-19.6 19.6-19.6h190c10.8,0 19.6,8.8 19.6,19.6 0,10.8-8.7,19.6-19.6,19.6zm0-110.3h-190c-10.8,0-19.6-8.8-19.6-19.6 0-10.8 8.8-19.6 19.6-19.6h190c10.8,0 19.6,8.8 19.6,19.6 0,10.8-8.7,19.6-19.6,19.6z" fill="currentcolor"/></svg></a>'
},
Object.defineProperty(e,"__esModule",{value:!0})
}));

0 comments on commit 2d71e01

Please sign in to comment.