diff --git a/assets/css/frontend/widget-batch5.css b/assets/css/frontend/widget-batch5.css index c5d94b39..930abbf3 100644 --- a/assets/css/frontend/widget-batch5.css +++ b/assets/css/frontend/widget-batch5.css @@ -2517,3 +2517,19 @@ a.main-color > .icon-cover-card:hover, .aksrt-product-tab__skeleton .placeholder.s1 { width: 48%; } .aksrt-main-posts[data-load-mode="ajax"].is-ajax-loading { opacity: .85; } .widget-search-box.is-affix { position: sticky; top: 72px; } + + +/* batch40-42 residual */ +.aksrt-plate-info .count-mates { + gap: 8px; margin-top: 12px; padding-top: 10px; + border-top: 1px solid var(--color-line, rgba(0,0,0,.06)); +} +.aksrt-plate-info .count-mates item, +.aksrt-plate-info .count-mates .mate-views, +.aksrt-plate-info .count-mates .mate-reply, +.aksrt-plate-info .count-mates .mate-follow { + flex: 1 1 0; min-width: 0; text-align: center; +} +.aksrt-plate-info .count-mates .em14 { font-weight: 700; line-height: 1.2; } +.aksrt-fi[data-aksrt-feature-intro] .aksrt-fi__panel { display: none; } +.aksrt-fi[data-aksrt-feature-intro] .aksrt-fi__panel.is-active { display: block; } diff --git a/assets/js/widget-set.js b/assets/js/widget-set.js index 6bd366d6..4bbdad30 100644 --- a/assets/js/widget-set.js +++ b/assets/js/widget-set.js @@ -344,6 +344,41 @@ }); } + + // Feature intro media tabs. + function initFeatureIntro() { + document.querySelectorAll('[data-aksrt-feature-intro]').forEach(function (root) { + if (root.dataset.aksrtFiBound === '1') return; + root.dataset.aksrtFiBound = '1'; + var tabs = [].slice.call(root.querySelectorAll('.aksrt-fi__tab')); + var panels = [].slice.call(root.querySelectorAll('.aksrt-fi__panel')); + if (!tabs.length || !panels.length) return; + function go(i) { + tabs.forEach(function (t, idx) { + t.classList.toggle('is-active', idx === i); + }); + panels.forEach(function (p, idx) { + p.classList.toggle('is-active', idx === i); + var v = p.querySelector('video'); + if (!v) return; + if (idx === i) { + if (!v.getAttribute('src') && v.getAttribute('data-src')) { + v.setAttribute('src', v.getAttribute('data-src')); + } + if (v.play) v.play().catch(function () {}); + } else if (v.pause) { + v.pause(); + } + }); + } + tabs.forEach(function (t) { + t.addEventListener('click', function () { + go(parseInt(t.getAttribute('data-index') || '0', 10)); + }); + }); + }); + } + function initFloatingQRCodes() { var wrap = document.querySelector('.float-right'); if (!wrap) return; @@ -388,6 +423,7 @@ initForumTabTopics(); initProductTabs(); initMainPostsLazy(); + initFeatureIntro(); initFloatingQRCodes(); } diff --git a/src/AKSRT/Core/WidgetAjax.php b/src/AKSRT/Core/WidgetAjax.php index 0acba307..febe7a93 100644 --- a/src/AKSRT/Core/WidgetAjax.php +++ b/src/AKSRT/Core/WidgetAjax.php @@ -125,10 +125,16 @@ class WidgetAjax { if (!class_exists('\AKSRT\Widgets\WidgetPaidPosts')) { return $this->fail(); } + $paginate = sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')); + if (!in_array($paginate, ['none', 'ajax', 'number'], true)) { + $paginate = 'ajax'; + } $instance = [ - 'count' => max(1, min(20, (int) ($request->get_param('count') ?? 6))), - 'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'date')), - 'paginate' => sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')), + 'count' => max(1, min(20, (int) ($request->get_param('count') ?? 6))), + 'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'date')), + 'cat' => max(0, (int) ($request->get_param('cat') ?? 0)), + 'limit_day' => max(0, (int) ($request->get_param('limit_day') ?? 0)), + 'paginate' => $paginate, ]; $page = max(1, (int) ($request->get_param('page') ?? $request->get_param('paged') ?? 1)); return $this->payload(\AKSRT\Widgets\WidgetPaidPosts::query_payload($instance, $page), $page); @@ -187,12 +193,16 @@ class WidgetAjax { if (!class_exists('\AKSRT\Widgets\HotPostsWidget')) { return $this->fail(); } + $paginate = sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')); + if (!in_array($paginate, ['none', 'ajax', 'number'], true)) { + $paginate = 'ajax'; + } $instance = [ 'count' => max(1, min(20, (int) ($request->get_param('count') ?? 5))), 'order_by' => sanitize_key((string) ($request->get_param('order_by') ?? 'views')), 'days' => max(0, (int) ($request->get_param('days') ?? 30)), 'show_thumb' => $request->get_param('show_thumb') === null ? 1 : (int) $request->get_param('show_thumb'), - 'paginate' => sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')), + 'paginate' => $paginate, ]; $page = max(1, (int) ($request->get_param('page') ?? 1)); return $this->payload(\AKSRT\Widgets\HotPostsWidget::query_payload($instance, $page), $page); @@ -260,7 +270,7 @@ class WidgetAjax { 'orderby' => sanitize_key((string) ($request->get_param('orderby') ?? 'views')), 'style' => $style, 'plate' => max(0, (int) ($request->get_param('plate') ?? $request->get_param('plate_id') ?? 0)), - 'paginate' => sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')), + 'paginate' => in_array(sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')), ['none', 'ajax', 'number'], true) ? sanitize_key((string) ($request->get_param('paginate') ?? 'ajax')) : 'ajax', ]; $page = max(1, (int) ($request->get_param('page') ?? 1)); return $this->payload(\AKSRT\Widgets\WidgetForumHotTopics::query_payload($instance, $page), $page); diff --git a/src/AKSRT/Widgets/CategoriesWidget.php b/src/AKSRT/Widgets/CategoriesWidget.php index 62e79ec8..d034cc8d 100644 --- a/src/AKSRT/Widgets/CategoriesWidget.php +++ b/src/AKSRT/Widgets/CategoriesWidget.php @@ -176,10 +176,7 @@ class CategoriesWidget extends \WP_Widget { if ($title !== '') { echo $args['before_title'] . esc_html($title) . $args['after_title']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } - $rest = rest_url('aksrt/v1/widgets/categories'); - echo '