Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/cleantalk-admin-settings-page.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/cleantalk-admin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 119 additions & 0 deletions css/src/cleantalk-admin-settings-page.css
Original file line number Diff line number Diff line change
Expand Up @@ -726,3 +726,122 @@ button[value="save_changes"]:disabled {
flex-direction: column;
}
}

/* Fullpage trial/renew banner */
.apbct-trial-renew-fullpage {
display: flex;
position: fixed;
width: stretch;
top: 0;
bottom: 0;
overflow-y: auto;
justify-content: center;
align-items: flex-start;
font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
color: #444;
background-color: #f0f0f0;
z-index: 99;
margin-left: -20px;
}

.apbct-trial-renew-fullpage-notice {
height: fit-content;
padding: 32px 64px 64px 64px !important;
margin-top: 5em !important;
margin-bottom: 5em !important;
}

.apbct-trial-renew-fullpage-body {
margin-top: 32px;
margin-left: 32px;
}

.apbct-trial-renew-fullpage-image {
max-width: 100%;
height: auto;
width: 576px;
}

.apbct-banner-desc-block-row {
display: flex;
align-items: center;
}

.apbct-banner-red-point {
display: inline-block;
width: 8px;
height: 8px;
background-color: #BB3323;
border-radius: 50%;
margin-right: 8px;
}

.apbct-banner-error {
background-color: #ffffff !important;
box-shadow: 0px 4px 15px #84848440 !important;
border-left-color: #BB3323 !important;
}

.apbct-banner-background-container {
display: grid;
max-width: 644px;
gap: 16px;
padding: 32px;
background-color: #F3F6F9;
border-radius: 8px;
}

.apbct-banner-desc-block-title {
font-size: 18px;
font-weight: bold;
line-height: 22px;
color: #0A0A0A;
margin-bottom: 8px;
}

.apbct-banner-stat-value {
margin-bottom: 0px;
color: #444444;
}

.apbct-banner-desc-block-text {
font-size: 14px;
line-height: 22px;
color: #717182;
margin-left: 12px;
margin-top: 0;
}

.apbct-banner-desc-blocks {
display: grid;
gap: 16px;
}

.apbct-banner-desc-blocks-content {
display: flex;
gap: 72px;
flex-wrap: wrap;
justify-content: center;
margin: 32px 0;
}

@media (max-width: 1200px) {
.apbct-banner-desc-blocks-content { gap: 32px; }
}

@media (max-width: 782px) {
.apbct-trial-renew-fullpage { padding-top: 50px; padding-bottom: 50px; }
.apbct-trial-renew-fullpage-notice { padding: 24px 24px 32px 24px !important; }
.apbct-trial-renew-fullpage-body { margin-top: 20px; margin-left: 0; }
.apbct-banner-desc-blocks-content { gap: 24px; }
.apbct-banner-background-container { padding: 20px; }
.apbct-trial-renew-fullpage-image { width: 100%; }
.apbct-banner-desc-block-row { flex-wrap: wrap; }
}

@media (max-width: 480px) {
.apbct-trial-renew-fullpage-notice { padding: 16px 12px 24px 12px !important; }
.apbct-banner-background-container { padding: 16px; }
.apbct-banner-desc-blocks-content { gap: 16px; }
.apbct-banner-desc-block-title { font-size: 16px; }
}
20 changes: 20 additions & 0 deletions css/src/cleantalk-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,23 @@
line-height: 22px;
color: #646464 !important;
}

/* Trial/Renew banner styles */
.apbct-notice.apbct-banner-error {
padding: 16px 32px !important;
background-color: #ffffff !important;
box-shadow: 0px 4px 15px #84848440 !important;
border-left-color: #BB3323 !important;
}

.apbct-notice.apbct-banner-error .notice-dismiss::before {
color: #646464;
}

.apbct-banner-button-red {
background-color: #BB3323 !important;
}

