Plugin Directory

Changeset 3371340


Ignore:
Timestamp:
10/01/2025 04:21:42 PM (6 months ago)
Author:
greyforestdigital
Message:

Update to version 1.0.1

Location:
blocks-for-bandcamp/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • blocks-for-bandcamp/trunk/blocks-for-bandcamp.php

    r3368247 r3371340  
    66Author: GreyforestDigital
    77Author URI: https://www.greyforest.digital
    8 Version: 1.0.0
     8Version: 1.0.1
    99Requires at least: 6.0
    1010Requires PHP: 7.0
  • blocks-for-bandcamp/trunk/blocks/bandcamp-album/frontend.css

    r3368247 r3371340  
    99.bandcamp-album a.album-link svg {height:1.2em;width:auto;margin:0 .1em 0 .4em;display:inline-block;}
    1010
    11 .bandcamp-album .bandcamp-album-header-wrap {position:relative;z-index:1;padding:1rem;grid-gap:2rem;display:grid;grid-template-columns:repeat( auto-fit, 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) )}
    1212
    1313.bandcamp-album .bandcamp-album-artwork img {width:100%;max-width:300px;height:auto;}
     
    3939.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;}
    4040.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;}
    4142
    4243
  • blocks-for-bandcamp/trunk/blocks/bandcamp-album/frontend.js

    r3368247 r3371340  
    11document.addEventListener("DOMContentLoaded", function () {
    2   const playlists = document.querySelectorAll(".playlist");
     2  const playlists = document.querySelectorAll(".bandcamp-album");
    33
    44  playlists.forEach((playlist) => {
    55    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"));
    77    let current = 0;
    88
  • blocks-for-bandcamp/trunk/blocks/bandcamp-album/render.php

    r3368247 r3371340  
    33////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    44$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());
    66$blockID = !empty( $attributes['blockID'] ) ? esc_attr( $attributes['blockID'] ) : esc_attr('wp-block-' . wp_rand());
    77$className = !empty( $attributes['className'] ) ? esc_attr( $attributes['className'] ) : '';
     
    3232
    3333$css = "
    34 #{$blockID}.bandcamp-album{background-color:" . ( sanitize_hex_color( $backgroundColor ) ?: 'transparent' ) . ";}
     34#{$blockID}.bandcamp-album {background-color:" . ( sanitize_hex_color( $backgroundColor ) ?: 'transparent' ) . ";}
    3535#{$blockID}.bandcamp-album h3,
    3636#{$blockID}.bandcamp-album h4,
     
    3838#{$blockID}.bandcamp-album small,
    3939#{$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' ) . ";}
    4545";
    4646
    4747// 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 {
    5151    echo '<style>' . wp_kses( $css, [] ) . '</style>';
    52 }
     52//}
    5353////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    5454
     
    5757    echo '
    5858    <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">
    6060            <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"/>
    6161        </svg>
  • blocks-for-bandcamp/trunk/blocks/bandcamp-form/render.php

    r3368247 r3371340  
    108108
    109109$css = "
    110 #$blockID button { $cssButton }
    111 #$blockID button:hover { $cssButtonHover }
    112 #$blockID input { $cssInput }
    113 #$blockID input: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 }
    114114";
    115115
    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 {
    119119    echo "<style>".wp_kses($css,[])."</style>";
    120 }
     120//}
    121121//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////?>
    122122
     
    125125        <form action="https://www.bandcamp.com/yum?" method="get">
    126126            <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">
    128128                <?php echo esc_html( $button_text ); ?>
    129129            </button>
  • blocks-for-bandcamp/trunk/blocks/bandcamp-miniplayer/render.php

    r3368247 r3371340  
    33////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    44$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());
    66$blockID = !empty( $attributes['blockID'] ) ? esc_attr( $attributes['blockID'] ) : esc_attr('wp-block-' . wp_rand());
    77$className = !empty( $attributes['className'] ) ? esc_attr( $attributes['className'] ) : '';
     
    3333
    3434$blockID = sanitize_html_class( $blockID );
     35
    3536$css = "
    3637#{$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 ) . ";}
    4546";
    4647
    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 {
    5051    echo "<style>".wp_kses($css,[])."</style>";
    51 }
     52//}
    5253////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    5354
     
    9293    <?php if ($data) : ?>
    9394
    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 
    10695    <section id="<?php echo esc_attr($blockID); ?>" class="bandcamp-miniplayer">
    10796        <div class="bandcamp-miniplayer-play">
  • blocks-for-bandcamp/trunk/readme.txt

    r3368247 r3371340  
    88Requires at least: 6.0
    99Tested up to: 6.8
    10 Stable tag: 1.0.0
     10Stable tag: 1.0.1
    1111Requires PHP: 7.0
    1212License: GPLv2 or later
     
    6969== Changelog ==
    7070
     71= 1.0.1 -> Ocotber 1st, 2025 =
     72* "Album" playlist JS fix
     73* Fixed CSS targeting on frontend
     74* Admin CSS enqueuing fix
     75
    7176= 1.0.0 -> September 26th, 2025 =
    7277* Initial commit to repository.
  • blocks-for-bandcamp/trunk/src/init.php

    r3368247 r3371340  
    4141    public function gf_blocks_for_bandcamp__stylesheets()
    4242    {
    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            (
    4451            has_block('blocks-for-bandcamp/bandcamp-album',get_the_ID()) ||
    4552            has_block('blocks-for-bandcamp/bandcamp-embed',get_the_ID()) ||
     
    4754            has_block('blocks-for-bandcamp/bandcamp-merch',get_the_ID()) ||
    4855            has_block('blocks-for-bandcamp/bandcamp-miniplayer',get_the_ID())
     56            )
    4957        ) {
    50             add_filter( 'styles_inline_size_limit', '__return_zero' );
    5158            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,'');
    5259            wp_enqueue_style(GF_BLOCKS_FOR_BANDCAMP_PLUGIN_SLUG.'-stylesheet');
    53 
    5460        }
    5561    }
Note: See TracChangeset for help on using the changeset viewer.