InsertLatLongCoord

Make coordinates insert earier :)

  1. // ==UserScript==
  2. // @name InsertLatLongCoord
  3. // @namespace Munzee
  4. // @version 1.1
  5. // @description Make coordinates insert earier :)
  6. // @author CzPeet
  7. // @license MIT
  8. // @match https://www.munzee.com/m/*/*/admin/map/
  9. // @update https://greasyfork.org/hu/scripts/373967-insertlatlongcoord
  10. // ==/UserScript==
  11.  
  12. var lat = document.getElementById("latitude");
  13. var lng = document.getElementById("longitude");
  14.  
  15. var btn = lat.parentNode.parentNode.children[3];
  16.  
  17. lat.addEventListener('keyup', latKeyUp, false);
  18.  
  19. function latKeyUp(e)
  20. {
  21. var coords = lat.value.split(/[\s]+/).filter(String);
  22.  
  23. if (coords.length == 2)
  24. {
  25. lat.value = coords[0];
  26. lng.value = coords[1];
  27.  
  28. btn.click();
  29. }
  30. }