Changeset 3807983
- Timestamp:
- 11/17/2026 06:18:16 PM (109 minutes ago)
- Location:
- sortivo-tabs-organizer
- Files:
-
- 2 added
- 12 edited
- 1 copied
-
tags/0.7.2 (copied) (copied from sortivo-tabs-organizer/trunk )
-
tags/0.7.2/assets/admin.css (modified) (1 diff)
-
tags/0.7.2/assets/menu.js (modified) (7 diffs)
-
tags/0.7.2/includes/class-ptabs-admin.php (modified) (2 diffs)
-
tags/0.7.2/includes/class-ptabs-assets.php (added)
-
tags/0.7.2/includes/class-ptabs-menu.php (modified) (2 diffs)
-
tags/0.7.2/readme.txt (modified) (3 diffs)
-
tags/0.7.2/sortivo-tabs-organizer.php (modified) (2 diffs)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/assets/menu.js (modified) (7 diffs)
-
trunk/includes/class-ptabs-admin.php (modified) (2 diffs)
-
trunk/includes/class-ptabs-assets.php (added)
-
trunk/includes/class-ptabs-menu.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/sortivo-tabs-organizer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sortivo-tabs-organizer/tags/0.7.2/assets/admin.css
r3801054 r3807983 114 114 } 115 115 116 /* A link-style button; themes that style all buttons don't get to turn it into a box. */ 117 .ptabs-bar .ptabs-arrange-open { 118 -webkit-appearance: none; 119 appearance: none; 120 min-height: 0; 121 margin: 0; 122 padding: 0; 123 border: 0; 124 border-radius: 0; 125 background: none; 126 box-shadow: none; 127 color: #2271b1; 128 font: inherit; 129 font-size: 12px; 130 line-height: inherit; 131 text-decoration: underline; 132 cursor: pointer; 133 } 134 135 .ptabs-bar .ptabs-arrange-open:hover, 136 .ptabs-bar .ptabs-arrange-open:focus { 137 color: #135e96; 138 } 139 116 140 .ptabs-move-wrap { 117 141 white-space: nowrap; -
sortivo-tabs-organizer/tags/0.7.2/assets/menu.js
r3803786 r3807983 12 12 function loadCollapsed() { 13 13 try { 14 return JSON.parse( window.localStorage.getItem( KEY ) || '[]' ); 14 var list = JSON.parse( window.localStorage.getItem( KEY ) || '[]' ); 15 return Array.isArray( list ) ? list : []; 15 16 } catch ( e ) { 16 17 return []; 18 } 19 } 20 21 // The sidebar changed height: let WordPress measure it again. Otherwise a sidebar that was 22 // pinned while short stays pinned when it grows, and its bottom can't be scrolled into view. 23 function menuResized() { 24 if ( window.jQuery ) { 25 window.jQuery( document ).trigger( 'wp-pin-menu' ); 26 } else { 27 window.dispatchEvent( new Event( 'resize' ) ); 17 28 } 18 29 } … … 117 128 var isCollapsed = ! header.classList.contains( 'is-collapsed' ); 118 129 apply( isCollapsed ); 130 menuResized(); 119 131 collapsed = collapsed.filter( function ( id ) { 120 132 return id !== group.id; … … 154 166 toggle.appendChild( toggleLabel ); 155 167 toggleItem.appendChild( toggle ); 156 menu.insertBefore( toggleItem, document.getElementById( 'collapse-menu' ) ); 168 var collapseItem = document.getElementById( 'collapse-menu' ); 169 menu.insertBefore( toggleItem, collapseItem && collapseItem.parentNode === menu ? collapseItem : null ); 170 171 // The "Arrange sidebar" link on the Plugins page starts arranging too. 172 document.addEventListener( 'click', function ( e ) { 173 var link = e.target.closest && e.target.closest( '.ptabs-arrange-open' ); 174 if ( link ) { 175 e.preventDefault(); 176 window.scrollTo( 0, 0 ); 177 start(); 178 } 179 } ); 157 180 158 181 function button( text, className, onClick ) { … … 245 268 arranging = true; 246 269 menu.classList.add( 'ptabs-arranging' ); 270 // Arranging needs the full sidebar; a folded one comes back after Done or Cancel (page reload). 271 document.body.classList.remove( 'folded', 'auto-fold' ); 247 272 248 273 // Every group open while arranging. … … 292 317 menu.insertBefore( panel, menu.firstElementChild ); 293 318 toggleItem.hidden = true; 294 295 // Let WordPress recalculate its sticky sidebar for the new height. 296 window.dispatchEvent( new Event( 'resize' ) ); 319 menuResized(); 297 320 } 298 321 … … 361 384 } 362 385 endDrag(); 386 menuResized(); 363 387 } ); 364 388 … … 487 511 menu.insertBefore( emptyHint(), end ); 488 512 makeDraggable( header ); 513 menuResized(); 489 514 } ) 490 515 .catch( function () {} ); -
sortivo-tabs-organizer/tags/0.7.2/includes/class-ptabs-admin.php
r3801054 r3807983 128 128 esc_html__( 'Group the sidebar menu too', 'sortivo-tabs-organizer' ) 129 129 ); 130 if ( PTabs_Store::menu_enabled() ) { 131 // Starts "Arrange menu" in the sidebar (assets/menu.js). 132 echo '<button type="button" class="ptabs-arrange-open">' . esc_html__( 'Arrange sidebar', 'sortivo-tabs-organizer' ) . '</button>'; 133 } 130 134 echo '<a class="ptabs-transfer-link" href="' . esc_url( PTabs_Settings::url() ) . '">' . esc_html__( 'Export / import', 'sortivo-tabs-organizer' ) . '</a>'; 131 135 echo '</nav>'; … … 159 163 return; 160 164 } 161 wp_enqueue_style( 'ptabs-admin', PTABS_URL . 'assets/admin.css', array(), PTABS_VERSION );162 wp_enqueue_script( 'ptabs-admin', PTABS_URL . 'assets/admin.js', array(), PTABS_VERSION, true);163 wp_localize_script(165 // Printed into the page itself, so an update always takes effect (see PTabs_Assets). 166 PTabs_Assets::style( 'ptabs-admin', 'admin.css' ); 167 PTabs_Assets::script( 164 168 'ptabs-admin', 169 'admin.js', 165 170 'PTabs', 166 171 array( -
sortivo-tabs-organizer/tags/0.7.2/includes/class-ptabs-menu.php
r3803786 r3807983 419 419 return; 420 420 } 421 wp_enqueue_style( 'ptabs-menu', PTABS_URL . 'assets/menu.css', array(), PTABS_VERSION );422 wp_enqueue_script( 'ptabs-menu', PTABS_URL . 'assets/menu.js', array(), PTABS_VERSION, true );423 424 421 $data = array( 425 422 'groups' => self::$groups, … … 456 453 ); 457 454 } 458 wp_localize_script( 'ptabs-menu', 'PTabsMenu', $data ); 455 // Printed into the page itself, so an update always takes effect (see PTabs_Assets). 456 PTabs_Assets::style( 'ptabs-menu', 'menu.css' ); 457 PTabs_Assets::script( 'ptabs-menu', 'menu.js', 'PTabsMenu', $data ); 459 458 } 460 459 -
sortivo-tabs-organizer/tags/0.7.2/readme.txt
r3803786 r3807983 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 0.7. 07 Stable tag: 0.7.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 20 20 * **Remembers your tab** - after activating, deactivating or searching you stay in the tab you were in. 21 21 * **Tidy sidebar** - the menu items plugins add to the left sidebar are grouped under the same tab names, with a collapsible header per group. No page is moved and no link changes, so every plugin keeps working. Turn it off with one checkbox on the Plugins page. 22 * **Arrange the sidebar yourself** - click "Arrange menu" at the bottom of the sidebar . Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. Make a new group for them, or reset everything with one click. Until you do this, nothing changes.22 * **Arrange the sidebar yourself** - click "Arrange menu" at the bottom of the sidebar, or "Arrange sidebar" at the top of the Plugins page. Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. Make a new group for them, or reset everything with one click. Until you do this, nothing changes. 23 23 * **Export / import** - download your layout as a file (Tools > Sortivo Tabs) and import it on other sites, or use WP-CLI: `wp sortivo export` and `wp sortivo import`. 24 24 * Works with the All / Active / Inactive / Update filters and with search. … … 72 72 == Changelog == 73 73 74 = 0.7.2 = 75 * Fix: on some hosts an update did not fully take effect, because their server cache kept serving the old script and style of the plugin for days. The plugin now puts its small script and style into the admin page itself, so every update takes effect right away. 76 * Fix: the "Arrange sidebar" link keeps its link style with themes that style all buttons. 77 78 = 0.7.1 = 79 * Fix: after opening groups in the sidebar you can scroll down to the bottom of the menu again. 80 * New: an "Arrange sidebar" link at the top of the Plugins page, next to "Group the sidebar menu too". 81 74 82 = 0.7.0 = 75 83 * New: "Arrange menu" at the bottom of the sidebar. Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. The tabs on the Plugins page follow the same order. -
sortivo-tabs-organizer/tags/0.7.2/sortivo-tabs-organizer.php
r3803786 r3807983 3 3 * Plugin Name: Sortivo Tabs Organizer 4 4 * Description: Organize the Plugins page into tabs. Plugins are sorted into categories automatically, and you can move any plugin to another tab or make your own tabs. 5 * Version: 0.7. 05 * Version: 0.7.2 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 define( 'PTABS_VERSION', '0.7. 0' );16 define( 'PTABS_VERSION', '0.7.2' ); 17 17 define( 'PTABS_FILE', __FILE__ ); 18 define( 'PTABS_URL', plugin_dir_url( __FILE__ ) );19 18 19 require_once __DIR__ . '/includes/class-ptabs-assets.php'; 20 20 require_once __DIR__ . '/includes/class-ptabs-categorizer.php'; 21 21 require_once __DIR__ . '/includes/class-ptabs-store.php'; -
sortivo-tabs-organizer/trunk/assets/admin.css
r3801054 r3807983 114 114 } 115 115 116 /* A link-style button; themes that style all buttons don't get to turn it into a box. */ 117 .ptabs-bar .ptabs-arrange-open { 118 -webkit-appearance: none; 119 appearance: none; 120 min-height: 0; 121 margin: 0; 122 padding: 0; 123 border: 0; 124 border-radius: 0; 125 background: none; 126 box-shadow: none; 127 color: #2271b1; 128 font: inherit; 129 font-size: 12px; 130 line-height: inherit; 131 text-decoration: underline; 132 cursor: pointer; 133 } 134 135 .ptabs-bar .ptabs-arrange-open:hover, 136 .ptabs-bar .ptabs-arrange-open:focus { 137 color: #135e96; 138 } 139 116 140 .ptabs-move-wrap { 117 141 white-space: nowrap; -
sortivo-tabs-organizer/trunk/assets/menu.js
r3803786 r3807983 12 12 function loadCollapsed() { 13 13 try { 14 return JSON.parse( window.localStorage.getItem( KEY ) || '[]' ); 14 var list = JSON.parse( window.localStorage.getItem( KEY ) || '[]' ); 15 return Array.isArray( list ) ? list : []; 15 16 } catch ( e ) { 16 17 return []; 18 } 19 } 20 21 // The sidebar changed height: let WordPress measure it again. Otherwise a sidebar that was 22 // pinned while short stays pinned when it grows, and its bottom can't be scrolled into view. 23 function menuResized() { 24 if ( window.jQuery ) { 25 window.jQuery( document ).trigger( 'wp-pin-menu' ); 26 } else { 27 window.dispatchEvent( new Event( 'resize' ) ); 17 28 } 18 29 } … … 117 128 var isCollapsed = ! header.classList.contains( 'is-collapsed' ); 118 129 apply( isCollapsed ); 130 menuResized(); 119 131 collapsed = collapsed.filter( function ( id ) { 120 132 return id !== group.id; … … 154 166 toggle.appendChild( toggleLabel ); 155 167 toggleItem.appendChild( toggle ); 156 menu.insertBefore( toggleItem, document.getElementById( 'collapse-menu' ) ); 168 var collapseItem = document.getElementById( 'collapse-menu' ); 169 menu.insertBefore( toggleItem, collapseItem && collapseItem.parentNode === menu ? collapseItem : null ); 170 171 // The "Arrange sidebar" link on the Plugins page starts arranging too. 172 document.addEventListener( 'click', function ( e ) { 173 var link = e.target.closest && e.target.closest( '.ptabs-arrange-open' ); 174 if ( link ) { 175 e.preventDefault(); 176 window.scrollTo( 0, 0 ); 177 start(); 178 } 179 } ); 157 180 158 181 function button( text, className, onClick ) { … … 245 268 arranging = true; 246 269 menu.classList.add( 'ptabs-arranging' ); 270 // Arranging needs the full sidebar; a folded one comes back after Done or Cancel (page reload). 271 document.body.classList.remove( 'folded', 'auto-fold' ); 247 272 248 273 // Every group open while arranging. … … 292 317 menu.insertBefore( panel, menu.firstElementChild ); 293 318 toggleItem.hidden = true; 294 295 // Let WordPress recalculate its sticky sidebar for the new height. 296 window.dispatchEvent( new Event( 'resize' ) ); 319 menuResized(); 297 320 } 298 321 … … 361 384 } 362 385 endDrag(); 386 menuResized(); 363 387 } ); 364 388 … … 487 511 menu.insertBefore( emptyHint(), end ); 488 512 makeDraggable( header ); 513 menuResized(); 489 514 } ) 490 515 .catch( function () {} ); -
sortivo-tabs-organizer/trunk/includes/class-ptabs-admin.php
r3801054 r3807983 128 128 esc_html__( 'Group the sidebar menu too', 'sortivo-tabs-organizer' ) 129 129 ); 130 if ( PTabs_Store::menu_enabled() ) { 131 // Starts "Arrange menu" in the sidebar (assets/menu.js). 132 echo '<button type="button" class="ptabs-arrange-open">' . esc_html__( 'Arrange sidebar', 'sortivo-tabs-organizer' ) . '</button>'; 133 } 130 134 echo '<a class="ptabs-transfer-link" href="' . esc_url( PTabs_Settings::url() ) . '">' . esc_html__( 'Export / import', 'sortivo-tabs-organizer' ) . '</a>'; 131 135 echo '</nav>'; … … 159 163 return; 160 164 } 161 wp_enqueue_style( 'ptabs-admin', PTABS_URL . 'assets/admin.css', array(), PTABS_VERSION );162 wp_enqueue_script( 'ptabs-admin', PTABS_URL . 'assets/admin.js', array(), PTABS_VERSION, true);163 wp_localize_script(165 // Printed into the page itself, so an update always takes effect (see PTabs_Assets). 166 PTabs_Assets::style( 'ptabs-admin', 'admin.css' ); 167 PTabs_Assets::script( 164 168 'ptabs-admin', 169 'admin.js', 165 170 'PTabs', 166 171 array( -
sortivo-tabs-organizer/trunk/includes/class-ptabs-menu.php
r3803786 r3807983 419 419 return; 420 420 } 421 wp_enqueue_style( 'ptabs-menu', PTABS_URL . 'assets/menu.css', array(), PTABS_VERSION );422 wp_enqueue_script( 'ptabs-menu', PTABS_URL . 'assets/menu.js', array(), PTABS_VERSION, true );423 424 421 $data = array( 425 422 'groups' => self::$groups, … … 456 453 ); 457 454 } 458 wp_localize_script( 'ptabs-menu', 'PTabsMenu', $data ); 455 // Printed into the page itself, so an update always takes effect (see PTabs_Assets). 456 PTabs_Assets::style( 'ptabs-menu', 'menu.css' ); 457 PTabs_Assets::script( 'ptabs-menu', 'menu.js', 'PTabsMenu', $data ); 459 458 } 460 459 -
sortivo-tabs-organizer/trunk/readme.txt
r3803786 r3807983 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 0.7. 07 Stable tag: 0.7.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 20 20 * **Remembers your tab** - after activating, deactivating or searching you stay in the tab you were in. 21 21 * **Tidy sidebar** - the menu items plugins add to the left sidebar are grouped under the same tab names, with a collapsible header per group. No page is moved and no link changes, so every plugin keeps working. Turn it off with one checkbox on the Plugins page. 22 * **Arrange the sidebar yourself** - click "Arrange menu" at the bottom of the sidebar . Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. Make a new group for them, or reset everything with one click. Until you do this, nothing changes.22 * **Arrange the sidebar yourself** - click "Arrange menu" at the bottom of the sidebar, or "Arrange sidebar" at the top of the Plugins page. Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. Make a new group for them, or reset everything with one click. Until you do this, nothing changes. 23 23 * **Export / import** - download your layout as a file (Tools > Sortivo Tabs) and import it on other sites, or use WP-CLI: `wp sortivo export` and `wp sortivo import`. 24 24 * Works with the All / Active / Inactive / Update filters and with search. … … 72 72 == Changelog == 73 73 74 = 0.7.2 = 75 * Fix: on some hosts an update did not fully take effect, because their server cache kept serving the old script and style of the plugin for days. The plugin now puts its small script and style into the admin page itself, so every update takes effect right away. 76 * Fix: the "Arrange sidebar" link keeps its link style with themes that style all buttons. 77 78 = 0.7.1 = 79 * Fix: after opening groups in the sidebar you can scroll down to the bottom of the menu again. 80 * New: an "Arrange sidebar" link at the top of the Plugins page, next to "Group the sidebar menu too". 81 74 82 = 0.7.0 = 75 83 * New: "Arrange menu" at the bottom of the sidebar. Drag groups up and down, and drag any menu item into a group, also WordPress's own items like Posts or Settings. The tabs on the Plugins page follow the same order. -
sortivo-tabs-organizer/trunk/sortivo-tabs-organizer.php
r3803786 r3807983 3 3 * Plugin Name: Sortivo Tabs Organizer 4 4 * Description: Organize the Plugins page into tabs. Plugins are sorted into categories automatically, and you can move any plugin to another tab or make your own tabs. 5 * Version: 0.7. 05 * Version: 0.7.2 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 define( 'PTABS_VERSION', '0.7. 0' );16 define( 'PTABS_VERSION', '0.7.2' ); 17 17 define( 'PTABS_FILE', __FILE__ ); 18 define( 'PTABS_URL', plugin_dir_url( __FILE__ ) );19 18 19 require_once __DIR__ . '/includes/class-ptabs-assets.php'; 20 20 require_once __DIR__ . '/includes/class-ptabs-categorizer.php'; 21 21 require_once __DIR__ . '/includes/class-ptabs-store.php';
Note:
See TracChangeset
for help on using the changeset viewer.