diff options
author | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-06-27 01:05:04 +0400 |
---|---|---|
committer | Victor Dubiniuk <victor.dubiniuk@gmail.com> | 2014-06-27 01:06:21 +0400 |
commit | 498981c9d04a002749ba47ce500eeac5a19bb266 (patch) | |
tree | 918902d3bcd98a0293d5b9fc8aaed5d26327aab7 /files_videoviewer | |
parent | 95da7d9adca17d26960054a9c2103749d289b114 (diff) |
[Videoviewer] New fileactions
Diffstat (limited to 'files_videoviewer')
-rw-r--r-- | files_videoviewer/js/viewer.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/files_videoviewer/js/viewer.js b/files_videoviewer/js/viewer.js index 7815f1278..94bb84f00 100644 --- a/files_videoviewer/js/viewer.js +++ b/files_videoviewer/js/viewer.js @@ -52,11 +52,11 @@ var videoViewer = { 'video/x-matroska', 'video/x-ms-asf' ], - onView : function(file) { + onView : function(file, data) { videoViewer.file = file; - videoViewer.dir = $('#dir').val(); + videoViewer.dir = data.dir; videoViewer.location = videoViewer.getMediaUrl(file); - videoViewer.mime = FileActions.getCurrentMimeType(); + videoViewer.mime = data.fileActions.currentFile.parent().attr('data-mime'); OC.addScript('files_videoviewer','mediaelement-and-player', function(){ OC.addScript('files_videoviewer','mep-extra', videoViewer.showPlayer); @@ -102,11 +102,14 @@ var videoViewer = { }; $(document).ready(function() { - if (typeof FileActions !== 'undefined') { + if ( typeof OCA !== 'undefined' + && typeof OCA.Files !== 'undefined' + && typeof OCA.Files.fileActions !== 'undefined' + ) { for (var i = 0; i < videoViewer.mimeTypes.length; ++i) { var mime = videoViewer.mimeTypes[i]; - FileActions.register(mime, 'View', OC.PERMISSION_READ, '', videoViewer.onView); - FileActions.setDefault(mime, 'View'); + OCA.Files.fileActions.register(mime, 'View', OC.PERMISSION_READ, '', videoViewer.onView); + OCA.Files.fileActions.setDefault(mime, 'View'); } $(document).keydown(videoViewer.onKeyDown); } |