Gerrit checkbox resolved is always unchecked

Never automatically check "resolved", even on Done or Ack.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name            Gerrit checkbox resolved is always unchecked
// @description     Never automatically check "resolved", even on Done or Ack.
// @include         https://gerrit.example.com/c/*
// @version         1
// @run-at          document-start
// @namespace https://greasyfork.org/users/767392
// ==/UserScript==


function patchScript() {
    text = this.responseText
    text = text.replace(/n.unresolved=i/g, "n.unresolved=true");
  
    var newScript = document.createElement('script');
    newScript.type = "text/javascript";
    newScript.textContent = text;
    var body = document.getElementsByTagName('body')[0];
    body.appendChild(newScript);
}

window.addEventListener('beforescriptexecute',
  function(event)
  {
    var originalScript = event.target;

    if(/\/gr-app\.js$/.test(originalScript.src)) 
    { 
      var replacementScript = document.createElement('script');
      console.log('Greasemonkey is patching:', originalScript.src);

      originalScript.parentNode.replaceChild(replacementScript, originalScript);

      // prevent execution of the original script
      event.preventDefault();
      
      // load script and patch
      var oReq = new XMLHttpRequest();
      oReq.addEventListener("load", patchScript);
      oReq.open("GET", originalScript.src);
      oReq.send();
    }
  }
);