M01 Gallery List View
- 自動展開貼圖,並條列顯示
- 除第一頁之外,皆自動移除圖片區塊
2011-04-09 加入頁碼判斷
2011-04-09 基本架構完成
// ==UserScript==
// @name M01 Gallery List View
// @description M01 Gallery List View
// @version 2011-04-09
// @include http://www.mobile01.com/gallerydetail.php*
// @include https://www.mobile01.com/gallerydetail.php*
// ==/UserScript==
var pageIndex = parseInt(location.search.replace(/\?.*&p=(\d+)/,'$1'),10);
var gallery = document.getElementById('gallery_tl');
var gContent=document.getElementsByClassName('gallery_content')[0];
if (pageIndex >1)
gallery.parentNode.removeChild(gallery);
else
{
var imgs=gallery.querySelectorAll('img');
var tmp='<img src="@src" /><br />';
var newHTML='';
for(var i=0;i<imgs.length;i++)
newHTML+=tmp.replace('@src',imgs[i].src).replace('thumb','mobile01');
gallery.innerHTML=newHTML;
}
gContent.parentNode.removeChild(gContent);