// ==UserScript== // @name 煎蛋侠 // @name:en Jiandan Hero // @name:zh-TW 煎蛋俠 // @namespace hoothin // @version 1.0 // @description 为煎蛋jandan.net提供左右方向键快捷翻页、鼠标悬停显示大图、屏蔽指定用户发言等功能 // @description:en Tools for jandan.net // @description:zh-TW 為煎蛋jandan.net提供左右方向鍵快捷翻頁、鼠標懸停顯示大圖、屏蔽指定用戶發言等功能 // @author hoothin // @include http*://jandan.net/* // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @downloadURL none // ==/UserScript== (function() { 'use strict'; document.addEventListener("keydown", function(e) { if(/INPUT|TEXTAREA/.test(document.activeElement.tagName))return; switch(e.keyCode){ case 37://← var next=document.querySelector("span#nav_next>a"); if(next)next.click(); break; case 39://→ var pre=document.querySelector("span#nav_prev>a"); if(pre)pre.click(); break; } }); var authors=document.querySelectorAll("div.author"),i; for(i=0;idocument.documentElement.clientHeight/document.documentElement.clientWidth; if(type && bigImg.height>document.documentElement.clientHeight){ bigImg.height=document.documentElement.clientHeight; } if(!type && bigImg.width>document.documentElement.clientWidth){ bigImg.width=document.documentElement.clientWidth; } if(top-bigImg.height<0){ top=0; }else{ top-=bigImg.height; } if(left+bigImg.width>document.documentElement.clientWidth){ left=document.documentElement.clientWidth-bigImg.width; } bigImg.style.left=left+10+"px"; bigImg.style.top=top+"px"; } })();