[ 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
/
shared
/
presets
/
UPLOAD:
NAME
SIZE
QUICK PERMS
ACTIONS
📁 parts
SET
[ DEL ]
📄 ActionBar.js
9,233 B
SET
[ EDIT ]
|
[ DEL ]
📄 Behavior.js
5,564 B
SET
[ EDIT ]
|
[ DEL ]
📄 CTA.js
10,729 B
SET
[ EDIT ]
|
[ DEL ]
📄 Controls.js
4,779 B
SET
[ EDIT ]
|
[ DEL ]
📄 Edit.js
10,235 B
SET
[ EDIT ]
|
[ DEL ]
📄 Email.js
7,520 B
SET
[ EDIT ]
|
[ DEL ]
📄 Preset.js
6,565 B
SET
[ EDIT ]
|
[ DEL ]
📄 Search.js
3,832 B
SET
[ EDIT ]
|
[ DEL ]
📄 Style.js
2,114 B
SET
[ EDIT ]
|
[ DEL ]
📄 Watermark.js
4,043 B
SET
[ EDIT ]
|
[ DEL ]
📄 index.js
3,615 B
SET
[ EDIT ]
|
[ DEL ]
DELETE SELECTED
[ CLOSE ]
EDIT: Search.js
/** * WordPress dependencies */ import { __ } from "@wordpress/i18n"; import { ToggleControl, BaseControl, RangeControl, TextControl, Button, } from "@wordpress/components"; import { chevronDown, chevronUp } from "@wordpress/icons"; import { useEffect, useState } from "@wordpress/element"; export default ({ state, updateState, className }) => { const { search } = state; const [showAdvanced, setShowAdvanced] = useState(false); const defaults = { enabled: false, minMatchCharLength: 1, threshold: 0.3, placeholder: "Search", }; useEffect(() => { Object.keys(defaults).forEach((key) => { if (state?.search?.[key] === undefined) { updateSearchState({ [key]: defaults[key], }); } }); }, [state]); const updateSearchState = (updated) => { updateState({ ...state, search: { ...search, ...updated, }, }); }; return ( <div className={className}> <BaseControl> <h3>{__("Searchable Captions", "presto-player")}</h3> </BaseControl> <BaseControl className="presto-player__control--search"> <ToggleControl label={__("Enable", "presto-player")} help={__( "Show a search bar on your player which enables searching within the subtitles of the video.", "presto-player" )} onChange={(enabled) => { updateSearchState({ enabled, }); }} checked={search?.enabled} /> </BaseControl> {search?.enabled && ( <div> <BaseControl className="presto-player__control--placeholder-text"> <TextControl label={__("Placeholder Text", "presto-player")} help="" value={search?.placeholder} onChange={(placeholder) => updateSearchState({ placeholder })} /> </BaseControl> <BaseControl> <Button onClick={() => setShowAdvanced(!showAdvanced)} iconPosition="right" icon={showAdvanced ? chevronUp : chevronDown} variant="link" > {__("Advanced Settings", "presto-player")} </Button> </BaseControl> {!!showAdvanced && ( <> <BaseControl> <RangeControl label={__( "Minimum Matching Character Length", "presto-player" )} help={__( "Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to 2", "presto-player" )} value={search?.minMatchCharLength || 1} onChange={(minMatchCharLength) => updateSearchState({ minMatchCharLength }) } min={0} max={10} /> </BaseControl> <BaseControl> <RangeControl label={__("Threshold", "presto-player")} help={__( "At what point does the match algorithm give up. A threshold of 0.0 requires a perfect match (of both letters and location), a threshold of 1.0 would match anything.", "presto-player" )} value={search?.threshold || 1} onChange={(threshold) => updateSearchState({ threshold })} min={0} max={1} step={0.1} /> </BaseControl> </> )} </div> )} </div> ); };