diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-04 01:30:50 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2020-10-07 10:40:58 +0300 |
commit | 843d799a2e2c884026883e3f41b81066801a877d (patch) | |
tree | b427d0296556488e34e0892f01c858ed5294b954 /apps/files_sharing/src/files_sharing_tab.js | |
parent | 678ef8466d5d1788bab1cf66786e47515a1bcbd9 (diff) |
Move Files Sidebar to proper javascript standard
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/src/files_sharing_tab.js')
-rw-r--r-- | apps/files_sharing/src/files_sharing_tab.js | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/apps/files_sharing/src/files_sharing_tab.js b/apps/files_sharing/src/files_sharing_tab.js index ffb6cdec30a..e8988e8c40a 100644 --- a/apps/files_sharing/src/files_sharing_tab.js +++ b/apps/files_sharing/src/files_sharing_tab.js @@ -19,11 +19,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ +import Vue from 'vue' +import VueClipboard from 'vue-clipboard2' +import { translate as t, translatePlural as n } from '@nextcloud/l10n' import SharingTab from './views/SharingTab' import ShareSearch from './services/ShareSearch' import ExternalLinkActions from './services/ExternalLinkActions' - import TabSections from './services/TabSections' // Init Sharing Tab Service @@ -34,8 +36,28 @@ Object.assign(window.OCA.Sharing, { ShareSearch: new ShareSearch() }) Object.assign(window.OCA.Sharing, { ExternalLinkActions: new ExternalLinkActions() }) Object.assign(window.OCA.Sharing, { ShareTabSections: new TabSections() }) +Vue.prototype.t = t +Vue.prototype.n = n +Vue.use(VueClipboard) + +// Init Sharing tab component +const View = Vue.extend(SharingTab) + window.addEventListener('DOMContentLoaded', function() { if (OCA.Files && OCA.Files.Sidebar) { - OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab('sharing', SharingTab)) + OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({ + id: 'sharing', + name: t('files_sharing', 'Sharing'), + icon: 'icon-share', + + render: (el, fileInfo) => { + new View({ + propsData: { + fileInfo, + }, + }).$mount(el) + console.info(el) + }, + })) } }) |