shotcuts_set.js 977 B

12345678910111213141516171819202122232425262728293031323334353637
  1. var check = setInterval(function() {
  2. try {
  3. all_list = [
  4. ['F', '/'],
  5. ['C', '/recent_changes'],
  6. ['D', '/recent_discuss'],
  7. ['A', '/random']
  8. ];
  9. all_list.forEach(function(element) {
  10. shortcut.add(element[0], function() {
  11. window.location.href = element[1];
  12. }, {
  13. 'disable_in_input' : true
  14. });
  15. });
  16. all_list_2 = [
  17. ['W', '/w'],
  18. ['H', '/history'],
  19. ['E', '/edit'],
  20. ];
  21. all_list_2.forEach(function(element) {
  22. shortcut.add(element[0], function() {
  23. href_d = window.location.href.split("/");
  24. if(href_d[4]) {
  25. window.location.href = element[1] + '/' + href_d[4];
  26. }
  27. }, {
  28. 'disable_in_input' : true
  29. });
  30. });
  31. clearInterval(check);
  32. } catch { }
  33. });