@yidun/livedetect-sdk-h5 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined'
3
- ? factory(exports)
4
- : typeof define === 'function' && define.amd
5
- ? define(['exports'], factory)
6
- : ((global = global || self), factory((global.copee = {})));
7
- })(this, function (exports) {
8
- 'use strict';
9
-
10
- /**
11
- * Copy text to the user's clipboard
12
- */
13
- function toClipboard(text) {
14
- // Create element and select the text
15
- const ta = document.createElement('textarea');
16
- ta.value = text;
17
- ta.cols = 1;
18
- ta.rows = 1;
19
- ta.style.color = 'transparent';
20
- ta.style.border = 'none';
21
- document.body.appendChild(ta);
22
- ta.select();
23
- let success = false;
24
- try {
25
- success = document.execCommand('copy');
26
- } catch (err) {
27
- success = false;
28
- }
29
- // Cleanup the element we created
30
- document.body.removeChild(ta);
31
- return success;
32
- }
33
- /**
34
- * Copy text from an input/textarea element to a user's clipboard
35
- * @param el The <input> or <textarea> element
36
- * @param preserveSelection True if text selection/highlight should be preserved after copying text
37
- */
38
- function fromElement(el, preserveSelection) {
39
- let start = 0;
40
- let end = 0;
41
- let success = false;
42
- if (preserveSelection) {
43
- start = el.selectionStart || 0;
44
- end = el.selectionEnd || 0;
45
- }
46
- el.select();
47
- try {
48
- success = document.execCommand('copy');
49
- } catch (err) {
50
- success = false;
51
- }
52
- if (preserveSelection) {
53
- el.setSelectionRange(start, end);
54
- }
55
- return success;
56
- }
57
-
58
- exports.toClipboard = toClipboard;
59
- exports.fromElement = fromElement;
60
-
61
- Object.defineProperty(exports, '__esModule', { value: true });
62
- });