User:DaxServer/test1.js

// mw.hook( 'wikipage.content' ).add( function {    let articleName = mw.config.get('wgPageName');	articleName = encodeURIComponent(articleName); // fix bug involving & not getting converted to &amp;	let pageIsSandbox = articleName.match(/sandbox$/);    $.when( /**        * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor. * @see TemplateScript * @update-token */       mw.loader.using( [ '//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js' ] ), $.ready ).then( function { console.log('Add templatescript'); pathoschild.TemplateScript.add({           category: 'Being nice',            name: 'Welcome',            template: ' ~',            position: 'after',            editSummary: 'Welcome!',            forNamespaces: 'user talk'        }); } );

// Only on main namespace or sandbox // Only initiate in edit or submit mode if (           ! [0, 2].includes(mw.config.get('wgNamespaceNumber'))        ||  ! pageIsSandbox        ||  ! ['edit', 'submit'].includes(mw.config.get('wgAction'))    ) { return; }

$.when(       /**         * TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.         * @see TemplateScript         * @update-token          */        mw.loader.using( [ 'mediawiki.util', '//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js' ] ),        $.ready    ).then( function  {        let node = mw.util.addPortletLink('p-tb', '#', 'Book to Sfn', 'ds-book-to-sfn', 'Convert cite book to Sfn');

$( node ).click(function {            alert        }) } );

}); //