Skip to content

Commit

Permalink
Merge pull request #53 from iamsayan/develop
Browse files Browse the repository at this point in the history
added v1.8.8
  • Loading branch information
iamsayan authored Jun 26, 2023
2 parents 2c9f75c + 669905e commit a4916fa
Show file tree
Hide file tree
Showing 74 changed files with 29,269 additions and 12,428 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.

## 1.8.8
Release Date: June 26, 2023

* Added: Integration with AIOSEO Plugin last modified update checkbox.
* Updated: @wordpress/scripts to the latest version.
* Updated: Selectize JS Library.
* Updated: Background Process PHP Library.
* Tweak: Changed Toogle to Checkbox Control.
* Fixed: Deprecated Button Component parameter.
* Fixed: PHP Errors on Plugins page.
* Fixed: Properly support the id attribute in the shortcode. Props to @yoren.
* Tested with WordPress v6.2.

## 1.8.7
Release Date: January 25, 2023

Expand All @@ -20,7 +33,7 @@ Release Date: January 5, 2023
* Fixed: PHP Error if the the global post object is undefined.
* Fixed: WooCommerce product modified date updated even if the option is disabled.
* Fixed: Update Locked posts was showing all posts in post list page.
* Fixed: Lock Modified Date option was not working properly.
* Fixed: Lock the Modified Date option was not working properly.
* Fixed: Bulk Editing was not working.
* Tweak: Allow Toogle Disable Update Option for all post types and posts with future date.
* Imporved: Optimize codebase.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ const PostModifiedField = () => {
renderToggle={ ( { onToggle, isOpen } ) => (
<Button
className="edit-post-post-schedule__toggle"
variant="tertiary"
onClick={ onToggle }
aria-expanded={ isOpen }
isTertiary
>
{ dateI18n( dateTimeFormat, editedModified ) }
</Button>
Expand All @@ -57,6 +57,7 @@ const PostModifiedField = () => {
currentDate={ editedModified }
onChange={ ( modified ) => { editPost( { modified } ) } }
is12Hour={ is12HourFormat( settings.formats.time ) }
__nextRemoveResetButton={ true }
/>
) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { FormToggle } from '@wordpress/components';
import { CheckboxControl } from '@wordpress/components';
import { useSelect, useDispatch } from '@wordpress/data';
import { PluginPostStatusInfo } from '@wordpress/edit-post';

Expand All @@ -22,8 +22,8 @@ const PostModifiedDateToggle = () => {

return (
<PluginPostStatusInfo>
<span>{ __( 'Lock Modified Date', 'wp-last-modified-info' ) }</span>
<FormToggle
<CheckboxControl
label={ __( 'Lock the Modified Date', 'wp-last-modified-info' ) }
checked={ postMeta?._lmt_disableupdate == 'yes' ? true : false }
onChange={ () => editPost( { meta: { _lmt_disableupdate: postMeta?._lmt_disableupdate == 'yes' ? 'no' : 'yes' } } ) }
/>
Expand Down
2 changes: 1 addition & 1 deletion assets/css/admin.min.css

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions assets/css/admin.sass
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
margin-left: 0.4rem

.wplmi-form-control
&.wplmi-form-el.selectize-control
padding: 0 !important

&:not(.wplmi-editor)
width: 40%
padding: 6px 12px !important
Expand All @@ -106,6 +109,9 @@
@media screen and (max-width: 782px)
width: 95% !important

&.selectize-dropdown
padding: 0 !important

&:focus, &:hover
border-color: #ccc !important

Expand All @@ -122,16 +128,19 @@ textarea.wplmi-form-control:not(.selectize-control):not(.selectize-dropdown)
width: 60% !important

.selectize-input
padding: 8px 12px 5px !important
padding: 8px 8px 5px !important
box-shadow: none !important
border-color: #ccc

&:not(.has-items)
padding: 13px 15px !important

select.wplmi-form-control
background-position: right 13px top 55% !important

.selectize-control.multi .selectize-input > div
padding: 5px 25px 5px 12px !important
.selectize-control.multi .selectize-input > .item
padding: 5px 2px 5px 12px !important
border-radius: 3px

div.description
font-size: .79rem !important
Expand Down
21 changes: 20 additions & 1 deletion assets/css/selectize.min.css

Large diffs are not rendered by default.

118 changes: 62 additions & 56 deletions assets/js/admin.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
jQuery(document).ready(function ($) {
( function( $ ) {
'use strict';

if ( typeof wplmiAdminL10n === 'undefined' ) {
return false;
}

let highlighting = true,
wplmi_editor, wplmi_css_editor, wplmi_tag_editor;
wplmi_editor, wplmi_css_editor, wplmi_tag_editor;

if ( wplmiAdminL10n.highlighting == 'off' ) {
highlighting = false;
}

if ( highlighting ) {
wplmi_editor = wp.codeEditor.initialize($('#wplmi_display_info'), wplmiAdminL10n.html_editor);
wplmi_css_editor = wp.codeEditor.initialize($('#wplmi_custom_css'), wplmiAdminL10n.css_editor);
wplmi_tag_editor = wp.codeEditor.initialize($('#wplmi_template_display_info'), wplmiAdminL10n.html_editor);
wplmi_editor = wp.codeEditor.initialize( $( '#wplmi_display_info' ), wplmiAdminL10n.html_editor );
wplmi_css_editor = wp.codeEditor.initialize( $( '#wplmi_custom_css' ), wplmiAdminL10n.css_editor );
wplmi_tag_editor = wp.codeEditor.initialize( $( '#wplmi_template_display_info' ), wplmiAdminL10n.html_editor );
}

let wplmi_btns = $( '#wplmi-nav-container' ).find( 'a.wplmi-tab:not(.type-link)' );
for (let wplmi_btn of wplmi_btns) {
$( wplmi_btn ).on( 'click', function (e) {
for ( let wplmi_btn of wplmi_btns ) {
$( wplmi_btn ).on( 'click', function ( e ) {
e.preventDefault();
let tab_id = $(this).attr('id').replace('wplmi-tab-', '');
$('a.is-active').removeClass("is-active");
$(this).addClass("is-active");
$(".wplmi-metabox .wplmi-" + tab_id).removeClass('d-none');
$(".wplmi-metabox .postbox:not(.wplmi-" + tab_id + "), .wplmi-metabox .sub-links:not(.wplmi-" + tab_id + ")").addClass('d-none');

let tab_id = $( this ).attr( 'id' ).replace( 'wplmi-tab-', '' );
$( 'a.is-active' ).removeClass( "is-active" );
$( this ).addClass( "is-active" );
$( ".wplmi-metabox .wplmi-" + tab_id ).removeClass( 'd-none' );
$( ".wplmi-metabox .postbox:not(.wplmi-" + tab_id + "), .wplmi-metabox .sub-links:not(.wplmi-" + tab_id + ")" ).addClass( 'd-none' );

localStorage.setItem('wplmi_active_tab', tab_id);
if ( highlighting ) {
if ( tab_id == 'post' ) {
Expand Down Expand Up @@ -134,7 +137,7 @@ jQuery(document).ready(function ($) {
$( '#wplmi-settings-form' ).submit( function( e ) {
e.preventDefault();
$( ".wplmi-save" ).addClass( "disabled" ).val( wplmiAdminL10n.saving );
let jd = $.dialog({
let jd = $.dialog( {
title: wplmiAdminL10n.saving,
content: wplmiAdminL10n.saving_text,
useBootstrap: false,
Expand All @@ -144,11 +147,11 @@ jQuery(document).ready(function ($) {
closeIcon: false,
boxWidth: '25%',
scrollToPreviousElement: false,
});
$(this).ajaxSubmit({
} );
$( this ).ajaxSubmit( {
success: function() {
jd.close();
$.alert({
$.alert( {
title: wplmiAdminL10n.done,
content: wplmiAdminL10n.save_success,
useBootstrap: false,
Expand All @@ -162,12 +165,12 @@ jQuery(document).ready(function ($) {
text: wplmiAdminL10n.ok_button,
}
}
});
$(".wplmi-save").removeClass("disabled").val(wplmiAdminL10n.save_button);
} );
$( ".wplmi-save" ).removeClass( "disabled" ).val( wplmiAdminL10n.save_button );
},
error: function() {
jd.close();
$.alert({
$.alert( {
title: wplmiAdminL10n.error,
content: wplmiAdminL10n.process_failed,
useBootstrap: false,
Expand All @@ -181,7 +184,7 @@ jQuery(document).ready(function ($) {
text: wplmiAdminL10n.ok_button,
}
}
});
} );
},
});
});
Expand Down Expand Up @@ -209,7 +212,7 @@ jQuery(document).ready(function ($) {
text: wplmiAdminL10n.confirm_button,
action: function () {
mdc.close();
let cd = $.dialog({
let cd = $.dialog( {
title: process,
content: wplmiAdminL10n.processing,
useBootstrap: false,
Expand All @@ -219,11 +222,11 @@ jQuery(document).ready(function ($) {
closeIcon: false,
boxWidth: '25%',
scrollToPreviousElement: false,
});
} );
$.post( wplmiAdminL10n.ajaxurl, { action: action, action_type: type, security: wplmiAdminL10n.security }, function( response ) {
if( response.success === true ) {
cd.close();
$.alert({
$.alert( {
title: wplmiAdminL10n.done,
content: success,
useBootstrap: false,
Expand All @@ -243,7 +246,7 @@ jQuery(document).ready(function ($) {
}
}
}
});
} );
} else {
cd.close();
$.alert({
Expand All @@ -260,42 +263,45 @@ jQuery(document).ready(function ($) {
text: wplmiAdminL10n.ok_button,
}
}
});
} );
}
});
} );
}
},
cancel: {
text: wplmiAdminL10n.cancel_button,
}
}
})
} )
} );

$( "input.wplmi-copy" ).on( 'click', function( e ) {
e.preventDefault();
let el = $(this);

let el = $( this );
let value = el.val();
let action = el.data('action');
el.addClass("disabled").val(wplmiAdminL10n.please_wait);
let action = el.data( 'action' );
el.addClass( "disabled" ).val( wplmiAdminL10n.please_wait );

$.post( wplmiAdminL10n.ajaxurl, { action: action, security: wplmiAdminL10n.security }, function( response ) {
if ( response.success === true ) {
if ( navigator.clipboard ) {
navigator.clipboard.writeText( response.data.elements ).then( function() {
console.log('Copied to clipboard!');
console.log( 'Copied to clipboard!' );
}, function(err) {
console.error('Could not copy text: ', err);
console.error( 'Could not copy text: ', err );
} );
}
el.removeClass("disabled").val(value);
$(".wplmi-copied").show().delay(1000).fadeOut();
el.removeClass( "disabled" ).val( value );
$( ".wplmi-copied" ).show().delay(1000).fadeOut();
}
});
} );
} );

$( "input.wplmi-paste" ).on( 'click', function( e ) {
e.preventDefault();
let mdc = $.confirm({

let mdc = $.confirm( {
title: wplmiAdminL10n.paste_data,
content: '<textarea id="wplmi-settings-data-import" rows="4" style="width: 100%;"></textarea>',
useBootstrap: false,
Expand All @@ -315,7 +321,7 @@ jQuery(document).ready(function ($) {
return false;
}
mdc.close();
$.dialog({
$.dialog( {
title: wplmiAdminL10n.importing,
content: wplmiAdminL10n.processing,
useBootstrap: false,
Expand All @@ -325,31 +331,31 @@ jQuery(document).ready(function ($) {
closeIcon: false,
boxWidth: '25%',
scrollToPreviousElement: false,
});
} );
$.post( wplmiAdminL10n.ajaxurl, { action: 'wplmi_process_import_plugin_data', settings_data: settings_data, security: wplmiAdminL10n.security }, function( response ) {
if( response.success === true ) {
localStorage.setItem('wplmi_active_tab', 'post');
location.reload();
}
});
} );
}
},
close: {
text: wplmiAdminL10n.close_btn,
}
}
})
} )
} );

$( '#wplmi_post_types, #wplmi_schema_post_types, #wplmi_notification_post_types, #wplmi_archives' ).selectize( {
plugins: ['remove_button'],
plugins: [ 'remove_button' ],
delimiter: ',',
placeholder: $(this).data('placeholder'),
placeholder: $( this ).data( 'placeholder' ),
persist: false,
create: false
} );

$('#wplmi_recipients_list').selectize({
$( '#wplmi_recipients_list' ).selectize( {
plugins: ['remove_button', 'restore_on_backspace'],
persist: false,
create: true,
Expand All @@ -360,33 +366,33 @@ jQuery(document).ready(function ($) {
let regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return regex.test(String(input).toLowerCase());
}
});
} );

$(".coffee-amt").on( 'change', function() {
$( ".coffee-amt" ).on( 'change', function() {
let btn = $('.buy-coffee-btn');
btn.attr('href', btn.data('link') + $(this).val());
});
btn.attr( 'href', btn.data( 'link' ) + $( this ).val() );
} );

$( 'a.share-btn:not(.no-popup)' ).on( 'click', function (e) {
$( 'a.share-btn:not(.no-popup)' ).on( 'click', function ( e ) {
e.preventDefault();
wplmiOpenPopup( $(this).attr('href'), 'Share Window', 950, 700 );
wplmiOpenPopup( $( this ).attr( 'href' ), 'Share Window', 950, 700 );
} );

$( window ).keydown( function(e) {
if (e.ctrlKey || e.metaKey) {
switch (String.fromCharCode(e.which).toLowerCase()) {
$( window ).keydown( function( e ) {
if ( e.ctrlKey || e.metaKey ) {
switch ( String.fromCharCode( e.which ).toLowerCase() ) {
case 's':
e.preventDefault();
$('#wplmi-settings-form').submit();
$( '#wplmi-settings-form' ).submit();
break;
}
}
});
} );

$( '.click-to-copy' ).on( 'click', function( e ) {
e.preventDefault();
if ( highlighting ) {
let active_tab = localStorage.getItem('wplmi_active_tab'),
let active_tab = localStorage.getItem( 'wplmi_active_tab' ),
editor;
if ( active_tab == 'post' ) {
editor = wplmi_editor;
Expand Down Expand Up @@ -422,7 +428,7 @@ jQuery(document).ready(function ($) {

myField.val( textBefore + myValue + textAfter );
}
});
} )( jQuery );

function wplmiOpenPopup( url, title, w, h ) {
let y = window.outerHeight / 2 + window.screenY - ( h / 2)
Expand Down
Loading

0 comments on commit a4916fa

Please sign in to comment.