GitHub WIP reminder

Adds an reminder to not review WIP PR's

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        GitHub WIP reminder
// @namespace   urn://https://www.georgegillams.co.uk/greasemonkey/github_WIP_reminder
// @include     *github.com*
// @exclude     none
// @version     7
// @description:en	Adds an reminder to not review WIP PR's
// @description	Adds an reminder to not review WIP PR's
// @grant    		none
// ==/UserScript==

let lastModifiedPr = null;

function addReminder() {
  const prId = `${window.location}`.split('pull/')[1];
  if (lastModifiedPr !== prId) {
    const allElements = document.getElementsByTagName('SPAN');
    for (let i = 0; i < allElements.length; i += 1) {
      const element = allElements[i];
      if (element.innerText.includes('WIP')) {
        if (
          element.parentElement.parentElement.className.includes(
            'labels css-truncate',
          )
        ) {
          const newElement = document.createElement('div');
          newElement.innerText = `HEY THIS IS WIP!`;
          newElement.style.backgroundColor = '#d1435b';
          newElement.style.color = 'white';
          newElement.style.fontSize = '2rem';
          newElement.style.position = 'fixed';
          newElement.style.left = 0;
          newElement.style.top = 0;
          newElement.style.zIndex = 400;
          newElement.style.width = '100vw';
          newElement.style.height = '8rem';
          newElement.style.padding = '4rem 1rem 1rem 1rem';
          newElement.style.display = 'flex';
          newElement.style.alignItems = 'center';
          newElement.style.justifyContent = 'center';
          newElement.style.transition = 'all 0.4s';
          newElement.style.fontWeight = 'bold';
          newElement.onclick = () => {
            newElement.style.opacity = 0;
            newElement.style.pointerEvents = 'none';
          };
          element.parentElement.parentElement.appendChild(newElement);
        }
      }
    }
  }
  lastModifiedPr = prId;
}

setInterval(addReminder, 2000);