Skip to content

Instantly share code, notes, and snippets.

@miyukki
Created May 2, 2012 08:48
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save miyukki/2575225 to your computer and use it in GitHub Desktop.
Save miyukki/2575225 to your computer and use it in GitHub Desktop.
ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// ==UserScript==
// @name ZeroFix
// @namespace applest.net
// @version 0.9
// @description ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// @include http://www.nicovideo.jp/watch/*
// @license MIT License(http://en.wikipedia.org/wiki/MIT_License)
// ==/UserScript==
/*********************************************
* 右上の[raw]をクリックしてダウンロード開始 *
*********************************************/
/*
本コードの著作権は@toriimiyukkiにあります。
本ソフトウェアのライセンスは MIT License(http://en.wikipedia.org/wiki/MIT_License) とします。
*/
(function() {
var $ = function(name) { return document.querySelector(name); }
// タイトルの縮小
$('.videoDetailExpand').getElementsByTagName('h2')[0].style.fontSize = '180%';
$('.videoDetailExpand').style.height = 'auto';
// タグの複数段表示
$('.filter').parentNode.removeChild($('.filter'));
// 市場エリアをpopStateによるページ遷移に対応するため、タイトルが変わったのをトリガーにする(あまりよろしくない)
var now_title = "";
setInterval(function(){
if(now_title == "" || $('#videoInfo .videoTitleText').textContent != now_title){
// 市場エリアを投稿者情報に
/// 市場の撤去
while($('#ichibaPanel').firstChild){
$('#ichibaPanel').removeChild($('#ichibaPanel').firstChild);
}
/// 投稿者情報の表示
$('#ichibaPanel').appendChild($('#videoInfoHead').cloneNode(true));
$('#ichibaPanel').appendChild($('#videoStats').cloneNode(true));
$('#ichibaPanel').appendChild($('#hiddenUserProfile').cloneNode(true));
$('#ichibaPanel').appendChild($('#userProfile').cloneNode(true));
$('#ichibaPanel').appendChild($('#videoShareLinks').cloneNode(true));
$('#ichibaPanel #videoInfoHead').style.backgroundColor = '#F6F6F6';
$('#ichibaPanel #videoInfoHead').style.border = '1px solid #CCCCCC';
$('#ichibaPanel #videoInfoHead').style.borderRadius = '3px';
$('#ichibaPanel #videoInfoHead').style.padding = '5px';
$('#ichibaPanel #videoStats').style.backgroundColor = '#F6F6F6';
$('#ichibaPanel #videoStats').style.border = '1px solid #CCCCCC';
$('#ichibaPanel #videoStats').style.borderRadius = '3px';
$('#ichibaPanel #videoStats').style.padding = '5px';
$('#ichibaPanel #userProfile').style.backgroundColor = '#F6F6F6';
$('#ichibaPanel #userProfile').style.border = '1px solid #CCCCCC';
$('#ichibaPanel #userProfile').style.borderRadius = '3px';
$('#ichibaPanel #userProfile').style.padding = '5px';
$('#ichibaPanel .userIcon').style.width = '64px';
$('#ichibaPanel .userIcon').style.height = '64px';
now_title = $('#videoInfo .videoTitleText').textContent;
}
}, 1000);
// コメント入力エリアを下に
$('#textMarquee').style.height = '100px';
$('.textMarqueeOuter').style.marginTop = '10px';
$('.handler').parentNode.removeChild($('.handler'));
$('.commentInner').style.width = 'auto';
$('.commentOuter').style.cssText = 'display: block !important; opacity: 1 !important;';
$('#textMarquee').insertBefore($('.commentInner'), $('.textMarqueeOuter'));
$('.commentOuter').className = 'commentOuter2';
$('.commandInput').getElementsByTagName('input')[0].style.color = '#fff';
$('.commentInput').getElementsByTagName('input')[0].style.color = '#fff';
// フェードを無効化
$('.lightControllFilter').parentNode.removeChild($('.lightControllFilter'));
})();
@gwinjp
Copy link

gwinjp commented May 4, 2012

ザッピング視聴に応じた動画情報の更新実装ありがとうございます。

@yahei
Copy link

yahei commented May 5, 2012

mitsuki08さん
横から失礼します。
私の方でも動画によって複数段にならないことがあったので勝手に修正してみました。
こんな感じでどうですか?
https://gist.github.com/2603304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment