-
Notifications
You must be signed in to change notification settings - Fork 1
/
ShareKitPlugin.js
executable file
·91 lines (57 loc) · 1.72 KB
/
ShareKitPlugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// ShareKitPlugin.js
//
//
// Created by Erick Camacho on 28/07/11.
// MIT Licensed
//
function ShareKitPlugin()
{
console.log('creating plugin');
};
ShareKitPlugin.prototype.share = function(message, url)
{
cordova.exec(null, null, "ShareKitPlugin", "share", [message, url]);
};
ShareKitPlugin.prototype.isLoggedToTwitter = function( callback )
{
cordova.exec(callback, null, "ShareKitPlugin", "isLoggedToTwitter", [] );
};
ShareKitPlugin.prototype.isLoggedToFacebook = function( callback )
{
cordova.exec(callback, null, "ShareKitPlugin", "isLoggedToFacebook", [] );
};
ShareKitPlugin.prototype.logoutFromTwitter = function()
{
cordova.exec(null, null, "ShareKitPlugin", "logoutFromTwitter", [] );
};
ShareKitPlugin.prototype.logoutFromFacebook = function()
{
cordova.exec(null, null, "ShareKitPlugin", "logoutFromFacebook", [] );
};
ShareKitPlugin.prototype.facebookConnect = function()
{
cordova.exec(null, null, "ShareKitPlugin", "facebookConnect", [] );
};
ShareKitPlugin.prototype.shareToFacebook = function( message, url)
{
cordova.exec(null, null, "ShareKitPlugin", "shareToFacebook", [message, url] );
};
ShareKitPlugin.prototype.shareToTwitter = function( message, url)
{
cordova.exec(null, null, "ShareKitPlugin", "shareToTwitter", [message, url] );
};
ShareKitPlugin.prototype.shareToMail = function( subject, message)
{
cordova.exec(null, null, "ShareKitPlugin", "shareToMail", [subject, message] );
};
ShareKitPlugin.install = function()
{
if(!window.plugins)
{
window.plugins = {};
}
window.plugins.shareKit = new ShareKitPlugin();
return window.plugins.shareKit;
};
cordova.addConstructor(ShareKitPlugin.install);