ÿØÿà JFIF ÿÛ „ ( %"1"%)+...383,7(-.-
![]() Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20 System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 User : apache ( 48) PHP Version : 7.4.20 Disable Function : NONE Directory : /var/www/html/luckymerchan/layout/default/node_modules/clipboard/src/actions/ |
import ClipboardActionCut from './cut'; import ClipboardActionCopy from './copy'; /** * Inner function which performs selection from either `text` or `target` * properties and then executes copy or cut operations. * @param {Object} options */ const ClipboardActionDefault = (options = {}) => { // Defines base properties passed from constructor. const { action = 'copy', container, target, text } = options; // Sets the `action` to be performed which can be either 'copy' or 'cut'. if (action !== 'copy' && action !== 'cut') { throw new Error('Invalid "action" value, use either "copy" or "cut"'); } // Sets the `target` property using an element that will be have its content copied. if (target !== undefined) { if (target && typeof target === 'object' && target.nodeType === 1) { if (action === 'copy' && target.hasAttribute('disabled')) { throw new Error( 'Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute' ); } if ( action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled')) ) { throw new Error( 'Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes' ); } } else { throw new Error('Invalid "target" value, use a valid Element'); } } // Define selection strategy based on `text` property. if (text) { return ClipboardActionCopy(text, { container }); } // Defines which selection strategy based on `target` property. if (target) { return action === 'cut' ? ClipboardActionCut(target) : ClipboardActionCopy(target, { container }); } }; export default ClipboardActionDefault;