AutoSubmitTdk

auto submitter for tdk website

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greasyfork.org/scripts/479447/1277888/AutoSubmitTdk.js

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

let input = document.getElementById("tdk-srch-input");
let autocmp=document.getElementById("autocmp");
autocmp.disabled=true;
autocmp.style.pointerEvents = "none";
autocmp.style.opacity = "0";
// Execute a function when the user presses a key on the keyboard


// Execute a function when the user presses a key on the keyboard
input.addEventListener("keypress", function(event) {
  // If the user presses the "Enter" key on the keyboard
  input.addEventListener("keydown", function(event) {
    // If the user presses the "Ctrl+A" key combination
    if (event.ctrlKey && event.key === "a") {
      event.preventDefault();
      input.value = ""; // Clear the input value
    }
  });
  if (event.key != "Enter") {
    if ( event.key === "Alt" || event.key === "Tab") {
        return; 
        //For shortcuts
      }
    else {
    
    event.preventDefault();
    // Cancel the default action, if needed
    setInterval(function() {
      var divElements = document.querySelectorAll("#maddeler0");
      if(divElements){
        divElements.forEach(function(divElement) {
          var innerFailedDivElement = divElement.querySelector("#bulunmayan-gts");
          var innerSuccesfulDivElement = divElement.querySelector("#bulunan-gts0");
          if (innerFailedDivElement.textContent.trim() === "Bu söz bulunamadı.") {
            divElement.remove();
            console.log("removed")
          }
          if(innerSuccesfulDivElement.textContent.trim() !==input.value){
            divElement.remove();
            console.log("removed succesful one")
          }
        });
      } 
    
    }, 10);
    
    input.value=input.value+event.key;
    console.log("PressedEnter")
    document.getElementById("tdk-search-btn").click();
    // Trigger the button element with a click
    
    

  
    

    
    }
   
  }
});