laipower/wp-content/plugins/gp-premium/blog/functions/js/controls.js

99 lines
3.2 KiB
JavaScript
Raw Normal View History

jQuery( function( $ ) {
2020-04-07 13:03:04 +00:00
// Featured image controls
var featuredImageArchiveControls = [
2020-04-07 13:03:04 +00:00
'generate_blog_settings-post_image',
'generate_blog_settings-post_image_padding',
'generate_blog_settings-post_image_position',
'generate_blog_settings-post_image_alignment',
'generate_blog_settings-post_image_size',
2020-04-07 13:03:04 +00:00
'generate_blog_settings-post_image_width',
'generate_blog_settings-post_image_height',
'generate_regenerate_images_notice',
2020-04-07 13:03:04 +00:00
];
$.each( featuredImageArchiveControls, function( index, value ) {
2020-04-07 13:03:04 +00:00
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-archives' );
} );
var featuredImageSingleControls = [
2020-04-07 13:03:04 +00:00
'generate_blog_settings-single_post_image',
'generate_blog_settings-single_post_image_padding',
'generate_blog_settings-single_post_image_position',
'generate_blog_settings-single_post_image_alignment',
'generate_blog_settings-single_post_image_size',
2020-04-07 13:03:04 +00:00
'generate_blog_settings-single_post_image_width',
'generate_blog_settings-single_post_image_height',
'generate_regenerate_single_post_images_notice',
2020-04-07 13:03:04 +00:00
];
$.each( featuredImageSingleControls, function( index, value ) {
2020-04-07 13:03:04 +00:00
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-single' ).css( {
visibility: 'hidden',
height: '0',
width: '0',
margin: '0',
overflow: 'hidden',
2020-04-07 13:03:04 +00:00
} );
} );
var featuredImagePageControls = [
2020-04-07 13:03:04 +00:00
'generate_blog_settings-page_post_image',
'generate_blog_settings-page_post_image_padding',
'generate_blog_settings-page_post_image_position',
'generate_blog_settings-page_post_image_alignment',
'generate_blog_settings-page_post_image_size',
2020-04-07 13:03:04 +00:00
'generate_blog_settings-page_post_image_width',
'generate_blog_settings-page_post_image_height',
'generate_regenerate_page_images_notice',
2020-04-07 13:03:04 +00:00
];
$.each( featuredImagePageControls, function( index, value ) {
2020-04-07 13:03:04 +00:00
$( '#customize-control-' + value ).attr( 'data-control-section', 'featured-image-page' ).css( {
visibility: 'hidden',
height: '0',
width: '0',
margin: '0',
overflow: 'hidden',
2020-04-07 13:03:04 +00:00
} );
} );
// Post meta controls
var postMetaArchiveControls = [
2020-04-07 13:03:04 +00:00
'generate_settings-post_content',
'generate_blog_settings-excerpt_length',
'generate_blog_settings-read_more',
'generate_blog_settings-read_more_button',
'generate_blog_settings-date',
'generate_blog_settings-author',
'generate_blog_settings-categories',
'generate_blog_settings-tags',
'generate_blog_settings-comments',
'generate_blog_settings-infinite_scroll',
'generate_blog_settings-infinite_scroll_button',
'blog_masonry_load_more_control',
'blog_masonry_loading_control',
];
$.each( postMetaArchiveControls, function( index, value ) {
2020-04-07 13:03:04 +00:00
$( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-archives' );
} );
var postMetaSingleControls = [
2020-04-07 13:03:04 +00:00
'generate_blog_settings-single_date',
'generate_blog_settings-single_author',
'generate_blog_settings-single_categories',
'generate_blog_settings-single_tags',
'generate_blog_settings-single_post_navigation',
];
$.each( postMetaSingleControls, function( index, value ) {
2020-04-07 13:03:04 +00:00
$( '#customize-control-' + value ).attr( 'data-control-section', 'post-meta-single' ).css( {
visibility: 'hidden',
height: '0',
width: '0',
margin: '0',
overflow: 'hidden',
2020-04-07 13:03:04 +00:00
} );
} );
} );