From 42fa8304ddb811b0f725f245130f70c0f5e86a6c Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Tue, 04 Nov 2025 06:12:02 +0000
Subject: [PATCH] =Refactored LoginManager to be more extensible and configurable, as well as an AjaxRateLimiter

---
 inc/blocks/VideoCoverBlock.php |   30 +++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/inc/blocks/VideoCoverBlock.php b/inc/blocks/VideoCoverBlock.php
index e6292cd..90bda6a 100644
--- a/inc/blocks/VideoCoverBlock.php
+++ b/inc/blocks/VideoCoverBlock.php
@@ -1,6 +1,7 @@
 <?php
 namespace JVBase\blocks;
 
+use JVBase\blocks\CustomBlocks;
 if (!defined('ABSPATH')) {
 	exit;
 }
@@ -14,7 +15,7 @@
 class VideoCoverBlock
 {
 	protected static ?VideoCoverBlock $instance = null;
-	protected string $path = JVB_DIR . '/build/video-cover';
+	protected string $path = JVB_DIR . '/build/video';
 
 	public static function getInstance(): VideoCoverBlock
 	{
@@ -41,12 +42,16 @@
 	 */
 	public function render($attributes, $content): string
 	{
+
 		// Extract attributes with defaults
 		$poster_id = $attributes['posterId'] ?? 0;
 		$video_sources = $attributes['videoSources'] ?? [];
 		$mobile_sources = $attributes['mobileSources'] ?? [];
 		$css_class = $attributes['className'] ?? '';
 		$fade_class = $attributes['fadeEffect'] ?? false ? 'fade' : '';
+		$overlay_opacity = $attributes['overlayOpacity'] ?? 0;
+		$content_alignment = $attributes['contentAlignment'] ?? 'center';
+		$min_height = $attributes['minHeight'] ?? 0;
 		//Get date of current post
 		global $post;
 		$date = date('c',strtotime($post->post_date));
@@ -78,7 +83,7 @@
             "uploadDate": "'.$date.'"
         }
     </script>
-    <div class="wrap">
+    <div class="wrap abs edges">
         <div class="video-container">';
 		$html .= '<video';
 		$html .= ' muted loop playsinline autoplay';
@@ -117,8 +122,27 @@
 		}
 
 		$html .= '</video>';
-		$html .= '</div></div><div class="inner-wrap"></div></section>';
+
+		$inner_content = $this->extractInnerContent($content);
+		$html .= '</div></div><div class="inner-wrap">'.$inner_content.'</div></section>';
 
 		return $html;
 	}
+
+	/**
+	 * Extract inner content from the saved block content
+	 * Removes the wrapper div and returns just the inner blocks HTML
+	 */
+	protected function extractInnerContent(string $content): string
+	{
+		if (empty($content)) {
+			return '';
+		}
+
+		// Remove the placeholder wrapper div
+		$content = preg_replace('/<div[^>]*class="[^"]*video-cover-wrapper-placeholder[^"]*"[^>]*>/', '', $content, 1);
+		$content = preg_replace('/<\/div>\s*$/', '', $content, 1);
+
+		return trim($content);
+	}
 }

--
Gitblit v1.10.0