|
| 1 | +Clipboard |
| 2 | +========= |
| 3 | + |
| 4 | +Clipboard management plugin for Cordova/PhoneGap that supports iOS, Android, and Windows Phone 8. |
| 5 | + |
| 6 | +## Usage |
| 7 | + |
| 8 | +Install the plugin using the CLI, for instance with PhoneGap: |
| 9 | + |
| 10 | + phonegap local plugin add https://github.com/ibnclaudius/CordovaClipboard |
| 11 | + |
| 12 | +The plugin creates the object `cordova.plugins.clipboard` with the methods `copy(text, onSuccess, onError)` and `paste(onSuccess, onError)`. |
| 13 | + |
| 14 | +Example: |
| 15 | + |
| 16 | + var text = "Hello World!"; |
| 17 | + |
| 18 | + cordova.plugins.clipboard.copy(text); |
| 19 | + |
| 20 | + cordova.plugins.clipboard.paste(function (text) { alert(text); }); |
| 21 | + |
| 22 | +## Notes |
| 23 | + |
| 24 | +### All platforms |
| 25 | + |
| 26 | +- The plugin only works with text content. |
| 27 | + |
| 28 | +### Windows Phone |
| 29 | + |
| 30 | +- The Windows Phone platform doesn't allow applications to read the content of the clipboard. Using the `paste` method will return an error. |
| 31 | + |
| 32 | +### Android |
| 33 | + |
| 34 | +- The minimum supported API Level is 11. Make sure that `minSdkVersion` is larger or equal to 11 in `AndroidManifest.xml`. |
| 35 | + |
| 36 | +## Acknowledgements |
| 37 | + |
| 38 | +This plugin was inspired by [ClipboardManagerPlugin](https://github.com/jacob/ClipboardManagerPlugin) (Android) and [ClipboardPlugin](https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/ClipboardPlugin) (iOS). |
| 39 | + |
| 40 | +## License |
| 41 | + |
| 42 | +The MIT License (MIT) |
| 43 | + |
| 44 | +Copyright (c) 2013 Verso Solutions LLC |
| 45 | + |
| 46 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 47 | +of this software and associated documentation files (the "Software"), to deal |
| 48 | +in the Software without restriction, including without limitation the rights |
| 49 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 50 | +copies of the Software, and to permit persons to whom the Software is |
| 51 | +furnished to do so, subject to the following conditions: |
| 52 | + |
| 53 | +The above copyright notice and this permission notice shall be included in |
| 54 | +all copies or substantial portions of the Software. |
| 55 | + |
| 56 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 57 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 58 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 59 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 60 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 61 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 62 | +THE SOFTWARE. |
0 commit comments