updated plugin GP Premium version 1.11.3

This commit is contained in:
2020-08-24 15:44:54 +00:00
committed by Gitium
parent de9808fd12
commit a162f89e68
10 changed files with 66 additions and 30 deletions

View File

@ -25,7 +25,7 @@ jQuery(document).ready(function($) {
});
});
jQuery(window).load(function($) {
jQuery(window).on('load', function() {
if ( jQuery( '#_meta-generate-page-header-enable-image-crop' ).val() == 'enable' ) {
jQuery( '#crop-enabled' ).show();
}
@ -217,4 +217,4 @@ jQuery(document).ready(function($) {
// Open the featured image modal
wp.media.featuredImage.frame().open();
});
});
});

View File

@ -13,7 +13,7 @@
// Variable for some backgrounds ( grid )
var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
// html stuff for wpColorPicker copy of the original color-picker.js
_before = '<button type="button" class="button wp-color-result" aria-expanded="false" style="position:relative;"><span class="wp-color-result-text">' + wpColorPickerL10n.pick + '</span></button>',
_before = '<button type="button" class="button wp-color-result" aria-expanded="false" style="position:relative;"><span class="wp-color-result-text">' + gpSectionsColorPickerL10n.pick + '</span></button>',
_after = '<div class="wp-picker-holder" />',
_wrap = '<div class="wp-picker-container" />',
_button = '<input type="button" class="button button-small" />',
@ -63,14 +63,14 @@
// Set up HTML structure, hide things
el.addClass( 'wp-color-picker' ).wrap( _wrap );
self.wrap = el.parent();
self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor : self.initialValue } ).attr( 'title', wpColorPickerL10n.pick ).attr( 'data-current', wpColorPickerL10n.current );
self.toggler = $( _before ).insertBefore( el ).css( { backgroundColor : self.initialValue } ).attr( 'title', gpSectionsColorPickerL10n.pick ).attr( 'data-current', gpSectionsColorPickerL10n.current );
self.pickerContainer = $( _after ).insertAfter( el );
self.button = $( _button );
if ( self.options.defaultColor ) {
self.button.addClass( 'wp-picker-default' ).val( wpColorPickerL10n.defaultString );
self.button.addClass( 'wp-picker-default' ).val( gpSectionsColorPickerL10n.defaultString );
} else {
self.button.addClass( 'wp-picker-clear' ).val( wpColorPickerL10n.clear );
self.button.addClass( 'wp-picker-clear' ).val( gpSectionsColorPickerL10n.clear );
}
el.wrap( '<span class="wp-picker-input-wrap hidden" />' ).after( self.button );
@ -83,7 +83,7 @@
palettes : self.options.palettes,
change : function( event, ui ) {
if ( self.options.alpha ) {
self.toggler.css( { 'background-image' : 'url(' + image + ')' } ).html( '<span class="wp-color-result-text" style="position:relative;z-index:1;">' + wpColorPickerL10n.pick + '</span><span />' );
self.toggler.css( { 'background-image' : 'url(' + image + ')' } ).html( '<span class="wp-color-result-text" style="position:relative;z-index:1;">' + gpSectionsColorPickerL10n.pick + '</span><span />' );
self.toggler.find( 'span' ).last().css( {
'width' : '100%',
'height' : '100%',
@ -337,4 +337,4 @@
// Auto Call plugin is class is color-picker
jQuery( document ).ready( function( $ ) {
$( '.color-picker' ).wpColorPicker();
} );
} );

View File

@ -84,6 +84,20 @@ if ( ! function_exists( 'generate_page_header_metabox_enqueue' ) ) {
wp_enqueue_script( 'wp-color-picker' );
wp_enqueue_style( 'wp-color-picker' );
wp_enqueue_script( 'wp-color-picker-alpha', plugin_dir_url( __FILE__ ) . 'js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), GENERATE_PAGE_HEADER_VERSION );
wp_localize_script(
'wp-color-picker-alpha',
'gpSectionsColorPickerL10n',
array(
'defaultLabel' => __( 'Color value', 'gp-premium' ),
'pick' => __( 'Select Color', 'gp-premium' ),
'defaultString' => __( 'Default', 'gp-premium' ),
'defaultAriaLabel' => __( 'Select default color', 'gp-premium' ),
'clear' => __( 'Clear', 'gp-premium' ),
'clearAriaLabel' => __( 'Clear color', 'gp-premium' ),
)
);
wp_enqueue_style( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'css/metabox.css', array(), GENERATE_PAGE_HEADER_VERSION );
wp_enqueue_script( 'generate-lc-switch', plugin_dir_url( __FILE__ ) . 'js/lc_switch.js', array( 'jquery' ), GENERATE_PAGE_HEADER_VERSION, false );
wp_enqueue_script( 'generate-page-header-metabox', plugin_dir_url( __FILE__ ) . 'js/metabox.js', array( 'jquery','generate-lc-switch', 'wp-color-picker' ), GENERATE_PAGE_HEADER_VERSION, false );