cordova-clipboard
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "cordova-clipboard", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Clipboard management plugin for Cordova/PhoneGap that supports iOS, Android, and WP8", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -12,3 +12,3 @@ Clipboard | ||
The plugin creates the object `cordova.plugins.clipboard` with the methods `copy(text, onSuccess, onError)` and `paste(onSuccess, onError)`. | ||
The plugin creates the object `cordova.plugins.clipboard` with the methods `copy(text, onSuccess, onError)`, `paste(onSuccess, onError)` and `clear(onSuccess, onError)` | ||
@@ -23,2 +23,4 @@ Example: | ||
cordova.plugins.clipboard.clear(); | ||
## Notes | ||
@@ -25,0 +27,0 @@ |
@@ -55,2 +55,11 @@ /* | ||
} | ||
}, | ||
clear: function (successCallback, errorCallback, args) { | ||
try { | ||
if(Windows.ApplicationModel.DataTransfer.Clipboard.getContent()){ | ||
successCallback(true); | ||
} | ||
} catch (e) { | ||
errorCallback(e);; | ||
} | ||
} | ||
@@ -57,0 +66,0 @@ }; // exports |
@@ -32,4 +32,14 @@ var cordova = require('cordova'); | ||
/** | ||
* Clear the clipboard content | ||
* | ||
* @param {Function} onSuccess The function to call in case of success | ||
* @param {Function} onFail The function to call in case of error | ||
*/ | ||
Clipboard.prototype.clear = function (onSuccess, onFail) { | ||
cordova.exec(onSuccess, onFail, "Clipboard", "clear", []); | ||
}; | ||
// Register the plugin | ||
var clipboard = new Clipboard(); | ||
module.exports = clipboard; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
15986
98
65