User:C.Syde65/common.js

$(function addTalkButton {

var config = mw.config.get([       'wgTitle',        'wgNamespaceNumber',        'wgCanonicalNamespace',    ]); if (config.wgNamespaceNumber == '0') { var talkButtonLink = '/wiki/Talk:' + config.wgTitle; } else { var talkButtonLink = '/wiki/' + config.wgCanonicalNamespace + '_talk:' + config.wgTitle; };   var $talkButton = $('').attr({        'class': 'wds-button wds-is-squished wds-is-secondary',        'href': talkButtonLink,        'id': 'custom-talk-button'    }); var $talkButtonIcon = $(' '); var $talkButtonText = $(' Talk ');

$($talkButton).append($talkButtonIcon, $talkButtonText).insertBefore('#ca-edit'); $('#custom-talk-button').css('margin-right', '10px'); $('#ca-talk').remove; if ( wgNamespaceNumber === 1 ,3, 5, 7, 9, 11, 13, 15, 111, 421, 503, 829 ) { return; } });