# streamcast/trunk/assets/admin.js

StreamCast – bring live radio to your site with a sleek player, version trunk. 42 lines.

- Page: https://pluginprobe.com/plugins/streamcast/trunk/code/assets/admin.js
- Raw: https://pluginprobe.com/plugins/streamcast/trunk/raw/assets/admin.js
- Modified: 2026-08-25T12:06:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/streamcast/trunk/code/assets/admin.js#L10-L20`.

```javascript
(function ($) {
  $(document).ready(function () {
    // Copy Quick Embed Shortcode
    $(document).on("click", ".streamcast_shortcode_copy_btn", function (e) {
      e.preventDefault();
      const $btn = $(this);
      const text = $btn.data("shortcode") || $btn.data("clipboard-text");
      const $textSpan = $btn.find(".copy-text");
      const originalText = $textSpan.length ? $textSpan.text() : "";

      if (!text) return;

      const performFeedback = () => {
        $btn.addClass("copied");
        if ($textSpan.length) {
          $textSpan.text("Copied!");
          setTimeout(() => {
            $btn.removeClass("copied");
            $textSpan.text(originalText);
          }, 2000);
        } else {
          // Fallback if no span, maybe a tooltip or just a class
          setTimeout(() => {
            $btn.removeClass("copied");
          }, 2000);
        }
      };

      if (navigator.clipboard) {
        navigator.clipboard.writeText(text).then(performFeedback);
      } else {
        const tempInput = document.createElement("input");
        tempInput.value = text;
        document.body.appendChild(tempInput);
        tempInput.select();
        document.execCommand("copy");
        document.body.removeChild(tempInput);
        performFeedback();
      }
    });
  });
})(jQuery);
```
