MediaWiki Extension:CharInsert

提供:すだちWiki

はじめに

CharInsertはJavaScriptリンクの作成を有効にする拡張機能です。クリックされたときに、あらかじめ定義されたテキストがtext boxに挿入されます。

導入方法

ダウンロード

  • snapshot または masterをダウンロードする。snapshotを選んだときは、次のページでMediaWikiのバージョンを選ぶ。

CharInsert-02.png

インストール

  • ダウンロードしたファイルを解凍し「extensions」にアップロードする。
  • LocalSettings.phpに下記の行を書き加える。
require_once "$IP/extensions/CharInsert/CharInsert.php";

高度なインストール

※ここに書いていることがインストールの全てだと思いますが動作するコンテンツと動作しないコンテンツがあります。「すだち自由帳」で試験設置で動作確認し「すだちWiki」に導入したのですが正常に動作しません。何かが抜けているようです。ブラウザ、キャッシュなどの影響も考えられますが、原因の解明に至っていません。

重要: Extension:Gadgets が必要です。

編集画面のテキストボックスの下に、コード入力用ソフトウェアキーボードを表示します。

/**
 * Styling for links generated by [[MediaWiki:Edittools]]
 * @source www.mediawiki.org/wiki/Extension:CharInsert#Styling
 * @updated 2012-02-29
 */
.mw-charinsert-buttons {
	margin-top: 10px;
	border: 1px solid #aaaaaa;
	padding: 1px;
	text-align: center;
	font-size: 110%;
}
.mw-charinsert-buttons a {
	color: black;
	background-color: #cde !important;
	font-weight: bold;
	font-size: .9em;
	text-decoration: none;
	border: thin #069 outset;
	padding: 0 .1em .1em;
}
.mw-charinsert-buttons a:hover,
.mw-charinsert-buttons a:active {
	background-color: #bcd;
	border-style: inset;
}
.client-js .mw-edittools-section {
	display: inline;
}
.client-js .mw-edittools-section input[type="button"] {
	font-size: 0.9em;
	padding-left: 1px;
	padding-right: 1px;
	margin-left: 1px;
}
* Edittools[ResourceLoader|default]|Edittools.js

完了

CharInsert-01.png