PluginProbe
StreamCast – bring live radio to your site with a sleek player / 2.4.0
StreamCast – bring live radio to your site with a sleek player v2.4.0
2.4.5 2.4.4 trunk 1.0 1.1 2.0.0 2.1.10 2.1.2 2.1.4 2.1.5 2.1.8 2.2.1 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 All 29 releases
streamcast / assets / admin.js

admin.js in StreamCast – bring live radio to your site with a sleek player 2.4.0, at assets/admin.js

42 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function ($) {
2 $(document).ready(function () {
3 // Copy Quick Embed Shortcode
4 $(document).on("click", ".stp_shortcode_copy_btn", function (e) {
5 e.preventDefault();
6 const $btn = $(this);
7 const text = $btn.data("shortcode") || $btn.data("clipboard-text");
8 const $textSpan = $btn.find(".copy-text");
9 const originalText = $textSpan.length ? $textSpan.text() : "";
10
11 if (!text) return;
12
13 const performFeedback = () => {
14 $btn.addClass("copied");
15 if ($textSpan.length) {
16 $textSpan.text("Copied!");
17 setTimeout(() => {
18 $btn.removeClass("copied");
19 $textSpan.text(originalText);
20 }, 2000);
21 } else {
22 // Fallback if no span, maybe a tooltip or just a class
23 setTimeout(() => {
24 $btn.removeClass("copied");
25 }, 2000);
26 }
27 };
28
29 if (navigator.clipboard) {
30 navigator.clipboard.writeText(text).then(performFeedback);
31 } else {
32 const tempInput = document.createElement("input");
33 tempInput.value = text;
34 document.body.appendChild(tempInput);
35 tempInput.select();
36 document.execCommand("copy");
37 document.body.removeChild(tempInput);
38 performFeedback();
39 }
40 });
41 });
42 })(jQuery);