Move the settings screen to its own top-level menu
Adds an "M365 Login" menu entry with a Microsoft-style icon and one submenu per tab (Connection, Button, Security). The active tab is taken from the URL, kept in the post-save redirect and highlighted in the submenu. Notices are printed explicitly because top-level pages do not include options-head.php. Links, docs and screenshots updated. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JJxAHYdMfKPoN4koRc4Ci2
This commit is contained in:
parent
8766927123
commit
662756bc75
12 changed files with 664 additions and 576 deletions
|
|
@ -18,18 +18,36 @@
|
|||
try {
|
||||
window.localStorage.setItem( 'm365LoginTab', name );
|
||||
} catch ( e ) {}
|
||||
// Keep the URL (and the post-save redirect) on this tab.
|
||||
var $referer = $( '#m365-referer' );
|
||||
if ( $referer.length && window.history && window.history.replaceState ) {
|
||||
var url = new URL( window.location.href );
|
||||
if ( 'connection' === name ) {
|
||||
url.searchParams.delete( 'tab' );
|
||||
} else {
|
||||
url.searchParams.set( 'tab', name );
|
||||
}
|
||||
url.searchParams.delete( 'settings-updated' );
|
||||
window.history.replaceState( null, '', url.toString() );
|
||||
$referer.val( url.pathname + url.search );
|
||||
}
|
||||
}
|
||||
|
||||
$tabs.on( 'click', function () {
|
||||
activate( $( this ).data( 'tab' ) );
|
||||
} );
|
||||
|
||||
try {
|
||||
var saved = window.localStorage.getItem( 'm365LoginTab' );
|
||||
if ( saved && $tabs.filter( '[data-tab="' + saved + '"]' ).length ) {
|
||||
activate( saved );
|
||||
}
|
||||
} catch ( e ) {}
|
||||
var initial = $( '.m365-admin__tabs' ).data( 'initial-tab' );
|
||||
if ( initial && $tabs.filter( '[data-tab="' + initial + '"]' ).length ) {
|
||||
activate( initial );
|
||||
} else {
|
||||
try {
|
||||
var saved = window.localStorage.getItem( 'm365LoginTab' );
|
||||
if ( saved && $tabs.filter( '[data-tab="' + saved + '"]' ).length ) {
|
||||
activate( saved );
|
||||
}
|
||||
} catch ( e ) {}
|
||||
}
|
||||
|
||||
// Jump to the tab that contains a validation error.
|
||||
var $error = $( '.settings-error' ).first();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue