Changeset 3290026
- Timestamp:
- 05/08/2025 04:25:09 PM (11 months ago)
- Location:
- show-hide-section-block
- Files:
-
- 16 edited
- 1 copied
-
tags/3.1.0 (copied) (copied from show-hide-section-block/trunk)
-
tags/3.1.0/LICENSE (modified) (1 diff)
-
tags/3.1.0/build/show-hide-group/view.asset.php (modified) (1 diff)
-
tags/3.1.0/build/show-hide-group/view.js (modified) (1 diff)
-
tags/3.1.0/languages/show-hide-section-block.pot (modified) (2 diffs)
-
tags/3.1.0/plugin.php (modified) (1 diff)
-
tags/3.1.0/readme.txt (modified) (2 diffs)
-
tags/3.1.0/src/show-hide-group/index.php (modified) (3 diffs)
-
tags/3.1.0/src/show-hide-group/view.js (modified) (1 diff)
-
trunk/LICENSE (modified) (1 diff)
-
trunk/build/show-hide-group/view.asset.php (modified) (1 diff)
-
trunk/build/show-hide-group/view.js (modified) (1 diff)
-
trunk/languages/show-hide-section-block.pot (modified) (2 diffs)
-
trunk/plugin.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/show-hide-group/index.php (modified) (3 diffs)
-
trunk/src/show-hide-group/view.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
show-hide-section-block/tags/3.1.0/LICENSE
r3182831 r3290026 1 1 Show/Hide Section Block - a plugin for WordPress 2 2 3 Copyright 2020-202 4by Happy Prime3 Copyright 2020-2025 by Happy Prime 4 4 5 5 This program is free software; you can redistribute it and/or modify -
show-hide-section-block/tags/3.1.0/build/show-hide-group/view.asset.php
r3182831 r3290026 1 <?php return array('dependencies' => array(), 'version' => ' fbf381460e85f307651f');1 <?php return array('dependencies' => array(), 'version' => 'ed66e10f70e7d917c55e'); -
show-hide-section-block/tags/3.1.0/build/show-hide-group/view.js
r3182831 r3290026 1 (()=>{{const e=()=>{const e=document.querySelectorAll(".wp-block-happyprime-show-hide-group .toggle-all");e.length>0&&e.forEach((e=>e.addEventListener("click",(()=>{const t=e.parentElement.querySelectorAll("details.wp-block-happyprime-show-hide-section");"true"!==e.ariaExpanded?(t.forEach((e=>{e.setAttribute("open","true")})),e.innerText="Close All",e.ariaExpanded="true"):(t.forEach((e=>{e.removeAttribute("open")})),e.innerText="Open All",e.ariaExpanded="false")}))))} ;document.addEventListener("DOMContentLoaded",e)}})();1 (()=>{{const e=()=>{const e=document.querySelectorAll(".wp-block-happyprime-show-hide-group .toggle-all");e.length>0&&e.forEach((e=>e.addEventListener("click",(()=>{const t=e.parentElement.querySelectorAll("details.wp-block-happyprime-show-hide-section");"true"!==e.ariaExpanded?(t.forEach((e=>{e.setAttribute("open","true")})),e.innerText="Close All",e.ariaExpanded="true"):(t.forEach((e=>{e.removeAttribute("open")})),e.innerText="Open All",e.ariaExpanded="false")}))))},t=()=>{if(!window.location.hash)return;const e=document.querySelector(`details.wp-block-happyprime-show-hide-section${window.location.hash}`);e&&e.setAttribute("open","true")};document.addEventListener("DOMContentLoaded",(()=>{e(),t(),window.addEventListener("hashchange",t)}))}})(); -
show-hide-section-block/tags/3.1.0/languages/show-hide-section-block.pot
r3182831 r3290026 1 # Copyright (C) 202 4Happy Prime2 # This file is distributed under the same license as the Show / Hide Section Block plugin.1 # Copyright (C) 2025 Happy Prime 2 # This file is distributed under the GPLv2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Show / Hide Section Block 3. 0.0\n"5 "Project-Id-Version: Show / Hide Section Block 3.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/show-hide-section-block\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-11-06T05:29:22+00:00\n"12 "POT-Creation-Date: 2025-05-08T16:18:36+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 0.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: show-hide-section-block\n" 16 16 -
show-hide-section-block/tags/3.1.0/plugin.php
r3182831 r3290026 3 3 * Plugin Name: Show / Hide Section Block 4 4 * Description: Display an accessible show/hide interface with details and summary elements. 5 * Version: 3. 0.05 * Version: 3.1.0 6 6 * Plugin URI: https://wordpress.org/plugins/show-hide-section-block/ 7 7 * Author: Happy Prime 8 8 * Author URI: https://happyprime.co/ 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: show-hide-section-block 10 12 * Domain Path: /languages -
show-hide-section-block/tags/3.1.0/readme.txt
r3182831 r3290026 3 3 Tags: collapsible, details, summary 4 4 Requires at least: 6.4 5 Tested up to: 6. 76 Stable tag: 3. 0.05 Tested up to: 6.8 6 Stable tag: 3.1.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 50 50 ## Changelog 51 51 52 ### 3.1.0 53 54 * Automatically open an associated `<details>` element when its anchor is used in a URL. 55 * Update dependencies. 56 * Confirm compatibility with WordPress 6.8. 57 * Confirm license in plugin header. 58 52 59 ### 3.0.0 53 60 -
show-hide-section-block/tags/3.1.0/src/show-hide-group/index.php
r2905805 r3290026 23 23 * Deregister the default script handle added via WordPress via block.json. 24 24 */ 25 function deregister_default() {25 function deregister_default(): void { 26 26 wp_deregister_script( 'happyprime-show-hide-group-view-script' ); 27 27 } … … 47 47 48 48 /** 49 * Enqueue the toggle script if a Show / Hide Group block exists and the 50 * toggleattribute is set to true.49 * Enqueue the toggle script if a Show / Hide Group block exists and the toggle 50 * attribute is set to true. 51 51 * 52 52 * @param string|null $pre_render Content if previously rendered, otherwise null. … … 55 55 */ 56 56 function maybe_enqueue_script( $pre_render, array $parsed_block ) { 57 $enqueued = false; 58 59 if ( 'happyprime/show-hide-group' !== $parsed_block['blockName'] && 'happyprime/show-hide-section' !== $parsed_block['blockName'] ) { 60 return $pre_render; 61 } 62 63 // If a group has the toggle attribute, enqueue the script to support 64 // toggle all behaviour. 57 65 if ( 'happyprime/show-hide-group' === $parsed_block['blockName'] && isset( $parsed_block['attrs']['hasToggle'] ) && $parsed_block['attrs']['hasToggle'] ) { 58 66 wp_enqueue_script( 'happyprime-show-hide-group-view' ); 67 $enqueued = true; 68 } elseif ( 'happyprime/show-hide-section' === $parsed_block['blockName'] ) { 69 $inner_html = new \WP_HTML_Tag_Processor( $parsed_block['innerHTML'] ); 70 71 // If a section has an ID attribute, enqueue the script to support 72 // improved hash navigation. 73 if ( $inner_html->next_tag( [ 'id' => true ] ) ) { 74 wp_enqueue_script( 'happyprime-show-hide-section-view' ); 75 $enqueued = true; 76 } 77 } 78 79 // If we've enqueued the script, remove the filter to avoid unneccesary processing. 80 if ( $enqueued ) { 81 remove_filter( 'pre_render_block', __NAMESPACE__ . '\maybe_enqueue_script', 10, 2 ); 59 82 } 60 83 -
show-hide-section-block/tags/3.1.0/src/show-hide-group/view.js
r3182831 r3290026 32 32 }; 33 33 34 document.addEventListener('DOMContentLoaded', handleToggleButton); 34 /** 35 * Set a details element to `open` if its corresponding hash is in the URL. 36 * 37 * @returns {void} 38 */ 39 const handleHashNavigation = () => { 40 if (!window.location.hash) { 41 return; 42 } 43 44 const targetDetails = document.querySelector( 45 `details.wp-block-happyprime-show-hide-section${window.location.hash}` 46 ); 47 48 if (targetDetails) { 49 targetDetails.setAttribute('open', 'true'); 50 } 51 }; 52 53 document.addEventListener('DOMContentLoaded', () => { 54 handleToggleButton(); 55 handleHashNavigation(); 56 window.addEventListener('hashchange', handleHashNavigation); 57 }); 35 58 } -
show-hide-section-block/trunk/LICENSE
r3182831 r3290026 1 1 Show/Hide Section Block - a plugin for WordPress 2 2 3 Copyright 2020-202 4by Happy Prime3 Copyright 2020-2025 by Happy Prime 4 4 5 5 This program is free software; you can redistribute it and/or modify -
show-hide-section-block/trunk/build/show-hide-group/view.asset.php
r3182831 r3290026 1 <?php return array('dependencies' => array(), 'version' => ' fbf381460e85f307651f');1 <?php return array('dependencies' => array(), 'version' => 'ed66e10f70e7d917c55e'); -
show-hide-section-block/trunk/build/show-hide-group/view.js
r3182831 r3290026 1 (()=>{{const e=()=>{const e=document.querySelectorAll(".wp-block-happyprime-show-hide-group .toggle-all");e.length>0&&e.forEach((e=>e.addEventListener("click",(()=>{const t=e.parentElement.querySelectorAll("details.wp-block-happyprime-show-hide-section");"true"!==e.ariaExpanded?(t.forEach((e=>{e.setAttribute("open","true")})),e.innerText="Close All",e.ariaExpanded="true"):(t.forEach((e=>{e.removeAttribute("open")})),e.innerText="Open All",e.ariaExpanded="false")}))))} ;document.addEventListener("DOMContentLoaded",e)}})();1 (()=>{{const e=()=>{const e=document.querySelectorAll(".wp-block-happyprime-show-hide-group .toggle-all");e.length>0&&e.forEach((e=>e.addEventListener("click",(()=>{const t=e.parentElement.querySelectorAll("details.wp-block-happyprime-show-hide-section");"true"!==e.ariaExpanded?(t.forEach((e=>{e.setAttribute("open","true")})),e.innerText="Close All",e.ariaExpanded="true"):(t.forEach((e=>{e.removeAttribute("open")})),e.innerText="Open All",e.ariaExpanded="false")}))))},t=()=>{if(!window.location.hash)return;const e=document.querySelector(`details.wp-block-happyprime-show-hide-section${window.location.hash}`);e&&e.setAttribute("open","true")};document.addEventListener("DOMContentLoaded",(()=>{e(),t(),window.addEventListener("hashchange",t)}))}})(); -
show-hide-section-block/trunk/languages/show-hide-section-block.pot
r3182831 r3290026 1 # Copyright (C) 202 4Happy Prime2 # This file is distributed under the same license as the Show / Hide Section Block plugin.1 # Copyright (C) 2025 Happy Prime 2 # This file is distributed under the GPLv2 or later. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Show / Hide Section Block 3. 0.0\n"5 "Project-Id-Version: Show / Hide Section Block 3.1.0\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/show-hide-section-block\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 4-11-06T05:29:22+00:00\n"12 "POT-Creation-Date: 2025-05-08T16:18:36+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.1 0.0\n"14 "X-Generator: WP-CLI 2.11.0\n" 15 15 "X-Domain: show-hide-section-block\n" 16 16 -
show-hide-section-block/trunk/plugin.php
r3182831 r3290026 3 3 * Plugin Name: Show / Hide Section Block 4 4 * Description: Display an accessible show/hide interface with details and summary elements. 5 * Version: 3. 0.05 * Version: 3.1.0 6 6 * Plugin URI: https://wordpress.org/plugins/show-hide-section-block/ 7 7 * Author: Happy Prime 8 8 * Author URI: https://happyprime.co/ 9 * License: GPLv2 or later 10 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html 9 11 * Text Domain: show-hide-section-block 10 12 * Domain Path: /languages -
show-hide-section-block/trunk/readme.txt
r3182831 r3290026 3 3 Tags: collapsible, details, summary 4 4 Requires at least: 6.4 5 Tested up to: 6. 76 Stable tag: 3. 0.05 Tested up to: 6.8 6 Stable tag: 3.1.0 7 7 License: GPLv2 or later 8 8 Requires PHP: 7.4 … … 50 50 ## Changelog 51 51 52 ### 3.1.0 53 54 * Automatically open an associated `<details>` element when its anchor is used in a URL. 55 * Update dependencies. 56 * Confirm compatibility with WordPress 6.8. 57 * Confirm license in plugin header. 58 52 59 ### 3.0.0 53 60 -
show-hide-section-block/trunk/src/show-hide-group/index.php
r2905805 r3290026 23 23 * Deregister the default script handle added via WordPress via block.json. 24 24 */ 25 function deregister_default() {25 function deregister_default(): void { 26 26 wp_deregister_script( 'happyprime-show-hide-group-view-script' ); 27 27 } … … 47 47 48 48 /** 49 * Enqueue the toggle script if a Show / Hide Group block exists and the 50 * toggleattribute is set to true.49 * Enqueue the toggle script if a Show / Hide Group block exists and the toggle 50 * attribute is set to true. 51 51 * 52 52 * @param string|null $pre_render Content if previously rendered, otherwise null. … … 55 55 */ 56 56 function maybe_enqueue_script( $pre_render, array $parsed_block ) { 57 $enqueued = false; 58 59 if ( 'happyprime/show-hide-group' !== $parsed_block['blockName'] && 'happyprime/show-hide-section' !== $parsed_block['blockName'] ) { 60 return $pre_render; 61 } 62 63 // If a group has the toggle attribute, enqueue the script to support 64 // toggle all behaviour. 57 65 if ( 'happyprime/show-hide-group' === $parsed_block['blockName'] && isset( $parsed_block['attrs']['hasToggle'] ) && $parsed_block['attrs']['hasToggle'] ) { 58 66 wp_enqueue_script( 'happyprime-show-hide-group-view' ); 67 $enqueued = true; 68 } elseif ( 'happyprime/show-hide-section' === $parsed_block['blockName'] ) { 69 $inner_html = new \WP_HTML_Tag_Processor( $parsed_block['innerHTML'] ); 70 71 // If a section has an ID attribute, enqueue the script to support 72 // improved hash navigation. 73 if ( $inner_html->next_tag( [ 'id' => true ] ) ) { 74 wp_enqueue_script( 'happyprime-show-hide-section-view' ); 75 $enqueued = true; 76 } 77 } 78 79 // If we've enqueued the script, remove the filter to avoid unneccesary processing. 80 if ( $enqueued ) { 81 remove_filter( 'pre_render_block', __NAMESPACE__ . '\maybe_enqueue_script', 10, 2 ); 59 82 } 60 83 -
show-hide-section-block/trunk/src/show-hide-group/view.js
r3182831 r3290026 32 32 }; 33 33 34 document.addEventListener('DOMContentLoaded', handleToggleButton); 34 /** 35 * Set a details element to `open` if its corresponding hash is in the URL. 36 * 37 * @returns {void} 38 */ 39 const handleHashNavigation = () => { 40 if (!window.location.hash) { 41 return; 42 } 43 44 const targetDetails = document.querySelector( 45 `details.wp-block-happyprime-show-hide-section${window.location.hash}` 46 ); 47 48 if (targetDetails) { 49 targetDetails.setAttribute('open', 'true'); 50 } 51 }; 52 53 document.addEventListener('DOMContentLoaded', () => { 54 handleToggleButton(); 55 handleHashNavigation(); 56 window.addEventListener('hashchange', handleHashNavigation); 57 }); 35 58 }
Note: See TracChangeset
for help on using the changeset viewer.