Remember user has seen the video

[MAILPOET-1447]
This commit is contained in:
Pavel Dohnal
2018-08-14 15:42:31 +02:00
parent a35834417b
commit 03a452acfa
2 changed files with 10 additions and 0 deletions

View File

@@ -17,9 +17,18 @@ const renderBreadcrumb = (newsletterType) => {
};
function displayTutorial() {
const key = `user_seen_editor_tutorial${window.config.currentUserId}`;
MailPoet.Modal.popup({
title: MailPoet.I18n.t('tutorialVideoTitle'),
template: '<video style="height:640px;" src=' + window.config.dragDemoUrl + ' controls autoplay></video>',
onCancel: () => {
MailPoet.Ajax.post({
api_version: window.mailpoet_api_version,
endpoint: 'settings',
action: 'set',
data: {[key]: 1},
});
},
});
}

View File

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