Warning: You take full responsibility for any action you perform using PasteToCommons. You must read and understand Wikipedia policies and use this tool within these policies, or risk being blocked from editing. |
Description | Upload an image to Commons from anywhere on the site by pasting it |
---|---|
Updated | November 4, 2023 (12 months ago) |
Browsers | Chrome, Firefox, etc. |
Source | User:Nardog/PasteToCommons.js |
If you paste an image by Ctrl+V (or ⌘ Cmd+V or whatever depending on your OS) on any page on the site while this script is installed, a dialog will show up that allows you to upload it to Wikimedia Commons. This is to allow easier uploading and sharing of screenshots of the site.
Installation
editAdd the following to your common.js:
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/PasteToCommons.js&action=raw&ctype=text/javascript');
Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.
Usage
editThe default values for the description are based on the instructions at Wikipedia:Screenshots of Wikipedia . You may override them in your common.js using the following syntax:
window.pastetocommonsDefaults = {
filename: 'en.wikipedia.org Page Name yyyy-mm-dd',
description: 'Screenshot of the English Wikipedia',
source: 'Screenshot',
author: 'Wikipedia Authors, see the history of [[w:Page Name]]',
license: '{{Wikipedia-screenshot|1=en}}'
};
Caveats
editThe names of the site and the page on which you pasted the file will be published in the upload summary (separate from the filename/description).
This script employs hacks that may cease to work upon upstream code change.