利用者:本日晴天/SockInfo.js

お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。

多くの WindowsLinux のブラウザ

  • Ctrl を押しながら F5 を押す。

Mac における Safari

  • Shift を押しながら、更新ボタン をクリックする。

Mac における ChromeFirefox

  • Cmd Shift を押しながら R を押す。

詳細についてはWikipedia:キャッシュを消すをご覧ください。

/*
[[Wikipedia:管理者伝言板/投稿ブロック/ソックパペット]]において
各系統ごとに未対処の案件を数え、結果に応じて
{{進捗}}に相当するものを{{SockInfo}}に挿入する。
未対処の案件があれば{{SockActiveList}}の該当するリンクを強調し、案件数を
表示する。

このスクリプトはCC0 1.0 全世界で利用可能です。
https://creativecommons.org/publicdomain/zero/1.0/deed.ja

*/

( function() {
	var re = /Wikipedia:管理者伝言板\/投稿ブロック\/ソックパペット/;
	if ( ! re.test( mw.config.get( "wgPageName" ) ) ) {
		return;
	}
	
	$( function () {
		$(".sockinfo_active").each( function () {
			var status_color = '#0C0', status_text = '済';
			var doing_count = $( ".sock_report span.doing", this ).length;
			if ( doing_count > 0 ) {
				status_color = '#CCC';
				status_text = '進行中';
				var result = this.id.match(/^SockInfo_(.+)$/);
				if ( result ) {
					$( '#SockActiveList_' + result[1] + ' a' )
						.css( 'background', '#fdd' )
						.css( 'font-weight', 'bold' )
						.after('&nbsp;<sup style="font-weight: bold;">'
							+ doing_count
							+ '</sup>'
							);
				}
			}
			$( ".sock_status", this ).append( '<span style="background:'
				+ status_color
				+ ';">&emsp;&emsp;</span> <b>'
				+ status_text
				+ '</b>'
				);
		} );
	} );
} )();