twitcasting_collapse_comment

Collapse comment on Twitcasting.

目前為 2016-01-23 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        twitcasting_collapse_comment
// @namespace   http://catherine.v0cyc1pp.com/twitcasting_collapse_comment.user.js
// @include     http://twitcasting.tv/*
// @version     1.0
// @require     http://code.jquery.com/jquery-2.1.4.min.js
// @grant       none
// @run-at      document-end
// @description Collapse comment on Twitcasting.
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);


//console.log("twitcasting_collapse_comment start");

this.$ = this.jQuery = jQuery.noConflict(true);


function main() {
	var attr = $("div#navibox").attr("abcde");
	if( typeof attr !== 'undefined' && attr !== false ){
	} else {
		$("div#navibox").attr("abcde","twitcasting_collapse_comment");
		$("div#navibox").before('<div margin-top: 0px; margin-bottom: 0px;" width="320" frameborder="0" height="420" onclick="obj=document.getElementById(\'navibox\').style; obj.display=(obj.display==\'none\')?\'block\':\'none\';"><center><a style="cursor:pointer;">コメントエリア (クリックで展開)</a></center></div>');
		$("div#navibox").attr("style","display:none;clear:both;");
	}
};


var observer = new MutationObserver(function(mutations) {
    observer.disconnect();
    main();
    observer.observe( document, config);
});
 
var config = { attributes: false, childList: true, characterData: false, subtree:true }
 
observer.observe( document, config);