diff options
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/filelist.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 2761c3a62b2..7caed29baa3 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -2808,12 +2808,23 @@ }, openLocalClient: function(path) { - var scheme = 'nc://'; - var command = 'open'; - var uid = OC.getCurrentUser().uid; - var url = scheme + command + '/' + uid + '@' + window.location.host + OC.encodePath(path); + var link = OC.linkToOCS('apps/files/api/v1', 2) + 'openlocaleditor?format=json'; - window.location.href = url; + $.post(link, { + path + }) + .success(function(result) { + var scheme = 'nc://'; + var command = 'open'; + var uid = OC.getCurrentUser().uid; + var url = scheme + command + '/' + uid + '@' + window.location.host + OC.encodePath(path); + url += '?token=' + result.ocs.data.token; + + window.location.href = url; + }) + .fail(function() { + OC.Notification.show(t('files', 'Failed to redirect to client')) + }) }, /** |