Commit Graph

64 Commits

Author SHA1 Message Date
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
r3nanp cb1fec4c6a refactor: remove eslint ignore rules comments 2021-02-16 19:01:13 -03:00
r3nanp b21b99fe5f chore(clipboard): remove linter bugs 2021-02-13 10:56:07 -03:00
vitormalencar 971834388c update code style 2021-01-21 11:45:33 +01: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
LeuisKen 5de8be447f fix: change export from commonjs to es module for import from src usage. 2020-03-03 18:09:24 -08:00
ossdev 83824fa248 ClipboardJS: Removed PhantomJS Dependency
Added karma-chrome-launcher dependency

Signed-off-by: ossdev <ossdev@puresoftware.com>
2020-02-29 09:53:41 -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
Sebastian Ekström 941bdbb16e Use const instead of let when applicable 2016-04-01 13:17:12 +02:00
Helder Santana 90a52149ed fix babel 6 export default behaviour 2016-02-20 01:41:40 -05:00
Oskar Cieslik (rpawfuiml) 2aa163b1d0 Small ES2015 changes ;). 2015-11-13 22:01:59 +01:00
Zeno Rocha cb4301658c Updates delegate package which now exposes e.delegateTarget property #120 2015-11-13 00:24:46 -08:00
Paul Felice 37136663df use event's currentTarget instead of target 2015-11-06 15:49:21 +01: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
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
Zeno Rocha c16137511c Source formatting #63 2015-10-03 16:25:20 -07:00
Vitor Cortez 15a66df290 Edit ´getAttributeValue´ to a function declaration
Favoring function declaration over a function expression in this case to follow style guidelines.
2015-10-03 16:25:20 -07:00
Vitor Cortez ff4755fe4c Add helper method to dry default set functions 2015-10-03 16:25:20 -07:00
Zeno Rocha a5e29bd420 Removes code from #constructor to separate functions 2015-09-29 22:14:26 -07:00
Zeno Rocha 3394f59691 Returns undefined instead of null if attributes does not exists #21 2015-09-29 18:24:33 -07:00
Jory Graham 902c730a4d Use undefined for default parameters 2015-09-29 20:09:17 -04:00
rspecht 14baab7386 using default parameters instead the 'or' approach 2015-09-29 18:36:07 -03:00
Mauricio Soares 05a807e2fb Adds UMD support
Using the --standalone option from browserify it automatically wrap your code into a UMD module.
2015-09-29 11:09:28 -03:00
Zeno Rocha 194bf6aeb3 Source formatting 2015-09-28 23:54:34 -07:00
Zeno Rocha 1f61e16eb5 Fails silently in favor of speed 2015-09-28 21:59:18 -07:00
Zeno Rocha 775e4b898d Source formatting 2015-09-28 21:56:29 -07:00
Eduardo Lundgren b842987292 Adds support to set action/target/text via function 2015-09-29 01:15:21 -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 467684333f Moves from Node's require to ES6's import syntax 2015-09-26 17:31:18 -07:00
Zeno Rocha bb60a866b2 Fixes tests 2015-09-26 07:32:27 -07:00
Zeno Rocha e3f69de585 Renames host argument to emitter 2015-09-26 07:31:59 -07:00
Zeno Rocha 1ac258dea5 Moves to a better delegate library 2015-09-24 22:23:15 -07:00
Zeno Rocha 076e3b8a64 Destroys the previous ClipboardAction instance whenever a new click is triggered 2015-09-24 21:24:21 -07:00
Zeno Rocha 3610bfa08c Emits event on base class instead of each element for better performance 2015-09-24 18:19:40 -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 540038e2ad Adds documentation for each block 2015-09-24 16:18:50 -07:00
Zeno Rocha 56dd1aac22 Handles attributes with getters/setters and breaks code into two classes 2015-09-24 15:11:11 -07:00
Zeno Rocha e72ce02c87 Clears selection only if operation succeeded 2015-09-23 10:54:18 -07:00
Zeno Rocha dedfbffe05 Fixes selection on non-editable elements 2015-09-22 23:32:04 -07:00
Zeno Rocha fbb2a316bf Removes fake element from screen instead making it transparent 2015-09-22 09:59:15 -07:00
Zeno Rocha b4a748f89f Uses template string instead of concat strings 2015-09-22 08:33:34 -07:00
Zeno Rocha c92c4e545a Removes "no-support" event in favor of "error" and "copy/cut" in favor of "success" 2015-09-21 10:32:11 -07:00
Eduardo Lundgren 23b20d6006 Uses optimistic execCommand and removes redundant logic - Fixes #1 2015-09-21 09:39:41 -07:00
Zeno Rocha f3c042a364 Only fire detailed events if copy was successful 2015-09-21 01:15:01 -07:00
Zeno Rocha aebcbdf292 Updates headline and add default export 2015-09-21 00:37:02 -07:00