Created
April 1, 2025 13:58
-
-
Save FreePhoenix888/d7f67c06c0fbf3de95f34aecab66308e to your computer and use it in GitHub Desktop.
Jira Get Task Link Name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Toggle Fixed Clickable Link on F1 | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0.0 | |
// @description Adds a fixed clickable link that appears only after pressing F1 | |
// @author You | |
// @match https://rmrkz.atlassian.net/browse/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let linkDiv; // Will be initialized on first F1 press | |
let initialized = false; | |
document.addEventListener('keydown', function(event) { | |
if (event.key === 'F1') { | |
event.preventDefault(); // Prevent default F1 behavior | |
if (!initialized) { | |
initialized = true; | |
createLinkDiv(); | |
} else { | |
linkDiv.style.display = (linkDiv.style.display === 'none') ? 'block' : 'none'; | |
} | |
} | |
}); | |
function createLinkDiv() { | |
linkDiv = document.createElement('div'); | |
let linkElement = document.createElement('a'); | |
linkElement.href = window.location.href; | |
linkElement.textContent = document.title.replace(' - Jira', ''); | |
linkElement.target = "_blank"; | |
linkElement.style.color = 'blue'; | |
linkElement.style.textDecoration = 'underline'; | |
linkElement.style.cursor = 'pointer'; | |
linkDiv.style.position = 'fixed'; | |
linkDiv.style.top = '0'; | |
linkDiv.style.left = '0'; | |
linkDiv.style.width = '100%'; | |
linkDiv.style.backgroundColor = 'white'; | |
linkDiv.style.padding = '10px'; | |
linkDiv.style.zIndex = '9999'; | |
linkDiv.style.borderBottom = '2px solid #ccc'; | |
linkDiv.style.display = 'block'; // Show on first creation | |
linkDiv.appendChild(linkElement); | |
document.body.appendChild(linkDiv); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment