Add web intent plugin and bitcoin uri handler
This commit is contained in:
parent
b8fcc16a9d
commit
7c29eefab3
6 changed files with 326 additions and 1 deletions
75
mobile/plugins/com.borismus.webintent/www/webintent.js
Normal file
75
mobile/plugins/com.borismus.webintent/www/webintent.js
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
cordova.define("com.borismus.webintent.WebIntent", function(require, exports, module) { /**
|
||||
* cordova Web Intent plugin
|
||||
* Copyright (c) Boris Smus 2010
|
||||
*
|
||||
*/
|
||||
(function(cordova){
|
||||
var WebIntent = function() {
|
||||
|
||||
};
|
||||
|
||||
WebIntent.prototype.ACTION_SEND = "android.intent.action.SEND";
|
||||
WebIntent.prototype.ACTION_VIEW= "android.intent.action.VIEW";
|
||||
WebIntent.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
|
||||
WebIntent.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
|
||||
WebIntent.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
|
||||
WebIntent.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
|
||||
WebIntent.prototype.ACTION_CALL = "android.intent.action.CALL";
|
||||
WebIntent.prototype.ACTION_SENDTO = "android.intent.action.SENDTO";
|
||||
|
||||
WebIntent.prototype.startActivity = function(params, success, fail) {
|
||||
return cordova.exec(function(args) {
|
||||
success(args);
|
||||
}, function(args) {
|
||||
fail(args);
|
||||
}, 'WebIntent', 'startActivity', [params]);
|
||||
};
|
||||
|
||||
WebIntent.prototype.hasExtra = function(params, success, fail) {
|
||||
return cordova.exec(function(args) {
|
||||
success(args);
|
||||
}, function(args) {
|
||||
fail(args);
|
||||
}, 'WebIntent', 'hasExtra', [params]);
|
||||
};
|
||||
|
||||
WebIntent.prototype.getUri = function(success, fail) {
|
||||
return cordova.exec(function(args) {
|
||||
success(args);
|
||||
}, function(args) {
|
||||
fail(args);
|
||||
}, 'WebIntent', 'getUri', []);
|
||||
};
|
||||
|
||||
WebIntent.prototype.getExtra = function(params, success, fail) {
|
||||
return cordova.exec(function(args) {
|
||||
success(args);
|
||||
}, function(args) {
|
||||
fail(args);
|
||||
}, 'WebIntent', 'getExtra', [params]);
|
||||
};
|
||||
|
||||
|
||||
WebIntent.prototype.onNewIntent = function(callback) {
|
||||
return cordova.exec(function(args) {
|
||||
callback(args);
|
||||
}, function(args) {
|
||||
}, 'WebIntent', 'onNewIntent', []);
|
||||
};
|
||||
|
||||
WebIntent.prototype.sendBroadcast = function(params, success, fail) {
|
||||
return cordova.exec(function(args) {
|
||||
success(args);
|
||||
}, function(args) {
|
||||
fail(args);
|
||||
}, 'WebIntent', 'sendBroadcast', [params]);
|
||||
};
|
||||
|
||||
window.webintent = new WebIntent();
|
||||
|
||||
// backwards compatibility
|
||||
window.plugins = window.plugins || {};
|
||||
window.plugins.webintent = window.webintent;
|
||||
})(window.PhoneGap || window.Cordova || window.cordova);
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue