Greasy Fork is available in English.

translator thing

uhhhh if roblox autocaptures spectating names it adds a button and it copies it

  1. // ==UserScript==
  2. // @name translator thing
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description uhhhh if roblox autocaptures spectating names it adds a button and it copies it
  6. // @author realwut
  7. // @match https://www.roblox.com/localization/games/107172930/translations?languageCode=nl
  8. // @icon https://www.google.com/s2/favicons?domain=roblox.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. // IS THE SITE LOADED?
  13. window.addEventListener("load", function(){
  14.  
  15. // CREATING THE BUTTON
  16. let clone = document.querySelector('#selenium-save-entry-button').cloneNode( true );
  17. clone.setAttribute('id', 'selenium-submit-invalid-button');
  18. document.querySelectorAll('.col-sm-6')[2].appendChild( clone );
  19. clone.innerHTML = "Invalid";
  20. document.getElementById("selenium-submit-invalid-button").style.marginRight = "10px";
  21. clone.removeAttribute("disabled")
  22.  
  23. // DEFINING THE INPUT TEXTBOX
  24. let inputbox = document.getElementById("selenium-translation-text");
  25.  
  26. // INVALID BUTTON LISTENER FUNCTION
  27. document.getElementById("selenium-submit-invalid-button").addEventListener("click", function() {
  28.  
  29. //COPYING AND PASTING THE TEXT
  30. inputbox.value = document.getElementById("selenium-entry-source-text").innerHTML;
  31. inputbox.innerHTML = document.getElementById("selenium-entry-source-text").innerHTML;
  32. inputbox.classList.remove("ng-pristine");
  33. inputbox.classList.remove("ng-empty");
  34. inputbox.classList.add("ng-valid");
  35. inputbox.classList.add("ng-not-empty");
  36. inputbox.classList.add("ng-dirty");
  37. inputbox.classList.add("ng-valid-parse");
  38.  
  39. // MANUAL TEXTBOX UPDATE (IMPORTANT)
  40. if ("createEvent" in document) {
  41. var evt = document.createEvent("HTMLEvents");
  42. evt.initEvent("change", false, true);
  43. inputbox.dispatchEvent(evt);
  44. }
  45. else {
  46. inputbox.fireEvent("onchange");
  47. }
  48.  
  49. });
  50. });
  51.