Mobile01 image shower collocate with AutoPagerize

可搭配AutoPagerize使用的Mobile01 image shower

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name           Mobile01 image shower collocate with AutoPagerize
// @namespace      MA
// @description    可搭配AutoPagerize使用的Mobile01 image shower
// @include        https://www.mobile01.com/topicdetail.php*
// @include        http://www.mobile01.com/topicdetail.php*
// @include        https://www.mobile01.com/waypointtopicdetail.php*
// @include        http://www.mobile01.com/waypointtopicdetail.php*
// @version        0.02
// ==/UserScript==

function LoadAttachImage()
{
	var img,i,imgLength;

	img=document.getElementsByName('attachimg');
	imgLength=img.length;
	for(i=0;i<imgLength;i++)
	{
		img[0].innerHTML='<img src="http://attach.mobile01.com/attach/'+img[0].id+'" border="0">';
		img[0].removeAttribute('name');
	}

	img=document.getElementsByName('waypointimg');
	imgLength=img.length;
	for(i=0;i<imgLength;i++)
	{
		img[0].innerHTML='<img src="http://attach.mobile01.com/waypoint/'+img[0].id+'" border="0">';
		img[0].removeAttribute('name');
	}
}
//以下兩行感謝shyangs at ptt.cc的提供XDD
LoadAttachImage();
window.addEventListener('AutoPagerize_DOMNodeInserted',function(){LoadAttachImage();},false);