MediaWiki:Gadget-copyCategoryMembers.js

$(function {	wgNamespace = mw.config.get('wgCanonicalNamespace');	if (wgNamespace != 'Category') return;	$(mw.util.addPortletLink('p-cactions', 'javascript:;', '!Copy Members', 'ca-copy-cat-members', 'Copy Category Members', null, '#ca-move-to-user')).click(function { a = new mw.Api; a.get({			action : 'query',			list : 'categorymembers',			cmtitle : mw.config.get('wgPageName'),			cmlimit : 'max'		}).then(function(data) {			tbl = [];			for (page in data.query.categorymembers) {				tbl.push(data.query.categorymembers[page].title);			}			var str = tbl.join('\n');			var el = document.createElement('textarea');			el.value = str;			el.setAttribute('readonly', '');			$(el).insertAfter('#contentSub');			el.select;		}); }); });