User:Gryllida/js/copyPageTitleToClipboard-0.2.js

/* Author : Svetlana Tkachenko svetlana@members.fsf.org Licence: GPLv3+ Description: [beta] adds 'copy title' tab that copies current page title to clipboard Version: 0.2pre Date: 2018-03-29 Changes: [x] moved link to 'tools' section of vector skin TODO: [ ] test See also . User:Gryllida/Tasks var gryllidaCopyTitle = function{ var $temp = $(" ", {       val: wgCanonicalNamespace+":"+wgTitle    }).appendTo("body"); alert($temp); $temp.select; document.execCommand("copy"); $temp.remove; }; mw.loader.using(['mediawiki.api', 'jquery.ui'], function {	"use strict";	// Copy page title to clipboard	// Code stolen from User:The Earwig/permalink.js	// Add link in 'tools' section	// Code stolen from MediaWiki:Gadget-onScreenEdit.js	mw.util.addPortletLink('p-tb', 'javascript:gryllidaCopyTitle;void%200', 'Copy title'); });