Jump to content

Extension:ClipBox

From mediawiki.org
MediaWiki extensions manual
ClipBox
Release status: stable
Implementation Tag
Description embed inputbox to copy text for clipboard e.g. campaign code
Author(s) Kimagurenote (Corytalk)
Latest version 1.0.0
MediaWiki 1.25+
Database changes No
License BSD 3-clause "Modified" License
Download https://kimagurenote.net/kn/ClipBox#Download
https://kimagurenote.net/kn/ClipBox#History
Example https://kimagurenote.net/kn/ClipBox#Example_%E4%BD%BF%E7%94%A8%E4%BE%8B
‎<clipbox>

The ClipBox extension provides a way to embed inputbox to copy text for clipboard e.g. campaign code.

Installation

[edit]
  • Download zip file from author's website, unzip it and place the file(s) in a directory called ClipBox in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    /* Extension:ClipBox */
    wfLoadExtension( 'ClipBox' );
    
  • Add the following code at the bottom of your MediaWiki:Common.css. You can fully customize it.
/* Extension:ClipBox */
.clipbox {
	font-size: 16px;
	color: #333;
	align-items: center;
}
.clipbox input {
	padding: 7px 0;
	text-align: center;
	border-radius: 5px;
	font-size:14px;
	letter-spacing:1px;
}
.clipbox button {
	font-size: 16px;
	padding: 9px;
	border-radius: 5px;
	color:#444;
}
.clipbox button:hover {
	opacity: 0.8;
}
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
You will need interface-admin permission to edit Common.css on MediaWiki 1.32 or above.

Usage

[edit]

embed simply

[edit]

Just embed an inputbox and button simply. For example:

<clipbox>MYCODE</clipbox>

parameters

[edit]

You can specify some parameters. For example:

<clipbox
	id="mycampaign"
	size="15"
	title="My campaign code"
	input="readonly"
	style="text-align: center;">
MYCODE
</clipbox>

You can specify id, size, style and title.

id and size are applied ‎<input> directly.

style and title are applied ‎<div> directly.

And you can specify input="readonly" for suppress to edit inputbox by user.

If you use two or more ‎<clipbox> tags in same page, you must set different id on all tags.

Notes

[edit]

This extension will not work on browsers disabled JavaScript.

See also

[edit]