Skip to content

Commit

Permalink
Accessible Photos directory settings
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
  • Loading branch information
Pytal authored and nextcloud-command committed May 25, 2023
1 parent 67a355b commit 10f33ab
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 21 deletions.
4 changes: 2 additions & 2 deletions js/photos-main.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions js/photos-main.js.LICENSE.txt
Expand Up @@ -57,6 +57,10 @@

/*! @license DOMPurify 2.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.5/LICENSE */

/*! For license information please see NcButton.js.LICENSE.txt */

/*! For license information please see NcTextField.js.LICENSE.txt */

/*! For license information please see index.module.js.LICENSE.txt */

/*! Hammer.JS - v2.0.7 - 2016-04-22
Expand Down
2 changes: 1 addition & 1 deletion js/photos-main.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/photos-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/photos-public.js.map

Large diffs are not rendered by default.

56 changes: 41 additions & 15 deletions src/components/Settings/PhotosLocationSettings.vue
Expand Up @@ -21,27 +21,28 @@
-->

<template>
<div>
<!-- Description -->
<p class="app-settings-section__desc">
{{ t('photos', 'Default Photos upload and Albums location') }}
</p>

<!-- Picker -->
<input v-model="photosLocation"
class="app-settings-section__input"
type="text"
@input="debounceUpdatePhotosFolder(photosLocation)"
@change="debounceUpdatePhotosFolder(photosLocation)"
@click="debounceSelectPhotosFolder"
@focus.once="debounceSelectPhotosFolder"
@keyboard.enter="debounceSelectPhotosFolder">
<div class="photos-location">
<NcTextField class="photos-location__text-field"
:label="t('photos', 'Default Photos upload and Albums location')"
:label-visible="true"
:value.sync="photosLocation"
@update:value="debounceUpdatePhotosFolder(photosLocation)" />
<NcButton :aria-label="t('photos', 'Choose default Photos upload and Albums location')"
@click="debounceSelectPhotosFolder">
<template #icon>
<Folder :size="20" />
</template>
</NcButton>
</div>
</template>

<script>
import debounce from 'debounce'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import Folder from 'vue-material-design-icons/Folder.vue'
import { getFilePickerBuilder, showError } from '@nextcloud/dialogs'
import UserConfig from '../../mixins/UserConfig.js'
Expand All @@ -53,6 +54,12 @@ export default {
UserConfig,
],
components: {

Check warning on line 57 in src/components/Settings/PhotosLocationSettings.vue

View workflow job for this annotation

GitHub Actions / eslint

The "components" property should be above the "mixins" property on line 53
NcButton,
NcTextField,
Folder,
},
methods: {
debounceSelectPhotosFolder: debounce(function() {
this.selectPhotosFolder()
Expand Down Expand Up @@ -93,3 +100,22 @@ export default {
},
}
</script>

<style lang="scss" scoped>
.photos-location {
display: flex;
align-items: flex-end;
gap: 0 8px;
&__text-field {
max-width: 300px;
:deep {
.input-field__main-wrapper,
input {
height: var(--default-clickable-area) !important;
}
}
}
}
</style>

0 comments on commit 10f33ab

Please sign in to comment.