ã¾ ã ã ã® ã ã¿ ã
ã¯ã。ã¾ããã®ãã¿ã§ã。
ã³ã¼ãã¯ä»¥ä¸ã®ã¨ãã。
å¾ã§、userscriptsã¸æ稿ãã¾ã。
ä¾ã®ãã¨ãOperaã§ããåä½ç¢ºèªãã¦ãã¾ãã。
qãã¼ã§åã®ã¤ã©ã¹ã
wãã¼ã§æ¬¡ã®ã¤ã©ã¹ã
bãã¼ã§ããã¯ãã¼ã¯
å é ã®ãã¼ã¸ã§å¤ååãããªã«ã·ã¯ãªããã©、æ°ã«ããªã(ï¾ï¾
ã¯ã。ã¾ããã®ãã¿ã§ã。
ã³ã¼ãã¯ä»¥ä¸ã®ã¨ãã。
å¾ã§、userscriptsã¸æ稿ãã¾ã。
ä¾ã®ãã¨ãOperaã§ããåä½ç¢ºèªãã¦ãã¾ãã。
qãã¼ã§åã®ã¤ã©ã¹ã
wãã¼ã§æ¬¡ã®ã¤ã©ã¹ã
bãã¼ã§ããã¯ãã¼ã¯
å é ã®ãã¼ã¸ã§å¤ååãããªã«ã·ã¯ãªããã©、æ°ã«ããªã(ï¾ï¾
// ==UserScript==
// @name piapro
// @namespace http://looxu.blogspot.com/
// @include http://piapro.jp/content/*
// @author Arc Cosine
// @version 1.0
// ==/UserScript==
// License Public Domain
(function(){
var PIAPRO = {
init : function(){
window.addEventListener('keypress', function(e){
PIAPRO.addKeyBind( 'b', function(){ PIAPRO.bookMark(); }, e);
PIAPRO.addKeyBind( 'q', function(){ PIAPRO.moveLink(0); }, e);
PIAPRO.addKeyBind( 'w', function(){ PIAPRO.moveLink(1); }, e);
},false);
},
addKeyBind : function( keyChar, func, eve ){
var t=eve.target;
var n=t.tagName.toLowerCase();
if( t.nodeType != 1 || n == 'input' || n == 'textarea' ){
return;
}
var pressKey = eve.which;
keyChar = (keyChar=='Enter') ? 13 : keyChar.charCodeAt(keyChar);
if( pressKey == keyChar ){
eve.preventDefault(); //Stop Default Event
func.apply();
}
},
bookMark : function(){
var url = 'http://piapro.jp/bookmark/';
var id = location.href.match(/content\/(.*)/)[1];
var cont_id = document.getElementsByName('content_type_id')[0].value;
var param = 'mode=add&id=' + id + '&content_type_id=' + cont_id + '&folder_id=0';
var xhr = new XMLHttpRequest();
xhr.open( 'POST', url, false );
xhr.onreadystatechange = function(){
if( xhr.status == 200 && xhr.readyState == 4 ){
location.reload();
}
}
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xhr.send( param );
},
moveLink : function(mode){
var imgs = document.querySelectorAll('#main_in680 div.mt10 div div a img');
var target = [];
for( var i=0, l=imgs.length; i<l; i++ ){
if( /gen/.test(imgs[i]['src']) ){
target.push(imgs[i].parentNode);
}
}
var link = target[mode];
if( typeof link != 'undefined' ){
location.href = link;
}
}
};
PIAPRO.init();
})();
ã³ã¡ã³ã
ã³ã¡ã³ããæ稿