Файловый менеджер - Редактировать - /var/www/html/mediawiki-1.43.1/extensions/PageProperties/resources/tabs.js
Ðазад
/*! * JavaScript for Special:Preferences: Tab navigation. */ ( function () { $( () => { let tabs, previousTab, switchingNoHash; if ( !$( '.mw-prefs-tabs' ).get( 0 ) ) { return; } // ***edited switchingNoHash = true; // Make sure the accessibility tip is focussable so that keyboard users take notice, // but hide it by default to reduce visual clutter. // Make sure it becomes visible when focused. $( '<div>' ) .addClass( 'mw-navigation-hint' ) .text( mw.msg( 'prefs-tabs-navigation-hint' ) ) .attr( { tabIndex: 0 } ) .insertBefore( '.mw-htmlform-ooui-wrapper' ); tabs = OO.ui.infuse( $( '.mw-prefs-tabs' ) ); tabs.$element.addClass( 'mw-prefs-tabs-infused' ); function enhancePanel( panel ) { if ( !panel.$element.data( 'mw-section-infused' ) ) { panel.$element.removeClass( 'mw-htmlform-autoinfuse-lazy' ); mw.hook( 'htmlform.enhance' ).fire( panel.$element ); panel.$element.data( 'mw-section-infused', true ); } } function onTabPanelSet( panel ) { let scrollTop, active; if ( switchingNoHash ) { return; } // Handle hash manually to prevent jumping, // therefore save and restore scrollTop to prevent jumping. scrollTop = $( window ).scrollTop(); // Changing the hash apparently causes keyboard focus to be lost? // Save and restore it. This makes no sense though. active = document.activeElement; location.hash = '#' + panel.getName(); if ( active ) { active.focus(); } $( window ).scrollTop( scrollTop ); } tabs.on( 'set', onTabPanelSet ); /** * @ignore * @param {string} name The name of a tab * @param {boolean} [noHash] A hash will be set according to the current * open section. Use this flag to suppress this. */ function switchPrefTab( name, noHash ) { if ( noHash ) { switchingNoHash = true; } tabs.setTabPanel( name ); enhancePanel( tabs.getCurrentTabPanel() ); if ( noHash ) { switchingNoHash = false; } } // Jump to correct section as indicated by the hash. // This function is called onload and onhashchange. function detectHash() { let hash = location.hash, matchedElement, $parentSection; if ( hash.match( /^#mw-prefsection-[\w]+$/ ) ) { // mw.storage.session.remove( 'mwpreferences-prevTab' ); switchPrefTab( hash.slice( 1 ) ); } else if ( hash.match( /^#mw-[\w-]+$/ ) ) { matchedElement = document.getElementById( hash.slice( 1 ) ); $parentSection = $( matchedElement ).closest( '.mw-prefs-section-fieldset' ); if ( $parentSection.length ) { // mw.storage.session.remove( 'mwpreferences-prevTab' ); // Switch to proper tab and scroll to selected item. switchPrefTab( $parentSection.attr( 'id' ), true ); matchedElement.scrollIntoView(); } } } // ***edited // eslint-disable-next-line no-constant-condition if ( false ) { $( window ) .on( 'hashchange', () => { const hash = location.hash; if ( hash.match( /^#mw-[\w-]+/ ) ) { detectHash(); } else if ( hash === '' ) { switchPrefTab( 'mw-prefsection-personal', true ); } } ) // Run the function immediately to select the proper tab on startup. .trigger( 'hashchange' ); } // Restore the active tab after saving the preferences // ***edited previousTab = mw.storage.session.get( 'pageproperties-prevTab' ); if ( previousTab ) { switchPrefTab( previousTab, true ); // Deleting the key, the tab states should be reset until we press Save mw.storage.session.remove( 'pageproperties-prevTab' ); } // ***edited $( '#pageproperties-form' ).on( 'submit', () => { const currentTab = tabs.getCurrentTabPanelName(); // ***edited if ( currentTab ) { mw.storage.session.set( 'pageproperties-prevTab', currentTab ); } } ); } ); }() );
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка