Commit Graph

48 Commits

Author SHA1 Message Date
Beto Muniz 21db7250ed
Support more HTML input types. Close #800 (#808)
* Support more HTML input types.

* Improve test description. Remove .only

* Apply logic only when target is an input element
2022-05-04 14:47:44 -03:00
Patrick H. Lauke 08169bce8c
Fix #805 don't `blur()` the trigger after a clipboard action (#807)
* Remove the `blur()` following a clipboard action

It's pointless to set `focus()` on the trigger first, if in the next step you're just going to `blur()` the active element anyway.

* Tweak test to not expect active element to be body

Since it's now not `blur()`ing anymore

* Fix test

see https://github.com/zenorocha/clipboard.js/pull/807#discussion_r862080076
2022-05-04 14:45:44 -03:00
Beto Muniz 7d675f5fc1
Fix Event API. Update demos. Update tests (#793) 2022-02-02 12:13:00 -03:00
Beto Muniz 44df750c9f
Isolate actions strategies in order to code improvement and programmatic 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
2021-05-18 11:46:22 -03:00
vitormalencar 7b7ce32b65 Merge branch 'master' of github.com:zenorocha/clipboard.js into feature-732-removing-dom-el
* 'master' of github.com:zenorocha/clipboard.js:
  refactor(workflows): remove unused lint file
  feat(workflows): add lint code job
  chore(eslint): add comments and new rules
  chore(deps): remove sort-package-json
  refactor: remove eslint ignore rules comments
  ci(lint): create a ci workflow
  chore(clipboard): remove linter bugs
  chore(deps): add dependencies and new scripts
  chore(test): remove linter bugs
  chore(linter): add linter configuration
  feat(eslint): add linter configuration
  chore(deps): add linter
  updating naming
  adding deploy action
2021-02-25 16:21:53 +01:00
vitormalencar 5d3da80640 feat: updating test coverage 2021-02-25 16:16:42 +01:00
vitormalencar eff98406b9 updating tests 2021-02-24 22:47:58 +01:00
r3nanp cb1fec4c6a refactor: remove eslint ignore rules comments 2021-02-16 19:01:13 -03:00
r3nanp 99c1b9488b chore(test): remove linter bugs 2021-02-13 10:53:22 -03:00
Beto Muniz ddb5adc6f8 Merge branch 'master' into small-enhancements
* master:
  update code style
  update prettier config
  update dependencies
  update code style
  Add prettier husky and  lint-staged
  Add prettier config file
  add prettier config files
2021-01-21 14:25:36 -03:00
vitormalencar 971834388c update code style 2021-01-21 11:45:33 +01:00
Beto Muniz e5d3f91f35 Remove unnecessary dependency 2021-01-20 12:57:58 -03:00
vitormalencar 2660565b61 update code style 2021-01-20 16:55:03 +01:00
Zeno Rocha e430d056ad Fix "isSupported" behavior - Closes #666 2020-03-04 22:24:24 -08:00
Peder Johnsen f42b57067d Container option (#368)
* Allow container option to fix bugs related to bootstrap modals etc.

* Updated readme to reflect addition of container option

* Name link

* Removed test log

* Remove unwanted whitespace

* Refactored description
2017-05-29 14:17:26 -07:00
Gabriel Kalani 5ab50475e0 ES6 refactor (#409)
* little fix

* little fix /2

* test/clipboard.js refactored

* emitter: emitter --> emitter

* Examples in ES6

* es6

* back to original code

* script > npm test

* script > npm test not necessary

* updating modules

* removing export default
2017-05-02 21:34:18 -07:00
Itai Steinherz 63d1b0f014 Add isSupported method #355 2017-02-07 23:36:29 -08:00
Zeno Rocha 7a5a910bcd Removes error message when target/text attributes are null, undefined, or false 2016-04-03 22:16:22 -07:00
RAFIE Younes 31e3622e17 Fixed RTL issue #161 2016-02-02 13:27:11 -08:00
Netto Farah 4b27a72dce Add a bit more clarity to Invalid Target test 2015-12-13 13:11:02 -08:00
Paul Felice 37136663df use event's currentTarget instead of target 2015-11-06 15:49:21 +01:00
Zeno Rocha 03ee9829e0 Removes browserify tests 2015-10-28 12:56:52 -07:00
Zeno Rocha 6b1f6b22a6 Allows HTML elements to be passed in the constructor - Fixes #25 2015-10-26 01:06:29 -07:00
Zeno Rocha 70b2548a80 Migrates to delegate fork 2015-10-20 12:35:25 -07:00
Rafael Fragoso c911ba0f53 Replacing anonymous functions with arrow functions to keep the pattern 2015-10-15 21:24:06 -03:00
Zeno Rocha 8dc4e2e132 Adds destroy method for ClipboardAction too #24 2015-10-03 19:05:12 -07:00
Zeno Rocha 0c24503214 Source formatting and testing for #24 2015-10-03 19:04:37 -07:00
Zeno Rocha cc9d562580 Renames "initialize" method to "onClick" #51 2015-10-03 16:44:47 -07:00
Bryan Bess 4d1fa1ba75 Remove unused import and add missing semicolons 2015-09-30 20:55:35 -05:00
Zeno Rocha aeec3fd520 Source formatting #19 2015-09-29 22:28:15 -07:00
Mauricio Soares 4534fc4ca0 Adds test for browserify
This commit adds tests to make sure that the browserify bundle will work in the dist file of clipboard.js

This commit adds the mocha and chai modules, since karma doesn't work well with node only tests.

Also splited tests tasks in package.json and updated .gitignore
2015-09-29 22:16:32 -07:00
Zeno Rocha a5e29bd420 Removes code from #constructor to separate functions 2015-09-29 22:14:26 -07:00
Jory Graham d66aab1124 Default options for ClipboardAction too 2015-09-29 20:23:05 -04:00
Jory Graham 902c730a4d Use undefined for default parameters 2015-09-29 20:09:17 -04:00
Zeno Rocha 1f61e16eb5 Fails silently in favor of speed 2015-09-28 21:59:18 -07:00
Eduardo Lundgren b842987292 Adds support to set action/target/text via function 2015-09-29 01:15:21 -03:00
Eduardo Lundgren beab7bc087 Changes target to support selector instead of id 2015-09-28 23:37:58 -03:00
Mauricio Soares 157b0fb5a2 Rename data-attributes to prefix "clipboard"
This PR renames all the data-attributes for data-clipboard-X, this is due the possibility of conflict with projects that already uses these data-attributes.
2015-09-28 14:06:22 -03:00
Zeno Rocha b0e118f750 Improves test coverage 2015-09-27 11:53:52 -07:00
Zeno Rocha 1acd23049e Asserts error messages on tests 2015-09-26 09:26:54 -07:00
Zeno Rocha abeee82bdc Throws error if either data-target or data-text were passed and throws error if neither data-target nor data-text were passed too 2015-09-26 09:25:15 -07:00
Zeno Rocha bb60a866b2 Fixes tests 2015-09-26 07:32:27 -07:00
Zeno Rocha ced945f11a Replaces every single event listener in favor of event delegation 2015-09-24 17:02:33 -07:00
Zeno Rocha 1febe4eecc Adds karma test suite 2015-09-24 15:11:56 -07:00
Zeno Rocha f3c042a364 Only fire detailed events if copy was successful 2015-09-21 01:15:01 -07:00
Zeno Rocha cd7c8bfc27 Adds tests for Clipboard.validate 2015-09-20 15:40:59 -07:00
Zeno Rocha ec20389775 Adds tests for constructor 2015-09-20 00:57:19 -07:00
Zeno Rocha bea448d6c5 Includes base test structure 2015-09-20 00:23:33 -07:00