# booking/11.2/includes/page-form-builder/_src/support_functions.js

Booking Calendar, version 11.2. 39 lines.

- Page: https://pluginprobe.com/plugins/booking/11.2/code/includes/page-form-builder/_src/support_functions.js
- Raw: https://pluginprobe.com/plugins/booking/11.2/raw/includes/page-form-builder/_src/support_functions.js
- Modified: 2026-03-23T09:05:02+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/booking/11.2/code/includes/page-form-builder/_src/support_functions.js#L10-L20`.

```javascript
/**
 * Help Fucntions.
 * @file: ../includes/page-form-builder/_out/bfb_support_func.js
 */

/**
 * Clipboard (UI-only helper)
 *
 * @param text
 * @returns {Promise<boolean>}
 */
async function wpbc_copy_to_clipboard(text) {
	try {
		if ( window.isSecureContext && navigator.clipboard && navigator.clipboard.writeText ) {
			await navigator.clipboard.writeText( String( text || '' ) );
			return true;
		}
	} catch ( e ) {
		window._wpbc?.dev?.error?.( 'wpbc_copy_to_clipboard', e );
	}

	try {
		const ta = document.createElement( 'textarea' );
		ta.value = String( text || '' );
		ta.setAttribute( 'readonly', '' );
		ta.style.position = 'fixed';
		ta.style.top      = '-9999px';
		ta.style.opacity  = '0';
		document.body.appendChild( ta );
		ta.focus();
		ta.select();
		const ok = document.execCommand( 'copy' );
		document.body.removeChild( ta );
		return !! ok;
	} catch ( _ ) {
		return false;
	}
}

```
