Transformania Time Focus Text Boxes

For Transformania Time multiplayer edition. Places focus in some text entry fields as soon as the page loads. Saves you some clicks.

  1. // ==UserScript==
  2. // @name Transformania Time Focus Text Boxes
  3. // @namespace http://steamcommunity.com/id/siggo/
  4. // @version 1.0.1
  5. // @description For Transformania Time multiplayer edition. Places focus in some text entry fields as soon as the page loads. Saves you some clicks.
  6. // @author Prios
  7. // @match https://www.transformaniatime.com/pvp/playerlookup
  8. // @match https://www.transformaniatime.com/pvp/myfriends
  9. // @match https://www.transformaniatime.com/PvP/Shout
  10. // @match https://www.transformaniatime.com/pvp/shout
  11. // @match https://www.transformaniatime.com/pvp/myskills
  12. // @match https://www.transformaniatime.com/messages/write*
  13. // @match https://www.transformaniatime.com/item/selfcast
  14. // @match https://www.transformaniatime.com/Info/GearTool
  15. // @match https://www.transformaniatime.com/npc/lorekeeperlearnspell*
  16. // @grant none
  17. // @license MIT
  18. // ==/UserScript==
  19.  
  20. (function() {
  21. 'use strict';
  22.  
  23. var thisURL = window.location.pathname;
  24. var textBox;
  25.  
  26. switch (thisURL) { // goofy but works and is easy to understand
  27. case '/pvp/playerlookup':
  28. textBox = $( '#FirstName' );
  29. break;
  30. case '/pvp/myfriends':
  31. textBox = $( '[type="search"]' );
  32. break;
  33. case '/PvP/Shout':
  34. textBox = $( '#Message' );
  35. break;
  36. case '/pvp/shout':
  37. textBox = $( '#Message' );
  38. break;
  39. case '/pvp/myskills':
  40. textBox = $( '[type="search"]' );
  41. break;
  42. case '/messages/write':
  43. textBox = $( '#MessageText' );
  44. break;
  45. case '/item/selfcast':
  46. textBox = $( '[type="search"]' );
  47. break;
  48. case '/Info/GearTool':
  49. textBox = $( '[type="search"]' );
  50. break;
  51. case '/npc/lorekeeperlearnspell':
  52. textBox = $( '[type="search"]' );
  53. }
  54.  
  55. textBox[0].focus();
  56.  
  57. })();