「利用者:Y-dash/Scripts/InsertBlockReasonOther.js」の版間の差分

削除された内容 追加された内容
Y-dash (会話 | 投稿記録)
+1
Y-dash (会話 | 投稿記録)
m ++
4行目: 4行目:
var options = [
var options = [
'{{blocked proxy}}',
'{{blocked proxy}}',
'{{blocked proxy}} <!-- Web Proxy -->',
'{{blocked proxy}} &lt;!-- Web Proxy --&gt;',
'{{range block/spmode}} &lt;!-- [[Wikipedia:投稿ブロック依頼/spmode.ne.jp 追認]]での合意に基づく --&gt;',
'[[WP:ILLEGIT]]',
'[[WP:ILLEGIT]]',
'[[WP:SCRUTINY]]',
'[[WP:SCRUTINY]]',

2019年7月10日 (水) 16:54時点における版

$(function() {
	if( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Block' ) {
		// wpReason-otherへの挿入候補
		var options = [
			'{{blocked proxy}}',
			'{{blocked proxy}} &lt;!-- Web Proxy --&gt;',
			'{{range block/spmode}} &lt;!-- [[Wikipedia:投稿ブロック依頼/spmode.ne.jp 追認]]での合意に基づく --&gt;',
			'[[WP:ILLEGIT]]',
			'[[WP:SCRUTINY]]',
			'LTA',
			'[[LTA:203]]',
			'[[LTA:ASPE]]',
			'[[LTA:GRIMM]]',
			'[[LTA:HAT]]',
			'[[LTA:ISECHIKA]]',
			'[[LTA:TAROSU]]',
			'VIP',
			'[[Wikipedia:進行中の荒らし行為#リダイレクト・曖昧さ回避の乱造_(初出106.186.48.128)]]'
		];

		// select要素の生成
		var select = '<select id="insert-block-reason-other" style="height: 37.75px; width: 755.19px;"><option selected>-</option>';
		options.forEach( function( option ) {
			select += '<option>' + option + '</option>';
		});
		select += '</select>';

		// つっこむ
		$( '#mw-input-wpReason-select' ).after( select );

		// イベントつける
		$( '#insert-block-reason-other' ).change( function() {
			$( '.oo-ui-inputWidget-input[name="wpReason-other"]' ).val( $(this).val() );
		});
	}
});