Skip to content

Commit

Permalink
readme update and elementor modal button
Browse files Browse the repository at this point in the history
  • Loading branch information
shuvo7670 committed Apr 30, 2024
1 parent 5ef34e7 commit 7b20637
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 62 deletions.
27 changes: 21 additions & 6 deletions assets/js/elementor-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@
label_schedule = wpsp_submit_button.data('label-schedule'),
label_publish = wpsp_submit_button.data('label-publish'),
label_update = wpsp_submit_button.data('label-update'),
label_draft = wpsp_submit_button.data('label-draft'),
advanced_schedule = $('.wpsp-advanced-schedule'),
advanced_schedule_text = $('span:nth-child(2)', advanced_schedule),
avd_label_schedule = advanced_schedule.data('label-schedule'),
avd_label_update = advanced_schedule.data('label-update'),
status = advanced_schedule.data('status'),
isAdvanced = advanced_schedule.data('is-advanced'),
immediately_btn = $('.wpsp-immediately-publish'),
wpsp_adv_date,
wpsp_date;


var updateLabel = function(current_time, selected_time){
if (current_time.getTime() < selected_time.getTime()) {
wpsp_submit_button_text.text(label_schedule)
} else {
wpsp_submit_button_text.text(label_publish)
if( status == 'draft' ) {
wpsp_submit_button_text.text(label_draft)
}else{
wpsp_submit_button_text.text(label_publish)
}
}
}

Expand Down Expand Up @@ -64,7 +71,7 @@
}
}
});

if ($('.wpsp-pro-fields.wpsp-pro-activated label input').length) {
flatpickr(".wpsp-pro-fields.wpsp-pro-activated label input", {
enableTime: true,
Expand All @@ -75,6 +82,14 @@
});
}

wpsp_adv_date = flatpickr("#wpsp-advanced-schedule-datetime", {
enableTime: true,
dateFormat: "Y-m-d H:i:S",
altInput: true,
altFormat: "F j, Y h:i K",
appendTo: window.document.querySelector('.wpsp-el-modal-date-picker'),
});

