Changeset 3157155
- Timestamp:
- 09/24/2024 09:27:14 PM (17 months ago)
- Location:
- bordered-blocks
- Files:
-
- 20 added
- 8 edited
-
tags/1.1.4 (added)
-
tags/1.1.4/LICENSE (added)
-
tags/1.1.4/README.md (added)
-
tags/1.1.4/assets (added)
-
tags/1.1.4/assets/css (added)
-
tags/1.1.4/assets/css/bordered-blocks-admin.css (added)
-
tags/1.1.4/assets/css/bordered-blocks.css (added)
-
tags/1.1.4/assets/faq.php (added)
-
tags/1.1.4/assets/img (added)
-
tags/1.1.4/assets/img/sophie.png (added)
-
tags/1.1.4/assets/js (added)
-
tags/1.1.4/assets/js/bordered-blocks-admin.js (added)
-
tags/1.1.4/assets/js/bordered-blocks.js (added)
-
tags/1.1.4/assets/js/colorpicker.js (added)
-
tags/1.1.4/assets/plugin-info.php (added)
-
tags/1.1.4/assets/supported-blocks.php (added)
-
tags/1.1.4/bordered-blocks.php (added)
-
tags/1.1.4/index.php (added)
-
tags/1.1.4/readme.txt (added)
-
tags/1.1.4/uninstall.php (added)
-
trunk/README.md (modified) (4 diffs)
-
trunk/assets/css/bordered-blocks.css (modified) (4 diffs)
-
trunk/assets/faq.php (modified) (3 diffs)
-
trunk/assets/js/bordered-blocks.js (modified) (2 diffs)
-
trunk/assets/plugin-info.php (modified) (1 diff)
-
trunk/assets/supported-blocks.php (modified) (1 diff)
-
trunk/bordered-blocks.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bordered-blocks/trunk/README.md
r3147754 r3157155 5 5 * Plugin URI: https://wordpress.org/plugins/bordered-blocks/ 6 6 * Requires at least: 5.9 7 * Tested up to: 6.6. 18 * Stable tag: 1.1. 37 * Tested up to: 6.6.2 8 * Stable tag: 1.1.4 9 9 * License: GPLv3 or later 10 10 * License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 53 53 Although you can leave the "bordered" view on when you create/edit pages, it is not recommended, as it will indeed add a lot more information to the editor which may be distracting. It will also have some impact on the performance (although I'm working on that). The recommended use is to keep using the default editor view, and only sparingly flip the switch to show the borders and labels of the Blocks on the page. 54 54 55 ### So wait, can borders be turned on and off instantly?55 ### Can borders be turned on and off instantly? 56 56 57 Pretty much, yes. In the plugin's settings, you can choose to have the editor show the standard view by default, or the bordered view. If you have the standard view, then flipping the switch at the top of the page will quickly show all borders/labels. If you have the bordered view, flipping the switch will quickly remove all borders/labels and go back to the standard view.57 While that used to be the case until version 1.1.3, this option has been removed for now as it did not appear to be working anymore with WordPress 6.6.2. I will look into adding this again, but for now, the borders are always showing in the editor as long as the plugin is active. 58 58 59 59 ### Some of my blocks don't have a label, look weird, etc. … … 94 94 ## Changelog 95 95 96 ### 1.1.4 97 * Removed the ON/OFF toggle in the editor since it was not working with WordPress 6.6.2 98 96 99 ### 1.1.3 97 100 * Fixed JS issue that appeared when saving settings … … 114 117 ## Upgrade Notice 115 118 119 ### 1.1.4 120 * Emergency fix 121 116 122 ### 1.1.3 117 123 * Bug fixes -
bordered-blocks/trunk/assets/css/bordered-blocks.css
r3147754 r3157155 22 22 } 23 23 24 . borderedblocks .editor-styles-wrapper .wp-block {24 .editor-styles-wrapper .wp-block { 25 25 margin-top: 0 !important; 26 26 } 27 27 28 . borderedblocks .editor-styles-wrapper .wp-block[data-empty="true"] {28 .editor-styles-wrapper .wp-block[data-empty="true"] { 29 29 padding-top: 10px !important; 30 30 } 31 31 32 . borderedblocks .editor-styles-wrapper *[data-title]:hover {32 .editor-styles-wrapper *[data-title]:hover { 33 33 border-color: #00000 !important; 34 34 } … … 43 43 } 44 44 45 . borderedblocks .editor-styles-wrapper .wp-block.block-list-appender {45 .editor-styles-wrapper .wp-block.block-list-appender { 46 46 border: 0; 47 47 padding: 0; 48 48 } 49 49 50 . borderedblocks .editor-styles-wrapper .block-editor-inserter {50 .editor-styles-wrapper .block-editor-inserter { 51 51 z-index: 25; 52 52 } 53 53 54 . borderedblocks .editor-styles-wrapper .wp-block::before,55 . borderedblocks .editor-styles-wrapper .wp-block *[data-title]::before {54 .editor-styles-wrapper .wp-block::before, 55 .editor-styles-wrapper .wp-block *[data-title]::before { 56 56 transition: all 0.2s; 57 57 position: absolute; … … 74 74 } 75 75 76 . borderedblocks .editor-styles-wrapper .wp-block img,77 . borderedblocks .editor-styles-wrapper .wp-block video {76 .editor-styles-wrapper .wp-block img, 77 .editor-styles-wrapper .wp-block video { 78 78 opacity: 0.75; 79 79 } 80 80 81 . borderedblocks .editor-styles-wrapper .wp-block[data-empty="true"]:before {81 .editor-styles-wrapper .wp-block[data-empty="true"]:before { 82 82 display: none; 83 83 } 84 84 85 . borderedblocks .editor-styles-wrapper .contains-blocks[data-title] *[data-title]{85 .editor-styles-wrapper .contains-blocks[data-title] *[data-title]{ 86 86 margin-top: 0 87 87 } … … 91 91 /* ------------------------------------------------------------------ */ 92 92 93 . borderedblocks .editor-styles-wrapper h1 {position: relative;}94 . borderedblocks .editor-styles-wrapper h1:before {content:"H1 Title";}93 .editor-styles-wrapper h1 {position: relative;} 94 .editor-styles-wrapper h1:before {content:"H1 Title";} 95 95 96 96 -
bordered-blocks/trunk/assets/faq.php
r2703437 r3157155 37 37 <p> 38 38 <strong> 39 <?php _e(' So wait, can borders be turned on and off instantly?','Bordered Blocks'); ?>39 <?php _e('Can borders be turned on and off instantly in the editor?','Bordered Blocks'); ?> 40 40 </strong> 41 41 </p> 42 42 43 43 <p> 44 <?php _e(' Pretty much, yes. In the plugin\'s settings, you can choose to have the editor show the standard view by default, -OR- the bordered view. If you have the standard view, then flipping the switch at the top of the page will quickly show all borders/labels. If you have the bordered view, flipping the switch will quickly remove all borders/labels and go back to the standard view.','Bordered Blocks'); ?>44 <?php _e('While that used to be the case until version 1.1.3, this option has been removed for now as it did not appear to be working anymore with WordPress 6.6.2. I will look into adding this again, but for now, the borders are always showing in the editor as long as the plugin is active.','Bordered Blocks'); ?> 45 45 </p> 46 46 … … 52 52 53 53 <p> 54 <?php _e('Bordered Blocks currently only supports the default Blocks that come with WordPress (support for WooCommerce and Jetpack is planned). If you have additional blocks added with plugins (or custom code), and they are not coded exactly following WordPress standards, they may not look as intended with borders and/or labels. If that\'s the case, please reach out to the plugin developer and have them check if all their Blocks have the proper naming with "data-title" attributes.','Bordered Blocks'); ?>54 <?php _e('Bordered Blocks currently only supports the default Blocks that come with WordPress and WooCommerce. If you have additional blocks added with plugins (or custom code), and they are not coded exactly following WordPress standards, they may not look as intended with borders and/or labels. If that\'s the case, please reach out to the plugin developer and have them check if all their Blocks have the proper naming with "data-title" attributes.','Bordered Blocks'); ?> 55 55 </p> 56 56 … … 81 81 <?php _e('but -are- on the roadmap:','Bordered Blocks'); ?></p> 82 82 <ul> 83 <li> 84 <?php _e('Re-introcing the toggle to show/hide borders instantly in the editor','Bordered Blocks'); ?> 85 </li> 83 86 <li> 84 87 <?php _e('Support for Jetpack Blocks','Bordered Blocks'); ?> -
bordered-blocks/trunk/assets/js/bordered-blocks.js
r3147754 r3157155 21 21 22 22 // Apply CSS styles for borders 23 let cssVar = '. borderedblocks .editor-styles-wrapper .wp-block, .borderedblocks .editor-styles-wrapper *[data-title], .borderedblocks.editor-styles-wrapper .contains-blocks[data-title] *[data-title]{';23 let cssVar = '.editor-styles-wrapper .wp-block, .editor-styles-wrapper *[data-title], .editor-styles-wrapper .contains-blocks[data-title] *[data-title]{'; 24 24 cssVar += 'border: '+borderstyle+' '+borderwidth+'px '+bordercolor+' !important;'; 25 25 cssVar += 'padding: '+paddingtop+'px '+paddingright+'px '+paddingbottom+'px '+paddingleft+'px !important; margin-bottom: 20px !important;}'; 26 26 // Apply CSS styles for labels 27 27 if (labelsize < 1) { 28 cssVar += '. borderedblocks .editor-styles-wrapper .wp-block:before {display: none;}';28 cssVar += '.editor-styles-wrapper .wp-block:before {display: none;}'; 29 29 } else { 30 cssVar += '. borderedblocks .editor-styles-wrapper .wp-block::before, .borderedblocks.editor-styles-wrapper .wp-block *[data-title]::before {';30 cssVar += '.editor-styles-wrapper .wp-block::before, .editor-styles-wrapper .wp-block *[data-title]::before {'; 31 31 cssVar += 'font-size:'+labelsize+'px;height:'+(labelsize*1.5)+'px;line-height:'+(labelsize*1.5)+'px;background:'+labelbackground+';color:'+labelcolor+';opacity:'+(labelopacity/10)+';'; 32 32 cssVar += '}'; 33 33 } 34 cssVar += '. borderedblocks .editor-styles-wrapper .wp-block.contains-blocks[data-title] {position: relative; padding: 0 !important; border: none;}';35 cssVar += '. borderedblocks .editor-styles-wrapper .wp-block.contains-blocks::before {display: none;}';36 cssVar += '. borderedblocks .editor-styles-wrapper hr.wp-block-separator[data-title], .borderedblocks .editor-styles-wrapper .contains-blocks[data-title] hr[data-title] {padding: 0 !important;} .borderedblocks.editor-styles-wrapper hr.wp-block-separator:after {display: none;}';37 cssVar += '. borderedblocks .editor-styles-wrapper .wp-block[data-title="Social Icon"] {border: none; padding: 0 !important; margin-bottom: 0 !important;} .borderedblocks .editor-styles-wrapper .wp-block.contains-blocks[data-title="Social Icons"] *[data-title="Social Icon"] {border: none; padding: 0 !important; margin-bottom: 0 !important;} .borderedblocks.editor-styles-wrapper .wp-block[data-title="Social Icon"]:before {display: none;}';34 cssVar += '.editor-styles-wrapper .wp-block.contains-blocks[data-title] {position: relative; padding: 0 !important; border: none;}'; 35 cssVar += '.editor-styles-wrapper .wp-block.contains-blocks::before {display: none;}'; 36 cssVar += '.editor-styles-wrapper hr.wp-block-separator[data-title], .editor-styles-wrapper .contains-blocks[data-title] hr[data-title] {padding: 0 !important;} .editor-styles-wrapper hr.wp-block-separator:after {display: none;}'; 37 cssVar += '.editor-styles-wrapper .wp-block[data-title="Social Icon"] {border: none; padding: 0 !important; margin-bottom: 0 !important;} .editor-styles-wrapper .wp-block.contains-blocks[data-title="Social Icons"] *[data-title="Social Icon"] {border: none; padding: 0 !important; margin-bottom: 0 !important;} .editor-styles-wrapper .wp-block[data-title="Social Icon"]:before {display: none;}'; 38 38 39 39 $('#borderedBlocks-css-variable').html(cssVar); 40 40 41 41 // Whether the toggle button (and the borders) should be ON of OFF by default 42 let checkedornot;43 if (bordershow) {44 $('body').addClass('borderedblocks');45 checkedornot = 'checked';46 }42 // let checkedornot; 43 // if (bordershow) { 44 // $('body').addClass('borderedblocks'); 45 // checkedornot = 'checked'; 46 // } 47 47 48 function addToggle() {48 // function addToggle() { 49 49 // Adding the toggle button 50 50 // First line is updated - we can remove the second line a few versions down the road. 51 $('.editor-document-tools__left').append('<div class="borderedblocks-header"><span class="borderedblocks-toggle components-form-toggle is-'+checkedornot+'"><input class="components-form-toggle__input" id="borderedblocks-toggle" type="checkbox" aria-describedby="inspector-toggle-contr-0__help" '+checkedornot+'><span class="components-form-toggle__track"></span><span class="components-form-toggle__thumb"></span><label for="borderedblocks-toggle">Show borders/labels</label></span></div>').addClass('hasToggle');52 $('.edit-post-header-toolbar__left').append('<div class="borderedblocks-header"><span class="borderedblocks-toggle components-form-toggle is-'+checkedornot+'"><input class="components-form-toggle__input" id="borderedblocks-toggle" type="checkbox" aria-describedby="inspector-toggle-contr-0__help" '+checkedornot+'><span class="components-form-toggle__track"></span><span class="components-form-toggle__thumb"></span><label for="borderedblocks-toggle">Show borders/labels</label></span></div>').addClass('hasToggle');53 }51 // $('.editor-document-tools__left').append('<div class="borderedblocks-header"><span class="borderedblocks-toggle components-form-toggle is-'+checkedornot+'"><input class="components-form-toggle__input" id="borderedblocks-toggle" type="checkbox" aria-describedby="inspector-toggle-contr-0__help" '+checkedornot+'><span class="components-form-toggle__track"></span><span class="components-form-toggle__thumb"></span><label for="borderedblocks-toggle">Show borders/labels</label></span></div>').addClass('hasToggle'); 52 // $('.edit-post-header-toolbar__left').append('<div class="borderedblocks-header"><span class="borderedblocks-toggle components-form-toggle is-'+checkedornot+'"><input class="components-form-toggle__input" id="borderedblocks-toggle" type="checkbox" aria-describedby="inspector-toggle-contr-0__help" '+checkedornot+'><span class="components-form-toggle__track"></span><span class="components-form-toggle__thumb"></span><label for="borderedblocks-toggle">Show borders/labels</label></span></div>').addClass('hasToggle'); 53 // } 54 54 55 $('#editor').on('click','.borderedblocks-toggle',function(){56 $(this).toggleClass('is-checked');57 $('body').toggleClass('borderedblocks');58 });55 // $('#editor').on('click','.borderedblocks-toggle',function(){ 56 // $(this).toggleClass('is-checked'); 57 // $('body').toggleClass('borderedblocks'); 58 // }); 59 59 60 60 // This function SHOULD run every time a new block is added, or when an existing block is changed. … … 99 99 let cssCode = ''; 100 100 blocksOnPage.forEach(function(blockType) { 101 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block[data-title="'+blockType+'"]:before {content: "'+blockType+'";} .borderedblocks.editor-styles-wrapper .wp-block[data-title="'+blockType+'"] *[data-title="'+blockType+'"]:before {content: "'+blockType+'";} ';101 cssCode += '.editor-styles-wrapper .wp-block[data-title="'+blockType+'"]:before {content: "'+blockType+'";} .editor-styles-wrapper .wp-block[data-title="'+blockType+'"] *[data-title="'+blockType+'"]:before {content: "'+blockType+'";} '; 102 102 }); 103 103 104 104 embedsOnPage.forEach(function(embedType) { 105 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block[borderedblocks-label="'+embedType+'"]:before {content: "'+embedType+'";} .borderedblocks.editor-styles-wrapper .wp-block[borderedblocks-label="'+embedType+'"] *[data-title="Embed"]:before {content: "'+embedType+'";} ';105 cssCode += '.editor-styles-wrapper .wp-block[borderedblocks-label="'+embedType+'"]:before {content: "'+embedType+'";} .editor-styles-wrapper .wp-block[borderedblocks-label="'+embedType+'"] *[data-title="Embed"]:before {content: "'+embedType+'";} '; 106 106 }); 107 107 108 108 // There's a few exceptions (thanks to the WordPress editor inconsistencies), so we'll need to add those. 109 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block.taxonomy-category:before {content: "Post Categories";}';110 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block.taxonomy-post_tag:before {content: "Post Tags";}';111 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block[borderedblocks-label="Next post"]:before {content: "Next Post";}';112 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block[borderedblocks-label="Previous post"]:before {content: "Previous Post";}';113 cssCode += '. borderedblocks .editor-styles-wrapper .wp-block.wp-block-query-title:before {content: "Archive Title";}';109 cssCode += '.editor-styles-wrapper .wp-block.taxonomy-category:before {content: "Post Categories";}'; 110 cssCode += '.editor-styles-wrapper .wp-block.taxonomy-post_tag:before {content: "Post Tags";}'; 111 cssCode += '.editor-styles-wrapper .wp-block[borderedblocks-label="Next post"]:before {content: "Next Post";}'; 112 cssCode += '.editor-styles-wrapper .wp-block[borderedblocks-label="Previous post"]:before {content: "Previous Post";}'; 113 cssCode += '.editor-styles-wrapper .wp-block.wp-block-query-title:before {content: "Archive Title";}'; 114 114 115 115 // -
bordered-blocks/trunk/assets/plugin-info.php
r3147761 r3157155 14 14 <?php _e('Version:','Bordered Blocks'); ?> 15 15 </strong> 16 1.1. 316 1.1.4 17 17 </li> 18 18 <li><strong> -
bordered-blocks/trunk/assets/supported-blocks.php
r2703437 r3157155 117 117 </ul> 118 118 119 <p><?php _e('Support for Jetpack Blocks will be included in the nextversion.','Bordered Blocks'); ?></p>119 <p><?php _e('Support for Jetpack Blocks will be included in a future version.','Bordered Blocks'); ?></p> 120 120 121 121 -
bordered-blocks/trunk/bordered-blocks.php
r3147754 r3157155 6 6 Author: Senff 7 7 Author URI: http://www.senff.com 8 Version: 1.1. 38 Version: 1.1.4 9 9 */ 10 10 … … 21 21 22 22 function borderedblocks_default_options() { 23 $versionNum = '1.1. 3';23 $versionNum = '1.1.4'; 24 24 if (get_option('borderedblocks_options') === false) { 25 25 $new_options['gb_bordershow'] = ''; … … 52 52 53 53 $script_vars = array( 54 'version' => '1.1. 1',54 'version' => '1.1.4', 55 55 'bordershow' => $options['gb_bordershow'], 56 56 'bordercolor' => $options['gb_bordercolor'], … … 68 68 69 69 $gb_version = get_option('borderedblocks_version'); 70 $versionNum = '1.1. 3';70 $versionNum = '1.1.4'; 71 71 72 72 wp_enqueue_script('borderedblocksLoader', plugins_url('/assets/js/bordered-blocks.js', __FILE__), array( 'jquery' ), $versionNum, true); … … 74 74 75 75 wp_register_style('borderedblocksAdminStyle', plugins_url('/assets/css/bordered-blocks.css', __FILE__) ); 76 wp_enqueue_style('borderedblocksAdminStyle');76 wp_enqueue_style('borderedblocksAdminStyle'); 77 77 } 78 78 … … 204 204 205 205 <table class="form-table"> 206 <tr >206 <tr style="display: none;"> 207 207 <th scope="row"><?php _e('Default State','Bordered Blocks'); ?> </th> 208 208 <td> … … 644 644 645 645 register_activation_hook( __FILE__, 'borderedblocks_default_options' ); 646 add_action('enqueue_block_ editor_assets', 'borderedblocks_styles' );646 add_action('enqueue_block_assets', 'borderedblocks_styles' ); 647 647 add_action('admin_menu', 'borderedblocks_menu'); 648 648 add_action('admin_init', 'borderedblocks_admin_init' ); -
bordered-blocks/trunk/readme.txt
r3147754 r3157155 5 5 Plugin URI: https://wordpress.org/plugins/bordered-blocks/ 6 6 Requires at least: 5.9 7 Tested up to: 6.6. 18 Stable tag: 1.1. 37 Tested up to: 6.6.2 8 Stable tag: 1.1.4 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 53 53 Although you can leave the "bordered" view on when you create/edit pages, it is not recommended, as it will indeed add a lot more information to the editor which may be distracting. It will also have some impact on the performance (although I'm working on that). The recommended use is to keep using the default editor view, and only sparingly flip the switch to show the borders and labels of the Blocks on the page. 54 54 55 = So wait, can borders be turned on and off instantly?55 = Can borders be turned on and off instantly? 56 56 57 Pretty much, yes. In the plugin's settings, you can choose to have the editor show the standard view by default, or the bordered view. If you have the standard view, then flipping the switch at the top of the page will quickly show all borders/labels. If you have the bordered view, flipping the switch will quickly remove all borders/labels and go back to the standard view.57 While that used to be the case until version 1.1.3, this option has been removed for now as it did not appear to be working anymore with WordPress 6.6.2. I will look into adding this again, but for now, the borders are always showing in the editor as long as the plugin is active. 58 58 59 59 = Some of my blocks don't have a label, look weird, etc. … … 93 93 == Changelog == 94 94 95 = 1.1.4 = 96 * Removed the ON/OFF toggle in the editor since it was not working with WordPress 6.6.2 97 95 98 = 1.1.3 = 96 99 * Fixed JS issue that appeared when saving settings … … 113 116 == Upgrade Notice == 114 117 118 = 1.1.4 = 119 * Emergency fix 120 115 121 = 1.1.3 = 116 122 * Bug fixes
Note: See TracChangeset
for help on using the changeset viewer.