Skip to content

Commit

Permalink
Feature/video media read (#410)
Browse files Browse the repository at this point in the history
* v0.0.0

* add media button to ckeditor

* fix js

* final cleanup and fixes

* CR feedback
  • Loading branch information
Harvel218 authored Jan 11, 2022
1 parent 1520a27 commit 4320890
Show file tree
Hide file tree
Showing 12 changed files with 441 additions and 237 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class HandleAutoComplete {
const data = await res.json();

this._addToSelectMenu(data);
this.selectMenu.firstChild.click();
this.selectMenu?.firstChild?.click();

triggerCustomEvent(this.mediaContainer, 'cms.media.saved.reload.completed', data);
} catch (error) {
Expand Down Expand Up @@ -127,7 +127,7 @@ export class HandleAutoComplete {
_addToSelectMenu(arr) {
triggerCustomEvent(this.mediaContainer, 'cms.media.display.update.start');
this.selectMenu.innerHTML = '';
arr.forEach((item) => {
arr?.forEach((item) => {
this.selectMenu.insertAdjacentHTML('beforeend', this._itemTemplate(item.path, item.code.trim()));
});
triggerCustomEvent(this.mediaContainer, 'cms.media.display.update.end');
Expand Down
5 changes: 3 additions & 2 deletions src/Resources/assets/admin/scss/_css.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#bitbag-cms-resource-preview-modal {
height: 90%;
height: 100%;
}

#bitbag-cms-resource-preview-modal iframe {
width: 100%;
height: 600px;
height: 100vh;
}

#bitbag-cms-resource-preview-modal .ui.header {
Expand Down Expand Up @@ -52,6 +52,7 @@
}

.media-list__item__input {
z-index: 99;
position: absolute !important;
bottom: 10px;
right: 10px;
Expand Down
12 changes: 8 additions & 4 deletions src/Resources/config/fos_ck_editor/fos_ck_editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ fos_ck_editor:
forcePasteAsPlainText: 'allow-word'
allowedContent: true
extraPlugins:
- 'media'
- 'mediaVideo'
- 'mediaImage'
plugins:
media:
path: '/bundles/bitbagsyliuscmsplugin/js/ckeditor-plugins/media/'
mediaVideo:
path: '/bundles/bitbagsyliuscmsplugin/js/ckeditor-plugins/video/'
filename: 'plugin.js'
mediaImage:
path: '/bundles/bitbagsyliuscmsplugin/js/ckeditor-plugins/image/'
filename: 'plugin.js'
toolbars:
configs:
Expand All @@ -26,4 +30,4 @@ fos_ck_editor:
- '@standard.paragraph'
- '@standard.about'
items:
standard.insert: ['Image', 'Media', 'Table', 'HorizontalRule', 'SpecialChar']
standard.insert: ['Image', 'MediaVideo', 'MediaImage', 'Table', 'HorizontalRule', 'SpecialChar']
Binary file added src/Resources/public/.DS_Store
Binary file not shown.
Loading

0 comments on commit 4320890

Please sign in to comment.