//Tooltip and icon swapping
function addTooltip($el) {
$el.tipsy({
Expand Down Expand Up @@ -151,6 +166,7 @@
}).on('click', '.wpsp-immediately-publish', function (e) {
e.preventDefault();
wpsp_date.clear();
wpsp_adv_date.clear();
wpsp_submit_button_text.text(label_publish);
$(this).addClass('active');
wpsp_submit_button_text.trigger('click', [$(this)]);
Expand Down Expand Up @@ -181,7 +197,6 @@
wpsp_date.setDate(data.data.post_time);
isAdvanced = data.data.advanced;
status = data.data.status;

if (data.data.status === 'future') {
advanced_schedule.hide();
immediately_btn.show();
Expand All @@ -192,7 +207,7 @@
}

if(isAdvanced){
wpsp_submit_button.hide();
// wpsp_submit_button.hide();
immediately_btn.show().removeClass('active');
advanced_schedule_text.text(avd_label_update);
}
Expand Down Expand Up @@ -359,7 +374,7 @@
let twitter_selected_profiles;
let is_twitter_share = true;
const el_twitter_profile = $('[name="wpsp-el-content-twitter"]:checked').val();
if( el_twitter_profile == 'wpsp-el-social-facebook-custom' ) {
if( el_twitter_profile == 'wpsp-el-social-twitter-custom' ) {
twitter_selected_profiles = $('[name="wpsp_el_social_twitter[]"]:checked').map(function() {
return $(this).val();
}).get();
Expand All @@ -380,7 +395,7 @@
let is_linkedin_share = true;
const el_linkedin_page = $('[name="wpsp-el-content-linkedin-page"]:checked').val();
const el_linkedin_profile = $('[name="wpsp-el-content-linkedin-profile"]:checked').val();
if( el_linkedin_page == 'wpsp-el-social-linkedin-page-custom' || el_linkedin_profile == 'wpsp-el-social-linkedin-custom-custom' ) {
if( el_linkedin_page == 'wpsp-el-social-linkedin-page-custom' || el_linkedin_profile == 'wpsp-el-social-linkedin-profile-custom' ) {
linkedin_selected_profiles = $('[name="wpsp_el_social_linkedin[]"]:checked').map(function() {
return $(this).val();
}).get();
Expand Down
9 changes: 6 additions & 3 deletions includes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ public function schedulepress_el_tab () { ?>
<button class="wpsp_el_share_now"><?php echo esc_html__('Share Now','wp-scheduled-posts') ?></button>
<button class="elementor-button wpsp-el-form-submit"
data-label-schedule="<?php esc_html_e( 'Schedule', 'wp-scheduled-posts' ); ?>"
data-label-publish="<?php esc_html_e( 'Publish', 'wp-scheduled-posts' ); ?>"
data-label-publish="<?php esc_html_e( 'Update', 'wp-scheduled-posts' ); ?>"
data-label-draft="<?php esc_html_e( 'Publish', 'wp-scheduled-posts' ); ?>"
data-label-update="<?php esc_html_e( 'Update', 'wp-scheduled-posts' ); ?>">
<span class="elementor-state-icon">
<i class="eicon-loading eicon-animation-spin" aria-hidden="true"></i>
Expand Down Expand Up @@ -458,7 +459,7 @@ function wpsp_filter_selected_profile_object($profile)

public function wpsp_get_pinterest_sections( $profiles )
{
if( $profiles['platform'] == 'pinterest' ) {
if( isset( $profiles['platform'] ) && $profiles['platform'] == 'pinterest' ) {
if ( isset( $profiles['pinterest_custom_board_name'] ) && isset( $profiles['pinterest_custom_section_name'] ) ) {
return [ $profiles['pinterest_custom_board_name'] => $profiles['pinterest_custom_section_name'] ];
}
Expand Down Expand Up @@ -822,6 +823,7 @@ public function wpsp_el_tab_action() {
'republish_datetime' => '',
'unpublish_datetime' => '',
'post_status' => 'future',
'_wpscppro_advance_schedule_date' => '',
'advanced' => null,
'wpsp-el-content-facebook' => '',
'wpsp-el-content-twitter' => '',
Expand All @@ -836,6 +838,8 @@ public function wpsp_el_tab_action() {
'wpsp_el_pinterest_board' => [],
] );

do_action( 'wpsp_el_action_before', $args );

// @todo moved to pro, will be removed in next version...
if ( $this->pro_enabled ) {
if ( ! empty( $args['republish_datetime'] ) ) {
Expand All @@ -847,7 +851,6 @@ public function wpsp_el_tab_action() {
}
}

do_action( 'wpsp_el_action_before', $args );

$is_future = true;

Expand Down
105 changes: 53 additions & 52 deletions languages/wp-scheduled-posts.pot
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-04-28T06:31:19+00:00\n"
"POT-Creation-Date: 2024-04-30T08:32:29+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.8.1\n"
"X-Domain: wp-scheduled-posts\n"

#. Plugin Name of the plugin
#: includes/Admin.php:372
#: includes/Admin.php:374
#: includes/Admin.php:377
#: includes/Admin.php:411
#: includes/Admin.php:373
#: includes/Admin.php:375
#: includes/Admin.php:378
#: includes/Admin.php:412
#: includes/Admin/Menu.php:34
msgid "SchedulePress"
msgstr ""
Expand Down Expand Up @@ -107,86 +107,87 @@ msgid "Share Now"
msgstr ""

#: includes/Admin.php:347
#: includes/Admin.php:356
#: includes/Admin.php:357
msgid "Schedule"
msgstr ""

#: includes/Admin.php:348
#: includes/Admin.php:360
msgid "Publish"
#: includes/Admin.php:350
#: includes/Admin.php:359
msgid "Update"
msgstr ""

#: includes/Admin.php:349
#: includes/Admin.php:358
msgid "Update"
#: includes/Admin.php:361
msgid "Publish"
msgstr ""

#: includes/Admin.php:419
#: includes/Admin.php:427
#: includes/Admin.php:433
#: includes/Admin.php:420
#: includes/Admin.php:428
#: includes/Admin.php:434
msgid "Pro Feature"
msgstr ""

#: includes/Admin.php:420
#: includes/Admin.php:421
#: assets/gutenberg/utils/DummyProFeatures.js:37
msgid "Unpublish On"
msgstr ""

#: includes/Admin.php:423
#: includes/Admin.php:430
#: includes/Admin.php:436
#: includes/Admin.php:424
#: includes/Admin.php:431
#: includes/Admin.php:437
msgid "PRO"
msgstr ""

#: includes/Admin.php:428
#: includes/Admin.php:429
#: assets/gutenberg/utils/DummyProFeatures.js:43
msgid "Republish On"
msgstr ""

#: includes/Admin.php:434
#: includes/Admin.php:435
#: includes/Admin/Settings.php:137
#: includes/Admin/Settings.php:1121
#: includes/Admin/Settings.php:1142
#: assets/gutenberg/utils/DummyProFeatures.js:51
msgid "Advanced Schedule"
msgstr ""

#: includes/Admin.php:528
#: includes/Admin.php:529
#: includes/Social/InstantShare.php:83
#: assets/gutenberg/social-share.js:435
msgid "Choose Social Share Platform"
msgstr ""

#: includes/Admin.php:539
#: includes/Admin.php:566
#: includes/Admin.php:615
#: includes/Admin.php:646
#: includes/Admin.php:680
#: includes/Admin.php:727
#: includes/Admin/Settings/assets/js/admin.js:1
msgid "Default"
msgstr ""

#: includes/Admin.php:540
#: includes/Admin.php:567
#: includes/Admin.php:616
#: includes/Admin.php:647
#: includes/Admin.php:681
#: includes/Admin.php:728
#: includes/Admin/Settings/assets/js/admin.js:1
msgid "Default"
msgstr ""

#: includes/Admin.php:541
#: includes/Admin.php:568
#: includes/Admin.php:617
#: includes/Admin.php:648
#: includes/Admin.php:682
#: includes/Admin.php:729
msgid "Custom"
msgstr ""

#: includes/Admin.php:554
#: includes/Admin.php:580
#: includes/Admin.php:629
#: includes/Admin.php:660
#: includes/Admin.php:667
#: includes/Admin.php:715
#: includes/Admin.php:742
#: includes/Admin.php:555
#: includes/Admin.php:581
#: includes/Admin.php:630
#: includes/Admin.php:661
#: includes/Admin.php:668
#: includes/Admin.php:716
#: includes/Admin.php:743
msgid "You may forget to add or enable profile/page from <a href=\"%s\">SchedulePress settings</a>. "
msgstr ""

#: includes/Admin.php:593
#: includes/Admin.php:594
#: assets/gutenberg/social-share.js:458
#: assets/gutenberg/social-share.js:487
#: assets/gutenberg/social-share.js:505
Expand All @@ -201,7 +202,7 @@ msgstr ""
msgid "Profile"
msgstr ""

#: includes/Admin.php:596
#: includes/Admin.php:597
#: assets/gutenberg/social-share.js:506
#: assets/gutenberg/social-share.js:524
#: assets/gutenberg/social-share.js:547
Expand All @@ -210,27 +211,27 @@ msgstr ""
msgid "Page"
msgstr ""

#: includes/Admin.php:622
#: includes/Admin.php:623
msgid "(Profile)"
msgstr ""

#: includes/Admin.php:653
#: includes/Admin.php:654
msgid "(Page)"
msgstr ""

#: includes/Admin.php:854
#: includes/Admin.php:857
msgid "Your post successfully updated"
msgstr ""

#: includes/Admin.php:992
#: includes/Admin.php:995
msgid "Your post successfully published"
msgstr ""

#: includes/Admin.php:1003
#: includes/Admin.php:1006
msgid "Your post id is empty"
msgstr ""

#: includes/Admin.php:1030
#: includes/Admin.php:1033
msgid "Your post successfully scheduled"
msgstr ""

Expand Down Expand Up @@ -899,31 +900,31 @@ msgstr ""
msgid "You may forget to add or enable social media from <a href=\"%s\">SchedulePress settings</a>. "
msgstr ""

#: includes/Social/InstantShare.php:320
#: includes/Social/InstantShare.php:420
#: includes/Social/InstantShare.php:325
#: includes/Social/InstantShare.php:425
#: includes/Social/SocialProfile.php:200
#: includes/Social/SocialProfile.php:272
#: includes/Social/SocialProfile.php:617
msgid "Invalid nonce."
msgstr ""

#: includes/Social/InstantShare.php:325
#: includes/Social/InstantShare.php:426
#: includes/Social/InstantShare.php:330
#: includes/Social/InstantShare.php:431
#: includes/Social/SocialProfile.php:204
#: includes/Social/SocialProfile.php:278
#: includes/Social/SocialProfile.php:623
msgid "You are unauthorized to access social profiles."
msgstr ""

#: includes/Social/InstantShare.php:407
#: includes/Social/InstantShare.php:412
msgid "Failed!, You didn't select any social media."
msgstr ""

#: includes/Social/InstantShare.php:527
#: includes/Social/InstantShare.php:532
msgid "Sorry, your requested platform integration is not added."
msgstr ""

#: includes/Social/Pinterest.php:260
#: includes/Social/Pinterest.php:269
msgid "Your post has been successfully shared!"
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ No, SchedulePress doesn’t require any additional plugin. All you have to do is

== Changelog ==

= 5.1.0 - 2024-04-29 =
= 5.1.0 - 2024-04-30 =
- Added: Instagram Social Share.
- Improved: Twitter Post sharing.
- Few minor bug fixes & improvements.
Expand Down

0 comments on commit 7b20637

Please sign in to comment.