Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b2f1ba4
docker-compose for development
JenSeReal Aug 18, 2021
d795d25
added pdf component and query for pdfs
JenSeReal Aug 19, 2021
5b78108
added action items and created toggle
JenSeReal Aug 19, 2021
a714889
added action items and created toggle
JenSeReal Aug 19, 2021
2a57795
fixed refs of vue components
JenSeReal Aug 19, 2021
8834d8d
fixed refs of vue components
JenSeReal Aug 19, 2021
382127a
working preview action item button
JenSeReal Aug 19, 2021
6c6c053
working download button and destuctured export
JenSeReal Aug 19, 2021
52afb9c
add delete & share component
tw-ekonic Aug 20, 2021
0ba7f47
add edit component
tw-ekonic Aug 20, 2021
c113ecd
refactoring & typos
JenSeReal Aug 20, 2021
4b86ba2
test items-container
tw-ekonic Aug 20, 2021
c300f9d
testing action items container
JenSeReal Aug 20, 2021
41065b3
fix edit items
tw-ekonic Aug 20, 2021
1a87a96
working can edit
JenSeReal Aug 23, 2021
2fe083d
final refactoring for pull request
JenSeReal Aug 23, 2021
529c467
final refactoring for pull request
JenSeReal Aug 23, 2021
2d43627
final refactoring for pull request
JenSeReal Aug 23, 2021
c18761f
Merge remote-tracking branch 'upstream/4.1-dev' into 4.1-dev-media-ma…
JenSeReal Aug 24, 2021
4524703
merged latest 4.1 dev
JenSeReal Aug 24, 2021
4ed2d73
fixed eslint recommendations
JenSeReal Aug 24, 2021
fab917d
fixed bug with preview
JenSeReal Aug 24, 2021
489d268
reverted package-lock.json
JenSeReal Aug 24, 2021
bc42712
Merge remote-tracking branch 'vue/4.1-dev-media-manager-action-items'…
laoneo Oct 24, 2021
f04e95c
Merge remote-tracking branch 'upstream/4.1-dev' into j4/refactor/vue/…
laoneo Oct 24, 2021
e64bfb0
fix conflicts
laoneo Oct 24, 2021
f6d1178
Adapt code from #35451
laoneo Oct 24, 2021
6cda75f
Update administrator/components/com_media/resources/scripts/component…
laoneo Oct 24, 2021
963c2b4
Update administrator/components/com_media/resources/scripts/component…
laoneo Oct 24, 2021
3379fcc
Update administrator/components/com_media/resources/scripts/component…
laoneo Oct 24, 2021
eafb1ec
cs
laoneo Oct 24, 2021
3dfdcce
Merge branch 'j4/refactor/vue/browser' of github.com:Digital-Peak/joo…
laoneo Oct 24, 2021
e972603
more cs
laoneo Oct 24, 2021
9d2d7c5
Restore doublce click handler
laoneo Oct 24, 2021
200ead0
Merge branch '4.1-dev' into j4/refactor/vue/browser
laoneo Nov 6, 2021
b74d00b
Merge branch '4.1-dev' into j4/refactor/vue/browser
laoneo Nov 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
<template>
<span
class="media-browser-select"
:aria-label="translate('COM_MEDIA_TOGGLE_SELECT_ITEM')"
:title="translate('COM_MEDIA_TOGGLE_SELECT_ITEM')"
/>
<div
class="media-browser-actions"
:class="{ active: showActions }"
>
<media-browser-action-item-toggle
ref="actionToggle"
:on-focused="focused"
:main-action="openActions"
@keyup.up="openLastActions()"
@keyup.down="openActions()"
/>
<div
v-if="showActions"
class="media-browser-actions-list"
>
<ul>
<li>
<media-browser-action-item-preview
v-if="previewable"
ref="actionPreview"
:on-focused="focused"
:main-action="openPreview"
:closing-action="hideActions"
@keyup.up="$refs.actionDelete.$el.focus()"
@keyup.down="$refs.actionDownload.$el.focus()"
/>
</li>
<li>
<media-browser-action-item-download
v-if="downloadable"
ref="actionDownload"
:on-focused="focused"
:main-action="download"
:closing-action="hideActions"
@keyup.up="$refs.actionPreview.$el.focus()"
@keyup.down="$refs.actionRename.$el.focus()"
/>
</li>
<li>
<media-browser-action-item-rename
ref="actionRename"
:on-focused="focused"
:main-action="openRenameModal"
:closing-action="hideActions"
@keyup.up="
downloadable
? $refs.actionDownload.$el.focus()
: $refs.actionDelete.$el.focus()
"
@keyup.down="
canEdit
? $refs.actionEdit.$el.focus()
: shareable
? $refs.actionShare.$el.focus()
: $refs.actionDelete.$el.focus()
"
/>
</li>
<li>
<media-browser-action-item-edit
v-if="canEdit"
ref="actionEdit"
:on-focused="focused"
:main-action="editItem"
:closing-action="hideActions"
@keyup.up="$refs.actionRename.$el.focus()"
@keyup.down="$refs.actionShare.$el.focus()"
/>
</li>
<li>
<media-browser-action-item-share
v-if="shareable"
ref="actionShare"
:on-focused="focused"
:main-action="openShareUrlModal"
:closing-action="hideActions"
@keyup.up="
canEdit
? $refs.actionEdit.$el.focus()
: $refs.actionRename.$el.focus()
"
@keyup.down="$refs.actionDelete.$el.focus()"
/>
</li>
<li>
<media-browser-action-item-delete
ref="actionDelete"
:on-focused="focused"
:main-action="openConfirmDeleteModal"
:hide-actions="hideActions"
@keyup.up="
shareable
? $refs.actionShare.$el.focus()
: $refs.actionRename.$el.focus()
"
@keyup.down="
previewable
? $refs.actionPreview.$el.focus()
: $refs.actionRename.$el.focus()
"
/>
</li>
</ul>
</div>
</div>
</template>

