User:Enterprisey/magic-talk-editnotices.js

if( mw.config.get( "wgNamespaceNumber" ) === 5 || mw.config.get( "wgNamespaceNumber" ) === 13 ) { mw.loader.using( [ "mediawiki.api.category" ], function {        new mw.Api.getCategories( mw.config.get( "wgPageName" ).replace( "_talk:", ":" ) ).then( function ( projectPageCats ) { var isTargetCat = function ( categoryObject ) { return categoryObject.title === "Wikipedia_information_pages"; }; if( projectPageCats.some( isTargetCat ) ) { console.log( "Detected that we're on the talk page of a page in Category:Wikipedia information pages." ); document.querySelectorAll( '.mw-editsection > a, #ca-edit > span > a' ) .forEach( function ( editLink ) {                       editLink.setAttribute( "href", editLink.getAttribute( "href" ) + "&editintro=Template:Wikipedia_information_pages_talk_page_editnotice");                   } ); }       } );    } ); }