nijie_no_carousel

ニジエの「この絵で抜いた人はこんな絵でも抜いています」をカルーセルを使わずにすべて表示

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           nijie_no_carousel
// @version        0.1
// @namespace      
// @author         qa2
// @description    ニジエの「この絵で抜いた人はこんな絵でも抜いています」をカルーセルを使わずにすべて表示
// @include        http://nijie.info/view.php?id=*
// @include        https://nijie.info/view.php?id=*
// @run-at         document-end
// ==/UserScript==

(function(){
	var css ='\
	#carouselPrev-view,#carouselNext-view{display:none;}\
	#carouselWrap-view,#carouselWrap-view ul.column{height:254px;}\
	#carouselInner-view{width:auto!important;margin-left:0!important;}\
	#carouselInner-view ul.column li a img{max-width:118px;margin:0,padding:0}\
	#carouselInner-view ul.column li{width:120px;height:122px;margin-top:5px;margin-right:5px}';

	(function(csstext){
		var sheet = document.body.appendChild(document.createElement("style"))
		sheet.type="text/css";
		sheet.textContent = csstext;
		sheet.id = 'outercss';
		return sheet;
	})(css);

	function reform(node){
		view = document.evaluate('.//div[@id="carouselInner-view"]', node, null, 7, null).snapshotItem(0);
		if(view){
			ul = view.getElementsByClassName("column");
			while(ul[1]){
				list = ul[1].getElementsByTagName("li");
				while(list[0]){
					ul[0].appendChild(list[0]);
				}
				view.removeChild(ul[1]);
			}
		}
	}

	document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (evt) {
	    var node = evt.target;
	    reform(node);
	}, false);

	reform(document);
})();