reblog machine keybind
http://reblog.machine.mamemomonga.com/js/ReblogMachine.js
$(window).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), d; for (d in a.main_buttons_config) { var e = a.main_buttons_config[d]; if (e.key == b || e.key.toUpperCase() == b) { $("#btns_navi_" + d).click(); return } } b == "w" || b == "W" ? (d = $("#cb_tweet"), d.attr("checked") ? d.attr({ checked: !1 }) : d.attr({ checked: !0 }), a.model.save_tweet($("#cb_tweet").attr("checked"))) : (b == "q" || b == "Q") && $("#btn_wheelmode").click() } });
ReblogMachine.settings.prototype = { btns_navi: { next: { key: "j", type: "navi", title: "\u6b21", colors: { normal: "#333333", click: "#FF0000", hold: "#0000FF" } }, prev: { key: "k", type: "navi", title: "\u524d", colors: { normal: "#333333", click: "#FF0000", hold: "#0000FF" } }, published: { key: "t", type: "post", title: "\u516c\u958b", colors: { normal: "#333333", click: "#FF0000", hold: "#0000FF" } }, like: { key: "l", type: "like", title: "\u597d\u304d!", colors: { normal: "#333333", click: "#FF0000", hold: "#0000FF" } }, more: { key: "m", type: "more", title: "\u3055\u3089\u306b\u6f5c\u308b", colors: { normal: "#006600", click: "#FF0000", hold: "#0000FF" } } }, btns_navi_height: { small: 40, large: 74 }, post_types: "any,photo,quote,text,link,video,audio".split(","), btns_types: { colors: { normal: "#333333", click: "#FF0000", hold: "#660000" } }, btn_wheelmode: { colors: { normal: "#333333", click: "#FF0000", hold: "#660000" } } };
ReblogMachine.controller = function () { var a = this; a.currentType = ""; a.settings = new ReblogMachine.settings; a.main_buttons_config = a.settings.btns_navi; //...snip...