User:Shahadat/CopyCodeBlock
Jump to navigation
Jump to search
Description | Adds a button to copy the content of each code block (<pre> ) |
---|---|
Updated | November 24, 2023 (8 months ago) |
Browser support | Chrome, Firefox, etc. |
Source | User:Shahadat/CopyCodeBlock.js |
This script adds a button at the top right corner of each code block (created in wikitext via <pre>...</pre>
, <syntaxhighlight>...</syntaxhighlight>
, or a line beginning with a space, or the entirety of a Lua, CSS, or JavaScript page) that only shows up when your mouse cursor is inside the block and copies the content of the block when clicked.
Installation
- Method 1
Get ScriptInstaller, then navigate to User:Shahadat/CopyCodeBlock.js and click "Install" at the top.
- Method 2
- Place
{{subst:iusc|User:Shahadat/CopyCodeBlock.js}}
on Special:MyPage/common.js or a skin-specific page, like Special:MyPage/vector.js. - Press "Publish Changes"
Script Attribution
![]() | This script was manually imported from Wikipedia in compliance with their CC-BY-SA license. This script is utilized either partially or in full, incorporating corrections, modifications, or imported from the original script. For details regarding the original script and its creator, please refer to the following link: https://en.wikipedia.org/wiki/User:Nardog/CopyCodeBlock |