-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Isolate actions strategies in order to code improvement and programma…
…tic usage. (#749) * Isolate cut, copy and core helper functions. * Update tests to accommodate new proposal * Add/update tests * Add tests to static copy/cut methods * Update condition syntax based on PR reviews * Migrate clipboard-action-default to functional approach. Update tests. Add tests * Improve folder structure. Clean up code. * Add types. Fix tsd check env. Improve in-code doc comments * Improve in-code doc comments
- Loading branch information
1 parent
8762fc7
commit 44df750
Showing
22 changed files
with
718 additions
and
741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ bower_components | |
node_modules | ||
yarn-error.log | ||
yarn.lock | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>target-programmatic-copy</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
<body> | ||
<!-- 1. Define some markup --> | ||
<textarea id="bar">hello</textarea> | ||
<button id="btn"> | ||
Copy | ||
</button> | ||
|
||
<!-- 2. Include library --> | ||
<script src="../dist/clipboard.min.js"></script> | ||
|
||
<!-- 3. Instantiate clipboard --> | ||
<script> | ||
var btn = document.querySelector('#btn'); | ||
|
||
btn.addEventListener('click', () => { | ||
const textCopied = ClipboardJS.copy(document.querySelector('#bar')); | ||
console.log('copied!', textCopied); | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>target-programmatic-cut</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
<body> | ||
<!-- 1. Define some markup --> | ||
<textarea id="bar">hello</textarea> | ||
<button id="btn"> | ||
Cut | ||
</button> | ||
|
||
<!-- 2. Include library --> | ||
<script src="../dist/clipboard.min.js"></script> | ||
|
||
<!-- 3. Instantiate clipboard --> | ||
<script> | ||
var btn = document.querySelector('#btn'); | ||
|
||
btn.addEventListener('click', () => { | ||
const textCut = ClipboardJS.cut(document.querySelector('#bar')); | ||
console.log('cut!', textCut); | ||
}) | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>text-programmatic-copy</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
</head> | ||
<body> | ||
<!-- 1. Define some markup --> | ||
<button id="btn"> | ||
Copy | ||
</button> | ||
|
||
<!-- 2. Include library --> | ||
<script src="../dist/clipboard.min.js"></script> | ||
|
||
<!-- 3. Instantiate clipboard --> | ||
<script> | ||
var btn = document.querySelector('#btn'); | ||
|
||
btn.addEventListener('click', () => { | ||
const textCopied = ClipboardJS.copy('123'); | ||
console.log('copied!', textCopied); | ||
}) | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.