Skip to content

Instantly share code, notes, and snippets.

@taizooo
Created March 2, 2012 16:16
Show Gist options
  • Save taizooo/1959402 to your computer and use it in GitHub Desktop.
Save taizooo/1959402 to your computer and use it in GitHub Desktop.
reblog machine で "o" キーで tumblelog を、"r"キーで reblog ページを開く
// ==UserScript==
// @name reblogMachineOpenDoor.user.js
// @namespace http://taizooo.tumblr.com/
// @include http://reblog.machine.mamemomonga.com/dashboard*
// ==/UserScript==
location.href = 'javascript:(' +
function () {
(function (w) {
$(w).keypress(function (b) {
if (!b.ctrlKey && (b.which == 32 || 65 <= b.which && b.which <= 90 || 97 <= b.which && b.which <= 122)) {
var b = String.fromCharCode(b.which);
if (b == 'o') {
w.open($('a#avatar_tumblelog')[0].href);
} else if (b == 'r') {
w.open($('a#btns_pfunc_t_reblog')[0].href);
}
}
});
})(window)
}.toString() + ')()';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment