Advertisement
Guest User

Untitled

a guest
Jun 21st, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Rgrong Shortcut Overrider
  3. // @namespace    http://rgrong.net/
  4. // @version      0.1
  5. // @match        http://rgr.kr/*
  6. // @match        http://rgrong.net/*
  7. // @match        http://rgrong.com/*
  8. // @match        http://rgrong.kr/*
  9. // @match        http://rgrong.co.kr/*
  10. // @match        http://miniti.co.kr/*
  11. // @match        http://miniti.net/*
  12. // @match        http://te31.net/*
  13. // @match        http://te31.co.kr/*
  14. // @match        http://te31.kr/*
  15. // @match        http://te31.com/*
  16. // @grant        none
  17. // ==/UserScript==
  18.  
  19. (function() {
  20.     'use strict';
  21.     document.onkeypress = (function(g) {
  22.         var words = [
  23.             {text : '1', url : '/rgr/zboard.php?id=rgrong'},
  24.             {text : '2', url : '/rgr/zboard.php?id=rare2014'},
  25.             {text : '0', url : '/rgr/zboard.php?id=100'},
  26.             {text : '4', url : '/rgr/zboard.php?id=sports'},
  27.             {text : 'Y', url : '/rgr/zboard.php?id=loveqa1'},
  28.             {text : 'y', url : '/rgr/zboard.php?id=loveqa1'},
  29.             {text : '6', url : '/rgr/zboard.php?id=plaza'},
  30.             {text : '7', url : '/rgr/zboard.php?id=18news'},
  31.             {text : '8', url : '/rgr/zboard.php?id=pcclub'},
  32.             {text : '9', url : '/rgr/zboard.php?id=yonye'},
  33.             {text : 'h', url : '/rgr/zboard.php?id=hearthstone'},
  34.             {text : 'H', url : '/rgr/zboard.php?id=hearthstone'},
  35.             {text : 'w', url : '/rgr/zboard.php?id=multi2'},
  36.             {text : 'o', url : '/rgr/zboard.php?id=coc'},
  37.             {text : 'N', url : '/rgr/zboard.php?id=pad'},
  38.             {text : 'n', url : '/rgr/zboard.php?id=pad'},
  39.             {text : 'p', url : '/rgr/zboard.php?id=iphone'},
  40.             {text : 'P', url : '/rgr/zboard.php?id=iphone'},
  41.             {text : 's', url : '/rgr/zboard.php?id=sports2'},
  42.             {text : 'l', url : '/rgr/zboard.php?id=maple'},
  43.             {text : 'b', url : '/rgr/zboard.php?id=vehicle1'},
  44.             {text : 'f', url : '/rgr/zboard.php?id=ganzi'},
  45.             {text : 'm', url : '/rgr/zboard.php?id=ma9'},
  46.             {text : '3', url : '/rgr/zboard.php?id=sgm1'},
  47.             {text : '[', url : '/rgr/zboard.php?id=maple'},
  48.             {text : 'd', url : '/rgr/zboard.php?id=diablo'},
  49.             {text : 'e', url : '/rgr/zboard.php?id=animation'},
  50.             {text : 'j', url : '/rgr/zboard.php?id=hair'},
  51.             {text : 'i', url : '/rgr/newmain.php?by=3'},
  52.             {text : 't', url : '/rgr/newmain.php?by=9'},
  53.             {text : '`', url : '#re'},
  54.             {text : 'g', url : '/rgr/zboard.php?id=royal'},
  55.             {text : 'G', url : '/rgr/zboard.php?id=royal'},
  56.             {text : 'K', url : '/rgr/zboard.php?id=df1'},
  57.             {text : 'k', url : '/rgr/zboard.php?id=df1'},
  58.             {text : '5', url : '/rgr/zboard.php?id=car'},
  59.             {text : 'z', url : '/rgr/zboard.php?id=ufc'},
  60.             {text : 'Z', url : '/rgr/zboard.php?id=ufc'},
  61.             {text : 'Q', url : 'http://tagme.to/tagme@te31/'},
  62.             {text : 'q', url : 'http://tagme.to/tagme@te31/'},
  63.             {text : 'W', url : '/rgr/zboard.php?id=multi2'},
  64.             {text : 'O', url : '/rgr/zboard.php?id=coc'},
  65.             {text : 'S', url : '/rgr/zboard.php?id=sports2'},
  66.             {text : 'L', url : '/rgr/zboard.php?id=lol'},
  67.             {text : 'B', url : '/rgr/zboard.php?id=vehicle1'},
  68.             {text : 'F', url : '/rgr/zboard.php?id=ganzi'},
  69.             {text : 'M', url : '/rgr/zboard.php?id=ma9'},
  70.             {text : 'D', url : '/rgr/zboard.php?id=diablo'},
  71.             {text : 'E', url : '/rgr/zboard.php?id=animation'},
  72.             {text : 'J', url : '/rgr/zboard.php?id=hair'},
  73.             {text : 'u', url : '/rgr/zboard.php?id=vehicle'},
  74.             {text : 'U', url : '/rgr/zboard.php?id=vehicle'},
  75.             {text : 'I', url : '/rgr/newmain.php?by=3'},
  76.             {text : 'T', url : '/rgr/newmain.php?by=9'},
  77.             {text : 'A', url : 'http://rgr.kr/w/index.html'},
  78.             {text : 'a', url : 'http://rgr.kr/w/index.html'},
  79.             {text : 'X', url : 'javascript:error()'},
  80.             {text : 'x', url : 'javascript:error()'},
  81.             {text : 'r', url : document.location},
  82.             {text : 'R', url : document.location}
  83.         ], input = 0, matches = [];
  84.         function filter(c) {
  85.             for (var i = 0, j = 0, n = matches.length; i < n; ++i) {
  86.                 if (matches[i].charAt(input) == c) {
  87.                     matches[j++] = matches[i];
  88.                 }
  89.             }
  90.             return j;
  91.         }
  92.         function getCharacter(e) {
  93.             var c = NaN;
  94.             if (!e) {
  95.                 e = g.event;
  96.             }
  97.             if (e) {
  98.                 if (e.which) {
  99.                     c = e.which;
  100.                 } else if (e.keyCode) {
  101.                     c = e.keyCode;
  102.                 }
  103.                 if (c) {
  104.                     return String.fromCharCode(c);
  105.                 }
  106.             }
  107.         }
  108.         function reset() {
  109.             for (var i = 0, n = words.length; i < n; ++i) {
  110.                 matches[i] = words[i].text;
  111.             }
  112.             input = 0;
  113.         }
  114.         reset();
  115.         return function(e) {
  116.             if (!e) {
  117.                 var e = window.event;
  118.                 if ((e.srcElement.tagName == 'INPUT') || (e.srcElement.tagName == 'TEXTAREA')) return;
  119.             } else if ((e.target.tagName == 'INPUT') || (e.target.tagName == 'TEXTAREA')) return;
  120.             var c = getCharacter(e), i, l, m, n;
  121.             if (c) {
  122.                 if (!(n = filter(c))) {
  123.                     reset();
  124.                     n = filter(c);
  125.                 }
  126.                 if ((1 == n) && ((m = matches[0]).length == ++input)) {
  127.                     for (i = 0, l = words.length; i < l; ++i) {
  128.                         if (words[i].text == m) {
  129.                             location.href = words[i].url;
  130.                             break;
  131.                         }
  132.                     }
  133.                 } else {
  134.                     matches.length = n;
  135.                 }
  136.             }
  137.         };
  138.     })(this);
  139. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement