init
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<style type="text/css">
|
||||
.mailpoet-deactivate-survey-modal {
|
||||
display: none;
|
||||
table-layout: fixed;
|
||||
position: fixed;
|
||||
z-index: 9999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(0,0,0,0.8);
|
||||
}
|
||||
.mailpoet-deactivate-survey-wrap {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.mailpoet-deactivate-survey {
|
||||
background-color: #fff;
|
||||
border: 0 solid #ccc;
|
||||
border-radius: 3px;
|
||||
margin: 0 auto;
|
||||
padding: 12px;
|
||||
width: 520px;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.mailpoet-deactivate-survey a.button {
|
||||
white-space: normal;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.pds-box .pds-vote {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,53 @@
|
||||
<div class="mailpoet-deactivate-survey-modal" id="mailpoet-deactivate-survey-modal">
|
||||
<div class="mailpoet-deactivate-survey-wrap">
|
||||
<div class="mailpoet-deactivate-survey">
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('load', function() {
|
||||
var deactivateLink = document.querySelector('#the-list [data-slug="mailpoet"] span.deactivate a');
|
||||
var overlay = document.querySelector('#mailpoet-deactivate-survey-modal');
|
||||
var closeButton = document.querySelector('#mailpoet-deactivate-survey-close');
|
||||
var formOpen = false;
|
||||
|
||||
if (!deactivateLink || !overlay || !closeButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
deactivateLink.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
overlay.style.display = 'table';
|
||||
formOpen = true;
|
||||
});
|
||||
|
||||
closeButton.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
overlay.style.display = 'none';
|
||||
formOpen = false;
|
||||
location.href = deactivateLink.getAttribute('href');
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
if ((event.keyCode === 27) && formOpen) {
|
||||
location.href = deactivateLink.getAttribute('href');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// This callback is by docs, and guarantees that the modal window is closed and deactivated only after the vote has been submitted
|
||||
var pd_callback = function(json) {
|
||||
var obj = JSON.parse(json);
|
||||
var deactivateLink = document.querySelector('#the-list [data-slug="mailpoet"] span.deactivate a');
|
||||
var overlay = document.querySelector('#mailpoet-deactivate-survey-modal');
|
||||
if (obj.result === 'already-registered' || obj.result === 'registered') {
|
||||
overlay.style.display = 'none';
|
||||
location.href = deactivateLink.getAttribute('href');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" charset="utf-8" src="https://secure.polldaddy.com/p/11161195.js"></script>
|
||||
|
||||
<noscript><a href="https://poll.fm/11161195"><%= __("We're sorry to see you leave. Could you tell us more why are you deactivating MailPoet?") %></a></noscript>
|
||||
|
||||
<a class="button" id="mailpoet-deactivate-survey-close"><%= __('Skip survey and deactivate MailPoet') %> →</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<% if(is_loading_3rd_party_enabled()) %>
|
||||
<% include 'deactivationPoll/embedded-poll.html' %>
|
||||
<% else %>
|
||||
<% include 'deactivationPoll/link-poll.html' %>
|
||||
<% endif %>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<?php
|
||||
@@ -0,0 +1,62 @@
|
||||
<div class="mailpoet-deactivate-survey-modal" id="mailpoet-deactivate-survey-modal">
|
||||
<div class="mailpoet-deactivate-survey-wrap">
|
||||
<div class="mailpoet-deactivate-survey">
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('load', function() {
|
||||
var deactivateLink = document.querySelector('#the-list [data-slug="mailpoet"] span.deactivate a');
|
||||
var overlay = document.querySelector('#mailpoet-deactivate-survey-modal');
|
||||
var closeButton = document.querySelector('#mailpoet-deactivate-survey-close');
|
||||
var participateButton = document.querySelector('#mailpoet-deactivate-survey-participate');
|
||||
var formOpen = false;
|
||||
|
||||
if (!deactivateLink || !overlay || !closeButton || !participateButton) {
|
||||
return;
|
||||
}
|
||||
|
||||
deactivateLink.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
overlay.style.display = 'table';
|
||||
formOpen = true;
|
||||
});
|
||||
|
||||
closeButton.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
overlay.style.display = 'none';
|
||||
formOpen = false;
|
||||
location.href = deactivateLink.getAttribute('href');
|
||||
});
|
||||
|
||||
participateButton.addEventListener('click', function (event) {
|
||||
setTimeout(function() {closeButton.click(); }, 50);
|
||||
});
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
if ((event.keyCode === 27) && formOpen) {
|
||||
location.href = deactivateLink.getAttribute('href');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<p><strong>
|
||||
|
||||
<%= __("We're sorry to see you go. Would you be open to sharing how MailPoet didn't work for you so we could improve it?") %>
|
||||
</strong><br><%= __('It will take only a minute.') %></p>
|
||||
<a
|
||||
class="button button-primary"
|
||||
id="mailpoet-deactivate-survey-participate"
|
||||
href="https://poll.fm/11161195"
|
||||
target="_blank"
|
||||
rel="noopener nofollow"
|
||||
><%= __("Yes") %> →</a>
|
||||
|
||||
<a
|
||||
class="button"
|
||||
id="mailpoet-deactivate-survey-close"
|
||||
>
|
||||
<%= __('No') %>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user