-
Notifications
You must be signed in to change notification settings - Fork 48
/
viewer.js
38 lines (35 loc) · 1 KB
/
viewer.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
/**
* Nextcloud - keeweb
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Jonne Haß <[email protected]>
* @copyright Jonne Haß 2016
*/
// Inspired by documents app
(function ($, OC) {
$(document).ready(function() {
if ( typeof OCA !== 'undefined'
&& typeof OCA.Files !== 'undefined'
&& typeof OCA.Files.fileActions !== 'undefined'
) {
OCA.Files.fileActions.registerAction({
name: 'Open',
mime: 'application/x-kdbx',
permissions: OC.PERMISSION_UPDATE,
icon: OC.imagePath('core', 'actions/edit'),
actionHandler: function (fileName, context) {
OC.redirect(
OC.generateUrl(
'apps/keeweb/?open={file}',
{'file': OC.joinPaths(context.dir, fileName)}
)
);
},
displayName: t('keeweb', 'Open')
});
OCA.Files.fileActions.setDefault('application/x-kdbx', 'Open');
}
});
})(jQuery, OC);