<script>
import * as types from '../../../store/mutation-types.es6';

export default {
name: 'MediaBrowserActionItemsContainer',
props: {
item: { type: Object, default: () => {} },
onFocused: { type: Function, default: () => {} },
edit: { type: Function, default: () => {} },
editable: { type: Function, default: () => false },
previewable: { type: Boolean, default: false },
downloadable: { type: Boolean, default: false },
shareable: { type: Boolean, default: false },
},
data() {
return {
showActions: false,
};
},
computed: {
/* Check if the item is an document to edit */
canEdit() {
return this.editable();
},
},
watch: {
// eslint-disable-next-line
"$store.state.showRenameModal"(show) {
if (
!show
&& this.$refs.actionToggle
&& this.$store.state.selectedItems.find(
(item) => item.name === this.item.name,
) !== undefined
) {
this.$refs.actionToggle.$el.focus();
}
},
},
methods: {
/* Hide actions dropdown */
hideActions() {
this.showActions = false;
},
/* Preview an item */
openPreview() {
this.$store.commit(types.SHOW_PREVIEW_MODAL);
this.$store.dispatch('getFullContents', this.item);
},
/* Download an item */
download() {
this.$store.dispatch('download', this.item);
},
/* Opening confirm delete modal */
openConfirmDeleteModal() {
this.$store.commit(types.UNSELECT_ALL_BROWSER_ITEMS);
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
this.$store.commit(types.SHOW_CONFIRM_DELETE_MODAL);
},
/* Rename an item */
openRenameModal() {
this.hideActions();
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
this.$store.commit(types.SHOW_RENAME_MODAL);
},
/* Open modal for share url */
openShareUrlModal() {
this.$store.commit(types.SELECT_BROWSER_ITEM, this.item);
this.$store.commit(types.SHOW_SHARE_MODAL);
},
/* Open actions dropdown */
openActions() {
this.showActions = true;
if (this.previewable) {
this.$nextTick(() => this.$refs.actionPreview.$el.focus());
} else {
this.$nextTick(() => this.$refs.actionRename.$el.focus());
}
},
/* Open actions dropdown and focus on last element */
openLastActions() {
this.showActions = true;
this.$nextTick(() => this.$refs.actionDelete.$el.focus());
},
editItem() {
this.edit();
},
},
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<button
type="button"
class="action-delete"
:aria-label="translate('COM_MEDIA_ACTION_DELETE')"
:title="translate('COM_MEDIA_ACTION_DELETE')"
@keyup.enter="openConfirmDeleteModal()"
@keyup.space="openConfirmDeleteModal()"
@focus="focused(true)"
@blur="focused(false)"
@keyup.esc="hideActions()"
>
<span
class="image-browser-action icon-trash"
aria-hidden="true"
@click.stop="openConfirmDeleteModal()"
/>
</button>
</template>

<script>
export default {
name: 'MediaBrowserActionItemDelete',
props: {
onFocused: { type: Function, default: () => {} },
mainAction: { type: Function, default: () => {} },
closingAction: { type: Function, default: () => {} },
},
methods: {
openConfirmDeleteModal() {
this.mainAction();
},
hideActions() {
this.hideActions();
},
focused(bool) {
this.onFocused(bool);
},
},
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<button
type="button"
class="action-download"
:aria-label="translate('COM_MEDIA_ACTION_DOWNLOAD')"
:title="translate('COM_MEDIA_ACTION_DOWNLOAD')"
@keyup.enter="download()"
@keyup.space="download()"
@focus="focused(true)"
@blur="focused(false)"
@keyup.esc="hideActions()"
>
<span
class="image-browser-action icon-download"
aria-hidden="true"
@click.stop="download()"
/>
</button>
</template>

<script>
export default {
name: 'MediaBrowserActionItemDownload',
props: {
onFocused: { type: Function, default: () => {} },
mainAction: { type: Function, default: () => {} },
closingAction: { type: Function, default: () => {} },
},
methods: {
download() {
this.mainAction();
},
hideActions() {
this.closingAction();
},
focused(bool) {
this.onFocused(bool);
},
},
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<template>
<button
type="button"
class="action-edit"
:aria-label="translate('COM_MEDIA_ACTION_EDIT')"
:title="translate('COM_MEDIA_ACTION_EDIT')"
@keyup.enter="editItem()"
@keyup.space="editItem()"
@focus="focused(true)"
@blur="focused(false)"
@keyup.esc="hideActions()"
>
<span
class="image-browser-action icon-pencil-alt"
aria-hidden="true"
@click.stop="editItem()"
/>
</button>
</template>

<script>
export default {
name: 'MediaBrowserActionItemEdit',
props: {
onFocused: { type: Function, default: () => {} },
mainAction: { type: Function, default: () => {} },
closingAction: { type: Function, default: () => {} },
},
methods: {
openRenameModal() {
this.mainAction();
},
hideActions() {
this.closingAction();
},
focused(bool) {
this.onFocused(bool);
},
editItem() {
this.mainAction();
},
},
};
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Rename from './rename.vue';
import Toggle from './toggle.vue';
import Preview from './preview.vue';
import Download from './download.vue';
import Share from './share.vue';
import Delete from './delete.vue';
import Edit from './edit.vue';
import Container from './actionItemsContainer.vue';

export {
Rename, Toggle, Preview, Download, Share, Delete, Edit, Container,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<button
type="button"
class="action-preview"
:aria-label="translate('COM_MEDIA_ACTION_PREVIEW')"
:title="translate('COM_MEDIA_ACTION_PREVIEW')"
@keyup.enter="openPreview()"
@keyup.space="openPreview()"
@focus="focused(true)"
@blur="focused(false)"
@keyup.esc="hideActions()"
>
<span
class="image-browser-action icon-search-plus"
aria-hidden="true"
@click.stop="openPreview()"
/>
</button>
</template>

<script>
export default {
name: 'MediaBrowserActionItemPreview',
props: {
onFocused: { type: Function, default: () => {} },
mainAction: { type: Function, default: () => {} },
closingAction: { type: Function, default: () => {} },
},
methods: {
openPreview() {
this.mainAction();
},
hideActions() {
this.closingAction();
},
focused(bool) {
this.onFocused(bool);
},
},
};
</script>
Loading