diff options
author | patrick <patrick@westberliner.net> | 2021-02-28 19:19:34 +0300 |
---|---|---|
committer | patrick <patrick@westberliner.net> | 2021-02-28 19:19:34 +0300 |
commit | 0005bfb85f22041f01f48a726cfd038cc3857692 (patch) | |
tree | b4987c3cb7db6d939e00f8f2f4d76459434da038 | |
parent | 62add016d52dbdc2ebff41b211685d024d6078dd (diff) |
Renamed vue files. For less work in the future.
-rw-r--r-- | src/main.js | 6 | ||||
-rw-r--r-- | src/views/ChecksumTab.vue | 46 | ||||
-rw-r--r-- | src/views/ChecksumTab20.vue (renamed from src/views/ChecksumTab21.vue) | 48 |
3 files changed, 50 insertions, 50 deletions
diff --git a/src/main.js b/src/main.js index ebe880c..51a4878 100644 --- a/src/main.js +++ b/src/main.js @@ -21,18 +21,18 @@ */ import Vue from 'vue' import { translate as t } from '@nextcloud/l10n' +import ChecksumTab20 from './views/ChecksumTab20' import ChecksumTab from './views/ChecksumTab' -import ChecksumTab21 from './views/ChecksumTab21' // Init Sharing tab component -const View = Vue.extend(ChecksumTab21) +const View = Vue.extend(ChecksumTab) let tabInstance = null window.addEventListener('DOMContentLoaded', function() { if (OCA.Files && OCA.Files.Sidebar) { let checksumTab if (OC.config.version < 21) { - checksumTab = new OCA.Files.Sidebar.Tab('checksum', ChecksumTab) + checksumTab = new OCA.Files.Sidebar.Tab('checksum', ChecksumTab20) } else { checksumTab = new OCA.Files.Sidebar.Tab({ id: 'checksum', diff --git a/src/views/ChecksumTab.vue b/src/views/ChecksumTab.vue index d174d29..f08306e 100644 --- a/src/views/ChecksumTab.vue +++ b/src/views/ChecksumTab.vue @@ -21,9 +21,7 @@ --> <template> - <Tab :id="id" - :icon="icon" - :name="name"> + <div> <!-- checksum content --> <Multiselect v-model="algorithm" @@ -36,14 +34,13 @@ <p :class="{ 'icon-loading': loading }" class="checksum-hash-result"> <span v-if="!loading && algorithm.id !== ''"><strong>{{ algorithm.label }}:</strong>{{ hash }}</span> </p> - </Tab> + </div> </template> <script> import { generateUrl } from '@nextcloud/router' import axios from '@nextcloud/axios' import Multiselect from '@nextcloud/vue/dist/Components/Multiselect' -import Tab from '@nextcloud/vue/dist/Components/AppSidebarTab' const algorithms = [ { id: '', label: t('checksum', 'Choose Algorithm') }, @@ -60,25 +57,13 @@ export default { name: 'ChecksumTab', components: { - Tab, Multiselect, }, mixins: [], - props: { - fileInfo: { - type: Object, - default: () => {}, - required: true, - }, - }, - data() { return { - // Enabled won't work as intended. This is a workaround for now. - icon: (this.fileInfo.type === 'file') ? 'icon-category-auth' : '', - name: t('checksum', 'Checksum'), loading: false, algorithm: algorithms[0], algorithms, @@ -88,25 +73,6 @@ export default { computed: { /** - * Needed to differenciate the tabs - * pulled from the AppSidebarTab component. - * - * @returns {string} - */ - id() { - return 'checksum' - }, - - /** - * Allow checksum only on files. - * - * @returns {boolean} - */ - enabled() { - return (this.fileInfo.type === 'file') - }, - - /** * Returns the current active tab. * Needed because AppSidebarTab also uses $parent.activeTab. * @@ -120,6 +86,14 @@ export default { methods: { /** + * Update current fileInfo and fetch new data. + * @param {Object} fileInfo the current file FileInfo. + */ + update(fileInfo) { + this.fileInfo = fileInfo + }, + + /** * Handles selection change event by triggering hash ajax call. * * @param {Object} algorithm - The selected algorithm object. diff --git a/src/views/ChecksumTab21.vue b/src/views/ChecksumTab20.vue index 7f0e120..442f515 100644 --- a/src/views/ChecksumTab21.vue +++ b/src/views/ChecksumTab20.vue @@ -21,7 +21,9 @@ --> <template> - <div> + <Tab :id="id" + :icon="icon" + :name="name"> <!-- checksum content --> <Multiselect v-model="algorithm" @@ -34,13 +36,14 @@ <p :class="{ 'icon-loading': loading }" class="checksum-hash-result"> <span v-if="!loading && algorithm.id !== ''"><strong>{{ algorithm.label }}:</strong>{{ hash }}</span> </p> - </div> + </Tab> </template> <script> import { generateUrl } from '@nextcloud/router' import axios from '@nextcloud/axios' import Multiselect from '@nextcloud/vue/dist/Components/Multiselect' +import Tab from '@nextcloud/vue/dist/Components/AppSidebarTab' const algorithms = [ { id: '', label: t('checksum', 'Choose Algorithm') }, @@ -54,16 +57,28 @@ const algorithms = [ ] export default { - name: 'ChecksumTab21', + name: 'ChecksumTab20', components: { + Tab, Multiselect, }, mixins: [], + props: { + fileInfo: { + type: Object, + default: () => {}, + required: true, + }, + }, + data() { return { + // Enabled won't work as intended. This is a workaround for now. + icon: (this.fileInfo.type === 'file') ? 'icon-category-auth' : '', + name: t('checksum', 'Checksum'), loading: false, algorithm: algorithms[0], algorithms, @@ -73,6 +88,25 @@ export default { computed: { /** + * Needed to differenciate the tabs + * pulled from the AppSidebarTab component. + * + * @returns {string} + */ + id() { + return 'checksum' + }, + + /** + * Allow checksum only on files. + * + * @returns {boolean} + */ + enabled() { + return (this.fileInfo.type === 'file') + }, + + /** * Returns the current active tab. * Needed because AppSidebarTab also uses $parent.activeTab. * @@ -86,14 +120,6 @@ export default { methods: { /** - * Update current fileInfo and fetch new data. - * @param {Object} fileInfo the current file FileInfo. - */ - update(fileInfo) { - this.fileInfo = fileInfo - }, - - /** * Handles selection change event by triggering hash ajax call. * * @param {Object} algorithm - The selected algorithm object. |