Skip to content
Merged
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
4 changes: 1 addition & 3 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,9 +1441,6 @@
scInput.on('input', function () {
scConnectForm.removeData('scValidated');
resetVisualState();
if (scApiKeyBadgeHolders().not('.is_hidden').length) {
scApiKeyBadgeSetChecking();
}
});

scConnectForm.on('submit', function (e) {
Expand Down Expand Up @@ -1482,6 +1479,7 @@
scConnectMsgWrap.hide();
scmsgError.hide();
scmsgSuccess.hide();
scApiKeyBadgeSetChecking();

var ajaxNonce = (connectCfg && connectCfg.nonce) || scConnectForm.attr('data-sc-connect-validate-nonce') || '';
var fallbackAjaxUrl = (function () {
Expand Down
4 changes: 4 additions & 0 deletions assets/scss/add-ons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
.sc_addons_main {
flex: 1 1 auto;
min-width: 0;
.sc_addons_card_subtitle {
margin-top: 8px;
}
}

.sc_addons_sidebar {
Expand Down Expand Up @@ -63,6 +66,7 @@

.sc_addon_item_desc {
color: var(--sc-color-medium-gray);
margin-top: 8px;
}

.sc_addon_item_actions {
Expand Down
52 changes: 39 additions & 13 deletions assets/scss/connect.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,31 @@
text-align: center;
}

.sc_connect_welcome_title_row {
display: flex;
align-items: center;
gap: 20px;
text-align: left;
margin-bottom: 16px;

.sc_logo_link img {
display: block;
height: 40px;
width: auto;
}
}

.sc_connect_welcome_heading {
margin: 0;
padding: 0;
text-align: left;
flex: 1;
}
.sc_connect_welcome_subtitle {
text-align: left;
margin: 0px;
}

.sc_connect_welcome_video {
/* Video placeholder container */
margin: 40px auto 0;
Expand Down Expand Up @@ -84,12 +109,10 @@
.sc_connect_helper_row {
display: flex;
flex-direction: column;
margin-top: 8px;
font-family: var(--sc-font-body);
font-size: var(--sc-font-base);
line-height: var(--sc-body-small-line-height);
color: var(--sc-color-dark-gray);
gap: 12px;
}

.sc_connect_helper_text {
Expand Down Expand Up @@ -186,7 +209,7 @@
.sc_section_title {
display: block;
width: 100%;
margin-bottom: 16px;
margin-bottom: 8px;
}

.sc_helpful_links_cards_wrapper {
Expand Down Expand Up @@ -558,7 +581,7 @@
}

.sc_connect_credentials_link_row_center {
margin-top: 21px;
margin-top: 8px;
text-align: center;
}

Expand All @@ -571,10 +594,6 @@
margin-top: 16px;
}

.sc_connect_credentials_step_help {
margin-top: 8px;
}

.sc_connect_credentials_field_top {
margin-top: 16px;
}
Expand Down Expand Up @@ -619,7 +638,7 @@

.sc_connect_modal__actions {
margin-top: 0;
justify-content: flex-end;
justify-content: center;
flex-wrap: wrap;
}
}
Expand All @@ -629,15 +648,22 @@
}

.sc_connect_credentials_link_row {
margin-top: 10px;
margin-top: 8px;
}

.sc_connect_credentials_core_card {
margin-top: 24px;
}

.sc_connect_credentials_core_form {
margin-top: 12px;
.sc_setup_card {
.sc_connect_credentials_core_form {
margin-top: 12px;
.sc_item_spaced {
margin-bottom: 0px;
}
}
.sc_connect_setup_progress_title {
margin: 0px;
}
}

@media (max-width: 1024px) {
Expand Down
9 changes: 3 additions & 6 deletions assets/scss/design-system.scss
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@
line-height: var(--sc-h3-line-height);
letter-spacing: var(--sc-letter-spacing);
color: var(--sc-color-black);
margin: 0px;
}

.sc_h4 {
Expand All @@ -274,6 +275,7 @@
line-height: var(--sc-h4-line-height);
letter-spacing: var(--sc-letter-spacing);
color: var(--sc-color-black);
margin: 0px;
}

.sc_h5 {
Expand Down Expand Up @@ -1158,17 +1160,12 @@
justify-content: space-between;
margin: 0 auto 24px;

.sc_connect_page_header_left,
.sc_connect_page_header_right {
.sc_connect_page_header_left {
display: flex;
align-items: center;
flex: 0 0 auto;
}

.sc_connect_page_header_right {
margin-left: auto;
}

.sc_connect_page_header_left .sc_logo_link img {
display: block;
height: 40px;
Expand Down
12 changes: 12 additions & 0 deletions assets/scss/misc-settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
margin: 0 0 10px;
}

/* Card title already shows "General"; hide duplicate Settings API section heading. */
.simcal-misc-settings-general > h2 {
display: none;
}

.sc_misc_settings_card + .sc_misc_settings_card {
margin-top: 24px;
}
Expand Down Expand Up @@ -76,6 +81,13 @@
}
}

.simcal-misc-settings-general {
.form-table {
th {
vertical-align: middle;
}
}
}
.submit {
margin: 18px 0 0;
padding: 0;
Expand Down
12 changes: 1 addition & 11 deletions includes/admin/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ class="wrap <?php echo $is_misc_settings_page
</a>
</span>
</div>
<div class="sc_connect_page_header_right">
<span class="sc_text--body_b1">
<?php echo esc_html__('Addons', 'google-calendar-events'); ?>
</span>
</div>
</div>

<div class="sc_connect_notices">
Expand Down Expand Up @@ -311,11 +306,6 @@ class="wrap <?php echo $is_misc_settings_page
</a>
</span>
</div>
<div class="sc_connect_page_header_right">
<span class="sc_text--body_b1">
<?php echo esc_html__('Settings', 'google-calendar-events'); ?>
</span>
</div>
</div>

<div class="sc_connect_notices">
Expand All @@ -334,7 +324,7 @@ class="wrap <?php echo $is_misc_settings_page
<div class="sc_text--body_b3 sc_text--dark"><?php echo $calendars_contents['description']; ?></div>
<?php } ?>

<form id="simcal-misc-settings-form-calendars" method="post" action="options.php">
<form id="simcal-misc-settings-form-calendars" class="simcal-misc-settings-general" method="post" action="options.php">
<?php
do_action('simcal_admin_page_' . $this->page . '_' . $calendars_tab_id . '_start');
settings_fields('simple-calendar_' . $this->page . '_' . $calendars_tab_id);
Expand Down
28 changes: 14 additions & 14 deletions includes/admin/pages/add-ons.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ public static function html()
]);

$catalog = [
'fullcalendar' => [
'title' => __('FullCalendar Extended', 'google-calendar-events'),
'description' => __(
'Adds month, week, day, and list views to your calendar with improved interactivity and display flexibility.',
'google-calendar-events',
),
'learn_more_url' => 'https://simplecalendar.io/downloads/fullcalendar/',
'buy_url' => simcal_get_url('addons'),
'is_active' => function_exists('simcal_is_fullcalendar_addon_active')
? simcal_is_fullcalendar_addon_active()
: $is_plugin_active('simple-calendar-fullcalendar/simple-calendar-fullcalendar.php'),
'icon' => 'fullcalendar-extended.svg',
'license_key' => $fullcalendar_license_key,
],
'google_pro' => [
'title' => __('Google Calendar Pro', 'google-calendar-events'),
'description' => __(
Expand All @@ -171,6 +157,20 @@ public static function html()
'icon' => 'google-calendar-pro.svg',
'license_key' => $google_pro_license_key,
],
'fullcalendar' => [
'title' => __('FullCalendar Extended', 'google-calendar-events'),
'description' => __(
'Adds month, week, day, and list views to your calendar with improved interactivity and display flexibility.',
'google-calendar-events',
),
'learn_more_url' => 'https://simplecalendar.io/downloads/fullcalendar/',
'buy_url' => simcal_get_url('addons'),
'is_active' => function_exists('simcal_is_fullcalendar_addon_active')
? simcal_is_fullcalendar_addon_active()
: $is_plugin_active('simple-calendar-fullcalendar/simple-calendar-fullcalendar.php'),
'icon' => 'fullcalendar-extended.svg',
'license_key' => $fullcalendar_license_key,
],
'appointment' => [
'title' => __('Book an Appointment', 'google-calendar-events'),
'description' => __(
Expand Down
6 changes: 3 additions & 3 deletions includes/admin/pages/components/progress.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

$circle_class = $percent >= 100 ? '100' : ($percent >= 67 ? '67' : '33');
?>
<div class="sc_setup_card">
<h3 class="sc_connect_helpful_links_title">
<div class="sc_setup_card sc_setup_progress_card">
<h3 class="sc_connect_setup_progress_title">
<?php esc_html_e('Setup progress', 'google-calendar-events'); ?>
</h3>
<p class="sc_text--body_b2 sc_text--dark">
<?php esc_html_e(
'Complete the steps below to sync your Google Calendar with your website in real time.',
'Complete the steps below to sync your Google Calendar events with your website in real-time.',
'google-calendar-events',
); ?>
</p>
Expand Down
19 changes: 14 additions & 5 deletions includes/admin/pages/connect-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
];
$step_template_path = isset($step_template_map[$step]) ? $step_template_map[$step] : $step_template_map['api_key'];

$welcome_context_for_template =
$is_pro_flow && 'appointment' !== (string) $welcome_context ? 'pro' : (string) $welcome_context;

$context = [
// Shared.
'assets_base' => $assets_base,
Expand All @@ -62,22 +65,28 @@
'has_published_pro_calendar' => $has_published_pro_calendar,
'should_hide_progress' => $should_hide_progress,
// Welcome.
'video_url' => (function () use ($is_pro_flow) {
'video_url' => (function () use ($is_pro_flow, $welcome_context_for_template) {
$core_video_url = 'https://www.youtube.com/embed/3QveIbm5Oc0?si=fMEUU0Za7KFzlJk5';
$pro_video_url = 'https://www.youtube.com/embed/lmN774Fk3rw?si=zBMoOck0BjI7Q39j';
$default = $is_pro_flow ? $pro_video_url : $core_video_url;
$appointment_video_url = 'https://www.youtube.com/embed/yCSpUlBnunw';
$default =
'appointment' === $welcome_context_for_template
? $appointment_video_url
: ($is_pro_flow
? $pro_video_url
: $core_video_url);

/**
* Filter the welcome video embed URL shown on the Connect welcome step.
*
* @since 3.6.2
*
* @param string $default_embed_url Default YouTube embed URL.
* @param string $context 'core' or 'pro'.
* @param string $context 'core', 'pro', or 'appointment'.
*/
return apply_filters('simple_calendar_connect_welcome_video_url', $default, $is_pro_flow ? 'pro' : 'core');
return apply_filters('simple_calendar_connect_welcome_video_url', $default, $welcome_context_for_template);
})(),
'welcome_context' => $is_pro_flow ? 'pro' : $welcome_context,
'welcome_context' => $welcome_context_for_template,
// Sidebar.
'sidebar_template_path' => SIMPLE_CALENDAR_PATH . 'includes/admin/pages/connect/sidebar.php',
];
Expand Down
10 changes: 3 additions & 7 deletions includes/admin/pages/connect/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
} ?>
<div class="wrap sc_root" id="simcal-connect-page">
<div class="sc_connect_page_outer">
<?php $hide_sidebar = !empty($context['hide_sidebar']); ?>
<?php if (!$hide_sidebar) { ?>
<div class="sc_connect_page_header">
<div class="sc_connect_page_header_left">
<span class="sc_logo">
Expand All @@ -24,14 +26,8 @@
</a>
</span>
</div>
<div class="sc_connect_page_header_right">
<span class="sc_text--body_b1">
<?php echo __('Connect', 'google-calendar-events'); ?>
</span>
</div>
</div>

<?php $hide_sidebar = !empty($context['hide_sidebar']); ?>
<?php } ?>
<div class="sc_connect_page_inner<?php echo $hide_sidebar ? ' sc_connect_page_inner--no-sidebar' : ''; ?>">
<div>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

$has_api_key_for_step = isset($has_api_key) && (bool) $has_api_key;
$api_key_field_item_class = $is_credentials_core ? 'sc_item sc_item_spaced' : 'sc_item_spaced';
$api_key_field_item_class = $is_credentials_core ? 'sc_item sc_core_item_spaced' : 'sc_core_item_spaced';
?>
<div class="<?php echo esc_attr($card_class); ?>">
<div class="sc_connect_credentials_header">
Expand Down Expand Up @@ -79,7 +79,7 @@ class="sc_text--body_b3 sc_connect_google_api_key_health_detail is_hidden"
<input type="hidden" name="simple-calendar_settings_feeds[__sc_partial_sections][google]" value="1" />
<div class="<?php echo esc_attr($api_key_field_item_class); ?>">
<label for="sc_google_api_key" class="sc_h6">
<?php esc_html_e('Google API Key', 'google-calendar-events'); ?>
<?php esc_html_e('Google API key', 'google-calendar-events'); ?>
</label>

<div id="sc_connect_api_key_wrap" class="sc_input_wrapper sc_input_wrapper--icons-outside sc_input_wrapper--square sc_input_full">
Expand Down Expand Up @@ -133,10 +133,7 @@ class="sc_icon--square"
<p class="sc_connect_helper_text">
<?php
/* translators: %1$s: Opening anchor tag, %2$s: Closing anchor tag */
$text = __(
'Protect your API key from unauthorized access. To create one, follow our %1$sstep-by-step guide%2$s.',
'google-calendar-events',
);
$text = __('To create one, follow our %1$sstep-by-step guide%2$s.', 'google-calendar-events');
echo wp_kses(
sprintf(
$text,
Expand Down
Loading
Loading