MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
AdminIsidore (talk | contribs) Created page with "→Any JavaScript here will be loaded for all users on every page load.: // Force the glossary creation form on OODA_WIKI:Add_a_glossary_term to open in a new tab $( function() { var $formContainer = $( '#new-term-form' ); if ( $formContainer.length ) { $formContainer.find( 'form' ).attr( 'target', '_blank' ); } } );" |
AdminIsidore (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
// Force the glossary creation | // Force the glossary and music creation forms to open in a new tab | ||
$( function() { | $( function() { | ||
var $formContainer = $( '#new-term-form' ); | // This selector targets both form containers by their ID | ||
var $formContainer = $( '#new-term-form, #new-concept-form' ); | |||
if ( $formContainer.length ) { | if ( $formContainer.length ) { | ||
$formContainer.find( 'form' ).attr( 'target', '_blank' ); | $formContainer.find( 'form' ).attr( 'target', '_blank' ); | ||
} | } | ||
} ); | } ); |
Revision as of 03:05, 28 August 2025
/* Any JavaScript here will be loaded for all users on every page load. */
// Force the glossary and music creation forms to open in a new tab
$( function() {
// This selector targets both form containers by their ID
var $formContainer = $( '#new-term-form, #new-concept-form' );
if ( $formContainer.length ) {
$formContainer.find( 'form' ).attr( 'target', '_blank' );
}
} );