JSFiddle - React, Tailwind, and code Playground

by philll_t

HTML

<h1>
<span>Title</span><span>#321</span>
</h1>
<h2>
1: Drag and drop these links on to your bookmarks bar
</h2>

<a href='javascript:!function(){var e;let t=(e=`${window.location.pathname.split("/").at(-1)}-${document.getElementsByTagName("h1")[0].innerHTML}`).replace(/\W+/gm," ").trim().toLowerCase().replace(/\s/g,"-");!function e(t){let a=document.createElement("textarea");a.value=t,document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a),console.log(`Coppied to clipboard: ${t}`)}(`git checkout -b "${t}"`)}();'>Get Create PR Jira</a> (NEW!)
<br />
<a href='javascript:!function(){const e=document.querySelector(".gh-header-show h1"),[t,n]=e.getElementsByTagName("span"),o=t.innerText,c=n.innerText.replace("#","");!function(e){const t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),console.log(`Coppied to clipboard: ${e}`)}(`${c}\tPR #${c}\t\tMarketing: Front End Website\tEnhancement\t\t${o}\tPB\tNo\tLow\tPhil`)}();'>Get Release Note</a>
<br />

<a href='javascript:!function e(t){let a=document.createElement("textarea");a.value=t,document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}(`[${document.getElementsByTagName("h1")[0].innerHTML}](${document.location.href})`);'>Get Jira Do</a> 
<br />

<a href='javascript:!function(){var b;let c=document.querySelectorAll(".opened-by"),d="";c.forEach(a=>{d+=`- ${function(a){let b=a.innerText;return/^\#\d+/.exec(b)}(a)}
`});let a;b=d,(a=document.createElement("textarea")).value=b,document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}()'>Copy list of PRs</a>
<br />
<a href='javascript:!function(){const e=document.querySelector(".gh-header-show h1"),t=e.querySelector("span.markdown-title"),o=`git checkout -b "${`${e.querySelector("span.f1-light.color-fg-muted").innerText} ${t.innerText}`.replace(/\W+/gm,"...

JavaScript

/* function toClipboard(text) {
    const textArea = document.createElement('textarea');
    textArea.value = text;
    
    document.body.appendChild(textArea);
    
    textArea.select();
    document.execCommand("copy");
    
    document.body.removeChild(textArea);
}

const text = `(${document.getElementsByTagName("h1")[0].innerHTML})[${document.location.href}]`; */

/* (function() {
function toClipboard(text) {
    const textArea = document.createElement('textarea');
    textArea.value = text;
    
    document.body.appendChild(textArea);
    
    textArea.select();
    document.execCommand("copy");
    
    document.body.removeChild(textArea);
}
toClipboard(`[${document.getElementsByTagName("h1")[0].innerHTML}](${document.location.href})`);
 })()*/
 
 
 function convertStringToPRName(text) {
     return text.replace(/\W+/gm," ").trim().toLowerCase().replace(/\s/g,"-");
 }
 
 function getJiraTicketId() {
 		 return window.location.pathname.split("/").at(-1);
 }
 
 function geJiratHeader() {
     return document.getElementsByTagName("h1")[0].innerHTML;
 }
 
// get release notes
(function () {
function toClipboard(text) {
    
   
    const textArea = document.createElement('textarea');
    textArea.value = text;
    
    document.body.appendChild(textArea);
    
    textArea.select();
    document.execCommand("copy");
    
    document.body.removeChild(textArea);
    console.log(`Coppied to clipboard: ${text}`);
}

const title = document.querySelector(".gh-header-show h1");
const [prNameElement, prNumberElement] = title.getElementsByTagName("span");
const prName = prNameElement.innerText;
const prNumber = prNumberElement.innerText.replace("#", "");

toClipboard(`${prNumber}	PR #${prNumber}		Marketing: Front End Website	Enhancement		${prName}	PB	No	Low	Phil`);
});

// Create Jira Branch
(function () {
function toClipboard(text) {
    
   
    const textArea = document.createElement('textarea');
    textArea.value = text;
    
   ...