Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Rgrong Shortcut Overrider
- // @namespace http://rgrong.net/
- // @version 0.1
- // @match http://rgr.kr/*
- // @match http://rgrong.net/*
- // @match http://rgrong.com/*
- // @match http://rgrong.kr/*
- // @match http://rgrong.co.kr/*
- // @match http://miniti.co.kr/*
- // @match http://miniti.net/*
- // @match http://te31.net/*
- // @match http://te31.co.kr/*
- // @match http://te31.kr/*
- // @match http://te31.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- document.onkeypress = (function(g) {
- var words = [
- {text : '1', url : '/rgr/zboard.php?id=rgrong'},
- {text : '2', url : '/rgr/zboard.php?id=rare2014'},
- {text : '0', url : '/rgr/zboard.php?id=100'},
- {text : '4', url : '/rgr/zboard.php?id=sports'},
- {text : 'Y', url : '/rgr/zboard.php?id=loveqa1'},
- {text : 'y', url : '/rgr/zboard.php?id=loveqa1'},
- {text : '6', url : '/rgr/zboard.php?id=plaza'},
- {text : '7', url : '/rgr/zboard.php?id=18news'},
- {text : '8', url : '/rgr/zboard.php?id=pcclub'},
- {text : '9', url : '/rgr/zboard.php?id=yonye'},
- {text : 'h', url : '/rgr/zboard.php?id=hearthstone'},
- {text : 'H', url : '/rgr/zboard.php?id=hearthstone'},
- {text : 'w', url : '/rgr/zboard.php?id=multi2'},
- {text : 'o', url : '/rgr/zboard.php?id=coc'},
- {text : 'N', url : '/rgr/zboard.php?id=pad'},
- {text : 'n', url : '/rgr/zboard.php?id=pad'},
- {text : 'p', url : '/rgr/zboard.php?id=iphone'},
- {text : 'P', url : '/rgr/zboard.php?id=iphone'},
- {text : 's', url : '/rgr/zboard.php?id=sports2'},
- {text : 'l', url : '/rgr/zboard.php?id=maple'},
- {text : 'b', url : '/rgr/zboard.php?id=vehicle1'},
- {text : 'f', url : '/rgr/zboard.php?id=ganzi'},
- {text : 'm', url : '/rgr/zboard.php?id=ma9'},
- {text : '3', url : '/rgr/zboard.php?id=sgm1'},
- {text : '[', url : '/rgr/zboard.php?id=maple'},
- {text : 'd', url : '/rgr/zboard.php?id=diablo'},
- {text : 'e', url : '/rgr/zboard.php?id=animation'},
- {text : 'j', url : '/rgr/zboard.php?id=hair'},
- {text : 'i', url : '/rgr/newmain.php?by=3'},
- {text : 't', url : '/rgr/newmain.php?by=9'},
- {text : '`', url : '#re'},
- {text : 'g', url : '/rgr/zboard.php?id=royal'},
- {text : 'G', url : '/rgr/zboard.php?id=royal'},
- {text : 'K', url : '/rgr/zboard.php?id=df1'},
- {text : 'k', url : '/rgr/zboard.php?id=df1'},
- {text : '5', url : '/rgr/zboard.php?id=car'},
- {text : 'z', url : '/rgr/zboard.php?id=ufc'},
- {text : 'Z', url : '/rgr/zboard.php?id=ufc'},
- {text : 'Q', url : 'http://tagme.to/tagme@te31/'},
- {text : 'q', url : 'http://tagme.to/tagme@te31/'},
- {text : 'W', url : '/rgr/zboard.php?id=multi2'},
- {text : 'O', url : '/rgr/zboard.php?id=coc'},
- {text : 'S', url : '/rgr/zboard.php?id=sports2'},
- {text : 'L', url : '/rgr/zboard.php?id=lol'},
- {text : 'B', url : '/rgr/zboard.php?id=vehicle1'},
- {text : 'F', url : '/rgr/zboard.php?id=ganzi'},
- {text : 'M', url : '/rgr/zboard.php?id=ma9'},
- {text : 'D', url : '/rgr/zboard.php?id=diablo'},
- {text : 'E', url : '/rgr/zboard.php?id=animation'},
- {text : 'J', url : '/rgr/zboard.php?id=hair'},
- {text : 'u', url : '/rgr/zboard.php?id=vehicle'},
- {text : 'U', url : '/rgr/zboard.php?id=vehicle'},
- {text : 'I', url : '/rgr/newmain.php?by=3'},
- {text : 'T', url : '/rgr/newmain.php?by=9'},
- {text : 'A', url : 'http://rgr.kr/w/index.html'},
- {text : 'a', url : 'http://rgr.kr/w/index.html'},
- {text : 'X', url : 'javascript:error()'},
- {text : 'x', url : 'javascript:error()'},
- {text : 'r', url : document.location},
- {text : 'R', url : document.location}
- ], input = 0, matches = [];
- function filter(c) {
- for (var i = 0, j = 0, n = matches.length; i < n; ++i) {
- if (matches[i].charAt(input) == c) {
- matches[j++] = matches[i];
- }
- }
- return j;
- }
- function getCharacter(e) {
- var c = NaN;
- if (!e) {
- e = g.event;
- }
- if (e) {
- if (e.which) {
- c = e.which;
- } else if (e.keyCode) {
- c = e.keyCode;
- }
- if (c) {
- return String.fromCharCode(c);
- }
- }
- }
- function reset() {
- for (var i = 0, n = words.length; i < n; ++i) {
- matches[i] = words[i].text;
- }
- input = 0;
- }
- reset();
- return function(e) {
- if (!e) {
- var e = window.event;
- if ((e.srcElement.tagName == 'INPUT') || (e.srcElement.tagName == 'TEXTAREA')) return;
- } else if ((e.target.tagName == 'INPUT') || (e.target.tagName == 'TEXTAREA')) return;
- var c = getCharacter(e), i, l, m, n;
- if (c) {
- if (!(n = filter(c))) {
- reset();
- n = filter(c);
- }
- if ((1 == n) && ((m = matches[0]).length == ++input)) {
- for (i = 0, l = words.length; i < l; ++i) {
- if (words[i].text == m) {
- location.href = words[i].url;
- break;
- }
- }
- } else {
- matches.length = n;
- }
- }
- };
- })(this);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement