mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
31 lines
569 B
JavaScript
31 lines
569 B
JavaScript
/**
|
|
* Clipboard plugin for PhoneGap
|
|
*
|
|
* @constructor
|
|
*/
|
|
function ClipboardPlugin()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Set the clipboard text
|
|
*
|
|
* @param {String} text The new clipboard content
|
|
*/
|
|
ClipboardPlugin.prototype.setText = function(text)
|
|
{
|
|
PhoneGap.exec("ClipboardPlugin.setText", text);
|
|
}
|
|
|
|
/**
|
|
* Register the plugin with PhoneGap
|
|
*/
|
|
ClipboardPlugin.install = function()
|
|
{
|
|
if ( !window.plugins )
|
|
window.plugins = {};
|
|
if ( !window.plugins.clipboardPlugin )
|
|
window.plugins.clipboardPlugin = new ClipboardPlugin();
|
|
}
|
|
PhoneGap.addConstructor(ClipboardPlugin.install);
|