Changeset 2794297
- Timestamp:
- 10/04/2022 11:27:13 PM (3 years ago)
- Location:
- block-styling
- Files:
-
- 15 added
- 2 edited
-
assets/banner-1544x500-new.png (added)
-
assets/banner-772x250-new.png (added)
-
assets/icon-128x128.gif (added)
-
assets/icon-256x256.gif (added)
-
assets/icon-512x512.gif (added)
-
assets/icon.webp (added)
-
assets/screenshot-1.gif (added)
-
assets/screenshot-2.gif (added)
-
assets/screenshot-3.gif (added)
-
assets/screenshot-4.gif (added)
-
tags/1.0 (added)
-
tags/1.0/trunk (added)
-
tags/1.0/trunk/README.txt (added)
-
tags/1.0/trunk/block-styling-backend.php (added)
-
tags/1.0/trunk/index.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/block-styling-backend.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
block-styling/trunk/README.txt
r2794027 r2794297 36 36 (Behind the scenes adding small CSS and bytes of code to change Gutenberg **blocks layout** ). 37 37 38 = May I have any extra heavy resources or bloat ? =38 = May I have any extra heavy resources or bloat ? = 39 39 40 40 Nope. Just, on backend, few bytes of compressed code. … … 42 42 == Screenshots == 43 43 44 1. The idea45 2. This is the second screen shot46 3. Third47 4. Fo rth44 1. How it works 45 2. Plugin in action on pages 46 3. Plugin working on posts 47 4. Focus on title and columns 48 48 49 49 == Changelog == 50 51 = 2.0 = 52 * Added titles to each section 53 * Microinteraction while mouseover blocks 54 * Microinterations on active blocks 55 * Improved code 56 * Improved plugin's bagdes and icons 57 * Plus: fixed Pattern sidebar 50 58 51 59 = 1.0 = -
block-styling/trunk/block-styling-backend.php
r2794027 r2794297 10 10 * Plugin URI: https://www.whynot.media/ 11 11 * Description: Making Blocks Ui more accessible and friendly, someway easier to handle and visually manage. 12 * Version: 1.0.012 * Version: 2.0.0 13 13 * Author: Dennys Dionigi 14 14 * Author URI: https://codepen.io/DedaloD … … 27 27 * Currently plugin version. 28 28 */ 29 define( 'BLOCK_STYLING_BACKEND_VERSION', ' 1.0.0' );29 define( 'BLOCK_STYLING_BACKEND_VERSION', '2.0.0' ); 30 30 31 31 … … 79 79 'type' => 'hidden', 80 80 ) ); 81 $wp_customize->selective_refresh->add_partial( 'information_links', array(81 $wp_customize->selective_refresh->add_partial( 'information_links', array( 82 82 'selector' => '.edit-post', 83 83 'container_inclusive' => true, … … 90 90 global $post; 91 91 $types = array( 'post', 'page' ); 92 92 93 93 if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) { 94 94 95 95 if ( $post && in_array( $post->post_type, $types, true ) && current_user_can('administrator') ) { 96 96 97 97 $edit_link_frontend = '<div id="id-edit-post"><div class="edit-post" onclick="editPost()"> <button onclick="editPost()">Modifica Body</button></div></div> 98 <script async>98 <script async> 99 99 document.getElementById("id-edit-post").onclick = function() {messageSuccess()}; 100 100 … … 102 102 document.getElementById("id-edit-post").innerHTML = "Caricamento in corso... Attendere"; 103 103 } 104 104 105 105 let getUrl; 106 106 107 107 function editPost() { 108 108 getUrl = window.location.href ="'.admin_url().'post.php?post='.get_the_ID().'&action=edit"; 109 109 110 110 } 111 111 </script>'; 112 112 113 113 $content = $edit_link_frontend.$content; 114 114 115 115 } 116 117 }118 116 117 } 118 119 119 return $content; 120 120 } … … 138 138 add_action( 'admin_head', 'custom_css_edit_post' ); 139 139 function custom_css_edit_post() { 140 141 if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) {140 141 if( isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe' ) { 142 142 143 $display = '<style>.edit-post-fullscreen-mode-close.has-icon {display: none !important;}143 $display = '<style>.edit-post-fullscreen-mode-close.has-icon {display: none !important;} 144 144 .components-editor-notices__snackbar {display: none !important;} 145 .editor-post-publish-panel__content {display:none!important;}146 </style>';145 .editor-post-publish-panel__content {display:none!important;} 146 </style>'; 147 147 echo $display; 148 148 149 149 } 150 }151 150 } 151 152 152 153 153 //** Grazie a Dennys Dionigi e Roberto B. … … 155 155 /*css admin*/ 156 156 add_action('enqueue_block_editor_assets','my_custom_css_admin'); 157 function my_custom_css_admin(){echo '<style>.wp-block-group[role=group]>*{border:1px solid #000!important}.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{border: 1px solid rgb(0 0 0/70%)!important}@media (min-width:769px){.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{width:-webkit-fill-available!important}}:is(.editor-styles-wrapper .wp-block-columns >.wp-block-column >.wp-block-html,iframe.components-sandbox){width:fit-content;max-height:35vh;overflow-y:scroll;border:1px solid #000!important;color:#000}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar{width:5px}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-track{background:rgb(0 0 0/5%)}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-thumb{background:rgb(9 207 136/60%)}:is(.block-library-html__edit,iframe.components-sandbox):is(:hover,:focus) .block-editor-plain-text::-webkit-scrollbar-thumb{background:#000}.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{padding:0 0 2.5rem!important}.block-editor-rich-text__editable:is(:hover,:active,:focus,:focus-within){z-index:5}.whynot-block-slider{height:min-content}div img{backdrop-filter:contrast(.8)}.block-editor-block-list__layout .block-editor-block-list__block:after{box-shadow:0 0 0 .5px rgb(0 0 0/50%)!important}.wp-block[data-align=full]{display:flex;flex-direction:column}.wp-block-columns.are-vertically-aligned-center{align-items:center;display:flex;justify-content:center}</style>';}157 function my_custom_css_admin(){echo '<style>.wp-block-group[role=group]>*{border:1px solid #000!important}.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{border:.6px dashed rgb(0 0 0/70%)!important}@media (min-width:769px){.editor-styles-wrapper .wp-block-columns>.wp-block-column>.wp-block{width:-webkit-fill-available!important}}:is(.editor-styles-wrapper .wp-block-columns >.wp-block-column >.wp-block-html,iframe.components-sandbox){width:fit-content;max-height:35vh;overflow-y:scroll;border:1px solid #000!important;color:#000}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar{width:5px}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-track{background:rgb(0 0 0/5%)}:is(.block-library-html__edit .block-editor-plain-text,iframe.components-sandbox)::-webkit-scrollbar-thumb{background:rgb(9 207 136/60%)}:is(.block-library-html__edit,iframe.components-sandbox):is(:hover,:focus) .block-editor-plain-text::-webkit-scrollbar-thumb{background:#000}.edit-post-layout__metaboxes:not(:empty) .edit-post-meta-boxes-area{padding:0 0 2.5rem!important}.block-editor-rich-text__editable:is(:hover,:active,:focus,:focus-within){z-index:5}.whynot-block-slider{height:min-content}div img{backdrop-filter:contrast(.8)}.block-editor-block-list__layout .block-editor-block-list__block:after{box-shadow:0 0 0 .5px rgb(0 0 0/50%)!important}.wp-block[data-align=full]{display:flex;flex-direction:column}.wp-block-columns.are-vertically-aligned-center{align-items:center;display:flex;justify-content:center}:is(.wp-admin) [data-title]:not([data-title=""]):before{--white-hwb:hwb(0deg 100% 0%);--black-hwb:hwb(0deg 0% 100%);--invert-hwb:invert(1);--limegreen-hwb:hwb(120deg 20% 20%);--royalblue-hwb:hwb(225deg 25% 12%);--orangered-hwb:hwb(33deg 0% 0%);;content:attr(data-title);position:relative;display:flex;place-content:center;place-items:center;top:-1.5ch;left:-1ch;width:fit-content;height:fit-content;padding:3px;font:600 .99ex sans-serif;letter-spacing:.7px;background:var(--black-hwb);color:hwb(0deg 100% 0%);border:2.5px var(--white-hwb) solid;text-rendering:geometricprecision;-webkit-font-smoothing:subpixel-antialiased;-moz-osx-font-smoothing:subpixel-antialiased;white-space:nowrap;z-index:2;filter:drop-shadow(0 0 1px var(--black-hwb)) drop-shadow(2px 4px 10px var(--white-hwb));transition:all .6s ease-in-out;-webbkit-transition:all .6s ease-in-out;will-change:filter,text-shadow,background;speak:never}@supports (font-smooth){[data-title]:not([data-title=""]):before{font-smooth:always}}[data-title]:not([data-title=""]):hover:before{filter:invert(1);text-shadow:.5px .5px 3ch var(--white-hwb);transition:all .5s ease}.is-selected[data-title]:not([data-title=""]):before{background:var(--royalblue-hwb);filter:unset}[data-title]:not([data-title=""]) :has([data-title]):before{border-bottom:1px var(--limegreen-hwb) dashed}.is-selected[data-title][data-type="core/spacer"]:before{position:absolute;background:var(--orangered-hwb)}:is(.is-selected,.rich-text.is-selected:focus){-webkit-box-shadow:0 0 0 1px hwb(0deg 0% 100%);box-shadow:0 0 0 1px hwb(0deg 0% 100%)}:is(.wp-admin) .block-editor-block-patterns-list__item {height:auto;}</style>';} 158 158 function admin_style(){echo '<style>.CodeMirror-code{font-family:sans-serif;font-size:12px;word-spacing:3px;letter-spacing:.5px}.cm-qualifier,.cm-tag{-webkit-text-fill-color:#000;font-weight:700}.cm-variable-3,[role=presentation] .cm-builtin:nth-child(1){font-weight:700}</style>';} 159 159 add_action('admin_enqueue_scripts','admin_style');
Note: See TracChangeset
for help on using the changeset viewer.