Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2022-09-21 15:11:04 +0300
committerGitHub <noreply@github.com>2022-09-21 15:11:04 +0300
commit8268416a2cdd14a75d2ca7aaa1f2707580a121e2 (patch)
treeb44086c48b1c236f350efb8f19e2a31660b78817
parentd0ead94aea9e568075bba5aec1b12d959bd67ff1 (diff)
parentd415c656f6b1815ab6a7229bc5268abd5ea97a57 (diff)
Merge pull request #34171 from nextcloud/enh/edit-locally
Add edit locally file action
-rw-r--r--apps/files/js/fileactions.js24
-rw-r--r--apps/files/js/filelist.js9
2 files changed, 33 insertions, 0 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index f342f21a4fb..4525da876e3 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -711,6 +711,30 @@
});
this.registerAction({
+ name: 'EditLocally',
+ displayName: function(context) {
+ var locked = context.$file.data('locked');
+ if (!locked) {
+ return t('files', 'Edit locally');
+ }
+ },
+ mime: 'all',
+ order: -23,
+ iconClass: function(filename, context) {
+ var locked = context.$file.data('locked');
+ if (!locked) {
+ return 'icon-rename';
+ }
+ },
+ permissions: OC.PERMISSION_UPDATE,
+ actionHandler: function (filename, context) {
+ var dir = context.dir || context.fileList.getCurrentDirectory();
+ var path = dir === '/' ? dir + filename : dir + '/' + filename;
+ context.fileList.openLocalClient(path);
+ },
+ });
+
+ this.registerAction({
name: 'Open',
mime: 'dir',
permissions: OC.PERMISSION_READ,
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index ee596dd417e..fff704b9283 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2807,6 +2807,15 @@
});
},
+ openLocalClient: function(path) {
+ var scheme = 'nc://';
+ var command = 'open';
+ var uid = OC.getCurrentUser().uid;
+ var url = scheme + command + '/' + uid + '@' + window.location.host + (window.location.port ? `:${window.location.port}` : '') + OC.encodePath(path);
+
+ window.location.href = url;
+ },
+
/**
* Updates the given row with the given file info
*