[Konachan] Tagging: Verify Tags

Adds "Verify tags" to the tags utility bar on the upload and post pages. Clicking "Verify tags" moves any tags not in use on the site to a separate textbox. Moved tags will be ignored on submission.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name		[Konachan] Tagging: Verify Tags
// @namespace	Zolxys
// @description	Adds "Verify tags" to the tags utility bar on the upload and post pages.  Clicking "Verify tags" moves any tags not in use on the site to a separate textbox.  Moved tags will be ignored on submission.
// @include		/^https?://konachan\.(com|net)/post/(upload/?($|\?|#)|show/\d+($|[/?#]))/
// @version		1.4
// ==/UserScript==
var o = document.getElementById('post_tags');
var ne = document.createElement('div');
ne.id = ('zol_unused_tags_d');
ne.style.display = 'none';
ne.textContent = 'Unused Tags:';
o.parentNode.insertBefore(ne,o.nextSibling);
o = o.cloneNode(false);
o.id = ('zol_unused_tags');
o.name = o.id;
ne.appendChild(o);
o = ne.parentNode;
ne = document.createElement('script');
ne.setAttribute('type','text/javascript');
ne.innerHTML = String(function zol_verify_tags(){
	if (!TagCompletion.loaded) {
		TagCompletion.load_data(zol_verify_tags);
		return;
	}
	var t = document.getElementById('post_tags')
	var u = document.getElementById('zol_unused_tags');
	var a = t.value.toLowerCase().replace(/[,;`]/g,'').split(/[\s]/);
	t.value = '';
	for (var i = 0; i < a.length; ++i) {
		if (a[i] == '')
			continue;
		if (/^((char(acter)?|artist|copy(right)?):.+)?$/.test(a[i]) || TagCompletion.tag_data.indexOf('`'+ a[i] +'`') != -1)
			t.value += a[i] +' ';
		else
			u.value += ' '+ a[i];
	}
	document.getElementById('zol_unused_tags_d').style.display = '';
});
document.head.appendChild(ne);
o.appendChild(document.createTextNode(' | '));
ne = document.createElement('a');
ne.textContent = 'Verify tags';
//ne.setAttribute('onclick','zol_verify_tags(); return false;');
ne.href = 'javascript:zol_verify_tags();';
o.appendChild(ne);