mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-01-24 13:38:06 -05:00
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* Phonegap Web Intent plugin
|
|
* Copyright (c) Boris Smus 2010
|
|
*
|
|
*/
|
|
var WebIntent = function() {
|
|
|
|
};
|
|
|
|
WebIntent.ACTION_SEND = "android.intent.action.SEND";
|
|
WebIntent.ACTION_VIEW= "android.intent.action.VIEW";
|
|
WebIntent.EXTRA_TEXT = "android.intent.extra.TEXT";
|
|
WebIntent.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
|
|
|
|
WebIntent.prototype.startActivity = function(params, success, fail) {
|
|
return PhoneGap.exec(function(args) {
|
|
success(args);
|
|
}, function(args) {
|
|
fail(args);
|
|
}, 'WebIntent', 'startActivity', [params]);
|
|
};
|
|
|
|
WebIntent.prototype.hasExtra = function(params, success, fail) {
|
|
return PhoneGap.exec(function(args) {
|
|
success(args);
|
|
}, function(args) {
|
|
fail(args);
|
|
}, 'WebIntent', 'hasExtra', [params]);
|
|
};
|
|
|
|
WebIntent.prototype.getExtra = function(params, success, fail) {
|
|
return PhoneGap.exec(function(args) {
|
|
success(args);
|
|
}, function(args) {
|
|
fail(args);
|
|
}, 'WebIntent', 'getExtra', [params]);
|
|
};
|
|
|
|
PhoneGap.addConstructor(function() {
|
|
PhoneGap.addPlugin('webintent', new WebIntent());
|
|
PluginManager.addService("WebIntent","com.borismus.webintent.WebIntent");
|
|
}); |