Display tutorial video in editor

[MAILPOET-1447]
This commit is contained in:
Pavel Dohnal
2018-08-14 12:52:48 +02:00
parent 4a810f9103
commit 9efb5b5f90
2 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,12 @@ const renderBreadcrumb = (newsletterType) => {
ReactDOM.render(breadcrumb, breadcrumbContainer); ReactDOM.render(breadcrumb, breadcrumbContainer);
}; };
function displayTutorial() {
MailPoet.Modal.popup({
template: '<video style="height:640px;" src=' + window.config.dragDemoUrl + ' controls autoplay></video>',
});
}
const initializeEditor = (config) => { const initializeEditor = (config) => {
const editorContainer = document.getElementById('mailpoet_editor'); const editorContainer = document.getElementById('mailpoet_editor');
const getUrlParam = param => (location.search.split(`${param}=`)[1] || '').split('&')[0]; const getUrlParam = param => (location.search.split(`${param}=`)[1] || '').split('&')[0];
@ -33,6 +39,7 @@ const initializeEditor = (config) => {
}, },
}) })
.always(() => MailPoet.Modal.loading(false)) .always(() => MailPoet.Modal.loading(false))
.always(() => displayTutorial())
.done((response) => { .done((response) => {
const newsletter = response.data; const newsletter = response.data;

View File

@ -1295,6 +1295,7 @@
"newsletter_editor/image-missing.svg" "newsletter_editor/image-missing.svg"
) %>', ) %>',
}, },
dragDemoUrl: '<%= image_url("newsletter_editor/editor-drag-demo.mp4") %>',
}; };
wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config); wp.hooks.doAction('mailpoet_newsletters_editor_initialize', config);
</script> </script>