Fixes to sync strategy and document download button

This commit is contained in:
mateuswetah 2021-04-13 22:36:47 -03:00
parent 25ade95228
commit 26aa2d9b61
11 changed files with 66 additions and 118 deletions

View File

@ -20,7 +20,6 @@ $options = [
'<a href="https://creativethemes.com/blocksy/docs/general-options/colors/" target="_blank">', '<a href="https://creativethemes.com/blocksy/docs/general-options/colors/" target="_blank">',
'</a>' '</a>'
), ),
'setting' => [ 'transport' => 'postMessage' ],
'predefined' => true, 'predefined' => true,
'wrapperAttr' => [ 'wrapperAttr' => [
'data-type' => 'color-palette', 'data-type' => 'color-palette',
@ -70,9 +69,7 @@ $options = [
] ]
] ]
], ],
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix
]),
], ],
$prefix . 'items_list_text_palette' => [ $prefix . 'items_list_text_palette' => [
@ -85,7 +82,6 @@ $options = [
'<a href="https://creativethemes.com/blocksy/docs/general-options/colors/" target="_blank">', '<a href="https://creativethemes.com/blocksy/docs/general-options/colors/" target="_blank">',
'</a>' '</a>'
), ),
'setting' => [ 'transport' => 'postMessage' ],
'predefined' => true, 'predefined' => true,
'wrapperAttr' => [ 'wrapperAttr' => [
'data-type' => 'color-palette', 'data-type' => 'color-palette',
@ -132,8 +128,6 @@ $options = [
] ]
] ]
], ],
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix
]),
] ]
]; ];

View File

@ -1,8 +1,10 @@
<?php <?php
if (! isset($prefix)) { if (! isset($prefix)) {
$initial_prefix = '';
$prefix = ''; $prefix = '';
} else { } else {
$initial_prefix = $prefix;
$prefix = $prefix . '_'; $prefix = $prefix . '_';
} }
@ -16,9 +18,7 @@ $options = [
'type' => 'ct-panel', 'type' => 'ct-panel',
'switch' => true, 'switch' => true,
'value' => $enabled, 'value' => $enabled,
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix,
]),
'inner-options' => [ 'inner-options' => [
$prefix . 'filters_panel_background_style' => [ $prefix . 'filters_panel_background_style' => [
'label' => __('Panel style', 'blocksy'), 'label' => __('Panel style', 'blocksy'),
@ -47,9 +47,7 @@ $options = [
'max' => 80, 'max' => 80,
] ]
]), ]),
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix
]),
'divider' => 'bottom' 'divider' => 'bottom'
] ]
] ]
@ -58,21 +56,15 @@ $options = [
'label' => __( 'Start with filters hidden', 'blocksy-tainacan' ), 'label' => __( 'Start with filters hidden', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Load page with filters panel initially hidden.', 'blocksy-tainacan' ), 'desc' => __( 'Load page with filters panel initially hidden.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
$prefix . 'show_hide_filters_button' => [ $prefix . 'show_hide_filters_button' => [
'label' => __( 'Show the "Hide filters" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Hide filters" button', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Display the button for hidding the filters panel.', 'blocksy-tainacan' ), 'desc' => __( 'Display the button for hidding the filters panel.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-condition', 'type' => 'ct-condition',
@ -84,11 +76,9 @@ $options = [
'label' => __( 'Show filters button inside search control', 'blocksy-tainacan' ), 'label' => __( 'Show filters button inside search control', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Display the filters button inside the search control bar instead of floating aside.', 'blocksy-tainacan' ), 'desc' => __( 'Display the filters button inside the search control bar instead of floating aside.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
], ],
], ],
@ -96,21 +86,15 @@ $options = [
'label' => __( 'Filters fixed on scroll', 'blocksy-tainacan' ), 'label' => __( 'Filters fixed on scroll', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'If you want filters panel to get fixed on screen when scrolling down the items list. This will only take effect if the items list itself is taller than the screen height.', 'blocksy-tainacan' ), 'desc' => __( 'If you want filters panel to get fixed on screen when scrolling down the items list. This will only take effect if the items list itself is taller than the screen height.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
$prefix . 'filters_as_modal' => [ $prefix . 'filters_as_modal' => [
'label' => __( 'Filters as modal', 'blocksy-tainacan' ), 'label' => __( 'Filters as modal', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Display the filters panel as a full screen modal instead of aside, even on desktop.', 'blocksy-tainacan' ), 'desc' => __( 'Display the filters panel as a full screen modal instead of aside, even on desktop.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
] ]
], ],
], ],

View File

@ -21,6 +21,16 @@ $default_hero_elements[] = [
'heading_tag' => 'h1' 'heading_tag' => 'h1'
]; ];
$default_hero_elements[] = [
'id' => 'breadcrumbs',
'enabled' => true,
'description_visibility' => [
'desktop' => true,
'tablet' => true,
'mobile' => false,
]
];
$default_hero_elements[] = [ $default_hero_elements[] = [
'id' => 'custom_description', 'id' => 'custom_description',
'enabled' => true, 'enabled' => true,
@ -55,10 +65,7 @@ $options = [
'attr' => [ 'data-layers' => 'title-elements' ], 'attr' => [ 'data-layers' => 'title-elements' ],
'design' => 'block', 'design' => 'block',
'value' => $default_hero_elements, 'value' => $default_hero_elements,
'sync' => '',
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
]),
'settings' => [ 'settings' => [
'breadcrumbs' => [ 'breadcrumbs' => [

View File

@ -18,30 +18,21 @@ $options = [
'type' => 'ct-panel', 'type' => 'ct-panel',
'switch' => true, 'switch' => true,
'value' => $enabled, 'value' => $enabled,
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix,
'loader_selector' => 'section'
]),
'inner-options' => [ 'inner-options' => [
$prefix . 'show_items_per_page_button' => [ $prefix . 'show_items_per_page_button' => [
'label' => __( 'Show the "Items per page" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Items per page" button', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display the button for choosing how many items per page shoulb be loaded.', 'blocksy-tainacan' ),
'desc' => __( 'Display the button for choosing how many items per page shoulb be loaded.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
$prefix . 'show_go_to_page_button' => [ $prefix . 'show_go_to_page_button' => [
'label' => __( 'Show the "Go to page" button', 'blocksy-tainacan' ), 'label' => __( 'Show the "Go to page" button', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display the button for jumping to an specific page.', 'blocksy-tainacan' ),
'desc' => __( 'Display the button for jumping to an specific page.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
] ]
], ],
], ],

View File

@ -10,9 +10,7 @@ $options = [
$prefix . 'search-control-panel' => [ $prefix . 'search-control-panel' => [
'label' => __( 'Search control', 'blocksy-tainacan' ), 'label' => __( 'Search control', 'blocksy-tainacan' ),
'type' => 'ct-panel', 'type' => 'ct-panel',
'sync' => blocksy_sync_whole_page([ 'sync' => '',
'prefix' => $prefix,
]),
'inner-options' => [ 'inner-options' => [
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
@ -22,11 +20,8 @@ $options = [
'label' => __( 'Show simple search', 'blocksy-tainacan' ), 'label' => __( 'Show simple search', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display a simple textual search input for items title and description.', 'blocksy-tainacan' ),
'desc' => __( 'Display a simple textual search input for items title and description.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-condition', 'type' => 'ct-condition',
@ -38,11 +33,9 @@ $options = [
'label' => __( 'Show advanced search', 'blocksy-tainacan' ), 'label' => __( 'Show advanced search', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Display a link to open the advanced search panel.', 'blocksy-tainacan' ), 'desc' => __( 'Display a link to open the advanced search panel.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
], ],
], ],
@ -54,11 +47,8 @@ $options = [
'label' => __( 'Show sorting options', 'blocksy-tainacan' ), 'label' => __( 'Show sorting options', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display options related to the search such as the "Sort by" button and "Sort direction"', 'blocksy-tainacan' ),
'desc' => __( 'Display options related to the search such as the "Sort by" button and "Sort direction"', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-condition', 'type' => 'ct-condition',
@ -70,11 +60,9 @@ $options = [
'label' => __( 'Show "Sort by" button', 'blocksy-tainacan' ), 'label' => __( 'Show "Sort by" button', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ],
'desc' => __( 'Display the "Sort by" button, to select a metadata to sort by.', 'blocksy-tainacan' ), 'desc' => __( 'Display the "Sort by" button, to select a metadata to sort by.', 'blocksy-tainacan' ),
'sync' => blocksy_sync_whole_page([ 'sync' => ''
'prefix' => $prefix
])
], ],
], ],
], ],
@ -86,31 +74,22 @@ $options = [
'label' => __( 'Show inline view mode options', 'blocksy-tainacan' ), 'label' => __( 'Show inline view mode options', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display view mode options as inline buttons instead of a dropdown.', 'blocksy-tainacan' ),
'desc' => __( 'Display view mode options as inline buttons instead of a dropdown.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
$prefix . 'show_fullscreen_with_view_modes' => [ $prefix . 'show_fullscreen_with_view_modes' => [
'label' => __( 'Show full screen with view modes', 'blocksy-tainacan' ), 'label' => __( 'Show full screen with view modes', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'no', 'value' => 'no',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Offers full screen view mode options alongside other view modes instead of separated in the search control bar.', 'blocksy-tainacan' ),
'desc' => __( 'Offers full screen view mode options alongside other view modes instead of separated in the search control bar.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
$prefix . 'show_displayed_metadata_dropdown' => [ $prefix . 'show_displayed_metadata_dropdown' => [
'label' => __( 'Show "Displayed metadata" dropdown', 'blocksy-tainacan' ), 'label' => __( 'Show "Displayed metadata" dropdown', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display a dropdown for selecting the displayed metadata. This option may or not be present according to the current selected view mode.', 'blocksy-tainacan' ),
'desc' => __( 'Display a dropdown for selecting the displayed metadata. This option may or not be present according to the current selected view mode.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
blocksy_rand_md5() => [ blocksy_rand_md5() => [
'type' => 'ct-title', 'type' => 'ct-title',
@ -120,11 +99,8 @@ $options = [
'label' => __( 'Show "View as..." button', 'blocksy-tainacan' ), 'label' => __( 'Show "View as..." button', 'blocksy-tainacan' ),
'type' => 'ct-switch', 'type' => 'ct-switch',
'value' => 'yes', 'value' => 'yes',
'setting' => [ 'transport' => 'postMessage' ], 'desc' => __( 'Display the "View as..." button, which opens the exposers modal.', 'blocksy-tainacan' ),
'desc' => __( 'Display the "View as..." button, which opens the exposers modal.', 'blocksy-tainacan' ), 'sync' => ''
'sync' => blocksy_sync_whole_page([
'prefix' => $prefix
])
], ],
], ],
], ],

View File

@ -1,18 +1,5 @@
// Copy of Blocksy theme's onDocumentLoaded from their helpers package 'blocksy-frontend'
onDocumentLoadedDo = cb => {
if (/comp|inter|loaded/.test(document.readyState)) {
cb();
} else {
document.addEventListener('DOMContentLoaded', cb, false);
}
}
onDocumentLoadedDo(() => {
//console.log("Resetar as coisas aqui...");
});
window.ctEvents.default.on('blocksy:frontend:init', () => { window.ctEvents.default.on('blocksy:frontend:init', () => {
//console.log("Resetar mais coisas aqui...", tainacan_plugin); console.log("Resetar mais coisas aqui...", tainacan_plugin);
if (tainacan_plugin?.classes?.TainacanMediaGallery && tainacan_plugin?.tainacan_media_components) { if (tainacan_plugin?.classes?.TainacanMediaGallery && tainacan_plugin?.tainacan_media_components) {
(Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => { (Object.values(tainacan_plugin.tainacan_media_components) || []).forEach((component) => {
new tainacan_plugin.classes.TainacanMediaGallery( new tainacan_plugin.classes.TainacanMediaGallery(
@ -22,4 +9,6 @@ window.ctEvents.default.on('blocksy:frontend:init', () => {
); );
}); });
} }
document.dispatchEvent(new Event('TainacanReloadItemsListComponent'));
}); });

View File

@ -311,12 +311,14 @@
align-items: center; align-items: center;
} }
} }
.tainacan-media-component__swiper-main { .tainacan-item-section__document {
&:hover { position: relative;
.tainacan-item-file-download { }
opacity: 1; .tainacan-media-component__swiper-main,
transform: scale(1); .tainacan-item-section__document {
} &:hover .tainacan-item-file-download {
opacity: 1;
transform: scale(1);
} }
} }
} }

View File

@ -676,7 +676,12 @@ body:not(.tainacan-admin-page) .tainacan-modal-content .modal-card-body {
align-items: center; align-items: center;
} }
.tainacan-item-single .tainacan-media-component__swiper-main:hover .tainacan-item-file-download { .tainacan-item-single .tainacan-item-section__document {
position: relative;
}
.tainacan-item-single .tainacan-media-component__swiper-main:hover .tainacan-item-file-download,
.tainacan-item-single .tainacan-item-section__document:hover .tainacan-item-file-download {
opacity: 1; opacity: 1;
transform: scale(1); transform: scale(1);
} }

File diff suppressed because one or more lines are too long

2
style.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long