forked from SpiderOak/FileViewerPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileViewerPlugin.js
36 lines (29 loc) · 1.22 KB
/
FileViewerPlugin.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
var exec = require('cordova/exec');
var FileViewerPlugin = function() {};
// Are all of these needed???
FileViewerPlugin.prototype.ACTION_SEND = "android.intent.action.SEND";
FileViewerPlugin.prototype.ACTION_VIEW= "android.intent.action.VIEW";
FileViewerPlugin.prototype.EXTRA_TEXT = "android.intent.extra.TEXT";
FileViewerPlugin.prototype.EXTRA_SUBJECT = "android.intent.extra.SUBJECT";
FileViewerPlugin.prototype.EXTRA_STREAM = "android.intent.extra.STREAM";
FileViewerPlugin.prototype.EXTRA_EMAIL = "android.intent.extra.EMAIL";
FileViewerPlugin.prototype.view = function(params, success, fail) {
return exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'FileViewerPlugin', 'view', [params]);
};
// Only really useful on iOS
FileViewerPlugin.prototype.hide = function() {
return exec(null, null, 'FileViewerPlugin', 'hide', []);
};
FileViewerPlugin.prototype.share = function(params, success, fail) {
return exec(function(args) {
success(args);
}, function(args) {
fail(args);
}, 'FileViewerPlugin', 'share', [params]);
};
var fileviewerplugin = new FileViewerPlugin();
module.exports = fileviewerplugin;