Last active
November 3, 2015 17:41
-
-
Save KurohimeAkari/76a5a9127fa795f1d961 to your computer and use it in GitHub Desktop.
失敗作品:動くことには動く
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name niconico not clear tag | |
// @description タグ修正戦争が見てて(´・ω・`)な気持ちになるので | |
// @namespace http://shioneko.sakura.ne.jp/ | |
// @version 1.1.0 | |
// @include http://www.nicovideo.jp/watch/* | |
// @require http://code.jquery.com/jquery-2.1.4.min.js | |
// ==/UserScript== | |
// ページ移動反映処理ができない | |
$(function() { | |
//[ 非表示コンテンツ 一部一致でも消えるみたい]----------------// | |
var arycase = ["マリオメーカー問題","荒らし","タグ戦争"]; | |
//------------------------------------------------------// | |
var categories = $(".videoHeaderTag .videoHeaderTagLink"); | |
var tagUrl = "http://www.nicovideo.jp/tag/"; | |
var wiki_f = '<div class="tagControlContainer"><div class="dic"><a href="http://dic.nicovideo.jp/a/'; | |
var wiki_b = '"><span class="enable"></span></a></div></div>' | |
var num = false; | |
// 削除処理 | |
$('.videoHeaderTag').remove(); | |
$.each( | |
categories, | |
function(index, domEle) { | |
var ele = $(domEle); | |
var texts = $.trim(ele.text()); | |
// arycaseから文字列処理:matchしたものだけ表示 | |
//for (var i = 0; i < arycase.length; i++) { | |
for (var i = 0; i < arycase.length; i++) { | |
reg = new RegExp(arycase[i]); | |
if(texts.match(reg)){ | |
num = true; | |
break | |
} else { | |
num = false; | |
} | |
}; | |
if (num == false){ | |
$('#videoHeaderTagList').append(num); | |
$('#videoHeaderTagList').append('<li class="videoHeaderTagLink"><a href="'+ tagUrl + texts +'" target="new">' + texts + '</a>'+ wiki_f + texts + wiki_b +'</li>'); | |
} | |
}); | |
// なんだか残る要素を削除する。 | |
$('.videoHeaderTagLink:last-child').remove(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment