Skip to content

Commit 3d4c970

Browse files
committed
PB-95: Video background for Row
1 parent 3b6e166 commit 3d4c970

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

app/code/Magento/PageBuilder/view/adminhtml/ui_component/pagebuilder_base_form_with_background_video.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,14 +204,17 @@
204204
</checkbox>
205205
</formElements>
206206
</field>
207-
<field name="video_fallback_image" sortOrder="140" formElement="imageUploader">
207+
<field name="video_fallback_image" sortOrder="140" formElement="imageUploader" template="Magento_PageBuilder/form/element/uploader/image">
208208
<settings>
209209
<visible>false</visible>
210210
<label translate="true">Fallback Image</label>
211211
<componentType>imageUploader</componentType>
212212
<imports>
213213
<link name="visible">${$.parentName}.background_type:videoVisible</link>
214214
</imports>
215+
<tooltip>
216+
<description translate="true">Fallback images appear on the screen before a video loads. When the video loads, it replaces the fallback image. If the video does not load for some reason, the fallback image remains on the screen in place of the video.</description>
217+
</tooltip>
215218
</settings>
216219
<formElements>
217220
<imageUploader>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<!--
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
-->
7+
<div class="admin__field" visible="visible" css="$data.additionalClasses">
8+
<label class="admin__field-label" if="$data.label" attr="for: uid">
9+
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
10+
</label>
11+
12+
<div class="admin__field-control" css="'_with-tooltip': $data.tooltip">
13+
<div class="file-uploader image-uploader" data-role="drop-zone" css="_loading: isLoading">
14+
<div class="file-uploader-area">
15+
<input type="file" afterRender="onElementRender" attr="id: uid, name: inputName, multiple: isMultipleFiles" disable="disabled" />
16+
<label class="file-uploader-button action-default" attr="for: uid, disabled: disabled" disable="disabled" translate="'Upload'" />
17+
<label
18+
data-bind="event: {change: addFileFromMediaGallery, click: openMediaBrowserDialog}"
19+
class="file-uploader-button action-default"
20+
attr="id: mediaGalleryUid, disabled: disabled"
21+
data-force_static_path="1"
22+
translate="'Select from Gallery'"/>
23+
<render args="tooltipTpl" if="$data.tooltip"/>
24+
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
25+
<p class="image-upload-requirements">
26+
<span if="$data.maxFileSize">
27+
<span translate="'Maximum file size'" />: <text args="formatSize($data.maxFileSize)"/>.
28+
</span>
29+
<span if="$data.allowedExtensions">
30+
<span translate="'Allowed file types'" />: <text args="getAllowedFileExtensionsInCommaDelimitedFormat()"/>.
31+
</span>
32+
</p>
33+
</div>
34+
35+
<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
36+
<span html="notice"/>
37+
</div>
38+
39+
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
40+
41+
<each args="data: value, as: '$file'" render="$parent.getPreviewTmpl($file)"/>
42+
43+
<div if="!hasData()" class="image image-placeholder" click="triggerImageUpload">
44+
<div class="file-uploader-summary product-image-wrapper">
45+
<div class="file-uploader-spinner image-uploader-spinner" />
46+
<p class="image-placeholder-text" translate="'Browse to find or drag image here'"/>
47+
</div>
48+
</div>
49+
</div>
50+
<render args="$data.service.template" if="$data.hasService()"/>
51+
</div>
52+
</div>

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/row/preview.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import PreviewCollection from "../preview-collection";
2626
export default class Preview extends PreviewCollection {
2727
public getChildren: KnockoutComputed<{}>;
2828
public wrapClass: KnockoutObservable<boolean> = ko.observable(false);
29-
private element: Element;
29+
private element: HTMLElement;
3030

3131
/**
3232
* Debounce and defer the init of Jarallax
@@ -154,9 +154,9 @@ export default class Preview extends PreviewCollection {
154154
/**
155155
* Init the parallax element
156156
*
157-
* @param {Element} element
157+
* @param {HTMLElement} element
158158
*/
159-
public initParallax(element: Element) {
159+
public initParallax(element: HTMLElement) {
160160
this.element = element;
161161
_.defer(() => {
162162
this.buildJarallax();

app/code/Magento/PageBuilder/view/base/web/js/resource/vimeo/vimeo-wrapper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ define([
77
'vimeo'
88
], function (Player) {
99
'use strict';
10+
1011
window.Vimeo = window.Vimeo || {
1112
'Player': Player
1213
};

0 commit comments

Comments
 (0)