.apbct-banner-button-red:hover {
background-color: #ac2e20 !important;
}
9 changes: 9 additions & 0 deletions inc/cleantalk-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -1466,9 +1466,18 @@ function apbct_settings__display()
$actual_plugin_name = $apbct->data['wl_brandname'];
}

// Show fullpage trial/renew banner instead of settings if conditions are met
$trial_or_renew_fullpage_banner = new \Cleantalk\ApbctWP\AdminBannersModule\AdminBannerTrialAndRenewFullpage();
$trial_fullpage_style = '';
if ($trial_or_renew_fullpage_banner->needToShow()) {
$trial_or_renew_fullpage_banner->display();
$trial_fullpage_style = 'display:none;';
}

apbct_settings__render_react_mount();

$settings_wrap_style = apbct_settings__is_signup_wizard() ? 'display:none;' : '';
$settings_wrap_style .= $trial_fullpage_style;
echo '<div id="apbct-settings-page-wrap" style="' . esc_attr($settings_wrap_style) . '">';

// Title
Expand Down
3 changes: 3 additions & 0 deletions inc/images/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions inc/images/img_fullpage_trial_banner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion js/cleantalk-admin-settings-page.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/cleantalk-admin-settings-page.min.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions js/prebuild/apbct-public-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ class ApbctHandler {
return false;
}

for (const handler of iframeFetchHandlers) {
for (const handler of iframeCommonFetchHandlers) {
if (handler.matches(url, args)) {
const form = handler.getForm();
const blocked = await runIframeCommonFetchCheck(form);
Expand All @@ -3436,7 +3436,7 @@ class ApbctHandler {
* Adding a new provider only requires a new entry here — no need
* to duplicate the Promise/AJAX/blocked-check boilerplate above.
*/
const iframeFetchHandlers = [
const iframeCommonFetchHandlers = [
{
name: 'bitrix24',
matches: (url, args) =>
Expand Down Expand Up @@ -3481,7 +3481,7 @@ class ApbctHandler {
return false;
}

const data = collectIframeFields(form);
const data = collectIframeFormFields(form);

// Set internal call flag before making our own AJAX request
isInternalCall = true;
Expand Down Expand Up @@ -3524,7 +3524,7 @@ class ApbctHandler {
* @param {HTMLFormElement} form
* @return {object}
*/
const collectIframeFields = function(form) {
const collectIframeFormFields = function(form) {
const data = {
action: 'cleantalk_force_ajax_check',
};
Expand All @@ -3544,8 +3544,8 @@ class ApbctHandler {
return data;
};

// MAIN FETCH INTERCEPT LOGIC
// Override window.fetch
// MAIN FETCH INTERCEPT LOGIC - OVERRIDE WINDOW.FETCH

window.fetch = async function(...args) {
// Prevent recursion - if this is our internal call, pass through without processing
if (isInternalCall) {
Expand Down
12 changes: 6 additions & 6 deletions js/prebuild/apbct-public-bundle_ext-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ class ApbctHandler {
return false;
}

for (const handler of iframeFetchHandlers) {
for (const handler of iframeCommonFetchHandlers) {
if (handler.matches(url, args)) {
const form = handler.getForm();
const blocked = await runIframeCommonFetchCheck(form);
Expand All @@ -3436,7 +3436,7 @@ class ApbctHandler {
* Adding a new provider only requires a new entry here — no need
* to duplicate the Promise/AJAX/blocked-check boilerplate above.
*/
const iframeFetchHandlers = [
const iframeCommonFetchHandlers = [
{
name: 'bitrix24',
matches: (url, args) =>
Expand Down Expand Up @@ -3481,7 +3481,7 @@ class ApbctHandler {
return false;
}

const data = collectIframeFields(form);
const data = collectIframeFormFields(form);

// Set internal call flag before making our own AJAX request
isInternalCall = true;
Expand Down Expand Up @@ -3524,7 +3524,7 @@ class ApbctHandler {
* @param {HTMLFormElement} form
* @return {object}
*/
const collectIframeFields = function(form) {
const collectIframeFormFields = function(form) {
const data = {
action: 'cleantalk_force_ajax_check',
};
Expand All @@ -3544,8 +3544,8 @@ class ApbctHandler {
return data;
};

// MAIN FETCH INTERCEPT LOGIC
// Override window.fetch
// MAIN FETCH INTERCEPT LOGIC - OVERRIDE WINDOW.FETCH

window.fetch = async function(...args) {
// Prevent recursion - if this is our internal call, pass through without processing
if (isInternalCall) {
Expand Down
12 changes: 6 additions & 6 deletions js/prebuild/apbct-public-bundle_ext-protection_gathering.js
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ class ApbctHandler {
return false;
}

for (const handler of iframeFetchHandlers) {
for (const handler of iframeCommonFetchHandlers) {
if (handler.matches(url, args)) {
const form = handler.getForm();
const blocked = await runIframeCommonFetchCheck(form);
Expand All @@ -3436,7 +3436,7 @@ class ApbctHandler {
* Adding a new provider only requires a new entry here — no need
* to duplicate the Promise/AJAX/blocked-check boilerplate above.
*/
const iframeFetchHandlers = [
const iframeCommonFetchHandlers = [
{
name: 'bitrix24',
matches: (url, args) =>
Expand Down Expand Up @@ -3481,7 +3481,7 @@ class ApbctHandler {
return false;
}

const data = collectIframeFields(form);
const data = collectIframeFormFields(form);

// Set internal call flag before making our own AJAX request
isInternalCall = true;
Expand Down Expand Up @@ -3524,7 +3524,7 @@ class ApbctHandler {
* @param {HTMLFormElement} form
* @return {object}
*/
const collectIframeFields = function(form) {
const collectIframeFormFields = function(form) {
const data = {
action: 'cleantalk_force_ajax_check',
};
Expand All @@ -3544,8 +3544,8 @@ class ApbctHandler {
return data;
};

// MAIN FETCH INTERCEPT LOGIC
// Override window.fetch
// MAIN FETCH INTERCEPT LOGIC - OVERRIDE WINDOW.FETCH

window.fetch = async function(...args) {
// Prevent recursion - if this is our internal call, pass through without processing
if (isInternalCall) {
Expand Down
12 changes: 6 additions & 6 deletions js/prebuild/apbct-public-bundle_full-protection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3418,7 +3418,7 @@ class ApbctHandler {
return false;
}

for (const handler of iframeFetchHandlers) {
for (const handler of iframeCommonFetchHandlers) {
if (handler.matches(url, args)) {
const form = handler.getForm();
const blocked = await runIframeCommonFetchCheck(form);
Expand All @@ -3436,7 +3436,7 @@ class ApbctHandler {
* Adding a new provider only requires a new entry here — no need
* to duplicate the Promise/AJAX/blocked-check boilerplate above.
*/
const iframeFetchHandlers = [
const iframeCommonFetchHandlers = [
{
name: 'bitrix24',
matches: (url, args) =>
Expand Down Expand Up @@ -3481,7 +3481,7 @@ class ApbctHandler {
return false;
}

const data = collectIframeFields(form);
const data = collectIframeFormFields(form);

// Set internal call flag before making our own AJAX request
isInternalCall = true;
Expand Down Expand Up @@ -3524,7 +3524,7 @@ class ApbctHandler {
* @param {HTMLFormElement} form
* @return {object}
*/
const collectIframeFields = function(form) {
const collectIframeFormFields = function(form) {
const data = {
action: 'cleantalk_force_ajax_check',
};
Expand All @@ -3544,8 +3544,8 @@ class ApbctHandler {
return data;
};

// MAIN FETCH INTERCEPT LOGIC
// Override window.fetch
// MAIN FETCH INTERCEPT LOGIC - OVERRIDE WINDOW.FETCH

window.fetch = async function(...args) {
// Prevent recursion - if this is our internal call, pass through without processing
if (isInternalCall) {
Expand Down
Loading
Loading