Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* If the page name ends in a parenthetical part after a space then
   this script makes a "Base title" link under "Tools" in the sidebar.
   The link goes to the page name without the parenthetical part.
   To use the script, add the following line to Special:MyPage/common.js:
 
importScript('User:PrimeHunter/Base title.js'); // Linkback: [[User:PrimeHunter/Base title.js]]

*/


$( document ).ready( function() {
  var pattern = /_\(.*\)$/;
  if (mw.config.get('wgPageName').search(pattern) > 0) {
    mw.util.addPortletLink(
      'p-tb',
      mw.util.getUrl( mw.config.get('wgPageName').replace(pattern,'') ),
      'Base title',
      't-basetitle',
      'Title without parenthetical part: ' + mw.config.get('wgPageName').replace(pattern,'').replace('_',' '),
      null,
      '#t-info'
    );
  }
});