shotcuts_set.js 661 B

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