Skip to content

Commit

Permalink
Merge branch 'develop' into enhance/subscription_design_followups
Browse files Browse the repository at this point in the history
  • Loading branch information
sapayth authored Aug 16, 2024
2 parents 86ff1d1 + 7121e70 commit 0b0bffb
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 155 deletions.
92 changes: 34 additions & 58 deletions assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -906,42 +906,42 @@ span.pro-icon:hover .wpuf-pro-field-tooltip {
.headway-header ul li a:hover {
text-decoration: underline;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon {
.wrap h2.with-headway-icon,
.wrap h2.with-headway-icon,
.wrap h2.with-headway-icon {
display: flex;
justify-content: space-between;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon .flex-end,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon .flex-end,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon .flex-end {
.wrap h2.with-headway-icon .flex-end,
.wrap h2.with-headway-icon .flex-end,
.wrap h2.with-headway-icon .flex-end {
display: flex;
align-items: center;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden {
.wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden,
.wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden,
.wrap h2.with-headway-icon .flex-end .HW_badge.HW_softHidden {
background: #eea6d0 !important;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden {
.wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden,
.wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden,
.wrap h2.with-headway-icon .flex-end .flex-end .headway-icon:hover .HW_badge.HW_softHidden {
background: #ee62b4 !important;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon .flex-end a.canny-link,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon .flex-end a.canny-link,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon .flex-end a.canny-link {
.wrap h2.with-headway-icon .flex-end a.canny-link,
.wrap h2.with-headway-icon .flex-end a.canny-link,
.wrap h2.with-headway-icon .flex-end a.canny-link {
font-size: 1rem;
text-decoration: none;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon .flex-end a.canny-link:hover,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon .flex-end a.canny-link:hover,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon .flex-end a.canny-link:hover {
.wrap h2.with-headway-icon .flex-end a.canny-link:hover,
.wrap h2.with-headway-icon .flex-end a.canny-link:hover,
.wrap h2.with-headway-icon .flex-end a.canny-link:hover {
text-decoration: underline;
}
.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon #HW_frame_cont,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon #HW_frame_cont,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon #HW_frame_cont {
.wrap h2.with-headway-icon #HW_frame_cont,
.wrap h2.with-headway-icon #HW_frame_cont,
.wrap h2.with-headway-icon #HW_frame_cont {
top: 78px !important;
}
@media only screen and (max-width: 1399px) {
Expand Down Expand Up @@ -1069,59 +1069,35 @@ span.pro-icon:hover .wpuf-pro-field-tooltip {
}
.wpuf-help-page .wpuf-subscribe-box {
display: flex;
justify-content: space-between;
border: 1px solid #e5e5e5;
background: #fff;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
margin-top: 15px;
}
.wpuf-help-page .wpuf-subscribe-box .text-wrap {
width: calc(100% - 530px);
.wpuf-help-page .wpuf-subscribe-box .wpuf-text-wrap {
padding: 10px 15px;
width: 60%;
}
.wpuf-help-page .wpuf-subscribe-box .text-wrap h3 {
.wpuf-help-page .wpuf-subscribe-box .wpuf-text-wrap h3 {
color: #ff5722;
margin: 4px 0 0 0;
}
.wpuf-help-page .wpuf-subscribe-box .text-wrap p {
margin-bottom: 5px;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap {
width: 530px;
display: flex;
padding: 10px 0;
.wpuf-help-page .wpuf-subscribe-box .wpuf-form-wrap {
background: #f7f7f7;
padding-left: 20px;
padding: 10px 15px;
width: 40%;
border-left: 1px solid #eee;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap .thank-you {
font-size: 16px;
color: green;
padding-top: 20px;
text-align: center;
width: 100%;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap label {
.wpuf-help-page .wpuf-subscribe-box .wpuf-form-wrap label {
color: #666;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap input {
max-width: 100%;
overflow: hidden;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap input[type="text"],
.wpuf-help-page .wpuf-subscribe-box .form-wrap input[type="email"] {
padding: 5px 8px;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap .fname {
width: 35%;
margin-right: 10px;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap .email {
width: 40%;
margin-right: 10px;
.wpuf-help-page .wpuf-subscribe-box .wpuf-form-wrap form {
display: flex;
align-items: flex-end;
}
.wpuf-help-page .wpuf-subscribe-box .form-wrap .submit-btn {
width: 20%;
padding-top: 22px;
.wpuf-help-page .wpuf-subscribe-box .wpuf-form-wrap form input {
margin-right: 15px;
}
.wpuf-help-page .help-blocks {
display: flex;
Expand Down
6 changes: 3 additions & 3 deletions assets/less/admin.less
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,9 @@ span.pro-icon:hover .wpuf-pro-field-tooltip {
}
}

.user-frontend_page_wpuf-post-forms .wrap h2.with-headway-icon,
.user-frontend_page_wpuf-profile-forms .wrap h2.with-headway-icon,
.user-frontend_page_wpuf-settings .wrap h2.with-headway-icon {
.wrap h2.with-headway-icon,
.wrap h2.with-headway-icon,
.wrap h2.with-headway-icon {
display: flex;
justify-content: space-between;

Expand Down
53 changes: 12 additions & 41 deletions assets/less/help.less
Original file line number Diff line number Diff line change
Expand Up @@ -151,68 +151,39 @@

.wpuf-subscribe-box {
display: flex;
justify-content: space-between;
border: 1px solid #e5e5e5;
background: #fff;
box-shadow: 0 1px 1px rgba(0,0,0,.04);
margin-top: 15px;

.text-wrap {
width: ~"calc(100% - 530px)";
.wpuf-text-wrap {
padding: 10px 15px;
width: 60%;

h3 {
color: #ff5722;
margin: 4px 0 0 0;
}

p {
margin-bottom: 5px;
}
}

.form-wrap {
width: 530px;
display: flex;
padding: 10px 0;
.wpuf-form-wrap {
background: #f7f7f7;
padding-left: 20px;
padding: 10px 15px;
width: 40%;
border-left: 1px solid #eee;

.thank-you {
font-size: 16px;
color: green;
padding-top: 20px;
text-align: center;
width: 100%;
}

label {
color: #666;
}

input {
max-width: 100%;
overflow: hidden;
}

input[type="text"],
input[type="email"] {
padding: 5px 8px;
}

.fname {
width: 35%;
margin-right: 10px;
}
form {
display: flex;
align-items: flex-end;

.email {
width: 40%;
margin-right: 10px;
}

.submit-btn {
width: 20%;
padding-top: 22px;
input {
margin-right: 15px;
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions includes/Admin/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ public function tools_page() {
* @return void
*/
public function enqueue_settings_page_scripts() {
wp_enqueue_style( 'wpuf-admin' );
wp_enqueue_script( 'wpuf-admin' );
wp_enqueue_script( 'wpuf-subscriptions' );
wp_enqueue_script( 'wpuf-settings' );

Expand Down
109 changes: 65 additions & 44 deletions includes/Admin/views/support.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,32 +204,57 @@ function wpuf_help_related_articles( $articles ) {
<div class="wrap wpuf-help-page">
<h1><?php esc_html_e( 'General Help Questions', 'wp-user-frontend' ); ?> <a href="https://wedevs.com/docs/wp-user-frontend-pro/?utm_source=wpuf-help-page&utm_medium=button-primary&utm_campaign=view-all-docs" target="_blank" class="page-title-action"><span class="dashicons dashicons-external" style="margin-top: 8px;"></span> <?php esc_html_e( 'View all Documentations', 'wp-user-frontend' ); ?></a></h1>

<form class="wpuf-subscribe-box" id="wpuf-form-subscribe" action="https://wedevs.us16.list-manage.com/subscribe/post-json?u=66e606cfe0af264974258f030&id=0d176bb256&c=?" method="get">

<div class="text-wrap">
<div class="wpuf-subscribe-box">
<div class="wpuf-text-wrap">
<h3><?php esc_html_e( 'Subscribe to Our Newsletter', 'wp-user-frontend' ); ?></h3>
<p>
<?php echo wp_kses_post( __( 'Subscribe to our newsletter for regular <strong>tips</strong>, <strong>offers</strong> and <strong>news updates</strong>.', 'wp-user-frontend' ) ); ?>
<?php echo wp_kses_post(
__(
'Subscribe to our newsletter for regular <strong>tips</strong>, <strong>offers</strong> and <strong>news updates</strong>.',
'wp-user-frontend'
)
); ?>
</p>
</div>

<div class="form-wrap">
<div class="fname">
<label for="fname"><?php esc_html_e( 'First Name', 'wp-user-frontend' ); ?></label>
<input type="text" name="FNAME" id="fname" class="regular-text" value="<?php echo esc_attr( $current_user->first_name ); ?>" required>
</div>

<div class="email">
<label for="email"><?php esc_html_e( 'Email', 'wp-user-frontend' ); ?></label>
<input type="email" name="EMAIL" id="email" class="regular-text" value="<?php echo esc_attr( $current_user->user_email ); ?>" required>
</div>

<div class="submit-btn">
<input type="hidden" name="group[3555][1]" value="1">
<input type="submit" class="button button-primary" value="<?php echo esc_attr( __( 'Subscribe', 'wp-user-frontend' ) ); ?>">
</div>
<div class="wpuf-form-wrap">
<form id="wemail-embedded-subscriber-form" method="post"
action="https://api.getwemail.io/v1/embed/subscribe/8da67b42-c367-4ad3-ae70-5cf63635a832">
<div class="form-group">
<label for="wemail-first-name">First Name <span
class="required-indicator">*</span></label>
<div>
<input
type="text"
name="first_name"
id="wemail-first-name"
required="required"
placeholder="<?php echo esc_attr( "Enter first name" ); ?>"
value="<?php echo esc_attr( $current_user->first_name ); ?>"
class="form-control">
</div>
</div>
<div class="form-group">
<label for="wemail-email">Email <span
class="required-indicator">*</span></label>
<div>
<input
type="email"
name="email"
required="required"
id="wemail-email"
placeholder="<?php echo esc_attr( "Enter email" ); ?>"
value="<?php echo esc_attr( $current_user->user_email ); ?>"
class="form-control">
</div>
</div>
<input type="hidden" name="tag" value="698f5d31-4ef9-430a-a6f3-7f4bb24cdaf9">
<div>
<button class="button button-primary"><?php esc_html_e( 'Subscribe', 'wp-user-frontend' ); ?></button>
</div>

</form>
</div>
</form>
</div>

<div class="wpuf-help-tabbed">
<nav>
Expand Down Expand Up @@ -522,34 +547,30 @@ function wpuf_help_related_articles( $articles ) {
});
});

$('#wpuf-form-subscribe').submit(function(e) {
e.preventDefault();
const wemailForm = document.getElementById('wemail-embedded-subscriber-form');

var form = $(this);
if (wemailForm) {
wemailForm.addEventListener('submit', function(e) {
e.preventDefault();

form.find('input[type="submit"]').prop('disabled', true);
const formData = new FormData(wemailForm);
const email = formData.get('email');

$.ajax({
url: form.attr('action'),
data: form.serialize(),
type: 'GET',
dataType: 'json',
cache: false,
contentType: "application/json; charset=utf-8",
})
.done(function(data) {
// console.log(data);
if (!isValidEmail( email )) {
alert( 'Please enter a valid email address' );

if (data.result != "success") {
// do something
return;
}
})
.fail(function() {
// console.log("error");
})
.always(function(response) {
$('.form-wrap', form).html( '<div class="thank-you">' + response.msg + '</div>' );

wemailForm.submit();
});
});
}

function isValidEmail(email) {
// Regular expression for validating an Email
const regex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;

return regex.test(email);
}
});
</script>
2 changes: 1 addition & 1 deletion includes/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct() {
$this->register_ajax( 'wpuf_account_update_profile', [ new Frontend\Frontend_Account(), 'update_profile' ], $this->logged_in_only );
$this->register_ajax( 'wpuf_import_forms', [ new Admin\Admin_Tools(), 'import_forms' ], $this->logged_in_only );
$this->register_ajax( 'wpuf_get_child_cat', 'wpuf_get_child_cats' );
$this->register_ajax( 'wpuf_ajax_address', 'wpuf_get_child_cats' );
$this->register_ajax( 'wpuf_ajax_address', 'wpuf_ajax_get_states_field' );
$this->register_ajax( 'wpuf_update_billing_address', 'wpuf_update_billing_address' );
$this->register_ajax( 'wpuf_clear_schedule_lock', 'wpuf_clear_schedule_lock', $this->logged_in_only );
}
Expand Down
Loading

0 comments on commit 0b0bffb

Please sign in to comment.