Changeset 3371340
- Timestamp:
- 10/01/2025 04:21:42 PM (6 months ago)
- Location:
- blocks-for-bandcamp/trunk
- Files:
-
- 8 edited
-
blocks-for-bandcamp.php (modified) (1 diff)
-
blocks/bandcamp-album/frontend.css (modified) (2 diffs)
-
blocks/bandcamp-album/frontend.js (modified) (1 diff)
-
blocks/bandcamp-album/render.php (modified) (4 diffs)
-
blocks/bandcamp-form/render.php (modified) (2 diffs)
-
blocks/bandcamp-miniplayer/render.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
src/init.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blocks-for-bandcamp/trunk/blocks-for-bandcamp.php
r3368247 r3371340 6 6 Author: GreyforestDigital 7 7 Author URI: https://www.greyforest.digital 8 Version: 1.0. 08 Version: 1.0.1 9 9 Requires at least: 6.0 10 10 Requires PHP: 7.0 -
blocks-for-bandcamp/trunk/blocks/bandcamp-album/frontend.css
r3368247 r3371340 9 9 .bandcamp-album a.album-link svg {height:1.2em;width:auto;margin:0 .1em 0 .4em;display:inline-block;} 10 10 11 .bandcamp-album .bandcamp-album-header-wrap {position:relative;z-index:1;padding:1rem;grid-gap:2rem;display:grid;grid-template-columns:repeat( auto-fi t, minmax(200px, 1fr) )}11 .bandcamp-album .bandcamp-album-header-wrap {position:relative;z-index:1;padding:1rem;grid-gap:2rem;display:grid;grid-template-columns:repeat( auto-fill, minmax(200px, 1fr) )} 12 12 13 13 .bandcamp-album .bandcamp-album-artwork img {width:100%;max-width:300px;height:auto;} … … 39 39 .bandcamp-album .bandcamp-album-tracks ul li span.track-number {font-size:.7em;text-align:center;display:block;width:2.3em;height:2.3em;line-height:2.3em;position:relative;top:0px;border-radius:100%;text-align:center;background:rgba(0,0,0,0.5);color:#fff;margin:0 auto;} 40 40 .bandcamp-album .bandcamp-album-tracks ul li.active span.track-number {background:rgba(0,0,0,0.2);} 41 .bandcamp-album .bandcamp-album-tracks ul li.active span.track-link {font-weight:bold;} 41 42 42 43 -
blocks-for-bandcamp/trunk/blocks/bandcamp-album/frontend.js
r3368247 r3371340 1 1 document.addEventListener("DOMContentLoaded", function () { 2 const playlists = document.querySelectorAll(". playlist");2 const playlists = document.querySelectorAll(".bandcamp-album"); 3 3 4 4 playlists.forEach((playlist) => { 5 5 const audio = playlist.querySelector("audio"); 6 const trackLinks = Array.from(playlist.querySelectorAll(". playlist-tracks span.track-link"));6 const trackLinks = Array.from(playlist.querySelectorAll(".bandcamp-album-tracks .track-link")); 7 7 let current = 0; 8 8 -
blocks-for-bandcamp/trunk/blocks/bandcamp-album/render.php
r3368247 r3371340 3 3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 4 $align = !empty( $attributes['align'] ) ? esc_attr( $attributes['align'] ) : ''; 5 $anchor = !empty( $attributes['anchor'] ) ? esc_attr( $attributes['anchor'] ) : esc_attr('wp- block-' . wp_rand());5 $anchor = !empty( $attributes['anchor'] ) ? esc_attr( $attributes['anchor'] ) : esc_attr('wp-anchor-' . wp_rand()); 6 6 $blockID = !empty( $attributes['blockID'] ) ? esc_attr( $attributes['blockID'] ) : esc_attr('wp-block-' . wp_rand()); 7 7 $className = !empty( $attributes['className'] ) ? esc_attr( $attributes['className'] ) : ''; … … 32 32 33 33 $css = " 34 #{$blockID}.bandcamp-album {background-color:" . ( sanitize_hex_color( $backgroundColor ) ?: 'transparent' ) . ";}34 #{$blockID}.bandcamp-album {background-color:" . ( sanitize_hex_color( $backgroundColor ) ?: 'transparent' ) . ";} 35 35 #{$blockID}.bandcamp-album h3, 36 36 #{$blockID}.bandcamp-album h4, … … 38 38 #{$blockID}.bandcamp-album small, 39 39 #{$blockID}.bandcamp-album span, 40 #{$blockID}.bandcamp-album a {color:" . ( sanitize_hex_color( $textColor ) ?: 'inherit' ) . ";}41 #{$blockID}.bandcamp-album .playlist-tracks * {color:" . ( sanitize_hex_color( $trackColor ) ?: 'inherit' ) . ";}42 #{$blockID}.bandcamp-album a.album-link {background-color:" . ( sanitize_hex_color( $buttonColor ) ?: 'transparent' ) . ";color:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . " !important;}43 #{$blockID}.bandcamp-album a.album-link div {color:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . " !important;}44 #{$blockID}.bandcamp-album a.album-link path {fill:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . ";}40 #{$blockID}.bandcamp-album a {color:" . ( sanitize_hex_color( $textColor ) ?: 'inherit' ) . ";} 41 #{$blockID}.bandcamp-album .playlist-tracks * {color:" . ( sanitize_hex_color( $trackColor ) ?: 'inherit' ) . ";} 42 #{$blockID}.bandcamp-album a.album-link {background-color:" . ( sanitize_hex_color( $buttonColor ) ?: 'transparent' ) . ";color:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . " !important;} 43 #{$blockID}.bandcamp-album a.album-link div {color:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . " !important;} 44 #{$blockID}.bandcamp-album a.album-link path {fill:" . ( sanitize_hex_color( $buttonTextColor ) ?: 'inherit' ) . ";} 45 45 "; 46 46 47 47 // Frontend 48 if ( ! $is_editor ) {49 wp_add_inline_style( 'blocks-for-bandcamp-bandcamp-album-style', $css );50 } else {48 //if ( ! $is_editor ) { 49 // wp_add_inline_style( 'blocks-for-bandcamp-bandcamp-album-style', $css ); 50 //} else { 51 51 echo '<style>' . wp_kses( $css, [] ) . '</style>'; 52 }52 //} 53 53 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 54 54 … … 57 57 echo ' 58 58 <div class="bandcamp-block-message"> 59 <svg version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" xml:space="preserve">59 <svg version="1.1" style="max-width:100px" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" xml:space="preserve"> 60 60 <path d="M10.1,8.9l-3.3,6h7l3.3-6H10.1z M21.6,11.9c0-5.3-4.3-9.6-9.6-9.6s-9.6,4.3-9.6,9.6s4.3,9.6,9.6,9.6 S21.6,17.2,21.6,11.9z M12,20.9c-5,0-9-4-9-9s4-9,9-9s9,4,9,9S17,20.9,12,20.9z"/> 61 61 </svg> -
blocks-for-bandcamp/trunk/blocks/bandcamp-form/render.php
r3368247 r3371340 108 108 109 109 $css = " 110 # $blockIDbutton { $cssButton }111 # $blockIDbutton:hover { $cssButtonHover }112 # $blockIDinput { $cssInput }113 # $blockIDinput:hover { $cssInputHover }110 #{$blockID}.bandcamp-form button { $cssButton } 111 #{$blockID}.bandcamp-form button:hover { $cssButtonHover } 112 #{$blockID}.bandcamp-form input { $cssInput } 113 #{$blockID}.bandcamp-form input:hover { $cssInputHover } 114 114 "; 115 115 116 if ( !$is_editor ) {117 wp_add_inline_style( 'blocks-for-bandcamp-bandcamp-form-style', $css );118 } else {116 //if ( !$is_editor ) { 117 // wp_add_inline_style( 'blocks-for-bandcamp-bandcamp-form-style', $css ); 118 //} else { 119 119 echo "<style>".wp_kses($css,[])."</style>"; 120 }120 //} 121 121 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////?> 122 122 … … 125 125 <form action="https://www.bandcamp.com/yum?" method="get"> 126 126 <input type="text" name="code" placeholder="<?php echo esc_attr( $input_placeholder_text ); ?>" /> 127 <button <?php echo esc_attr($is_editor ? 'disabled' : ''); ?> class="wp-element-button" type="submit" ">127 <button <?php echo esc_attr($is_editor ? 'disabled' : ''); ?> class="wp-element-button" type="submit"> 128 128 <?php echo esc_html( $button_text ); ?> 129 129 </button> -
blocks-for-bandcamp/trunk/blocks/bandcamp-miniplayer/render.php
r3368247 r3371340 3 3 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 4 4 $align = !empty( $attributes['align'] ) ? esc_attr( $attributes['align'] ) : ''; 5 $anchor = !empty( $attributes['anchor'] ) ? esc_attr( $attributes['anchor'] ) : esc_attr('wp- block-' . wp_rand());5 $anchor = !empty( $attributes['anchor'] ) ? esc_attr( $attributes['anchor'] ) : esc_attr('wp-anchor-' . wp_rand()); 6 6 $blockID = !empty( $attributes['blockID'] ) ? esc_attr( $attributes['blockID'] ) : esc_attr('wp-block-' . wp_rand()); 7 7 $className = !empty( $attributes['className'] ) ? esc_attr( $attributes['className'] ) : ''; … … 33 33 34 34 $blockID = sanitize_html_class( $blockID ); 35 35 36 $css = " 36 37 #{$blockID}.bandcamp-miniplayer {background-color:" . ( sanitize_hex_color( $backgroundColor ) ?: 'transparent' ) . ";aspect-ratio:" . absint( $aspectRatioWidth ) . "/" . absint( $aspectRatioHeight ) . ";} 37 #{$blockID} .bandcamp-miniplayer-play svg path {fill:" . ( sanitize_hex_color( $buttonColor ) ?: 'currentColor' ) . " !important;}38 #{$blockID} .bandcamp-miniplayer-art {opacity:" . ( is_numeric( $attributes['artOpacity'] ) ? (float) $attributes['artOpacity'] : 1 ) . ";}39 #{$blockID} :hover .bandcamp-miniplayer-art {opacity:" . ( is_numeric( $attributes['artOpacityHover'] ) ? (float) $attributes['artOpacityHover'] : 1 ) . ";}40 #{$blockID} .bandcamp-miniplayer-albumlink a path {fill:" . esc_attr( gf_blocks_for_bandcamp__get_contrast_color( $buttonColor ) ) . ";}41 #{$blockID} h3,42 #{$blockID} h4,43 #{$blockID} p {color:" . ( sanitize_hex_color( $textColor ) ?: 'inherit' ) . ";}44 #{$blockID} .bandcamp-miniplayer-progress {background:" . ( sanitize_hex_color( $progressBarColor ) ?: 'transparent' ) . ";display:" . esc_attr( $css_display_progress_bar ) . ";width:" . esc_attr( $css_width_progress_bar ) . ";}38 #{$blockID}.bandcamp-miniplayer .bandcamp-miniplayer-play svg path {fill:" . ( sanitize_hex_color( $buttonColor ) ?: 'currentColor' ) . " !important;} 39 #{$blockID}.bandcamp-miniplayer .bandcamp-miniplayer-art {opacity:" . ( is_numeric( $attributes['artOpacity'] ) ? (float) $attributes['artOpacity'] : 1 ) . ";} 40 #{$blockID}.bandcamp-miniplayer:hover .bandcamp-miniplayer-art {opacity:" . ( is_numeric( $attributes['artOpacityHover'] ) ? (float) $attributes['artOpacityHover'] : 1 ) . ";} 41 #{$blockID}.bandcamp-miniplayer .bandcamp-miniplayer-albumlink a path {fill:" . esc_attr( gf_blocks_for_bandcamp__get_contrast_color( $buttonColor ) ) . ";} 42 #{$blockID}.bandcamp-miniplayer h3, 43 #{$blockID}.bandcamp-miniplayer h4, 44 #{$blockID}.bandcamp-miniplayer p {color:" . ( sanitize_hex_color( $textColor ) ?: 'inherit' ) . ";padding:5px 0;} 45 #{$blockID}.bandcamp-miniplayer .bandcamp-miniplayer-progress {background:" . ( sanitize_hex_color( $progressBarColor ) ?: 'transparent' ) . ";display:" . esc_attr( $css_display_progress_bar ) . ";width:" . esc_attr( $css_width_progress_bar ) . ";} 45 46 "; 46 47 47 if ( !$is_editor ) {48 wp_add_inline_style( 'blocks-for-bandcamp-bandcamp-miniplayer-style', $css );49 } else {48 //if ( !$is_editor ) { 49 // wp_add_inline_style( 'gf-bandcamp-inline', $css ); 50 //} else { 50 51 echo "<style>".wp_kses($css,[])."</style>"; 51 }52 //} 52 53 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 53 54 … … 92 93 <?php if ($data) : ?> 93 94 94 <style>95 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer {background-color:<?php echo esc_attr($backgroundColor); ?>;aspect-ratio:<?php echo esc_html($aspectRatioWidth.'/'.$aspectRatioHeight); ?>;}96 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer-play svg path {fill:<?php echo esc_attr($buttonColor); ?> !important;}97 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer-art {opacity:<?php echo esc_attr($attributes['artOpacity']); ?>;}98 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer:hover .bandcamp-miniplayer-art {opacity:<?php echo esc_attr($attributes['artOpacityHover']); ?>;}99 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer-albumlink a path {fill:<?php echo esc_attr(gf_blocks_for_bandcamp__get_contrast_color($buttonColor)); ?>;}100 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer h3,101 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer h4,102 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer p {color:<?php echo esc_attr($textColor); ?>;}103 #<?php echo esc_attr($anchor); ?>.bandcamp-miniplayer-progress {background:<?php echo esc_attr($progressBarColor); ?>;display:<?php echo esc_attr($display_progress_bar ? 'block' : 'none'); ?>;width:<?php echo esc_attr($is_editor ? '50%' : '0'); ?>}104 </style>105 106 95 <section id="<?php echo esc_attr($blockID); ?>" class="bandcamp-miniplayer"> 107 96 <div class="bandcamp-miniplayer-play"> -
blocks-for-bandcamp/trunk/readme.txt
r3368247 r3371340 8 8 Requires at least: 6.0 9 9 Tested up to: 6.8 10 Stable tag: 1.0. 010 Stable tag: 1.0.1 11 11 Requires PHP: 7.0 12 12 License: GPLv2 or later … … 69 69 == Changelog == 70 70 71 = 1.0.1 -> Ocotber 1st, 2025 = 72 * "Album" playlist JS fix 73 * Fixed CSS targeting on frontend 74 * Admin CSS enqueuing fix 75 71 76 = 1.0.0 -> September 26th, 2025 = 72 77 * Initial commit to repository. -
blocks-for-bandcamp/trunk/src/init.php
r3368247 r3371340 41 41 public function gf_blocks_for_bandcamp__stylesheets() 42 42 { 43 if ( 43 44 if (is_admin()) { 45 wp_register_style(GF_BLOCKS_FOR_BANDCAMP_PLUGIN_SLUG.'-stylesheet', GF_BLOCKS_FOR_BANDCAMP_PLUGIN_URL.'/assets/css/css.css','',GF_BLOCKS_FOR_BANDCAMP_PLUGIN_VERSION,''); 46 wp_enqueue_style(GF_BLOCKS_FOR_BANDCAMP_PLUGIN_SLUG.'-stylesheet'); 47 } 48 49 if ( !is_admin() && 50 ( 44 51 has_block('blocks-for-bandcamp/bandcamp-album',get_the_ID()) || 45 52 has_block('blocks-for-bandcamp/bandcamp-embed',get_the_ID()) || … … 47 54 has_block('blocks-for-bandcamp/bandcamp-merch',get_the_ID()) || 48 55 has_block('blocks-for-bandcamp/bandcamp-miniplayer',get_the_ID()) 56 ) 49 57 ) { 50 add_filter( 'styles_inline_size_limit', '__return_zero' );51 58 wp_register_style(GF_BLOCKS_FOR_BANDCAMP_PLUGIN_SLUG.'-stylesheet', GF_BLOCKS_FOR_BANDCAMP_PLUGIN_URL.'/assets/css/css.css','',GF_BLOCKS_FOR_BANDCAMP_PLUGIN_VERSION,''); 52 59 wp_enqueue_style(GF_BLOCKS_FOR_BANDCAMP_PLUGIN_SLUG.'-stylesheet'); 53 54 60 } 55 61 }
Note: See TracChangeset
for help on using the changeset viewer.